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

Does this work with vgo? #56

Closed
gioiafueter opened this issue Apr 10, 2019 · 5 comments · Fixed by #69
Closed

Does this work with vgo? #56

gioiafueter opened this issue Apr 10, 2019 · 5 comments · Fixed by #69

Comments

@gioiafueter
Copy link

Hi, following the instructions, but _ "./docs" doesn´t seem to be foundable. Could it be because we are using vgo modules and the project is not in the $GOPATH?
Is there any doc on how to go around this?

Thanks!

@easonlin404
Copy link
Member

./docs is generated by Swag CLI, please use swag to generate for it.

@mtarnawa
Copy link

@easonlin404 - what @gioiafueter meant is that, since "./docs" import is not a module, if gin-swagger is used with go.mod, it will fail to build as importing _ "./docs" (of course after it's generated) cannot be resolved to a module:

$ go build
build private/example/jwt-mock: cannot find module for path _/Users/mtarnawa/Documents/git/jwt-mock/docs

I solved this by simply doing go mod init inside docs folder.

@farwish
Copy link

farwish commented Jul 3, 2019

go mod init inside docs folder still fail, why

@ycg000344
Copy link

hi, same problem. use go mod.
Just resolved.

_ "${PROJECT_NAME}/docs"

replace

"./docs" // docs is generated by Swag CLI, you have to import it.

like my demo project ,it's

_ "github.com/ycg000344/go-web-cli/docs"

hope it works for you.

@easonlin404
Copy link
Member

I would update README using project's import ${PROJECT_NAME}/docs.

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

Successfully merging a pull request may close this issue.

5 participants