Registry / utility / goodhosts-hostsfile

goodhosts-hostsfile

JSON →
library0.1.7gogounverified

A Go library for managing the /etc/hosts file with support for adding, removing, and checking host entries.

go get github.com/goodhosts/hostsfile
INSTALL
IMPORT
SIG · GOODHOSTS-HOSTSFIL
G
goodhosts-hostsfile
utilitygov0.1.7
harness data pending
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.

hostsfile
github.com/goodhosts/hostsfile

Add a host entry to /etc/hosts and flush changes.

package main import ( "fmt" "github.com/goodhosts/hostsfile" ) func main() { hosts := hostsfile.NewHosts() hosts.Add("127.0.0.1", "example.local") if err := hosts.Flush(); err != nil { fmt.Println(err) } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.1.7latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
goodhosts-hostsfile — go get goodhosts-hostsfile · libregistry