Registry /
utility / lextoumbourou-goodhosts
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
goodhosts
✓ github.com/lextoumbourou/goodhosts
Adds a host entry to /etc/hosts and writes changes.
package main
import (
"github.com/lextoumbourou/goodhosts"
)
func main() {
hosts := goodhosts.NewHosts()
if err := hosts.Add("127.0.0.1", "example.com"); err != nil {
panic(err)
}
if err := hosts.Flush(); err != nil {
panic(err)
}
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
2.1.0+incompatiblelatest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.