mirror of
https://github.com/goodhosts/hostsfile.git
synced 2026-04-27 07:25:53 +03:00
[GH-ISSUE #56] Adding comments to hosts records #17
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hostsfile#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Alvov1 on GitHub (Oct 21, 2025).
Original GitHub issue: https://github.com/goodhosts/hostsfile/issues/56
I'd like to get an option to write a hosts record with comment. In my organization we're adding a lot of hosts records through our cli tool, and we want to specify that this record relates to our stuff
@luthermonson commented on GitHub (Oct 23, 2025):
you can use AddRaw. it supports parsing a
#and making a comment from the rest of the line since it uses NewHostsLine which supports parsing out the comment. Try something like the following...if you really want a func with that signature you could wrap AddRaw in your own code or if you really want AddCommented in this package feel free to put up a PR for it and I would merge it