magiconair / properties

Java properties scanner for Go
BSD 2-Clause "Simplified" License
323 stars 77 forks source link

props.Keys() also return the empty key #1

Closed emicklei closed 9 years ago

emicklei commented 9 years ago
func ScanProperties(content string) (map[string]string, error) {
    result := map[string]string{}
    props, err := properties.Load([]byte(content), properties.ISO_8859_1)
    if err != nil {
        return result, err
    }
    for _, each := range props.Keys() {
        result[each], _ = props.Get(each)
    }
    return result, nil
}

the result contains an empty string as key. I did not expect this.

magiconair commented 9 years ago

Correct. Fixed in v1.4.1