Skip to content

Commit

Permalink
make lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
tmc committed Nov 19, 2016
1 parent b6e267b commit c56093e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions protoc-gen-swagger/genswagger/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -399,7 +399,7 @@ func renderServices(services []*descriptor.Service, paths swaggerPathsObject, re
Description: desc,
In: "body",
Required: true,
Schema: &schema,
Schema: &schema,
})
}

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c56093e

Please sign in to comment.