diff --git a/hostctl b/hostctl new file mode 100755 index 0000000..7c98def Binary files /dev/null and b/hostctl differ diff --git a/pkg/host/host_file.go b/pkg/host/host_file.go index 772dd09..833d0ba 100644 --- a/pkg/host/host_file.go +++ b/pkg/host/host_file.go @@ -89,7 +89,7 @@ func Read(r io.Reader, strict bool) (*hostFile, error) { func IsHostLine(line string) bool { p := strings.Split(cleanLine(line), " ") i := 0 - if p[0] == "#" { + if p[0] == "#" && len(p) > 1 { i = 1 } ip := net.ParseIP(p[i])