kujtimiihoxha / gk

Go-Kit Genetator
Apache License 2.0
151 stars 28 forks source link

Add gokit/kit/endpoint import for the generated endpoint file #4

Closed lukyth closed 7 years ago

lukyth commented 7 years ago

In the generated endpoint file, there's an endpoint reference (generated by generator/generator.go#L648 and generator/generator.go#L684), which we need to import "github.com/go-kit/kit/endpoint" for it to work. Without that import, it won't be able to be compiled.

This PR fix it by adding "github.com/go-kit/kit/endpoint" to the import statement on generated endpoint file.

kujtimiihoxha commented 7 years ago

@lukyth thanks for your PR

I can see what the issue is but https://github.com/kujtimiihoxha/gk/blob/master/parser/src.go#L55 should have automatically added the import by searching your libraries, is it possible that you don't have go-kit installed ? or maybe you have multiple libraries that would satisfy endpoint that could be one reason why it is not automatically importing it.

Either way adding it manually guaranties that the import is present so I think this PR is safe to merge.

I'll check it and merge it 👍

kujtimiihoxha commented 7 years ago

Yep I can confirm that for me it is being added automatically, but adding it manually guaranties that it is there in the end so this PR is g2g.

Thanks again @lukyth