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
If you call HostsPerLine() before Add(), (with a plain-vanilla macOS starter hosts file) you get a panic, like this:
panic: runtime error: index out of range [6] with length 4 goroutine 1 [running]: github.com/goodhosts/hostsfile.(*Hosts).Add(0x140003264d0, {0x16eff7b14, 0x9}, {0x14000460fe0?, 0x1, 0x1}) /Users/rfay/workspace/ddev/vendor/github.com/goodhosts/hostsfile/hosts.go:167 +0x3ec github.com/ddev/ddev/pkg/ddevapp.AddHostEntry({0x16eff7b06, 0xd}, {0x16eff7b14, 0x9}) /Users/rfay/workspace/ddev/pkg/ddevapp/hostname_mgt.go:140 +0xd4 github.com/ddev/ddev/cmd/ddev/cmd.glob..func30(0x1019e66c0?, {0x14000066600?, 0x2, 0x2}) /Users/rfay/workspace/ddev/cmd/ddev/cmd/hostname.go:74 +0x20c github.com/spf13/cobra.(*Command).execute(0x1019e66c0, {0x140000665a0, 0x2, 0x2}) /Users/rfay/workspace/ddev/vendor/github.com/spf13/cobra/command.go:860 +0x4ac github.com/spf13/cobra.(*Command).ExecuteC(0x1019e98c0) /Users/rfay/workspace/ddev/vendor/github.com/spf13/cobra/command.go:974 +0x354 github.com/spf13/cobra.(*Command).Execute(...) /Users/rfay/workspace/ddev/vendor/github.com/spf13/cobra/command.go:902 github.com/ddev/ddev/cmd/ddev/cmd.Execute() /Users/rfay/workspace/ddev/cmd/ddev/cmd/root.go:143 +0x40 main.main() /Users/rfay/workspace/ddev/cmd/ddev/main.go:20 +0xac
This is demonstrated in a test repo: https://github.com/rfay/goodhostsbug/tree/broken
It's fixed by changing HostsPerLine() to later, see https://github.com/rfay/goodhostsbug
The text was updated successfully, but these errors were encountered:
Move HostsPerLine() to after add
2a53837
See goodhosts/hostsfile#42
b71df95
Successfully merging a pull request may close this issue.
If you call HostsPerLine() before Add(), (with a plain-vanilla macOS starter hosts file) you get a panic, like this:
This is demonstrated in a test repo: https://github.com/rfay/goodhostsbug/tree/broken
It's fixed by changing HostsPerLine() to later, see https://github.com/rfay/goodhostsbug
The text was updated successfully, but these errors were encountered: