Skip to content

Commit

Permalink
🪸 conn: add Addr.AppendText and revamp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
database64128 committed Feb 14, 2025
1 parent 7b86276 commit 74980f3
Show file tree
Hide file tree
Showing 2 changed files with 243 additions and 191 deletions.
7 changes: 6 additions & 1 deletion conn/addr.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,12 @@ func (a Addr) AppendTo(b []byte) []byte {
}
}

// MarshalText implements the encoding.TextMarshaler MarshalText method.
// AppendText implements [encoding.TextAppender].
func (a Addr) AppendText(b []byte) ([]byte, error) {
return a.AppendTo(b), nil
}

// MarshalText implements [encoding.TextMarshaler].
func (a Addr) MarshalText() ([]byte, error) {
switch a.af {
case addressFamilyNetip:
Expand Down
Loading

0 comments on commit 74980f3

Please sign in to comment.