Skip to content

Instantly share code, notes, and snippets.

@ik5
Created September 27, 2014 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ik5/3acc34760f8faedaa77d to your computer and use it in GitHub Desktop.
Save ik5/3acc34760f8faedaa77d to your computer and use it in GitHub Desktop.
Example on scanning INI file with github.com/vaughan0/go-ini
package main
import (
"fmt"
ini "github.com/vaughan0/go-ini"
"os"
)
const File = "test.ini"
func main() {
file, err := ini.LoadFile(File)
if err != nil {
fmt.Printf("Error: %v\n", err);
os.Exit(-1)
}
for name, _ := range file {
for key, value := range file[name] {
fmt.Printf("%s => %s\n", key, value)
}
}
}
[test1]
path=c:\a\b
name=A B
;comment=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment