code-generator icon indicating copy to clipboard operation
code-generator copied to clipboard

code generator on windows os use backslash in import path

Open alpha-99 opened this issue 2 years ago • 4 comments

Hi, When i am running generate-groups.sh to generate code, i got a error message. The error message is as follows:

./generate-groups.sh all github.com/bhl/custom-controller/resource/pkg/client github.com/bhl/custom-controller-resource/pkg/apis samplecrd:v1 --go-header-file ./hack/boilerplate.go.txt Generating deepcopy funcs Generating clientset for samplecrd:v1 at github.com/bhl/custom-controller/resource/pkg/client/clientset F0320 09:05:57.538225 11280 main.go:61] Error: Failed executing generator: some packages had errors: errors in package "github.com\bhl\custom-controller\resource\pkg\client\clientset\versioned": unable to format file "D:\go\src\github.com\bhl\custom-controller\resource\pkg\client\clientset\versioned\clientset.go" (23:30: unknown escape sequence (and 4 more errors)).

errors in package "github.com\bhl\custom-controller\resource\pkg\client\clientset\versioned\fake": unable to format file "D:\go\src\github.com\bhl\custom-controller\resource\pkg\client\clientset\versioned\fake\clientset_generated.go" (28:30: unknown escape sequence (and 13 more errors)).

errors in package "github.com\bhl\custom-controller\resource\pkg\client\clientset\versioned\typed\samplecrd\v1":unable to format file "D:\go\src\github.com\bhl\custom-controller\resource\pkg\client\clientset\versioned\typed\samplecrd\v1\samplecrd_client.go" (23:2: invalid import path: "github.com\bhl\custom-controller\resource\pkg\client\clientset\versioned\scheme").

I found someone also met this problem, and the issue has been closed. Has the issue been fixed yet. Is there any solutions. Thanks!

alpha-99 avatar Mar 20 '23 01:03 alpha-99