mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:31:43 +00:00
remove unused methods for outbook webhooks (#48350)
This commit is contained in:
parent
22769f72d0
commit
ef37053587
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user