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
Was trying to write an example for this package and saw that this doesn't compile.
package main import ( "fmt" "net" "os" "github.com/dghubble/ipnets" ) func main() { _, ipNet, err := net.ParseCIDR("192.0.2.0/24") if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(2) } nets, err := ipnets.Subnet(ipNet, 4) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(2) } for _, net := range nets { fmt.Println(net) } }
$ go run example.go # command-line-arguments ./example.go:18: cannot use ipNet (type *net.IPNet) as type net.IPNet in argument to ipnets.Subnet
Looks like everything in "net" always uses pointers to *IPNet. Maybe this package should too?
Edit. Also IPNet.String() is on a pointer so fmt.Println doesn't invoke that method.
IPNet.String()
fmt.Println
The text was updated successfully, but these errors were encountered:
Done
Sorry, something went wrong.
No branches or pull requests
Was trying to write an example for this package and saw that this doesn't compile.
Looks like everything in "net" always uses pointers to *IPNet. Maybe this package should too?
Edit. Also
IPNet.String()
is on a pointer sofmt.Println
doesn't invoke that method.The text was updated successfully, but these errors were encountered: