route/vendor/github.com/dickeyxxx/netrc
Cadey Ratio e3a389dde4 make dep prune things 2017-12-11 10:38:19 -08:00
..
.travis.yml change from vendor to dep 2017-10-06 08:29:20 -07:00
README.md change from vendor to dep 2017-10-06 08:29:20 -07:00
netrc.go vendor dependencies 2017-04-28 21:19:30 -07:00
netrc_test.go change from vendor to dep 2017-10-06 08:29:20 -07:00

README.md

netrc Build Status GoDoc

A netrc parser for Go.

Usage

Getting credentials for a host.

usr, err := user.Current()
n, err := netrc.Parse(filepath.Join(usr.HomeDir, ".netrc"))
fmt.Println(n.Machine("api.heroku.com").Get("password"))

Setting credentials on a host.

usr, err := user.Current()
n, err := netrc.Parse(filepath.Join(usr.HomeDir, ".netrc"))
n.Machine("api.heroku.com").Set("password", "newapikey")
n.Save()