Skip to content

cbuschka/config4go

Repository files navigation

config4go Build Status Code Coverage Go Report Card GoDoc Release MIT licensed

A simple config loader written in go.

Features

  • Unicode support (uses go runes, not bytes)
  • Very efficient (implementation based on a state machine)

Status

Still a prototype.

Examples

Config format:

# a comment
key1 = value1

key2=value2 # another comment

#eof

Load config as map:

import "github.com/cbuschka/config4go"

func doIt() (map[string]string, error) {
    configReader := NewConfigReader()
	config, err := configReader.ReadConfigFromFile("example.conf")
	if err != nil {
	    return nil, err
	}
	return config.ToMap(), nil
}

Contributing

Config4Go is an open source project, and contributions are welcome! Feel free to raise an issue or submit a pull request.

License

Copyright (c) 2016 by Cornelius Buschka.

MIT License

About

A simple config loader written in go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published