@@ -584,36 +584,36 @@ func TestMarshalJSONPBMarshaler(t *testing.T) {
584584 msg := dynamicMessage {RawJson : rawJson }
585585 str , err := new (Marshaler ).MarshalToString (& msg )
586586 if err != nil {
587- t .Errorf ("an unexpected error occurred when marshalling JSONPBMarshaler: %v" , err )
587+ t .Errorf ("an unexpected error occurred when marshaling JSONPBMarshaler: %v" , err )
588588 }
589589 if str != rawJson {
590- t .Errorf ("marshalling JSON produced incorrect output: got %s, wanted %s" , str , rawJson )
590+ t .Errorf ("marshaling JSON produced incorrect output: got %s, wanted %s" , str , rawJson )
591591 }
592592}
593593
594594func TestMarshalAnyJSONPBMarshaler (t * testing.T ) {
595595 msg := dynamicMessage {RawJson : `{ "foo": "bar", "baz": [0, 1, 2, 3] }` }
596596 a , err := ptypes .MarshalAny (& msg )
597597 if err != nil {
598- t .Errorf ("an unexpected error occurred when marshalling to Any: %v" , err )
598+ t .Errorf ("an unexpected error occurred when marshaling to Any: %v" , err )
599599 }
600600 str , err := new (Marshaler ).MarshalToString (a )
601601 if err != nil {
602- t .Errorf ("an unexpected error occurred when marshalling Any to JSON: %v" , err )
602+ t .Errorf ("an unexpected error occurred when marshaling Any to JSON: %v" , err )
603603 }
604604 // after custom marshaling, it's round-tripped through JSON decoding/encoding already,
605605 // so the keys are sorted, whitespace is compacted, and "@type" key has been added
606606 expected := `{"@type":"type.googleapis.com/` + dynamicMessageName + `","baz":[0,1,2,3],"foo":"bar"}`
607607 if str != expected {
608- t .Errorf ("marshalling JSON produced incorrect output: got %s, wanted %s" , str , expected )
608+ t .Errorf ("marshaling JSON produced incorrect output: got %s, wanted %s" , str , expected )
609609 }
610610
611611 // Do it again, but this time with indentation:
612612
613613 marshaler := Marshaler {Indent : " " }
614614 str , err = marshaler .MarshalToString (a )
615615 if err != nil {
616- t .Errorf ("an unexpected error occurred when marshalling Any to JSON: %v" , err )
616+ t .Errorf ("an unexpected error occurred when marshaling Any to JSON: %v" , err )
617617 }
618618 // same as expected above, but pretty-printed w/ indentation
619619 expected = `{
@@ -627,7 +627,7 @@ func TestMarshalAnyJSONPBMarshaler(t *testing.T) {
627627 "foo": "bar"
628628}`
629629 if str != expected {
630- t .Errorf ("marshalling JSON produced incorrect output: got %s, wanted %s" , str , expected )
630+ t .Errorf ("marshaling JSON produced incorrect output: got %s, wanted %s" , str , expected )
631631 }
632632}
633633
@@ -636,11 +636,11 @@ func TestMarshalWithCustomValidation(t *testing.T) {
636636
637637 js , err := new (Marshaler ).MarshalToString (& msg )
638638 if err != nil {
639- t .Errorf ("an unexpected error occurred when marshalling to json: %v" , err )
639+ t .Errorf ("an unexpected error occurred when marshaling to json: %v" , err )
640640 }
641641 err = Unmarshal (strings .NewReader (js ), & msg )
642642 if err != nil {
643- t .Errorf ("an unexpected error occurred when unmarshalling from json: %v" , err )
643+ t .Errorf ("an unexpected error occurred when unmarshaling from json: %v" , err )
644644 }
645645}
646646
@@ -883,7 +883,7 @@ func TestUnmarshaling(t *testing.T) {
883883
884884 err := tt .unmarshaler .Unmarshal (strings .NewReader (tt .json ), p )
885885 if err != nil {
886- t .Errorf ("unmarshalling %s: %v" , tt .desc , err )
886+ t .Errorf ("unmarshaling %s: %v" , tt .desc , err )
887887 continue
888888 }
889889
@@ -1017,7 +1017,7 @@ func TestAnyWithCustomResolver(t *testing.T) {
10171017 }
10181018 wanted := `{"@type":"https://foobar.com/some.random.MessageKind","oBool":true,"oInt64":"1020304","oString":"foobar","oBytes":"AQIDBA=="}`
10191019 if js != wanted {
1020- t .Errorf ("marshalling JSON produced incorrect output: got %s, wanted %s" , js , wanted )
1020+ t .Errorf ("marshaling JSON produced incorrect output: got %s, wanted %s" , js , wanted )
10211021 }
10221022
10231023 u := Unmarshaler {AnyResolver : resolver }
@@ -1032,7 +1032,7 @@ func TestAnyWithCustomResolver(t *testing.T) {
10321032 t .Errorf ("custom resolver was invoked with wrong URL: got %q, wanted %q" , resolvedTypeUrls [1 ], "https://foobar.com/some.random.MessageKind" )
10331033 }
10341034 if ! proto .Equal (any , roundTrip ) {
1035- t .Errorf ("message contents not set correctly after unmarshalling JSON: got %s, wanted %s" , roundTrip , any )
1035+ t .Errorf ("message contents not set correctly after unmarshaling JSON: got %s, wanted %s" , roundTrip , any )
10361036 }
10371037}
10381038
@@ -1043,7 +1043,7 @@ func TestUnmarshalJSONPBUnmarshaler(t *testing.T) {
10431043 t .Errorf ("an unexpected error occurred when parsing into JSONPBUnmarshaler: %v" , err )
10441044 }
10451045 if msg .RawJson != rawJson {
1046- t .Errorf ("message contents not set correctly after unmarshalling JSON: got %s, wanted %s" , msg .RawJson , rawJson )
1046+ t .Errorf ("message contents not set correctly after unmarshaling JSON: got %s, wanted %s" , msg .RawJson , rawJson )
10471047 }
10481048}
10491049
@@ -1077,7 +1077,7 @@ func TestUnmarshalAnyJSONPBUnmarshaler(t *testing.T) {
10771077 }
10781078
10791079 if ! proto .Equal (& got , & want ) {
1080- t .Errorf ("message contents not set correctly after unmarshalling JSON: got %v, wanted %v" , got , want )
1080+ t .Errorf ("message contents not set correctly after unmarshaling JSON: got %v, wanted %v" , got , want )
10811081 }
10821082}
10831083
0 commit comments