route/vendor/github.com/dickeyxxx/netrc
Cadey Ratio 50c1deaa7d
change from vendor to dep
2017-10-06 08:29:20 -07:00
..
examples change from vendor to dep 2017-10-06 08:29:20 -07: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()