Skip to content

Commit

Permalink
Make all public function has a comment with its name as the first word
Browse files Browse the repository at this point in the history
[golang/lint](https://github.com/golang/lint) wants it to be that way.
  • Loading branch information
lukyth authored and kujtimiihoxha committed Sep 8, 2017
1 parent ebc9558 commit 2c48ebd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ func (sg *ServiceGenerator) Generate(name string) error {
return err
}
f.Interfaces = []parser.Interface{
parser.NewInterfaceWithComment(iname, `Implement yor service methods methods.
e.x: Foo(ctx context.Context,s string)(rs string, err error)`, []parser.Method{}),
parser.NewInterfaceWithComment(iname, fmt.Sprintf(`%s implements yor service methods.
e.x: Foo(ctx context.Context,s string)(rs string, err error)`, iname), []parser.Method{}),
}
defaultFs := fs.Get()

Expand Down Expand Up @@ -190,7 +190,7 @@ func (sg *ServiceInitGenerator) Generate(name string) error {
if !exists {
newMethod := parser.NewMethodWithComment(
"New",
`Get a new instance of the service.
`New return a new instance of the service.
If you want to add service middleware this is the place to put them.`,
parser.NamedTypeValue{},
fmt.Sprintf(`s = &%s{}
Expand Down Expand Up @@ -632,8 +632,9 @@ func (sg *ServiceInitGenerator) generateEndpoints(name string, iface *parser.Int
parser.NewNameType("", "\""+serviceImport+"\""),
}
file.Methods = []parser.Method{
parser.NewMethod(
parser.NewMethodWithComment(
"New",
"New return a new instance of the endpoint that wraps the provided service.",
parser.NamedTypeValue{},
"",
[]parser.NamedTypeValue{
Expand Down

0 comments on commit 2c48ebd

Please sign in to comment.