kit icon indicating copy to clipboard operation
kit copied to clipboard

Incorect import when using go modules with full project name

Open Tapanito opened this issue 4 years ago • 2 comments

Hi,

I came across a bug whilst generating boilercode for go-kit. I'm running go version: go version go1.15.2 linux/amd64

Running the latest version of kit.

The service was generated as follows:

 kit new service vavite -m bitbucket.org/tapanito/hello

Then to generate the middleware and other boiler code:

kit generate service -w -t grpc --svc-mdw hello -f

The generates imports block looks as follows:

import (
	"context"
	service "hello/pkg/service"

	endpoint "github.com/go-kit/kit/endpoint"
)

The culprit line is: service "hello/pkg/service", as I'm using go modules with the module name bitbucket.org/tapanito/hello the import service "hello/pkg/service" is not valid.

Tapanito avatar Sep 28 '20 12:09 Tapanito

Hi,

I came across a bug whilst generating boilercode for go-kit. I'm running go version: go version go1.15.2 linux/amd64

Running the latest version of kit.

The service was generated as follows:

 kit new service vavite -m bitbucket.org/tapanito/hello

Then to generate the middleware and other boiler code:

kit generate service -w -t grpc --svc-mdw hello -f

The generates imports block looks as follows:

import (
	"context"
	service "hello/pkg/service"

	endpoint "github.com/go-kit/kit/endpoint"
)

The culprit line is: service "hello/pkg/service", as I'm using go modules with the module name bitbucket.org/tapanito/hello the import service "hello/pkg/service" is not valid.

Sorry,it‘s a bug, I will fix it at once.

GrantZheng avatar Oct 15 '20 12:10 GrantZheng

Hi,

I came across a bug whilst generating boilercode for go-kit. I'm running go version: go version go1.15.2 linux/amd64

Running the latest version of kit.

The service was generated as follows:

 kit new service vavite -m bitbucket.org/tapanito/hello

Then to generate the middleware and other boiler code:

kit generate service -w -t grpc --svc-mdw hello -f

The generates imports block looks as follows:

import (
	"context"
	service "hello/pkg/service"

	endpoint "github.com/go-kit/kit/endpoint"
)

The culprit line is: service "hello/pkg/service", as I'm using go modules with the module name bitbucket.org/tapanito/hello the import service "hello/pkg/service" is not valid.

Hi,I have fixed, it is bug caused by the PR(https://github.com/GrantZheng/kit/pull/12 )

GrantZheng avatar Oct 16 '20 13:10 GrantZheng