remove unused methods for outbook webhooks (#48350)

This commit is contained in:
Bolaji Olajide 2023-02-28 15:33:29 +01:00 committed by GitHub
parent 22769f72d0
commit ef37053587
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,27 +5,11 @@ import (
"context"
"encoding/json"
"net/http"
"reflect"
"github.com/sourcegraph/sourcegraph/internal/httpcli"
"github.com/sourcegraph/sourcegraph/lib/errors"
)
func nullable[T any](value T) *T {
if reflect.ValueOf(value).IsZero() {
return nil
}
return &value
}
func nullableMap[T, U any](value T, mapper func(T) U) *U {
if reflect.ValueOf(value).IsZero() {
return nil
}
mapped := mapper(value)
return &mapped
}
func makeRequest[T any](ctx context.Context, q queryInfo, client httpcli.Doer, res T) error {
reqBody, err := json.Marshal(q)
if err != nil {