Define Properties as map[string]string instead of using an internal map.
5 files changed
tree: b6bc97d61e646d0a6183b45ee3d395d73706031e
  1. decoder.go
  2. decoder_test.go
  3. doc.go
  4. example_test.go
  5. lex.go
  6. LICENSE
  7. parser.go
  8. properties.go
  9. README.md
README.md

Overview

goproperties is a Go library for parsing Java property files.

The current version supports reading both ISO-8859-1 and UTF-8 encoded data.

A future version will also support Spring Framework style property expansion like

key = value
key2 = ${key}

History

v0.9 - Initial release

Usage

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")

Import

go get github.com/magiconair/goproperties