Skip to content

Populating strings with values that could be parsed as booleans mutates the result #74

@lrewega

Description

@lrewega
package main

import (
        "fmt"

        "go.uber.org/config"
)

func main() {
        p, err := config.NewYAMLProviderFromBytes([]byte(`foo: yes`))
        if err != nil {
                panic(err)
        }

        var foo string

        if err := p.Get("foo").Populate(&foo); err != nil {
                panic(err)
        }

        fmt.Println(foo)
}

This prints true, not yes as I'd expect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions