-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(netmask): implement new encoding interfaces
Go 1.24 introduces two new interfaces to the encoding package, which have been implemented in net/netip: BinaryAppender and TextAppender. These interfaces are similar to the BinaryMarshaler and TextMarshaler interfaces, respectfully, but instead of creating a new byte-slice they append to a provided slice. As the two interfaces are closely related, this changeset implements the *Marshaler interfaces in terms of the *Appender interfaces.
- Loading branch information
1 parent
b9331f1
commit a608f45
Showing
3 changed files
with
141 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//go:build go1.24 | ||
|
||
package netmask | ||
|
||
import ( | ||
"encoding" | ||
) | ||
|
||
var _ encoding.BinaryAppender = (*Mask)(nil) | ||
var _ encoding.TextAppender = (*Mask)(nil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters