proposal: net: ParseIP should return an error, like other Parse functions #18757
Labels
FrozenDueToAge
Go2Cleanup
Used by Ian and Robert for Go 2 organization. Unless you’re Ian or Robert, please do not use this.
Proposal
v2
A language change or incompatible library change
Milestone
net.ParseIP
has 1 return value. It doesn't return a value of typeerror
. Other parse methods likeurl.Parse
,time.ParseDuration
andnet.ParseMAC
return 2 values. One of a specific type, the other is of typeerror
.Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.7.go version go1.7.4 linux/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
https://play.golang.org/p/d0K77gxoJe
What did you expect to see?
I'd expect that
net.ParseIP
has this signature:func ParseIP(s string) (IP, error)
What did you see instead?
func ParseIP(s string) IP
The text was updated successfully, but these errors were encountered: