Skip to content

Commit 0b94ce7

Browse files
committed
Fix comments to use one "l" in marshal*
This commit updates the spelling of words containing "marshal" to use just one "l" instead of "ll". For example: - marshalling -> marshaling - marshalled -> marshaled - etc. This spelling change follows the convention used by Go.
1 parent 508be91 commit 0b94ce7

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

decode.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
//
3838
// To unmarshal CBOR into a pointer, Unmarshal sets the pointer to nil
3939
// if CBOR data is null (0xf6) or undefined (0xf7). Otherwise, Unmarshal
40-
// unmarshalls CBOR into the value pointed to by the pointer. If the
40+
// unmarshals CBOR into the value pointed to by the pointer. If the
4141
// pointer is nil, Unmarshal creates a new value for it to point to.
4242
//
4343
// To unmarshal CBOR into an empty interface value, Unmarshal uses the
@@ -95,7 +95,7 @@ import (
9595
//
9696
// To unmarshal CBOR null (0xf6) and undefined (0xf7) values into a
9797
// slice/map/pointer, Unmarshal sets Go value to nil. Because null is often
98-
// used to mean "not present", unmarshalling CBOR null and undefined value
98+
// used to mean "not present", unmarshaling CBOR null and undefined value
9999
// into any other Go type has no effect and returns no error.
100100
//
101101
// Unmarshal supports CBOR tag 55799 (self-describe CBOR), tag 0 and 1 (time),
@@ -494,11 +494,11 @@ type BigIntDecMode int
494494

495495
const (
496496
// BigIntDecodeValue makes CBOR bignum decode to big.Int (instead of *big.Int)
497-
// when unmarshalling into a Go interface{}.
497+
// when unmarshaling into a Go interface{}.
498498
BigIntDecodeValue BigIntDecMode = iota
499499

500500
// BigIntDecodePointer makes CBOR bignum decode to *big.Int when
501-
// unmarshalling into a Go interface{}.
501+
// unmarshaling into a Go interface{}.
502502
BigIntDecodePointer
503503

504504
maxBigIntDecMode
@@ -831,7 +831,7 @@ type DecOptions struct {
831831
ExtraReturnErrors ExtraDecErrorCond
832832

833833
// DefaultMapType specifies Go map type to create and decode to
834-
// when unmarshalling CBOR into an empty interface value.
834+
// when unmarshaling CBOR into an empty interface value.
835835
// By default, unmarshal uses map[interface{}]interface{}.
836836
DefaultMapType reflect.Type
837837

decode_test.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,7 +2791,7 @@ func TestUnmarshalNil(t *testing.T) {
27912791
value any
27922792
wantValue any
27932793
}{
2794-
// Unmarshalling CBOR null to the following types is a no-op.
2794+
// Unmarshaling CBOR null to the following types is a no-op.
27952795
{
27962796
name: "bool",
27972797
value: true,
@@ -2868,7 +2868,7 @@ func TestUnmarshalNil(t *testing.T) {
28682868
wantValue: [3]int{1, 2, 3},
28692869
},
28702870

2871-
// Unmarshalling CBOR null to slice/map sets Go values to nil.
2871+
// Unmarshaling CBOR null to slice/map sets Go values to nil.
28722872
{
28732873
name: "[]byte",
28742874
value: []byte{1, 2, 3},
@@ -2885,35 +2885,35 @@ func TestUnmarshalNil(t *testing.T) {
28852885
wantValue: map[string]bool(nil),
28862886
},
28872887

2888-
// Unmarshalling CBOR null to ByteString (string wrapper for []byte) resets ByteString to empty string.
2888+
// Unmarshaling CBOR null to ByteString (string wrapper for []byte) resets ByteString to empty string.
28892889
{
28902890
name: "cbor.ByteString",
28912891
value: ByteString("\x01\x02\x03"),
28922892
wantValue: ByteString(""),
28932893
},
28942894

2895-
// Unmarshalling CBOR null to time.Time is a no-op.
2895+
// Unmarshaling CBOR null to time.Time is a no-op.
28962896
{
28972897
name: "time.Time",
28982898
value: time.Date(2020, time.January, 2, 3, 4, 5, 6, time.UTC),
28992899
wantValue: time.Date(2020, time.January, 2, 3, 4, 5, 6, time.UTC),
29002900
},
29012901

2902-
// Unmarshalling CBOR null to big.Int is a no-op.
2902+
// Unmarshaling CBOR null to big.Int is a no-op.
29032903
{
29042904
name: "big.Int",
29052905
value: mustBigInt("123"),
29062906
wantValue: mustBigInt("123"),
29072907
},
29082908

2909-
// Unmarshalling CBOR null to user defined struct types is a no-op.
2909+
// Unmarshaling CBOR null to user defined struct types is a no-op.
29102910
{
29112911
name: "user defined struct",
29122912
value: T{I: 123},
29132913
wantValue: T{I: 123},
29142914
},
29152915

2916-
// Unmarshalling CBOR null to cbor.Tag and cbor.RawTag is a no-op.
2916+
// Unmarshaling CBOR null to cbor.Tag and cbor.RawTag is a no-op.
29172917
{
29182918
name: "cbor.RawTag",
29192919
value: RawTag{123, []byte{4, 5, 6}},
@@ -2925,25 +2925,25 @@ func TestUnmarshalNil(t *testing.T) {
29252925
wantValue: Tag{123, "hello world"},
29262926
},
29272927

2928-
// Unmarshalling to cbor.RawMessage sets cbor.RawMessage to raw CBOR bytes (0xf6 or 0xf7).
2928+
// Unmarshaling to cbor.RawMessage sets cbor.RawMessage to raw CBOR bytes (0xf6 or 0xf7).
29292929
// It's tested in TestUnmarshal().
29302930

2931-
// Unmarshalling to types implementing cbor.BinaryUnmarshaler is a no-op.
2931+
// Unmarshaling to types implementing cbor.BinaryUnmarshaler is a no-op.
29322932
{
29332933
name: "cbor.BinaryUnmarshaler",
29342934
value: number(456),
29352935
wantValue: number(456),
29362936
},
29372937

2938-
// When unmarshalling to types implementing cbor.Unmarshaler,
2938+
// When unmarshaling to types implementing cbor.Unmarshaler,
29392939
{
29402940
name: "cbor.Unmarshaler",
29412941
value: nilUnmarshaler("hello world"),
29422942
wantValue: nilUnmarshaler("null"),
29432943
},
29442944
}
29452945

2946-
// Unmarshalling to values of specified Go types.
2946+
// Unmarshaling to values of specified Go types.
29472947
for _, tc := range testCases {
29482948
t.Run(tc.name, func(t *testing.T) {
29492949
for _, data := range data {
@@ -7506,7 +7506,7 @@ func TestUnmarshalTagNum55799(t *testing.T) {
75067506
copy(data[3:], tagNum55799)
75077507
copy(data[6:], tc.data)
75087508

7509-
// Test unmarshalling CBOR into empty interface.
7509+
// Test unmarshaling CBOR into empty interface.
75107510
var v any
75117511
if err := Unmarshal(data, &v); err != nil {
75127512
t.Errorf("Unmarshal(0x%x) returned error %v", data, err)
@@ -7520,15 +7520,15 @@ func TestUnmarshalTagNum55799(t *testing.T) {
75207520
}
75217521
}
75227522

7523-
// Test unmarshalling CBOR into RawMessage.
7523+
// Test unmarshaling CBOR into RawMessage.
75247524
var r RawMessage
75257525
if err := Unmarshal(data, &r); err != nil {
75267526
t.Errorf("Unmarshal(0x%x) returned error %v", data, err)
75277527
} else if !bytes.Equal(r, tc.data) {
75287528
t.Errorf("Unmarshal(0x%x) returned RawMessage %v, want %v", data, r, tc.data)
75297529
}
75307530

7531-
// Test unmarshalling CBOR into compatible data types.
7531+
// Test unmarshaling CBOR into compatible data types.
75327532
for _, value := range tc.wantValues {
75337533
v := reflect.New(reflect.TypeOf(value))
75347534
vPtr := v.Interface()
@@ -7545,7 +7545,7 @@ func TestUnmarshalTagNum55799(t *testing.T) {
75457545
}
75467546
}
75477547

7548-
// Test unmarshalling CBOR into incompatible data types.
7548+
// Test unmarshaling CBOR into incompatible data types.
75497549
for _, typ := range tc.wrongTypes {
75507550
v := reflect.New(typ)
75517551
vPtr := v.Interface()
@@ -7571,23 +7571,23 @@ func TestUnmarshalFloatWithTagNum55799(t *testing.T) {
75717571
copy(data, tagNum55799)
75727572
copy(data[3:], tc.data)
75737573

7574-
// Test unmarshalling CBOR into empty interface.
7574+
// Test unmarshaling CBOR into empty interface.
75757575
var v any
75767576
if err := Unmarshal(tc.data, &v); err != nil {
75777577
t.Errorf("Unmarshal(0x%x) returned error %v", tc.data, err)
75787578
} else {
75797579
compareFloats(t, tc.data, v, tc.wantInterfaceValue, tc.equalityThreshold)
75807580
}
75817581

7582-
// Test unmarshalling CBOR into RawMessage.
7582+
// Test unmarshaling CBOR into RawMessage.
75837583
var r RawMessage
75847584
if err := Unmarshal(tc.data, &r); err != nil {
75857585
t.Errorf("Unmarshal(0x%x) returned error %v", tc.data, err)
75867586
} else if !bytes.Equal(r, tc.data) {
75877587
t.Errorf("Unmarshal(0x%x) returned RawMessage %v, want %v", tc.data, r, tc.data)
75887588
}
75897589

7590-
// Test unmarshalling CBOR into compatible data types.
7590+
// Test unmarshaling CBOR into compatible data types.
75917591
for _, value := range tc.wantValues {
75927592
v := reflect.New(reflect.TypeOf(value))
75937593
vPtr := v.Interface()
@@ -7598,7 +7598,7 @@ func TestUnmarshalFloatWithTagNum55799(t *testing.T) {
75987598
}
75997599
}
76007600

7601-
// Test unmarshalling CBOR into incompatible data types.
7601+
// Test unmarshaling CBOR into incompatible data types.
76027602
for _, typ := range unmarshalFloatWrongTypes {
76037603
v := reflect.New(typ)
76047604
vPtr := v.Interface()
@@ -7638,7 +7638,7 @@ func TestUnmarshalTagNum55799AsElement(t *testing.T) {
76387638
}
76397639
for _, tc := range testCases {
76407640
t.Run(tc.name, func(t *testing.T) {
7641-
// Test unmarshalling CBOR into empty interface.
7641+
// Test unmarshaling CBOR into empty interface.
76427642
var v any
76437643
if err := Unmarshal(tc.data, &v); err != nil {
76447644
t.Errorf("Unmarshal(0x%x) returned error %v", tc.data, err)
@@ -7652,7 +7652,7 @@ func TestUnmarshalTagNum55799AsElement(t *testing.T) {
76527652
}
76537653
}
76547654

7655-
// Test unmarshalling CBOR into compatible data types.
7655+
// Test unmarshaling CBOR into compatible data types.
76567656
for _, value := range tc.values {
76577657
v := reflect.New(reflect.TypeOf(value))
76587658
vPtr := v.Interface()
@@ -7669,7 +7669,7 @@ func TestUnmarshalTagNum55799AsElement(t *testing.T) {
76697669
}
76707670
}
76717671

7672-
// Test unmarshalling CBOR into incompatible data types.
7672+
// Test unmarshaling CBOR into incompatible data types.
76737673
for _, typ := range tc.wrongTypes {
76747674
v := reflect.New(typ)
76757675
vPtr := v.Interface()

tag.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"sync"
1111
)
1212

13-
// Tag represents a tagged data item (CBOR major type 6), comprising a tag number and the unmarshalled tag content.
13+
// Tag represents a tagged data item (CBOR major type 6), comprising a tag number and the unmarshaled tag content.
1414
// NOTE: The same encoding and decoding options that apply to untagged CBOR data items also applies to tag content
1515
// during encoding and decoding.
1616
type Tag struct {

0 commit comments

Comments
 (0)