From c015ff9539d27bf5e922728a4c253319da257061 Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Wed, 12 Sep 2018 20:29:07 +0200 Subject: [PATCH] chore: switch to moul.io/protoc-gen-gotemplate --- .travis.yml | 3 +- Dockerfile | 4 +-- README.md | 2 +- cmd/web-editor/static/index.html | 4 +-- encoder.go | 2 +- examples/go-kit/glide.yaml | 2 +- examples/go-kit/main.go | 30 +++++++++---------- .../session/gen/client/grpc/client.go | 4 +-- .../session/gen/endpoints/endpoints.go | 2 +- .../session/gen/transports/grpc/grpc.go | 4 +-- .../session/gen/transports/http/http.go | 4 +-- examples/go-kit/services/session/service.go | 2 +- .../services/sprint/gen/client/grpc/client.go | 4 +-- .../sprint/gen/endpoints/endpoints.go | 2 +- .../sprint/gen/transports/grpc/grpc.go | 4 +-- .../sprint/gen/transports/http/http.go | 4 +-- examples/go-kit/services/sprint/service.go | 2 +- .../services/user/gen/client/grpc/client.go | 4 +-- .../services/user/gen/endpoints/endpoints.go | 2 +- .../services/user/gen/transports/grpc/grpc.go | 4 +-- .../services/user/gen/transports/http/http.go | 4 +-- examples/go-kit/services/user/service.go | 2 +- examples/helpers/helpers.proto | 2 +- examples/import/Makefile | 2 +- .../output/models/article/article.pb.go | 2 +- examples/import/output/output.go | 6 ++-- examples/import/templates/output.go.tmpl | 6 ++-- examples/single-package-mode/Makefile | 2 +- .../single-package-mode/output/bbb/bbb.pb.go | 2 +- .../single-package-mode/output/bbb/service.go | 2 +- .../single-package-mode/proto/aaa/aaa.proto | 4 +-- .../single-package-mode/proto/bbb/bbb.proto | 4 +-- main.go | 4 +-- slides/README.md | 16 +++++----- 34 files changed, 74 insertions(+), 73 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1ceb1e8..76545aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: go -go: 1.8.x +go: 1.11.x +go_import_path: moul.io/protoc-gen-gotemplate install: - go get github.com/Masterminds/glide - wget https://raw.githubusercontent.com/grpc-ecosystem/grpc-gateway/master/.travis/install-protoc.sh && chmod +x install-protoc.sh && ./install-protoc.sh 3.4.0 diff --git a/Dockerfile b/Dockerfile index b631dc3..db66eac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN apk --update add make git go rsync libc-dev \ && go get -u golang.org/x/tools/cmd/goimports # Install protoc-gen-gotemplate -COPY . /go/src/github.com/moul/protoc-gen-gotemplate -WORKDIR /go/src/github.com/moul/protoc-gen-gotemplate +COPY . /go/src/moul.io/protoc-gen-gotemplate +WORKDIR /go/src/moul.io/protoc-gen-gotemplate RUN git remote set-url origin https://github.com/moul/protoc-gen-gotemplate RUN go install . ./cmd/web-editor diff --git a/README.md b/README.md index c3af012..d87aff2 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ See the project helpers for the complete list. * Install the **Go** compiler and tools from https://golang.org/doc/install * Install **protobuf**: `go get -u github.com/golang/protobuf/{proto,protoc-gen-go}` -* Install **protoc-gen-gotemplate**: `go get -u github.com/moul/protoc-gen-gotemplate` +* Install **protoc-gen-gotemplate**: `go get -u moul.io/protoc-gen-gotemplate` ## Docker diff --git a/cmd/web-editor/static/index.html b/cmd/web-editor/static/index.html index 278c848..ee28ac1 100644 --- a/cmd/web-editor/static/index.html +++ b/cmd/web-editor/static/index.html @@ -129,10 +129,10 @@
Command: protoc --gotemplate_out=template_dir=.:. example.proto
-
Powered by protoc-gen-gotemplate
+
Powered by protoc-gen-gotemplate
- Fork me on GitHub + Fork me on GitHub diff --git a/encoder.go b/encoder.go index f5d5fe7..8258b3b 100644 --- a/encoder.go +++ b/encoder.go @@ -12,7 +12,7 @@ import ( "github.com/golang/protobuf/protoc-gen-go/descriptor" "github.com/golang/protobuf/protoc-gen-go/plugin" - pgghelpers "github.com/moul/protoc-gen-gotemplate/helpers" + pgghelpers "moul.io/protoc-gen-gotemplate/helpers" ) type GenericTemplateBasedEncoder struct { diff --git a/examples/go-kit/glide.yaml b/examples/go-kit/glide.yaml index 807973a..a7ec331 100644 --- a/examples/go-kit/glide.yaml +++ b/examples/go-kit/glide.yaml @@ -1,4 +1,4 @@ -package: github.com/moul/protoc-gen-gotemplate/examples/go-kit +package: moul.io/protoc-gen-gotemplate/examples/go-kit import: - package: github.com/go-kit/kit subpackages: diff --git a/examples/go-kit/main.go b/examples/go-kit/main.go index e544e3c..1de10ff 100644 --- a/examples/go-kit/main.go +++ b/examples/go-kit/main.go @@ -12,23 +12,23 @@ import ( "github.com/gorilla/handlers" "google.golang.org/grpc" - session_svc "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session" - session_endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints" - session_pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" - session_grpctransport "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/transports/grpc" - session_httptransport "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/transports/http" + session_svc "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session" + session_endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints" + session_pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" + session_grpctransport "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/transports/grpc" + session_httptransport "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/transports/http" - sprint_svc "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint" - sprint_endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints" - sprint_pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" - sprint_grpctransport "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/transports/grpc" - sprint_httptransport "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/transports/http" + sprint_svc "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint" + sprint_endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints" + sprint_pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" + sprint_grpctransport "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/transports/grpc" + sprint_httptransport "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/transports/http" - user_svc "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user" - user_endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints" - user_pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" - user_grpctransport "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/transports/grpc" - user_httptransport "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/transports/http" + user_svc "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user" + user_endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints" + user_pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" + user_grpctransport "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/transports/grpc" + user_httptransport "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/transports/http" ) func main() { diff --git a/examples/go-kit/services/session/gen/client/grpc/client.go b/examples/go-kit/services/session/gen/client/grpc/client.go index 9d69bb5..d09c75c 100644 --- a/examples/go-kit/services/session/gen/client/grpc/client.go +++ b/examples/go-kit/services/session/gen/client/grpc/client.go @@ -9,8 +9,8 @@ import ( grpctransport "github.com/go-kit/kit/transport/grpc" "google.golang.org/grpc" - endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" + endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" ) func New(conn *grpc.ClientConn, logger log.Logger) pb.SessionServiceServer { diff --git a/examples/go-kit/services/session/gen/endpoints/endpoints.go b/examples/go-kit/services/session/gen/endpoints/endpoints.go index edba02a..597ef54 100644 --- a/examples/go-kit/services/session/gen/endpoints/endpoints.go +++ b/examples/go-kit/services/session/gen/endpoints/endpoints.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/go-kit/kit/endpoint" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" oldcontext "golang.org/x/net/context" ) diff --git a/examples/go-kit/services/session/gen/transports/grpc/grpc.go b/examples/go-kit/services/session/gen/transports/grpc/grpc.go index eccbb3d..99b65b3 100644 --- a/examples/go-kit/services/session/gen/transports/grpc/grpc.go +++ b/examples/go-kit/services/session/gen/transports/grpc/grpc.go @@ -7,8 +7,8 @@ import ( grpctransport "github.com/go-kit/kit/transport/grpc" oldcontext "golang.org/x/net/context" - endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" + endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" ) // avoid import errors diff --git a/examples/go-kit/services/session/gen/transports/http/http.go b/examples/go-kit/services/session/gen/transports/http/http.go index b608681..d83c9c5 100644 --- a/examples/go-kit/services/session/gen/transports/http/http.go +++ b/examples/go-kit/services/session/gen/transports/http/http.go @@ -8,8 +8,8 @@ import ( gokit_endpoint "github.com/go-kit/kit/endpoint" httptransport "github.com/go-kit/kit/transport/http" - endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" + endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/endpoints" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" ) var _ = log.Printf diff --git a/examples/go-kit/services/session/service.go b/examples/go-kit/services/session/service.go index b7e2ea2..412b6eb 100644 --- a/examples/go-kit/services/session/service.go +++ b/examples/go-kit/services/session/service.go @@ -5,7 +5,7 @@ import ( "golang.org/x/net/context" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" ) type Service struct{} diff --git a/examples/go-kit/services/sprint/gen/client/grpc/client.go b/examples/go-kit/services/sprint/gen/client/grpc/client.go index a7ef1d2..ef39bac 100644 --- a/examples/go-kit/services/sprint/gen/client/grpc/client.go +++ b/examples/go-kit/services/sprint/gen/client/grpc/client.go @@ -9,8 +9,8 @@ import ( grpctransport "github.com/go-kit/kit/transport/grpc" "google.golang.org/grpc" - endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" + endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" ) func New(conn *grpc.ClientConn, logger log.Logger) pb.SprintServiceServer { diff --git a/examples/go-kit/services/sprint/gen/endpoints/endpoints.go b/examples/go-kit/services/sprint/gen/endpoints/endpoints.go index 47869d5..0b4558a 100644 --- a/examples/go-kit/services/sprint/gen/endpoints/endpoints.go +++ b/examples/go-kit/services/sprint/gen/endpoints/endpoints.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/go-kit/kit/endpoint" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" oldcontext "golang.org/x/net/context" ) diff --git a/examples/go-kit/services/sprint/gen/transports/grpc/grpc.go b/examples/go-kit/services/sprint/gen/transports/grpc/grpc.go index 5fd10c8..a301589 100644 --- a/examples/go-kit/services/sprint/gen/transports/grpc/grpc.go +++ b/examples/go-kit/services/sprint/gen/transports/grpc/grpc.go @@ -7,8 +7,8 @@ import ( grpctransport "github.com/go-kit/kit/transport/grpc" oldcontext "golang.org/x/net/context" - endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" + endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" ) // avoid import errors diff --git a/examples/go-kit/services/sprint/gen/transports/http/http.go b/examples/go-kit/services/sprint/gen/transports/http/http.go index b6df66a..40259f5 100644 --- a/examples/go-kit/services/sprint/gen/transports/http/http.go +++ b/examples/go-kit/services/sprint/gen/transports/http/http.go @@ -8,8 +8,8 @@ import ( gokit_endpoint "github.com/go-kit/kit/endpoint" httptransport "github.com/go-kit/kit/transport/http" - endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" + endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" ) var _ = log.Printf diff --git a/examples/go-kit/services/sprint/service.go b/examples/go-kit/services/sprint/service.go index 6b26f7c..0b3606f 100644 --- a/examples/go-kit/services/sprint/service.go +++ b/examples/go-kit/services/sprint/service.go @@ -5,7 +5,7 @@ import ( "golang.org/x/net/context" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb" ) type Service struct{} diff --git a/examples/go-kit/services/user/gen/client/grpc/client.go b/examples/go-kit/services/user/gen/client/grpc/client.go index 105f036..ea61cb8 100644 --- a/examples/go-kit/services/user/gen/client/grpc/client.go +++ b/examples/go-kit/services/user/gen/client/grpc/client.go @@ -9,8 +9,8 @@ import ( grpctransport "github.com/go-kit/kit/transport/grpc" "google.golang.org/grpc" - endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" + endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" ) func New(conn *grpc.ClientConn, logger log.Logger) pb.UserServiceServer { diff --git a/examples/go-kit/services/user/gen/endpoints/endpoints.go b/examples/go-kit/services/user/gen/endpoints/endpoints.go index bb13e4a..f995b6e 100644 --- a/examples/go-kit/services/user/gen/endpoints/endpoints.go +++ b/examples/go-kit/services/user/gen/endpoints/endpoints.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/go-kit/kit/endpoint" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" oldcontext "golang.org/x/net/context" ) diff --git a/examples/go-kit/services/user/gen/transports/grpc/grpc.go b/examples/go-kit/services/user/gen/transports/grpc/grpc.go index 636107f..3d225ba 100644 --- a/examples/go-kit/services/user/gen/transports/grpc/grpc.go +++ b/examples/go-kit/services/user/gen/transports/grpc/grpc.go @@ -7,8 +7,8 @@ import ( grpctransport "github.com/go-kit/kit/transport/grpc" oldcontext "golang.org/x/net/context" - endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" + endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" ) // avoid import errors diff --git a/examples/go-kit/services/user/gen/transports/http/http.go b/examples/go-kit/services/user/gen/transports/http/http.go index 409ab6f..498cd5b 100644 --- a/examples/go-kit/services/user/gen/transports/http/http.go +++ b/examples/go-kit/services/user/gen/transports/http/http.go @@ -8,8 +8,8 @@ import ( gokit_endpoint "github.com/go-kit/kit/endpoint" httptransport "github.com/go-kit/kit/transport/http" - endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" + endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" ) var _ = log.Printf diff --git a/examples/go-kit/services/user/service.go b/examples/go-kit/services/user/service.go index b4bb7f1..253bf5c 100644 --- a/examples/go-kit/services/user/service.go +++ b/examples/go-kit/services/user/service.go @@ -5,7 +5,7 @@ import ( "golang.org/x/net/context" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" ) type Service struct{} diff --git a/examples/helpers/helpers.proto b/examples/helpers/helpers.proto index d45e9bf..6dbf122 100644 --- a/examples/helpers/helpers.proto +++ b/examples/helpers/helpers.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package dummy; -option go_package = "github.com/moul/protoc-gen-gotemplate/examples/helpers"; +option go_package = "moul.io/protoc-gen-gotemplate/examples/helpers"; message Dummy1 { float aaa = 1; diff --git a/examples/import/Makefile b/examples/import/Makefile index af733c7..9cf5779 100644 --- a/examples/import/Makefile +++ b/examples/import/Makefile @@ -3,7 +3,7 @@ build: mkdir -p output # generate pb.go inluding imported proto - protoc --go_out=Mproto/common.proto=github.com/moul/protoc-gen-gotemplate/examples/import/output/models/common:./output proto/article.proto + protoc --go_out=Mproto/common.proto=moul.io/protoc-gen-gotemplate/examples/import/output/models/common:./output proto/article.proto protoc --go_out=,plugins=grpc:./output proto/common.proto # build our go file based on our template diff --git a/examples/import/output/models/article/article.pb.go b/examples/import/output/models/article/article.pb.go index eaa6c2b..16b2651 100644 --- a/examples/import/output/models/article/article.pb.go +++ b/examples/import/output/models/article/article.pb.go @@ -17,7 +17,7 @@ package article import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import common "github.com/moul/protoc-gen-gotemplate/examples/import/output/models/common" +import common "moul.io/protoc-gen-gotemplate/examples/import/output/models/common" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/examples/import/output/output.go b/examples/import/output/output.go index 4911f1a..b51b6d0 100644 --- a/examples/import/output/output.go +++ b/examples/import/output/output.go @@ -2,8 +2,8 @@ package company import ( - "github.com/moul/protoc-gen-gotemplate/examples/import/output/models/article" - "github.com/moul/protoc-gen-gotemplate/examples/import/output/models/common" + "moul.io/protoc-gen-gotemplate/examples/import/output/models/article" + "moul.io/protoc-gen-gotemplate/examples/import/output/models/common" ) type Repository interface { @@ -37,4 +37,4 @@ func (sdk *Sdk) GetArticle(ctx context.Context, } - \ No newline at end of file + diff --git a/examples/import/templates/output.go.tmpl b/examples/import/templates/output.go.tmpl index c055713..219a3cd 100644 --- a/examples/import/templates/output.go.tmpl +++ b/examples/import/templates/output.go.tmpl @@ -3,8 +3,8 @@ package {{.File.Package}} import ( - "github.com/moul/protoc-gen-gotemplate/examples/import/output/models/article" - "github.com/moul/protoc-gen-gotemplate/examples/import/output/models/common" + "moul.io/protoc-gen-gotemplate/examples/import/output/models/article" + "moul.io/protoc-gen-gotemplate/examples/import/output/models/common" ) type Repository interface { @@ -38,4 +38,4 @@ func (sdk *Sdk) {{$m.Name}}(ctx context.Context, {{if $t.OneofDecl}} req *{{$pkg } {{end}} {{/* streaming ifs */}} -{{end}}{{end}} {{/* range with */}} \ No newline at end of file +{{end}}{{end}} {{/* range with */}} diff --git a/examples/single-package-mode/Makefile b/examples/single-package-mode/Makefile index a8ee603..d5df807 100644 --- a/examples/single-package-mode/Makefile +++ b/examples/single-package-mode/Makefile @@ -9,7 +9,7 @@ build: protoc -I./proto --go_out=plugins=grpc:output proto/aaa/aaa.proto protoc -I./proto --go_out=plugins=grpc:output proto/bbb/bbb.proto @rm -rf output/aaa output/bbb - @mv output/github.com/moul/protoc-gen-gotemplate/examples/single-package-mode/output/* output/ + @mv output/moul.io/protoc-gen-gotemplate/examples/single-package-mode/output/* output/ @rm -rf output/github.com @# protoc-gen-gotemplate diff --git a/examples/single-package-mode/output/bbb/bbb.pb.go b/examples/single-package-mode/output/bbb/bbb.pb.go index 4fa356c..333920f 100644 --- a/examples/single-package-mode/output/bbb/bbb.pb.go +++ b/examples/single-package-mode/output/bbb/bbb.pb.go @@ -17,7 +17,7 @@ package bbb import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import the_aaa_package "github.com/moul/protoc-gen-gotemplate/examples/single-package-mode/output/aaa" +import the_aaa_package "moul.io/protoc-gen-gotemplate/examples/single-package-mode/output/aaa" import ( context "golang.org/x/net/context" diff --git a/examples/single-package-mode/output/bbb/service.go b/examples/single-package-mode/output/bbb/service.go index 6f1e6b4..26a1995 100644 --- a/examples/single-package-mode/output/bbb/service.go +++ b/examples/single-package-mode/output/bbb/service.go @@ -4,7 +4,7 @@ package bbb import ( "fmt" - "github.com/moul/protoc-gen-gotemplate/examples/single-package-mode/output/aaa" + "moul.io/protoc-gen-gotemplate/examples/single-package-mode/output/aaa" "golang.org/x/net/context" ) diff --git a/examples/single-package-mode/proto/aaa/aaa.proto b/examples/single-package-mode/proto/aaa/aaa.proto index 2959414..2bc1230 100644 --- a/examples/single-package-mode/proto/aaa/aaa.proto +++ b/examples/single-package-mode/proto/aaa/aaa.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/moul/protoc-gen-gotemplate/examples/single-package-mode/output/aaa"; +option go_package = "moul.io/protoc-gen-gotemplate/examples/single-package-mode/output/aaa"; package the.aaa.package; @@ -9,4 +9,4 @@ message AaaRequest { } message AaaReply { string error = 1; -} \ No newline at end of file +} diff --git a/examples/single-package-mode/proto/bbb/bbb.proto b/examples/single-package-mode/proto/bbb/bbb.proto index b41952f..2da408b 100644 --- a/examples/single-package-mode/proto/bbb/bbb.proto +++ b/examples/single-package-mode/proto/bbb/bbb.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package the.bbb.package; -option go_package = "github.com/moul/protoc-gen-gotemplate/examples/single-package-mode/output/bbb"; +option go_package = "moul.io/protoc-gen-gotemplate/examples/single-package-mode/output/bbb"; import "aaa/aaa.proto"; @@ -16,4 +16,4 @@ message BbbRequest { } message BbbReply { bool done = 1; -} \ No newline at end of file +} diff --git a/main.go b/main.go index 3014869..00a67a1 100644 --- a/main.go +++ b/main.go @@ -1,4 +1,4 @@ -package main +package main // import "moul.io/protoc-gen-gotemplate" import ( "io/ioutil" @@ -11,7 +11,7 @@ import ( "github.com/golang/protobuf/protoc-gen-go/plugin" ggdescriptor "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/descriptor" - pgghelpers "github.com/moul/protoc-gen-gotemplate/helpers" + pgghelpers "moul.io/protoc-gen-gotemplate/helpers" ) var ( diff --git a/slides/README.md b/slides/README.md index f1ad91f..8fa2682 100644 --- a/slides/README.md +++ b/slides/README.md @@ -26,7 +26,7 @@ * the good old ./generate.sh bash script * go:generate * make -* protobuf + [protoc-gen-gotemplate](https://github.com/moul/protoc-gen-gotemplate) +* protobuf + [protoc-gen-gotemplate](https://moul.io/protoc-gen-gotemplate) --- @@ -69,7 +69,7 @@ package sessionsvc import ( "fmt" "golang.org/x/net/context" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/session/gen/pb" ) type Service struct{} @@ -94,8 +94,8 @@ package {{.File.Package}}_httptransport import ( gokit_endpoint "github.com/go-kit/kit/endpoint" httptransport "github.com/go-kit/kit/transport/http" - endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/{{.File.Package}}/gen/endpoints" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/{{.File.Package}}/gen/pb" + endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/{{.File.Package}}/gen/endpoints" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/{{.File.Package}}/gen/pb" ) ``` @@ -105,8 +105,8 @@ package user_httptransport import ( gokit_endpoint "github.com/go-kit/kit/endpoint" httptransport "github.com/go-kit/kit/transport/http" - endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints" - pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" + endpoints "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/endpoints" + pb "moul.io/protoc-gen-gotemplate/examples/go-kit/services/user/gen/pb" ) ``` @@ -197,7 +197,7 @@ func RegisterHandlers(ctx context.Context, svc pb.UserServiceServer, mux *http.S # generation usages -* go-kit boilerplate (see [examples/go-kit](https://github.com/moul/protoc-gen-gotemplate/tree/master/examples/go-kit)) +* go-kit boilerplate (see [examples/go-kit](https://moul.io/protoc-gen-gotemplate/tree/master/examples/go-kit)) * k8s configuration * Dockerfile * documentation @@ -243,5 +243,5 @@ func RegisterHandlers(ctx context.Context, svc pb.UserServiceServer, mux *http.S # questions? -### github.com/moul/protoc-gen-gotemplate +### moul.io/protoc-gen-gotemplate ### @moul