Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
gaissmai committed Aug 4, 2022
1 parent 5516501 commit 493080d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions extnetip.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Package extnetip is an extension to net/netip.
// Package extnetip is an extension to net/netip with
// a few missing but important auxiliary functions for
// converting IP-prefixes to IP-ranges and vice versa.
//
// No additional types are defined, only required auxiliary
// functions for some existing net/netip types are provided.
// The functions are effectively performed in uint128 space,
// no conversions from/to bytes are performed.
//
// With these small extensions, third-party IP range libraries
// based on stdlib net/netip are now possible without frequent
// conversion to/from bytes.
// With these extensions to net/netip, third-party IP-range
// libraries become easily possible.
package extnetip

import "net/netip"
Expand Down Expand Up @@ -70,7 +71,7 @@ func Prefix(first, last netip.Addr) (prefix netip.Prefix, ok bool) {
bits -= 96
}

// make prefix
// make prefix, possible zone gets dropped
return netip.PrefixFrom(first, bits), ok
}

Expand Down

0 comments on commit 493080d

Please sign in to comment.