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

Better tag parsing for things like erroneous spaces #2

Open
flowchartsman opened this issue Mar 11, 2019 · 2 comments
Open

Better tag parsing for things like erroneous spaces #2

flowchartsman opened this issue Mar 11, 2019 · 2 comments

Comments

@flowchartsman
Copy link
Owner

An accidental space can currently break tag parsing in unfortunate ways. The most insidious example being:

type ServiceConfig struct {
        InfluxAddr     string `conf:"help:address to influxdb"`
        InfluxDB       string `conf:"help:influx database to use"`
        InfluxUserName string `conf:"help:influxdb username"`
        InfluxPassword string `conf:"help:influxdb password, noprint"`
 }

Where the config parses just fine, but the space before noprint causes it to be omitted, meaning INFLUX_PASSWORD will appear in the result of conf.String() No bueno.

@flowchartsman flowchartsman changed the title Better tag parsing for odd spaces Better tag parsing for things like erroneous spaces Mar 11, 2019
@flowchartsman
Copy link
Owner Author

flowchartsman commented Mar 11, 2019

strings.TrimSpace() Maybe. At the very least should have default clauses in parseTags()

@flowchartsman
Copy link
Owner Author

Also needed:

  • strings with commas
  • default values for lists

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

1 participant