https://github.com/subpop/go-ini
Go package that encodes and decodes INI-files
https://github.com/subpop/go-ini
decoder encoder golang ini marshal unmarshal
Last synced: 1 day ago
JSON representation
Go package that encodes and decodes INI-files
- Host: GitHub
- URL: https://github.com/subpop/go-ini
- Owner: subpop
- License: mit
- Created: 2019-09-11T18:38:20.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-04-09T15:53:56.000Z (6 days ago)
- Last Synced: 2025-04-09T16:51:05.019Z (6 days ago)
- Topics: decoder, encoder, golang, ini, marshal, unmarshal
- Language: Go
- Homepage:
- Size: 118 KB
- Stars: 14
- Watchers: 1
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - go-ini - A Go package that marshals and unmarshals INI-files. (Configuration / Standard CLI)
- fucking-awesome-go - go-ini - A Go package that marshals and unmarshals INI-files. (Configuration / Standard CLI)
- awesome-go - go-ini - A Go package that marshals and unmarshals INI-files. (Configuration / Standard CLI)
- awesome-go - go-ini - A Go package that marshals and unmarshals INI-files. (Configuration / Standard CLI)
- awesome-go-extra - go-ini - ini|7|3|1|2019-09-11T18:38:20Z|2021-04-06T17:32:24Z| (Configuration / Advanced Console UIs)
- awesome-go-with-stars - go-ini - A Go package that marshals and unmarshals INI-files. (Configuration / Standard CLI)
- awesome-go-cn - go-ini - ini) [![godoc][D]](https://godoc.org/github.com/subpop/go-ini) (配置 / 标准CLI)
- awesome-go-plus - go-ini - A Go package that marshals and unmarshals INI-files.  (Configuration / Standard CLI)
- awesome-go-plus - go-ini - A Go package that marshals and unmarshals INI-files. (Configuration / Standard CLI)
README
[](https://pkg.go.dev/github.com/subpop/go-ini)
[](https://goreportcard.com/report/github.com/subpop/go-ini)# go-ini
A Go package that encodes and decodes INI-files.
# Usage
```go
data := `[settings]
username=root
password=swordfish
shell[unix]=/bin/sh
shell[win32]=PowerShell.exe
`var config struct {
Settings struct {
Username string `ini:"username"`
Password string `ini:"password"`
Shell map[string]string `ini:"shell"`
} `ini:"settings"`
}if err := ini.Unmarshal(data, &config); err != nil {
fmt.Println(err)
}
fmt.Println(config)
```