https://github.com/jonathanhecl/goini
INI File manager package on Golang
https://github.com/jonathanhecl/goini
config file go goini golang ini inifile package
Last synced: 3 months ago
JSON representation
INI File manager package on Golang
- Host: GitHub
- URL: https://github.com/jonathanhecl/goini
- Owner: jonathanhecl
- License: mit
- Created: 2021-08-22T00:58:44.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-22T12:53:03.000Z (7 months ago)
- Last Synced: 2024-10-22T20:43:28.300Z (7 months ago)
- Topics: config, file, go, goini, golang, ini, inifile, package
- Language: Go
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# goini
## INI File manager package on Golang[](https://github.com/jonathanhecl/goini/actions/workflows/go.yml)
[](https://goreportcard.com/report/github.com/jonathanhecl/goini)
[](./LICENSE)With this package you can create or read INI files, preserving comments and types, very quick & easy.
> coverage: 94.0% of statements
>> go get github.com/jonathanhecl/goini
>## Features:
* Get & Set values.
* Create sections & keys dynamically.
* Preserve all the comments.
* Preserve empty lines.
* Works with big & small files.## Example:
```
package mainimport (
"github.com/jonathanhecl/goini"
)func main() {
// Load an existent file
ini, _ := goini.Load("./test.ini", nil)
/*
// New file
ini := goini.New(&goini.TOptions{CaseSensitive: false})
*/
// Read a key
value := ini.Get("section", "key").String())
// Set a key
ini.Set("section", "key", goini.String("test"))
// Save a file
ini.Save("./new.ini")}
```## Types supported:
* Byte
* String
* StringArray _(separated with comma)_
* Bool _(works with 1/0 and true/false)_
* Int
* Int8
* Int16
* Int32
* Uint64
* Float32
* Float64## Updated 21 oct 2024