Skip to content

anthony-y/inigo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IniGo

Read INI files in Go

(writing coming soon)

Installation

If you're using Go modules, just import IniGo

import "github.com/anthony-y/inigo"

and it will be built when you run

go build

If your code is in $GOPATH/src, then you'll need to first run

go get "github.com/anthony-y/inigo"

Getting started

Given this INI file

[MyData]
myVariable="Hello world"

The following code will output

Hello world
package main

import (
    "fmt"

    "github.com/anthony-y/inigo"
)

func main() {
    ini, errs := inigo.LoadIni("example.ini")
	if errs != nil {
		for _, err := range errs {
			fmt.Println(err)
		}
		return
    }
    
    fmt.Println(ini["MyData"]["myVariable"])
}

About

Read INI files in Go. Zero dependencies.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages