Skip to content

Commit

Permalink
better naming, API changed!
Browse files Browse the repository at this point in the history
  • Loading branch information
gaissmai committed Jul 30, 2022
1 parent f392c76 commit d78e295
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func Prefix(first, last netip.Addr) (prefix netip.Prefix, ok bool)

func Prefixes(first, last netip.Addr) []netip.Prefix

func AppendPrefixes(dst []netip.Prefix, first, last netip.Addr) []netip.Prefix
func PrefixesAppend(dst []netip.Prefix, first, last netip.Addr) []netip.Prefix
```

## Future
Expand Down
8 changes: 4 additions & 4 deletions extnetip.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ func Prefix(first, last netip.Addr) (prefix netip.Prefix, ok bool) {
// If first or last are invalid, in the wrong order, or if they're of different
// address families, then Prefixes returns nil.
//
// Prefixes necessarily allocates. See AppendPrefixes for a version that
// Prefixes necessarily allocates. See PrefixesAppend for a version that
// uses memory you provide.
func Prefixes(first, last netip.Addr) []netip.Prefix {
return AppendPrefixes(nil, first, last)
return PrefixesAppend(nil, first, last)
}

// AppendPrefixes is an append version of Prefixes. It appends
// PrefixesAppend is an append version of Prefixes. It appends
// the netip.Prefix entries to dst that covers the IP range from first to last.
func AppendPrefixes(dst []netip.Prefix, first, last netip.Addr) []netip.Prefix {
func PrefixesAppend(dst []netip.Prefix, first, last netip.Addr) []netip.Prefix {
if !(first.IsValid() && last.IsValid()) {
return nil
}
Expand Down

0 comments on commit d78e295

Please sign in to comment.