create-go-app / fiber-go-template

📝 Production-ready backend template with Fiber Go Web Framework for Create Go App CLI.
https://github.com/create-go-app/cli/wiki
Apache License 2.0
955 stars 120 forks source link

`swag init` breaks `make critic` #132

Closed p3nj closed 2 years ago

p3nj commented 2 years ago

Required check list:

My environment:

Describe the bug:

swag init will break make critic

  1. first time $ make critic have no error output
  2. use $ swag init regenerate swag documents, include docs.go
  3. run $ make critic again.
  4. See output
    ./docs/docs.go:2:1: codegenComment: comment should match `Code generated .* DO NOT EDIT.` regexp
    make: *** [critic] Error 1

    Expected behavior:

$ make critic should exit without issue after $ swag init

Screenshots: t-rec

Additional context:

$ swag init also won't read the @BasePath defines inside main.go. Will have to manually add /api to all API endpoints in order to make Swagger UI work.

welcome[bot] commented 2 years ago

Thanks for opening your first issue here! 🎉 Be sure to follow the issue template!

p3nj commented 2 years ago

I realised that this issue was raised by go-critic. moving there.