Closed agn-7 closed 8 months ago
I tried both with go get -u github.com/swaggo/swag/cmd/swag
and go install github.com/swaggo/swag/cmd/swag@latest
without any success
I realized the problem was related to the GOPATH
!
I went through the ~/go/bin
path and saw the swag
there indicating it is installed properly. Then, I opened the .zshrc
file to check the variables which were as follows:
GOROOT=/usr/local/go
GOPATH=~/.go
PATH=$PATH:$GOROOT/bin:$GOPATH/bin
Next, I rectified the GOPATH
from GOPATH=~/.go
to GOPATH=~/go
to solve the issue.
Now, swag init
works.
I installed gin-swagger but I cannot run the command
swag init
!What am I wrong?