https://blog.logrocket.com/documenting-go-web-apis-with-swag/
- Create and Read
Create_Read.mov
- Update and Delete
Update_Delete.mov
-
Go wasn't setup properly, so swag init didnt work
- issue
- GOBIN is empty
- to check,
go env
orgo env GOBIN
- it will be empty
- to check,
- GOBIN is empty
- fixes i did
- export GOBIN=$(go env GOPATH)/bin
- this will set the current project(?, i think) to use the go bin folder
- in my case its
/Users/zhenhaoc/go/bin
- in my case its
- afterwards
go install github.com/swaggo/swag/cmd/swag
<-- this will install swag into the go bin folder
- source swaggo/swag#197 (comment) tyvm!~
- issue
-
main.go doesn't recognise swaggerFiles
- issue
swaggerFiles "github.com/swaggo/files"
keeps getting deleted on save by gopls
- fixes
- save the main.go without the line first (lol)
go get -u github.com/swaggo/files
- then add it back in lol
- seems to resolve it?
- issue
-
trying to re-order the routes doesnt work
- issue
- reordering the routes doesnt do anything
- apparently the operations needs to be sorted/defined
- need to look into how to do it
- fixes
- try another tutorial lol
- issue