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

Cannot install directly from github #2560

Closed
chamini2 opened this issue Apr 15, 2021 · 6 comments
Closed

Cannot install directly from github #2560

chamini2 opened this issue Apr 15, 2021 · 6 comments

Comments

@chamini2
Copy link

chamini2 commented Apr 15, 2021

Problem statement

It seems that the github installation is not working. I have tried other method of installation but since this installs INSIDE a docker container, I do not know how to get it.

Steps to reproduce

$ go get -u github.com/go-swagger/go-swagger/cmd/swagger
package github.com/hashicorp/hcl/hcl/printer: cannot find package "github.com/hashicorp/hcl/hcl/printer" in any of:
	/usr/local/Cellar/go/1.13.4/libexec/src/github.com/hashicorp/hcl/hcl/printer (from $GOROOT)
	/Users/redacted/.go/src/github.com/hashicorp/hcl/hcl/printer (from $GOPATH)

Environment

swagger version: x.x.x
go version:

go version
go version go1.13.4 darwin/amd64

OS: macOS 11.1

@youyuanwu
Copy link
Member

I ran this $ go get -u github.com/go-swagger/go-swagger/cmd/swagger and it successfully installed it.
Can you show output of go env command?
The other way to install is to download from release. See: #2558 (comment)

@chamini2
Copy link
Author

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/matteo/Library/Caches/go-build"
GOENV="/Users/matteo/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/matteo/.go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.13.4/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.13.4/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/ht/prv18mgd1xx6bgvccwp_5v4m0000gn/T/go-build488367147=/tmp/go-build -gno-record-gcc-switches -fno-common"

@chamini2
Copy link
Author

some time ago there was a hcl dir in the hashicorp/hcl repo: https://github.com/hashicorp/hcl/tree/819a65acc453ba35681e287fa31f5f0bb084ddb9/hcl
but it's not there anymore.

@casualjim
Copy link
Member

you can install easier like this: go get github.com/go-swagger/go-swagger/cmd/swagger@latest

It makes use of go modules and so will use the dependency versions we built and tested against

@youyuanwu
Copy link
Member

In your go env output there is no:

GO111MODULE="on"

You should export it in your environment.
Try

$ GO111MODULE="on" go get -u github.com/go-swagger/go-swagger/cmd/swagger

Or as suggested above

$ GO111MODULE="on" go get github.com/go-swagger/go-swagger/cmd/swagger@latest

Or to get latest release

$ GO111MODULE="on" go get github.com/go-swagger/go-swagger/cmd/swagger@v0.27.0

@chamini2
Copy link
Author

Thanks for the possible solutions. I am no longer working on this but did not want to leave the issue open. It's probably the GO111MODULE variable.

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

No branches or pull requests

3 participants