I am new to go-lang
and so to go-swagger
. I am following a blog and have installed go-swagger
with command :
go get -u github.com/go-swagger/go-swagger/cmd/swagger
I can see that the go-swagger
folder is created in
C:\Go\bin\src\github.com\go-swagger
Now, I added my project path to $GOPATH
:
echo %GOPATH%
C:\Go\bin;D:\Personal\Learning\GoLang\Project-2;D:\Personal\Learning\GoLang\swagger;
When I run
D:\Personal\Learning\GoLang\swagger>swagger ./swagger.yaml
'swagger' is not recognized as an internal or external command,
operable program or batch file.
What am I missing ? Also, I would be grateful if you can suggest me some good material for go-swagger
as I am finding it very difficult to setup everything. There arent much blogs which can help me do HELLO WORLD
kinda setup
Thanks
Update 1:
I tried to set GOBIN
but no luck with that:
D:\Personal\Learning\GoLang\swagger>swagger validate https://raw.githubusercontent.com/swagger-api/swagger-spec/master/examples/v2.0/json/petstore-expanded.json
'swagger' is not recognized as an internal or external command,
operable program or batch file.
D:\Personal\Learning\GoLang\swagger>echo %GOBIN%
C:\Go\bin\;
Update 2:
I tried absolute path as suggested as well, but no luck:
D:\Personal\Learning\GoLang\swagger>C:\Go\bin\swagger validate https://raw.githubusercontent.com/swagger-api/swagger-spec/master/examples/v2.0/json/petstore-expanded.json
'C:\Go\bin\swagger' is not recognized as an internal or external command,
operable program or batch file.
Update 3:
Below command worked for me but it doesn't seem to be proper way:
go run C:\Go\bin\src\github.com\go-swagger\go-swagger\cmd\swagger\swagger.go validate https://raw.githubusercontent.com/swagger-api/swagger-spec/master/examples/v2.0/json/petstore-expanded.json