Skip to content

Commit d92a037

Browse files
committed
Rename Json to JSON, Http to HTTP
1 parent 11ea4d6 commit d92a037

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

deepobject.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func getFieldName(f reflect.StructField) string {
176176

177177
// Create a map of field names that we'll see in the deepObject to reflect
178178
// field indices on the given type.
179-
func fieldIndicesByJsonTag(i interface{}) (map[string]int, error) {
179+
func fieldIndicesByJSONTag(i interface{}) (map[string]int, error) {
180180
t := reflect.TypeOf(i)
181181
if t.Kind() != reflect.Struct {
182182
return nil, errors.New("expected a struct as input")
@@ -271,7 +271,7 @@ func assignPathValues(dst interface{}, pathValues fieldOrValue) error {
271271
}
272272
dst.Set(reflect.ValueOf(tm))
273273
}
274-
fieldMap, err := fieldIndicesByJsonTag(iv.Interface())
274+
fieldMap, err := fieldIndicesByJSONTag(iv.Interface())
275275
if err != nil {
276276
return fmt.Errorf("failed enumerating fields: %w", err)
277277
}

jsonmerge.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"github.com/apapsch/go-jsonmerge/v2"
77
)
88

9-
// JsonMerge merges two JSON representation into a single object. `data` is the
9+
// JSONMerge merges two JSON representation into a single object. `data` is the
1010
// existing representation and `patch` is the new data to be merged in
11-
func JsonMerge(data, patch json.RawMessage) (json.RawMessage, error) {
11+
func JSONMerge(data, patch json.RawMessage) (json.RawMessage, error) {
1212
merger := jsonmerge.Merger{
1313
CopyNonexistent: true,
1414
}

jsonmerge_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import (
66
"github.com/stretchr/testify/assert"
77
)
88

9-
func TestJsonMerge(t *testing.T) {
9+
func TestJSONMerge(t *testing.T) {
1010
t.Run("when object", func(t *testing.T) {
1111
t.Run("Merges properties defined in both objects", func(t *testing.T) {
1212
data := `{"foo": 1}`
1313
patch := `{"foo": null}`
1414
expected := `{"foo":null}`
1515

16-
actual, err := JsonMerge([]byte(data), []byte(patch))
16+
actual, err := JSONMerge([]byte(data), []byte(patch))
1717
assert.NoError(t, err)
1818
assert.Equal(t, expected, string(actual))
1919
})
@@ -23,7 +23,7 @@ func TestJsonMerge(t *testing.T) {
2323
patch := `{"source":"merge-me"}`
2424
expected := `{"source":"merge-me"}`
2525

26-
actual, err := JsonMerge([]byte(data), []byte(patch))
26+
actual, err := JSONMerge([]byte(data), []byte(patch))
2727
assert.NoError(t, err)
2828
assert.Equal(t, expected, string(actual))
2929
})
@@ -33,7 +33,7 @@ func TestJsonMerge(t *testing.T) {
3333
patch := `{"channel":{"id":1}}`
3434
expected := `{"channel":{"id":1,"status":"valid"}}`
3535

36-
actual, err := JsonMerge([]byte(data), []byte(patch))
36+
actual, err := JSONMerge([]byte(data), []byte(patch))
3737
assert.NoError(t, err)
3838
assert.Equal(t, expected, string(actual))
3939
})
@@ -43,7 +43,7 @@ func TestJsonMerge(t *testing.T) {
4343
patch := `{}`
4444
expected := `{}`
4545

46-
actual, err := JsonMerge([]byte(data), []byte(patch))
46+
actual, err := JSONMerge([]byte(data), []byte(patch))
4747
assert.NoError(t, err)
4848
assert.Equal(t, expected, string(actual))
4949
})
@@ -52,7 +52,7 @@ func TestJsonMerge(t *testing.T) {
5252
patch := `{"foo":"bar"}`
5353
expected := `{"foo":"bar"}`
5454

55-
actual, err := JsonMerge(nil, []byte(patch))
55+
actual, err := JSONMerge(nil, []byte(patch))
5656
assert.NoError(t, err)
5757
assert.Equal(t, expected, string(actual))
5858
})
@@ -61,7 +61,7 @@ func TestJsonMerge(t *testing.T) {
6161
data := `{"foo":"bar"}`
6262
expected := `{"foo":"bar"}`
6363

64-
actual, err := JsonMerge([]byte(data), nil)
64+
actual, err := JSONMerge([]byte(data), nil)
6565
assert.NoError(t, err)
6666
assert.Equal(t, expected, string(actual))
6767
})
@@ -72,7 +72,7 @@ func TestJsonMerge(t *testing.T) {
7272
patch := `[{"foo": null}]`
7373
expected := `[{"foo":1}]`
7474

75-
actual, err := JsonMerge([]byte(data), []byte(patch))
75+
actual, err := JSONMerge([]byte(data), []byte(patch))
7676
assert.NoError(t, err)
7777
assert.Equal(t, expected, string(actual))
7878
})

strictmiddleware/nethttp/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ import (
55
"net/http"
66
)
77

8-
type StrictHttpHandlerFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (response interface{}, err error)
8+
type StrictHTTPHandlerFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (response interface{}, err error)
99

10-
type StrictHttpMiddlewareFunc func(f StrictHttpHandlerFunc, operationID string) StrictHttpHandlerFunc
10+
type StrictHTTPMiddlewareFunc func(f StrictHTTPHandlerFunc, operationID string) StrictHTTPHandlerFunc

0 commit comments

Comments
 (0)