commit | 551d0acf4b68091f131dc86581e452780d49d80b | [log] [tgz] |
---|---|---|
author | Frank Schroeder <frschroeder@ebay.com> | Tue Jan 07 07:11:08 2014 +0100 |
committer | Frank Schroeder <frschroeder@ebay.com> | Tue Jan 07 07:11:08 2014 +0100 |
tree | 1301e297e0481e13b5bdf5c8add32d126839d2b1 | |
parent | 6f978bf2ce316ea90f8c0fdfca6185a2089a1992 [diff] |
Treat circular references and malformed expressions as errors. Add Set() method for setting values. Renamed GetDefault() to GetString(). Added GetFloat, GetInt, GetUint and GetBool convenience methods.
goproperties is a Go library for reading and writing Java property files.
It supports reading properties from multiple files and Spring style property expansion of expressions of ‘${key}’ to their corresponding value.
The current version supports reading both ISO-8859-1 and UTF-8 encoded data.
$ go get github.com/magiconair/goproperties
p := goproperties.MustLoadFile(filename, goproperties.ISO_8859_1) value, ok := p.Get("key") if ok { fmt.Println(value) }
or
// load multiple files and ignore missing files p := goproperties.MustLoadFiles([]string{filename1, filename2}, true, goproperties.ISO_8859_1) value, ok := p.Get("key") if ok { fmt.Println(value) }
v1.0, 6 Jan 2014 - Initial release
2 clause BSD license. See LICENSE file for details.