Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (23 sloc) 642 Bytes

ConfigParser for Go

Implementation of a parser of Python's ConfigParser file format for Go.

The format is similar to win INI's, but key/value pairs can be separated by either ' or :.

Whitespace is trimmed, but newlines are preserved.

Example usage:

package main

import (
    "fmt"
    "github.com/mikelikespie/configparser-go/configparser"
)

func main() {
    // configparser.Parse and configparser.ParseFile also work
    config, _ := configparser.ParseString(`[Hello]
foo = bar
boo : baz`)

    foo := config["Hello"]["foo"]

    fmt.Println(foo)
}