goprotobuf: gofmt -s
R=dsymonds
CC=golang-dev
https://codereview.appspot.com/8439044
diff --git a/proto/all_test.go b/proto/all_test.go
index 9c9cf0f..70bbe39 100644
--- a/proto/all_test.go
+++ b/proto/all_test.go
@@ -1158,7 +1158,7 @@
func TestProto1RepeatedGroup(t *testing.T) {
pb := &MessageList{
Message: []*MessageList_Message{
- &MessageList_Message{
+ {
Name: String("blah"),
Count: Int32(7),
},
diff --git a/proto/clone_test.go b/proto/clone_test.go
index 2823c15..71343ea 100644
--- a/proto/clone_test.go
+++ b/proto/clone_test.go
@@ -49,7 +49,7 @@
Connected: proto.Bool(true),
},
Others: []*pb.OtherMessage{
- &pb.OtherMessage{
+ {
Value: []byte("some bytes"),
},
},
@@ -111,7 +111,7 @@
},
Pet: []string{"horsey"},
Others: []*pb.OtherMessage{
- &pb.OtherMessage{
+ {
Value: []byte("some bytes"),
},
},
@@ -123,10 +123,10 @@
},
Pet: []string{"bunny", "kitty"},
Others: []*pb.OtherMessage{
- &pb.OtherMessage{
+ {
Key: proto.Int64(31415926535),
},
- &pb.OtherMessage{
+ {
// Explicitly test a src=nil field
Inner: nil,
},
@@ -140,11 +140,11 @@
},
Pet: []string{"bunny", "kitty", "horsey"},
Others: []*pb.OtherMessage{
- &pb.OtherMessage{
+ {
Key: proto.Int64(31415926535),
},
- &pb.OtherMessage{},
- &pb.OtherMessage{
+ {},
+ {
Value: []byte("some bytes"),
},
},
diff --git a/proto/properties.go b/proto/properties.go
index 28d4e1d..0127f72 100644
--- a/proto/properties.go
+++ b/proto/properties.go
@@ -252,14 +252,14 @@
case f == "packed":
p.Packed = true
case strings.HasPrefix(f, "name="):
- p.OrigName = f[5:len(f)]
+ p.OrigName = f[5:]
case strings.HasPrefix(f, "enum="):
- p.Enum = f[5:len(f)]
+ p.Enum = f[5:]
case strings.HasPrefix(f, "def="):
- p.Default = f[4:len(f)] // rest of string
+ p.Default = f[4:] // rest of string
if i+1 < len(fields) {
// Commas aren't escaped, and def is always last.
- p.Default += "," + strings.Join(fields[i+1:len(fields)], ",")
+ p.Default += "," + strings.Join(fields[i+1:], ",")
break
}
}
diff --git a/proto/text_parser_test.go b/proto/text_parser_test.go
index 0821a7d..5949065 100644
--- a/proto/text_parser_test.go
+++ b/proto/text_parser_test.go
@@ -261,10 +261,10 @@
out: &MyMessage{
Count: Int32(42),
Others: []*OtherMessage{
- &OtherMessage{},
- &OtherMessage{},
- &OtherMessage{},
- &OtherMessage{},
+ {},
+ {},
+ {},
+ {},
},
},
},
@@ -373,11 +373,11 @@
Connected: Bool(true),
},
Others: []*OtherMessage{
- &OtherMessage{
+ {
Key: Int64(3735928559),
Value: []byte{0x1, 'A', '\a', '\f'},
},
- &OtherMessage{
+ {
Weight: Float32(58.9),
Inner: &InnerMessage{
Host: String("lesha.mtv"),