Skip to content

Better tag parsing for things like erroneous spaces #2

@flowchartsman

Description

@flowchartsman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions