Skip to content

Commit ef05ca1

Browse files
authored
Use only "marshal/unmarshal" with single "l" (#1069)
Because of spelling choices for Go https://github.com/golang/go/wiki/Spelling
1 parent 1b2cf6e commit ef05ca1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

bindform_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ func TestMarshalForm(t *testing.T) {
159159
}
160160

161161
for k, v := range testCases {
162-
marshalled, err := MarshalForm(v, nil)
162+
marshaled, err := MarshalForm(v, nil)
163163
assert.NoError(t, err)
164-
encoded, err := url.QueryUnescape(marshalled.Encode())
164+
encoded, err := url.QueryUnescape(marshaled.Encode())
165165
assert.NoError(t, err)
166166
assert.Equal(t, k, encoded)
167167
}

bindparam.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func BindStyledParameterWithLocation(style string, explode bool, paramName strin
6868
// If the destination implements encoding.TextUnmarshaler we use it for binding
6969
if tu, ok := dest.(encoding.TextUnmarshaler); ok {
7070
if err := tu.UnmarshalText([]byte(value)); err != nil {
71-
return fmt.Errorf("error unmarshalling '%s' text as %T: %s", value, dest, err)
71+
return fmt.Errorf("error unmarshaling '%s' text as %T: %s", value, dest, err)
7272
}
7373

7474
return nil
@@ -82,7 +82,7 @@ func BindStyledParameterWithLocation(style string, explode bool, paramName strin
8282

8383
if t.Kind() == reflect.Struct {
8484
// We've got a destination object, we'll create a JSON representation
85-
// of the input value, and let the json library deal with the unmarshalling
85+
// of the input value, and let the json library deal with the unmarshaling
8686
parts, err := splitStyledParameter(style, explode, true, paramName, value)
8787
if err != nil {
8888
return err
@@ -233,7 +233,7 @@ func bindSplitPartsToDestinationArray(parts []string, dest interface{}) error {
233233
// into the struct.
234234
func bindSplitPartsToDestinationStruct(paramName string, parts []string, explode bool, dest interface{}) error {
235235
// We've got a destination object, we'll create a JSON representation
236-
// of the input value, and let the json library deal with the unmarshalling
236+
// of the input value, and let the json library deal with the unmarshaling
237237
var fields []string
238238
if explode {
239239
fields = make([]string, len(parts))
@@ -462,7 +462,7 @@ func bindParamsToExplodedObject(paramName string, values url.Values, dest interf
462462
return true, BindStringToObject(values.Get(paramName), dest)
463463
}
464464
if t.Kind() != reflect.Struct {
465-
return false, fmt.Errorf("unmarshalling query arg '%s' into wrong type", paramName)
465+
return false, fmt.Errorf("unmarshaling query arg '%s' into wrong type", paramName)
466466
}
467467

468468
fieldsPresent := false

bindstring.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func BindStringToObject(src string, dst interface{}) error {
100100
case reflect.Array:
101101
if tu, ok := dst.(encoding.TextUnmarshaler); ok {
102102
if err := tu.UnmarshalText([]byte(src)); err != nil {
103-
return fmt.Errorf("error unmarshalling '%s' text as %T: %s", src, dst, err)
103+
return fmt.Errorf("error unmarshaling '%s' text as %T: %s", src, dst, err)
104104
}
105105

106106
return nil

0 commit comments

Comments
 (0)