gogf / swagger

Swagger wrapper for GoFrame project.
https://goframe.org
30 stars 18 forks source link

Why is it "exit status 1"? #7

Closed webees closed 3 years ago

webees commented 3 years ago

api/user.go

// @summary 用户注册接口
func (a *userApi) SignUp(r *ghttp.Request) {
        // Some codes
}

go.mod

$ go mod tidy
module thash

go 1.15

require (
    github.com/gogf/gf v1.15.3
    github.com/gogf/swagger v1.2.0
    github.com/kr/text v0.2.0 // indirect
    github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
    golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d // indirect
    golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43 // indirect
    golang.org/x/text v0.3.5 // indirect
    golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
    gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
    gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
)

gf -v

GoFrame CLI Tool v1.15.0, https://goframe.org
Install Path: C:\Windows\gf.exe
Build Detail:
  Go Version:  go1.15.5
  GF Version:  v1.15.1
  Git Commit:  3b3701b7e8aa5fcc9f12ffc0f567ffce62d6308d
  Build Time:  2021-01-19 15:21:28

gf swagger --pack

The following message should be displayed

$ swag init
2021/02/21 18:21:13 Generate swagger docs....
2021/02/21 18:21:13 Generate general API Info, search dir:./
2021/02/21 18:21:21 ParseComment error in file app\api\user.go :cannot find type definition: model.UserApiSignUpReq