Nothing Special   »   [go: up one dir, main page]

Skip to content

Package goconfigobj is Golang Version for configobj in Python.

License

Notifications You must be signed in to change notification settings

goalzz85/goconfigobj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Package goconfigobj is Golang Version for configobj in Python. Python Version: https://github.com/DiffSK/configobj

Just Parse UTF-8 no BOM text, not parse list type, be careful.

package main

import "fmt"
import "github.com/kaixinmao/goconfigobj"
import "strings"

func main() {
	demoStr := `
    outside_key=val
    [test]
       [[demofff]]
            multi_line="""
            multi
            line
            data!
            """
            key=value
    [test2]
      test2key=value
    `

	reader := strings.NewReader(demoStr)
	configObj := goconfigobj.NewConfigObj(reader)
	fmt.Println(configObj.Value("outside_key"))
	fmt.Println(configObj.Section("test").Section("demofff").Value("multi_line"))
}

About

Package goconfigobj is Golang Version for configobj in Python.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages