commit | f9e00fbdffc499779bda529ca3bd74ae8606eaca | [log] [tgz] |
---|---|---|
author | Frank Schroeder <frschroeder@ebay.com> | Sat Jan 04 11:22:48 2014 +0100 |
committer | Frank Schroeder <frschroeder@ebay.com> | Sat Jan 04 11:22:48 2014 +0100 |
tree | 77ddd2664719ff05c62e8cfe3b5004781988b858 | |
parent | 41620358b8c0455b8f91f66d7f707faaa1dd0714 [diff] |
Move escaping to separate function.
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
buf, err := ioutil.ReadFile(filename) if err != nil { // handle error } p, err := goproperties.Decode(buf) if err != nil { // handle error } value, ok := p.Get("key") if ok { fmt.Println(value) }
or
p, err := goproperties.DecodeString("key = value") if err != nil { // handle error } value, ok := p.Get("key") if ok { fmt.Println(value) }
v0.9, 17 Dec 2013 - Initial release
2 clause BSD license. See LICENSE file for details.
Parts of the lexer are taken from the template/text/parser package For these parts the following applies:
Copyright 2011 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file of the go 1.2 distribution.