We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
A line in hosts file causes runtime error:
panic: runtime error: index out of range [0] with length 0 goroutine 1 [running]: github.com/guumaster/hostctl/pkg/parser.parseToDefault({0xc00042213c, 0x9, 0xec4}, {0x0, 0x55c8d424ac5b}) github.com/guumaster/hostctl/pkg/parser/parser.go:116 +0x1dc github.com/guumaster/hostctl/pkg/parser.Parse({0x55c8d4861aa0, 0xc00019c4b0}) github.com/guumaster/hostctl/pkg/parser/parser.go:67 +0x48a github.com/guumaster/hostctl/pkg/file.NewWithFs({0x55c8d45681f5, 0x55c8d4567e4c}, {0x55c8d48724f8, 0x55c8d4b2da28}) github.com/guumaster/hostctl/pkg/file/file.go:43 +0x10a github.com/guumaster/hostctl/pkg/file.NewFile(...) github.com/guumaster/hostctl/pkg/file/file.go:26 github.com/guumaster/hostctl/cmd/hostctl/actions.newListCmd.func1(0xc00041e580, {0x55c8d4b2da28, 0x0, 0x0}) github.com/guumaster/hostctl/cmd/hostctl/actions/list.go:24 +0x5f github.com/spf13/cobra.(*Command).execute(0xc00041e580, {0x55c8d4b2da28, 0x0, 0x0}) github.com/spf13/[email protected]/command.go:842 +0x60e github.com/spf13/cobra.(*Command).ExecuteC(0xc0001c6dc0) github.com/spf13/[email protected]/command.go:950 +0x3ad github.com/spf13/cobra.(*Command).Execute(...) github.com/spf13/[email protected]/command.go:887 main.main() ./main.go:19 +0x76
To Reproduce Steps to reproduce the behavior:
echo '# 1.1.1.1' > /tmp/hosts hostctl --host-file /tmp/hosts list
Expected behavior A clear and concise description of what you expected to happen.
The line should be treated as comment and not crash.
System (please complete the following information):
The text was updated successfully, but these errors were encountered:
8c0cb76
fixed in v1.1.3 Thanks for reporting!
Sorry, something went wrong.
guumaster
Successfully merging a pull request may close this issue.
Describe the bug
A line in hosts file causes runtime error:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
The line should be treated as comment and not crash.
System (please complete the following information):
The text was updated successfully, but these errors were encountered: