Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid import path #35

Open
vdieulesaint opened this issue Apr 19, 2019 · 3 comments
Open

Invalid import path #35

vdieulesaint opened this issue Apr 19, 2019 · 3 comments

Comments

@vdieulesaint
Copy link

Hi,

I am facing an issue with the gen.
From $GOPATH/src, I run the following commands :

  1. New service

$kit new service bugs

  1. 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 }

  1. 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

@GrantZheng
Copy link

Hi,

I am facing an issue with the gen.
From $GOPATH/src, I run the following commands :

  1. New service

$kit new service bugs

  1. 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 }

  1. 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 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.

@dkundu1
Copy link

dkundu1 commented Oct 8, 2019

Any update on this

@zhouchunli
Copy link

any update on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants