feat: add goTypeWithGoPackage

This function allows you to prefix your field of type message with what
you defined in the option go_package.

Moreover it handles message embedded.

In this commit, I rename gometalinter gas option in gosec.
This commit is contained in:
jhayotte
2018-08-09 10:23:10 +02:00
parent 6abbdf4cfb
commit 4b9116a5dd
8 changed files with 252 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
// Code generated by protoc-gen-gotemplate
package article
package company
import (
"github.com/moul/protoc-gen-gotemplate/examples/import/output/models/article"
@@ -7,5 +7,34 @@ import (
)
type Repository interface {
GetArticle(getarticle *common.GetArticle ) (*article.Article, error)
}
GetArticle(getarticle *common.GetArticle ) (*company.Article, []*company.Storage, error)
}
// ------------------------- Public SDK -----------------------------
// GetArticle : proto: missing extension proto: missing extension
func (sdk *Sdk) GetArticle(ctx context.Context,
getarticle *article.GetArticle, token, requestID string)(article *article.Article, storages []*article.GetArticleResponse_Storage, err error) {
out := &pb.GetArticleResponse{}
_ = out
return out.Article, out.Storages, nil
}