This package provides Go bindings for Augeas, the configuration editing tool.
go get honnef.co/go/augeas
Documentation can be found at godoc.org.
package main
import (
"honnef.co/go/augeas"
"fmt"
)
func main() {
ag, err := augeas.New("/", "", augeas.None)
if err != nil {
panic(err)
}
// There is also Augeas.Version(), but we're demonstrating Get
// here.
version, err := ag.Get("/augeas/version")
fmt.Println(version, err)
}
An extended example that fetches all host entries from /etc/hosts can be found in the playground.