Skip to content

asjustas/goini

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

GoIni

GoIni is simple .INI file parser in golang.

Installation

go get github.com/asjustas/goini

Usage

Ini file:

; last modified 1 April 2001 by John Doe
[owner]
name = John Doe
organization = Acme Widgets Inc.
 
[database]
; use IP address in case network name resolution is not working
server = 192.0.2.62     
port = 143
file = payroll.dat

Example program:

package main

import (
	"github.com/asjustas/goini"
	"fmt"
)

func main() {
	conf, err := goini.Load("test.ini")

	if err != nil {
		panic(err)
	}

	fmt.Println( conf.Str("owner", "name") )
	fmt.Println( conf.Str("owner", "organization") )

	fmt.Println( conf.Str("database", "server") )
	fmt.Println( conf.Int("database", "port") )
	fmt.Print( conf.Str("database", "file") )
}

API Docs

http://godoc.org/github.com/asjustas/goini

About

Simple .INI file parser in golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages