ini

package module
v0.0.0-...-cc89f65 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2020 License: MIT Imports: 4 Imported by: 0

README

go-ini

Package ini implements a simple INI parser for Go.

Comments

Any line beginning with a ';' is a comment.

; This is a comment

Keys

The basic element of an INI file is called a key. Whitespace is allowed around the '=' sign.

a=b
; equivalent to a=b
a = b  
; equivalent to a a=b b
a a = b b

Keys can be specified before any section is declared.

Sections

A section starts with '[' and ends with ']'. The section name must not be empty.

[section]
a=b
c=d

Documentation

Overview

Package ini implements parsing ini configuration files.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidLine = errors.New("ini: invalid line")

Functions

func Parse

func Parse(r io.Reader, handler Handler) error

Parse parses INI from the provided reader. It calls handler for each key-value pair.

Types

type Handler

type Handler func(section, key, value string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL