From c59d4008576dd3ff4ea6ff2502b8b53bbc840d5e Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 28 Sep 2020 12:14:53 +0300 Subject: [PATCH] move errors to internal Signed-off-by: Vasiliy Tolstov --- error.go | 4 ++-- generate.go | 2 +- {errors => internal/errors}/errors.go | 0 {errors => internal/errors}/errors.pb.go | 0 {errors => internal/errors}/errors.pb.micro.go | 0 {errors => internal/errors}/errors.proto | 0 6 files changed, 3 insertions(+), 3 deletions(-) rename {errors => internal/errors}/errors.go (100%) rename {errors => internal/errors}/errors.pb.go (100%) rename {errors => internal/errors}/errors.pb.micro.go (100%) rename {errors => internal/errors}/errors.proto (100%) diff --git a/error.go b/error.go index ab8d02a..2e72685 100644 --- a/error.go +++ b/error.go @@ -1,7 +1,7 @@ package grpc import ( - pberr "github.com/unistack-org/micro-client-grpc/errors" + pb "github.com/unistack-org/micro-client-grpc/internal/errors" "github.com/unistack-org/micro/v3/errors" "google.golang.org/grpc/status" ) @@ -17,7 +17,7 @@ func microError(err error) error { return verr } - if verr, ok := err.(*pberr.Error); ok { + if verr, ok := err.(*pb.Error); ok { return &errors.Error{Id: verr.Id, Code: verr.Code, Detail: verr.Detail, Status: verr.Status} } diff --git a/generate.go b/generate.go index 599d850..31c7626 100644 --- a/generate.go +++ b/generate.go @@ -1,3 +1,3 @@ package grpc -//go:generate protoc -I./errors -I. --go-grpc_out=paths=source_relative:./errors --go_out=paths=source_relative:./errors --micro_out=paths=source_relative:./errors errors/errors.proto +//go:generate protoc -I./internal/errors -I. --go-grpc_out=paths=source_relative:./internal/errors --go_out=paths=source_relative:./internal/errors --micro_out=paths=source_relative:./internal/errors internal/errors/errors.proto diff --git a/errors/errors.go b/internal/errors/errors.go similarity index 100% rename from errors/errors.go rename to internal/errors/errors.go diff --git a/errors/errors.pb.go b/internal/errors/errors.pb.go similarity index 100% rename from errors/errors.pb.go rename to internal/errors/errors.pb.go diff --git a/errors/errors.pb.micro.go b/internal/errors/errors.pb.micro.go similarity index 100% rename from errors/errors.pb.micro.go rename to internal/errors/errors.pb.micro.go diff --git a/errors/errors.proto b/internal/errors/errors.proto similarity index 100% rename from errors/errors.proto rename to internal/errors/errors.proto