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

How to install go-swagger on linux and use its embedded swagger commands? #3085

Open
pcgeng opened this issue Mar 11, 2024 · 3 comments
Open

Comments

@pcgeng
Copy link

pcgeng commented Mar 11, 2024

Problem statement

I can install go-swagger on linux with Go, but cannot use the swagger commands

root@photon [ ~ ]# go install github.com/go-swagger/go-swagger/cmd/swagger@latest
go: downloading github.com/go-openapi/analysis v0.21.4
go: downloading github.com/go-openapi/loads v0.21.2
go: downloading github.com/go-openapi/runtime v0.26.0
go: downloading github.com/go-openapi/spec v0.20.9
go: downloading github.com/go-openapi/strfmt v0.21.7
go: downloading github.com/go-openapi/swag v0.22.4
go: downloading github.com/go-openapi/validate v0.22.1
go: downloading github.com/gorilla/handlers v1.5.1
go: downloading golang.org/x/sys v0.8.0
go: downloading github.com/go-openapi/errors v0.20.4
go: downloading go.mongodb.org/mongo-driver v1.11.3
go: downloading github.com/go-openapi/jsonpointer v0.19.6
go: downloading github.com/spf13/viper v1.16.0
go: downloading golang.org/x/tools v0.9.3
go: downloading github.com/go-openapi/jsonreference v0.20.2
go: downloading github.com/felixge/httpsnoop v1.0.3
go: downloading github.com/fsnotify/fsnotify v1.6.0
go: downloading github.com/spf13/afero v1.9.5
go: downloading github.com/spf13/cast v1.5.1
go: downloading github.com/spf13/jwalterweatherman v1.1.0
go: downloading github.com/Masterminds/semver/v3 v3.2.0
go: downloading github.com/google/uuid v1.3.0
go: downloading github.com/huandu/xstrings v1.3.3
go: downloading github.com/imdario/mergo v0.3.12
go: downloading github.com/shopspring/decimal v1.2.0
go: downloading golang.org/x/crypto v0.9.0
go: downloading github.com/rogpeppe/go-internal v1.9.0
go: downloading golang.org/x/text v0.9.0
go: downloading github.com/subosito/gotenv v1.4.2
go: downloading github.com/pelletier/go-toml/v2 v2.0.8
go: downloading golang.org/x/mod v0.10.0
# runtime/cgo
_cgo_export.c:3:10: fatal error: stdlib.h: No such file or directory
    3 | #include <stdlib.h>
      |          ^~~~~~~~~~
compilation terminated.
root@photon [ ~ ]# swagger
-bash: swagger: command not found

Environment

swagger version: 0.30.5
go version: 1.20.12
OS: Linux (Photon/OpenSUSE)

@casualjim
Copy link
Member

You probably need to install glibc-devel or something. Or run go install with cgo disabled

@pcgeng
Copy link
Author

pcgeng commented Mar 12, 2024

I installed the build-essential, it can resolve the issue during installation. Is there any possible to document the installation using go on the offcial doc for go-swagger? I didn't find any installation with go in https://goswagger.io/install.html...

@casualjim
Copy link
Member

You may need to add $(go env GOPATH)/bin to your $PATH.

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

2 participants