Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 14 days 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 (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-16T17:28:25.000Z (3 months ago)
- Last Synced: 2024-08-16T18:56:41.402Z (3 months ago)
- Topics: decoder, encoder, golang, ini, marshal, unmarshal
- Language: Go
- Homepage:
- Size: 107 KB
- Stars: 14
- Watchers: 2
- 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-plus - go-ini - A Go package that marshals and unmarshals INI-files. ![stars](https://img.shields.io/badge/stars-14-blue) ![forks](https://img.shields.io/badge/forks-6-blue) (Configuration / Standard CLI)
- awesome-go-plus - go-ini - A Go package that marshals and unmarshals INI-files. (Configuration / Standard CLI)
README
[![PkgGoDev](https://pkg.go.dev/badge/git.sr.ht/~spc/go-ini)](https://pkg.go.dev/git.sr.ht/~spc/go-ini)
[![Go Report Card](https://goreportcard.com/badge/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)
```