Describe the bug
I'm unable to install swag given the instructions on the README
To Reproduce
Steps to reproduce the behavior:
go get github.com/swaggo/swag/cmd/swag on the command linego get github.com/swaggo/swag/cmd/swag
# github.com/ghodss/yaml
./yaml.go:102:28: undefined: yaml.UnmarshalStrict
swagzsh: command not found: swag
Expected behavior
swag should be installed properly on my machine.
Desktop (please complete the following information):
@pei0804
@jdiedrick Looks like you have older github.com/ghodss/yaml version at local, please add the -u flag when getting swag like:
go get -u github.com/swaggo/swag/cmd/swag
@jasonhancock please reopen it if you have any questions.
Followed the recommendation and still "zsh: command not found: swag"
I have installed swag as follows: go get -u github.com/swaggo/swag/cmd/swag. But when I run "swag", I got error like: -bash: swag: command not found. how can I resolved this issue? thanks.
Mac OS version: 10.14.3 and golang version: go1.11 darwin/amd64
@stiffer-cl the binary will likely have been installed to $GOPATH/bin/swag. Run if from there or copy the file from there to somplace in your $PATH
Thanks, I was able to resolve the issue by using the full path to the swag code base as you recommended.
From: Jason Hancock notifications@github.com
Reply-To: swaggo/swag reply@reply.github.com
Date: Wednesday, February 13, 2019 at 12:08 PM
To: swaggo/swag swag@noreply.github.com
Cc: Michael Roof michael@myhomegenius.com, Comment comment@noreply.github.com
Subject: Re: [swaggo/swag] Can't install swag (#209)
@stiffer-clhttps://github.com/stiffer-cl the binary will likely have been installed to $GOPATH/bin/swag. Run if from there or copy the file from there to somplace in your $PATH
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/swaggo/swag/issues/209#issuecomment-463304748, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Aq1XvxG21Do0mFrJf6Q4_OAQQRJIFtd2ks5vNFR_gaJpZM4WuMZl.
Path variable must be set:
After running go get -v -u github.com/swaggo/swag/cmd/swag
Please check /usr/local/go/bin or $HOME/go/bin where those swag executable is present.
Make sure you have that PATH in /etc/profile or $HOME/.profile
e.g. export PATH=$PATH:$HOME/go/bin
Hi @pnutmath @jasonhancock I did the following
I am new to Golang. Can you please help?
@hariraogotit from the directory with your main.go, run $HOME/go/bin/swag or add $HOME/go/bin to your $PATH, or copy $HOME/go/bin/swag to a directory in your $PATH
@hariraogotit from the directory with your main.go, run
$HOME/go/bin/swagor add$HOME/go/binto your$PATH, or copy$HOME/go/bin/swagto a directory in your$PATH
thank you very much that worked
@jasonhancock, please use export PATH=$(go env GOPATH)/bin:$PATH
Most helpful comment
Path variable must be set:
After running
go get -v -u github.com/swaggo/swag/cmd/swagPlease check
/usr/local/go/binor$HOME/go/binwhere those swag executable is present.Make sure you have that PATH in
/etc/profileor$HOME/.profilee.g. export PATH=$PATH:$HOME/go/bin