Invalid import path
Hi,
I am facing an issue with the gen. From $GOPATH/src, I run the following commands :
- New service
$kit new service bugs
- Implementation of a basic method in the service interface :
type BugsService interface { // Add your methods here // e.x: Foo(ctx context.Context,s string)(rs string, err error) Create(ctx context.Context, bug string) error }
- Generate MW
kit generate service bugs --dmw
=> Error
`$ kit generate service bugs --dmw panic: Error 5:9: invalid import path: "C:/Users/Vincent/go/src/bugs/pkg/service" while formatting source: // THIS FILE IS AUTO GENERATED BY GK-CLI DO NOT EDIT!! package endpoint
import ( service "C:/Users/Vincent/go/src/bugs/pkg/service" endpoint "github.com/go-kit/kit/endpoint" )
... `
The import path is absolute instead of relative. There is maybe something wrong with my dev environment.
$ go env set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\Vincent\AppData\Local\go-build set GOEXE=.exe set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOOS=windows set GOPATH=C:\Users\Vincent\go set GOPROXY= set GORACE= set GOROOT=C:\Go set GOTMPDIR= set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64 set GCCGO=gccgo set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD= set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Vincent\AppData\Local\Temp\go-build688545542=/tmp/go-build -gno-record-gcc-switches
I will appreciate your help.
Vincent
Hi,
I am facing an issue with the gen. From $GOPATH/src, I run the following commands :
- New service
$kit new service bugs
- Implementation of a basic method in the service interface :
type BugsService interface { // Add your methods here // e.x: Foo(ctx context.Context,s string)(rs string, err error) Create(ctx context.Context, bug string) error }
- Generate MW
kit generate service bugs --dmw=> Error
`$ kit generate service bugs --dmw panic: Error 5:9: invalid import path: "C:/Users/Vincent/go/src/bugs/pkg/service" while formatting source: // THIS FILE IS AUTO GENERATED BY GK-CLI DO NOT EDIT!! package endpoint
import ( service "C:/Users/Vincent/go/src/bugs/pkg/service" endpoint "github.com/go-kit/kit/endpoint" )
... `
The import path is absolute instead of relative. There is maybe something wrong with my dev environment.
$ go env set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\Vincent\AppData\Local\go-build set GOEXE=.exe set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOOS=windows set GOPATH=C:\Users\Vincent\go set GOPROXY= set GORACE= set GOROOT=C:\Go set GOTMPDIR= set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64 set GCCGO=gccgo set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD= set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Vincent\AppData\Local\Temp\go-build688545542=/tmp/go-build -gno-record-gcc-switchesI will appreciate your help. Vincent
Hi,I can not reproduction your case in my windows environment。I install the git bash on the windows system, and I use the kit tool in the git bash, everything is ok. You can try it.
Any update on this
any update on this