Skip to content
New issue

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

net, net/netip: unify address parsing #58098

Closed
neild opened this issue Jan 26, 2023 · 1 comment
Closed

net, net/netip: unify address parsing #58098

neild opened this issue Jan 26, 2023 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@neild
Copy link
Contributor

neild commented Jan 26, 2023

The net and net/netip packages both have IP address parsers. We should have only one. Probably simplest for net.ParseIP to just use net/netip for parsing:

func ParseIP(s string) IP {
  ip, err := netip.ParseAddr(in)
  if err != nil || ip.Zone() != "" {
    return nil
  }
  return IP(ip.AsSlice()).To16()
}
@seankhliao seankhliao added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 28, 2023
@seankhliao seankhliao added this to the Backlog milestone Jan 28, 2023
@gopherbot
Copy link

Change https://go.dev/cl/463987 mentions this issue: net: use net/netip for address parsing

johanbrandhorst pushed a commit to Pryz/go that referenced this issue Feb 12, 2023
Fixes golang#58098

Change-Id: I6ef963ba2c110215b8eda763cbfb258a25c8199a
GitHub-Last-Rev: 3d22f07
GitHub-Pull-Request: golang#58143
Reviewed-on: https://go-review.googlesource.com/c/go/+/463987
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
@golang golang locked and limited conversation to collaborators Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants