From 36f4177b68df8fc9987eccd8b3be489b3fed5f04 Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Sat, 19 Jan 2019 20:01:03 +0100 Subject: [PATCH] chore: lint --- .../session/gen/endpoints/endpoints.go | 2 +- .../sprint/gen/endpoints/endpoints.go | 2 +- .../services/user/gen/endpoints/endpoints.go | 2 +- examples/import/output/output.go | 30 +++++-------------- .../single-package-mode/output/bbb/service.go | 2 +- examples/time/output/time.go | 6 ++-- helpers/helpers.go | 4 +-- 7 files changed, 17 insertions(+), 31 deletions(-) diff --git a/examples/go-kit/services/session/gen/endpoints/endpoints.go b/examples/go-kit/services/session/gen/endpoints/endpoints.go index 597ef54..b7196c2 100644 --- a/examples/go-kit/services/session/gen/endpoints/endpoints.go +++ b/examples/go-kit/services/session/gen/endpoints/endpoints.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/go-kit/kit/endpoint" - pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" oldcontext "golang.org/x/net/context" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" ) var _ = endpoint.Chain diff --git a/examples/go-kit/services/sprint/gen/endpoints/endpoints.go b/examples/go-kit/services/sprint/gen/endpoints/endpoints.go index 0b4558a..6db874c 100644 --- a/examples/go-kit/services/sprint/gen/endpoints/endpoints.go +++ b/examples/go-kit/services/sprint/gen/endpoints/endpoints.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/go-kit/kit/endpoint" - pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" oldcontext "golang.org/x/net/context" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" ) var _ = endpoint.Chain diff --git a/examples/go-kit/services/user/gen/endpoints/endpoints.go b/examples/go-kit/services/user/gen/endpoints/endpoints.go index f995b6e..7bada77 100644 --- a/examples/go-kit/services/user/gen/endpoints/endpoints.go +++ b/examples/go-kit/services/user/gen/endpoints/endpoints.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/go-kit/kit/endpoint" - pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" oldcontext "golang.org/x/net/context" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" ) var _ = endpoint.Chain diff --git a/examples/import/output/output.go b/examples/import/output/output.go index b51b6d0..e651cda 100644 --- a/examples/import/output/output.go +++ b/examples/import/output/output.go @@ -2,39 +2,25 @@ package company import ( + "context" + "moul.io/protoc-gen-gotemplate/examples/import/output/models/article" - "moul.io/protoc-gen-gotemplate/examples/import/output/models/common" + "moul.io/protoc-gen-gotemplate/examples/import/output/models/common" ) type Repository interface { - GetArticle(getarticle *common.GetArticle ) (*company.Article, []*company.Storage, 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) { +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 := &pb.GetArticleResponse{} _ = out + return out.Article, out.Storages, nil - return out.Article, out.Storages, nil - } - - - diff --git a/examples/single-package-mode/output/bbb/service.go b/examples/single-package-mode/output/bbb/service.go index 26a1995..e5f956d 100644 --- a/examples/single-package-mode/output/bbb/service.go +++ b/examples/single-package-mode/output/bbb/service.go @@ -4,8 +4,8 @@ package bbb import ( "fmt" - "moul.io/protoc-gen-gotemplate/examples/single-package-mode/output/aaa" "golang.org/x/net/context" + "moul.io/protoc-gen-gotemplate/examples/single-package-mode/output/aaa" ) type Service struct{} diff --git a/examples/time/output/time.go b/examples/time/output/time.go index f9df110..56b6386 100644 --- a/examples/time/output/time.go +++ b/examples/time/output/time.go @@ -2,9 +2,9 @@ package foo import ( - "github.com/golang/protobuf/ptypes/timestamp" + "github.com/golang/protobuf/ptypes/timestamp" ) type Repository interface { - GetFoo(timestamp *timestamp.Timestamp ) (*timestamp.Timestamp, error) -} \ No newline at end of file + GetFoo(timestamp *timestamp.Timestamp) (*timestamp.Timestamp, error) +} diff --git a/helpers/helpers.go b/helpers/helpers.go index a45571b..20a1cc3 100644 --- a/helpers/helpers.go +++ b/helpers/helpers.go @@ -283,12 +283,12 @@ func samePath(a, b []int32) bool { return true } -func findSourceInfoLocation(i interface{}) *descriptor.SourceCodeInfo_Location { +/*func findSourceInfoLocation(i interface{}) *descriptor.SourceCodeInfo_Location { if pathMap == nil { return nil } return pathMap[i] -} +}*/ func leadingComment(i interface{}) string { loc := pathMap[i]