Comments (6)
Actually upon further consideration I believe this is an issue with the cli tool, not this package.
That being said, panics should likely prevented even among misuse of the API. Reopening for this reason.
from hostsfile.
I see what I think is the same panic with this package and the attached (pristine) /etc/hosts on macOS:
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
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
from hostsfile.
I'll open a new issue; this happens during add.
from hostsfile.
Thanks pls do
from hostsfile.
Opened
from hostsfile.
Related Issues (15)
- Please keep commit history and versioning! HOT 1
- Larger list of hosts per ip is not working in Windows HOT 3
- Q: Why is the position of a host on the line used? HOT 2
- Add/Remove/Contains functions for HostsLine
- Multiple hosts per line added on Windows causes problems HOT 3
- License? HOT 1
- Github action golang ci no longer found HOT 1
- Deputize maintainers/reviewers/testers HOT 2
- Duplicate lines in hostsfile after `Flush()` HOT 1
- Bug: Adding a host can add duplicates with differing IPs
- Regression - panic when calling Clear and then Add
- HostsPerLine is destructive HOT 15
- Calling HostsPerLine() before Add() results in a panic with plain vanilla macOS hosts file
- Comments are not published on Flush HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hostsfile.