2

Trying to install go-swagger on Ubuntu. I have installed brew(Linuxbrew):

sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

Next I did:

brew tap go-swagger/go-swagger
brew install go-swagger

typing swagger version it answers: swagger: command not found. anything else(-help, -version not working too) What I did wrong?

Helen
  • 87,344
  • 17
  • 243
  • 314
andrew17
  • 851
  • 2
  • 10
  • 25

4 Answers4

2

Use this:

git clone https://github.com/go-swagger/go-swagger
cd go-swagger
go install ./cmd/swagger

Verify using:

swagger version
0

Running brew tap go-swagger/go-swagger && brew install go-swagger and then re-running command go-swagger worked for me. Any more details that can be provided here?

This command may also assist you, since you're utilizing go already... might be problematic if utilizing go modules or not.
go get -u github.com/go-swagger/go-swagger/cmd/swagger

Thomas
  • 550
  • 5
  • 17
0

You're missing $GOPATH/bin in your path reason why it cannot find the it

Potential fix:

echo 'export PATH="${GOPATH-"~/go"}/bin:$PATH"' >> ~/.bashrc 
source ~/.bashrc
road
  • 479
  • 3
  • 20
-1

To install go-swagger run below command in GO PATH

go get -u github.com/go-swagger/go-swagger/cmd/swagger

To check the version and help run

  • swagger version
  • swagger -h
Umar Hayat
  • 4,300
  • 1
  • 12
  • 27