fix imports

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-01-18 13:31:52 +03:00
parent 5d85ade30c
commit edbc9228ae
2 changed files with 9 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -5,8 +5,12 @@ package {{goPkgLastElement .File | splitArray ";" | last}}
import (
"context"
"fmt"
"net/http"
"reflect"
"strings"
"github.com/gorilla/mux"
micro_api "github.com/unistack-org/micro/v3/api"
micro_client "github.com/unistack-org/micro/v3/client"
micro_server "github.com/unistack-org/micro/v3/server"
micro_client_http "github.com/unistack-org/micro-client-http"
@ -234,12 +238,12 @@ func (x *{{$ServiceName | lowerFirst}}{{.Name}}Stream) Recv() (*{{$reqMethod}},
{{- end}}
{{- end}}
func Register(r *mux.Router, h interface{}, eps []*api.Endpoint) error {
func Register(r *mux.Router, h interface{}, eps []*micro_api.Endpoint) error {
v := reflect.ValueOf(h)
methods := v.NumMethod()
if methods < 1 {
return ErrInvalidHandler
return fmt.Errorf("invalid handler specified: %#+v", h)
}
for _, ep := range eps {