Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for underscores as a just digit separators #1580

Closed
painhardcore opened this issue May 5, 2023 · 0 comments
Closed

Support for underscores as a just digit separators #1580

painhardcore opened this issue May 5, 2023 · 0 comments

Comments

@painhardcore
Copy link

Describe the bug
Currently, if somewhere we have in code:

const SomeVeryImportantThing = 1_000_000

We'll have warning in the console on the executing

warning: failed to evaluate const defaultMaxWriteSize at /google/secret_project/money.go:17:7, strconv.ParseUint: parsing "1_000_000": invalid syntax

The problem is that you should base 0 when you use strconv.ParseUint .

To Reproduce
Steps to reproduce the behavior:

  1. Make a constant with underscore
  2. Execute swag tooling
  3. See the warning in the output

Expected behavior
I don't expect any warning/error related to the valid constants

Your swag version
swag version v1.8.12

Your go version
go version go1.20.3 darwin/arm64

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: not relevant
  • Version: not relevant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants