不妨檢查看看 package name
這篇的原因是 package 名稱不符
很感謝你的回答,不過好像跟package沒有關係
我之前有看了他們的github的 issue,問題好像是當我下swag init這個指令的時候,它只會執行main.go裡面的註解,而不會執行到我寫在api 裡的註解
不過目前我還沒找到怎麼解決這個問題的方法,我有試過官方github的一些解法,不過好像沒有幫助orz
不管怎麼樣,還是非常感謝你的回答
底下這段(swag init 之後那段)是否有可能?
Getting started
Add comments to your API source code, See Declarative Comments Format.
Download swag by using:
$ go get -u github.com/swaggo/swag/cmd/swag
To build from source you need Go (1.9 or newer).
Or download a pre-compiled binary from the release page.
Run swag init in the project's root folder which contains the main.go file. This will parse your comments and generate the required files (docs folder and docs/docs.go).
$ swag init
Make sure to import the generated docs/docs.go so that your specific configuration gets init'ed. If your General API annotations do not live in main.go, you can let swag know with -g flag.
swag init -g http/api.go