Skip to content

Golang implementation of Python ConfigParser

License

Notifications You must be signed in to change notification settings

nareshdevasani/goconfigparser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status GoDoc Config File Parser (INI style)

This parser is build as a go equivalent of the Python ConfigParser module and is aimed for maximum compatibility for both the file format and the API. This should make it easy to use existing python style configuration files from go and also ease the porting of existing python code.

Example usage:

package main

import (
	"fmt"

	"github.com/mvo5/goconfigparser"
)

var cfgExample = `[service]
base: something
`

var cfgExample2 = `[service]
base=something
`

func main() {
	cfg := goconfigparser.New()
	cfg.ReadString(cfgExample)
	val, err := cfg.Get("service", "base")
	if err != nil {
		panic(err)
	}
	fmt.Printf("Got value %q\n", val)
}

It implements most of RawConfigParser (i.e. no interpolation) at this point.

Current Limitations:

  • no interpolation
  • no defaults
  • no write support
  • not all API is provided

About

Golang implementation of Python ConfigParser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%