From c56093eaf900293c5fe738704cc896e720feeec4 Mon Sep 17 00:00:00 2001 From: Travis Cline Date: Fri, 18 Nov 2016 16:53:01 -0800 Subject: [PATCH] make lint happy --- protoc-gen-swagger/genswagger/template.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/protoc-gen-swagger/genswagger/template.go b/protoc-gen-swagger/genswagger/template.go index a8431d29e1c..b81c4c05635 100644 --- a/protoc-gen-swagger/genswagger/template.go +++ b/protoc-gen-swagger/genswagger/template.go @@ -386,7 +386,7 @@ func renderServices(services []*descriptor.Service, paths swaggerPathsObject, re }, } } else { - lastField := b.Body.FieldPath[len(b.Body.FieldPath) - 1] + lastField := b.Body.FieldPath[len(b.Body.FieldPath)-1] schema = schemaOfField(lastField.Target, reg) } @@ -399,7 +399,7 @@ func renderServices(services []*descriptor.Service, paths swaggerPathsObject, re Description: desc, In: "body", Required: true, - Schema: &schema, + Schema: &schema, }) } @@ -565,7 +565,7 @@ func updateSwaggerDataFromComments(swaggerObject interface{}, comment string) er return nil } - return fmt.Errorf("No description nor summary property.") + return fmt.Errorf("no description nor summary property") } func protoComments(reg *descriptor.Registry, file *descriptor.File, outers []string, typeName string, typeIndex int32, fieldPaths ...int32) string { @@ -693,15 +693,15 @@ func isProtoPathMatches(paths []int32, outerPaths []int32, typeName string, type func protoPathIndex(descriptorType reflect.Type, what string) int32 { field, ok := descriptorType.Elem().FieldByName(what) if !ok { - panic(fmt.Errorf("Could not find protobuf descriptor type id for %s.", what)) + panic(fmt.Errorf("could not find protobuf descriptor type id for %s", what)) } pbtag := field.Tag.Get("protobuf") if pbtag == "" { - panic(fmt.Errorf("No Go tag 'protobuf' on protobuf descriptor for %s.", what)) + panic(fmt.Errorf("no Go tag 'protobuf' on protobuf descriptor for %s", what)) } path, err := strconv.Atoi(strings.Split(pbtag, ",")[1]) if err != nil { - panic(fmt.Errorf("Protobuf descriptor id for %s cannot be converted to a number: %s", what, err.Error())) + panic(fmt.Errorf("protobuf descriptor id for %s cannot be converted to a number: %s", what, err.Error())) } return int32(path)