Skip to content

Commit dcd826e

Browse files
committed
chore: run gofumpt
Signed-off-by: Christian Stewart <christian@aperture.us>
1 parent 675adaf commit dcd826e

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

features/text/text.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ func (g *textGenerator) genMessage(message *protogen.Message) {
122122
g.P("return x.MarshalProtoText()")
123123
g.P("}")
124124
}
125+
125126
func (g *textGenerator) genField(sbInitialLen int, field *protogen.Field, accessor string) {
126127
maybeAddSpace := func() {
127128
g.P("if sb.Len() > ", sbInitialLen, " {")

json/marshal_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ func (m *testMarshaler) MarshalProtoJSON(s *MarshalState) {
192192

193193
func TestMarshalSlice(t *testing.T) {
194194
testSlice := []*testMarshaler{
195-
&testMarshaler{value: 1},
196-
&testMarshaler{value: 2},
197-
&testMarshaler{value: 3},
195+
{value: 1},
196+
{value: 2},
197+
{value: 3},
198198
}
199199

200200
expected := `[{"value":1},{"value":2},{"value":3}]`

testproto/wkt/wkt_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestWellKnownTypes(t *testing.T) {
2929
anyVal, err := anypb.New(dur, "cool.apps/test-value")
3030
require.NoError(t, err)
3131

32-
ts := timestamppb.New(time.Date(2024, time.January, 10, 4, 20, 00, 00, time.UTC))
32+
ts := timestamppb.New(time.Date(2024, time.January, 10, 4, 20, 0o0, 0o0, time.UTC))
3333
m := &MessageWithWKT{
3434
Any: anyVal,
3535
Duration: dur,
@@ -51,10 +51,8 @@ func TestWellKnownTypes(t *testing.T) {
5151

5252
require.NotEmpty(t, vtProtoBytes)
5353

54-
var (
55-
// golangMsg = &MessageWithWKT{}
56-
vtProtoMsg = &MessageWithWKT{}
57-
)
54+
// golangMsg = &MessageWithWKT{}
55+
vtProtoMsg := &MessageWithWKT{}
5856

5957
require.NoError(t, vtProtoMsg.UnmarshalVT(vtProtoBytes))
6058

@@ -72,7 +70,7 @@ func TestWellKnownTypes(t *testing.T) {
7270
t.Log(string(jdata))
7371

7472
// Ensure output is consistent
75-
var expected = `{"any":{"@type":"cool.apps/test-value","value":"14402s"},"duration":"14402s","empty":{},"timestamp":"2024-01-10T04:20:00Z","doubleValue":123456789.12345679,"floatValue":123456792,"int64Value":"123456789","uint64Value":"123456789","int32Value":"123456789","uint32Value":"123456789","boolValue":true,"stringValue":"String marshalling and unmarshalling test","bytesValue":"Qnl0ZXMgbWFyc2hhbGxpbmcgYW5kIHVubWFyc2hhbGxpbmcgdGVzdA=="}`
73+
expected := `{"any":{"@type":"cool.apps/test-value","value":"14402s"},"duration":"14402s","empty":{},"timestamp":"2024-01-10T04:20:00Z","doubleValue":123456789.12345679,"floatValue":123456792,"int64Value":"123456789","uint64Value":"123456789","int32Value":"123456789","uint32Value":"123456789","boolValue":true,"stringValue":"String marshalling and unmarshalling test","bytesValue":"Qnl0ZXMgbWFyc2hhbGxpbmcgYW5kIHVubWFyc2hhbGxpbmcgdGVzdA=="}`
7674
require.Equal(t, expected, string(jdata))
7775

7876
jparsed := &MessageWithWKT{}

0 commit comments

Comments
 (0)