A golang package for parsing ini-style configuration files

Mini

Build Status GoDoc

Mini is a simple ini configuration file parser.

The ini syntax supported includes:

  • The standard name=value
  • Comments on new lines starting with # or ;
  • Blank lines
  • Sections labelled with [sectionname]
  • Split sections, using the same section in more than one place
  • Encoded strings, strings containing \n, \t, etc...
  • Array values using repeated keys named in the form key[]=value
  • Global key/value pairs that appear before the first section

Repeated keys, that aren't array keys, replace their previous value.

To use simply:

% go get github.com/sasbury/mini
Owner
Similar Resources

Config-loader - Minimal and safe way to load in configuration files without any extra boilerplate, made for my own personal usage

💕 config-loader Minimal and safe way to load in configuration files without any

Jul 4, 2022

Go-yaml - Yaml parsing Toolkit For Golang

go-yaml 介绍 gopkg.in/yaml.v3 已经是个非常好用的包,但是在实际开发中总有类型转换带来的麻烦,go-yaml只是在它的基础上,简单的一层

Jan 13, 2022

Configure is a Go package that gives you easy configuration of your project through redundancy

Configure Configure is a Go package that gives you easy configuration of your project through redundancy. It has an API inspired by negroni and the fl

Sep 26, 2022

Flags-first package for configuration

ff stands for flags-first, and provides an opinionated way to populate a flag.FlagSet with configuration data from the environment.

Dec 26, 2022

Environment variables configuration package for Go microservices.

gocfg Environment variables configuration package for Go microservices. It helps validate environment variable values and set default values if needed

Dec 30, 2021

A Go library for parsing struct tags from environment variables.

Envconfig Envconfig populates struct field values based on environment variables or arbitrary lookup functions. It supports pre-setting mutations, whi

Jan 2, 2023

✨Clean and minimalistic environment configuration reader for Golang

Clean Env Minimalistic configuration reader Overview This is a simple configuration reading tool. It just does the following: reads and parses configu

Jan 8, 2023

Golang library for managing configuration data from environment variables

envconfig import "github.com/kelseyhightower/envconfig" Documentation See godoc Usage Set some environment variables: export MYAPP_DEBUG=false export

Dec 26, 2022

Golang Configuration tool that support YAML, JSON, TOML, Shell Environment

Configor Golang Configuration tool that support YAML, JSON, TOML, Shell Environment (Supports Go 1.10+) Usage package main import ( "fmt" "github.c

Dec 29, 2022
Comments
  • Getting a string value does not work if the value contains a  backslash   ( \ )

    Getting a string value does not work if the value contains a backslash ( \ )

    strconv.Unquote( ""abc\def"" ) produces an error

    func getString(values map[string]interface{}, key string, def string) string { val := get(values, key) if val != nil { str, err := strconv.Unquote(fmt.Sprintf(""%v"", val)) if err == nil { return str } return def } return def }

    This works for me:

    func getString(values map[string]interface{}, key string, def string) string { val := get(values, key) if val != nil { str := fmt.Sprintf("%v", val) if len(str) > 0 { return str } return def } return def }

Related tags
Tinyini - Bare-bones Go library for reading INI-like configuration files

tinyini tinyini is a minimalistic library for parsing INI-like configuration files. example configuration file globalkey = globalvalue [section] key

Jan 10, 2022
ini parser for golang
ini parser for golang

INI Parser & Write Library ini parser and write library for Golang,easy-use,fast Features Can be read by []byte Can be read by file Supports file moni

Dec 3, 2022
A simple INI file parser and builder.

ini A simple INI file parser and builder. What Read INI files, or build them section by section. Datatypes are kept very simple. The main fuctions are

Nov 20, 2021
INI Loader written in Go

go-ini INI Loader written in Go Single threaded & simple Examples Read all params func (app MyApp) onParam(name string, value string) bool { app.c

Feb 11, 2022
Golang library for reading properties from configuration files in JSON and YAML format or from environment variables.

go-config Golang library for reading properties from configuration files in JSON and YAML format or from environment variables. Usage Create config in

Aug 22, 2022
🛠 A configuration library for Go that parses environment variables, JSON files, and reloads automatically on SIGHUP
🛠 A configuration library for Go that parses environment variables, JSON files, and reloads automatically on SIGHUP

config A small configuration library for Go that parses environment variables, JSON files, and reloads automatically on SIGHUP. Example func main() {

Dec 11, 2022
Manage local application configuration files using templates and data from etcd or consul

confd confd is a lightweight configuration management tool focused on: keeping local configuration files up-to-date using data stored in etcd, consul,

Dec 27, 2022
Generate initial configuration files for Go.

Generate initial configuration files for Go.

Mar 26, 2022
parser for configuration files

config-loader config-loader supports to load config files and convert to map values. Supported format json Usage import ( "fmt" "github.com/tharun2

Nov 27, 2021