Files
cof-spec/meta/meta.go
Yonah 1a807bb438 meta: wrap url type
This represents the URL cleanly during serialisation.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2026-04-20 21:57:20 +09:00

21 lines
580 B
Go

// Package meta defines system and member metadata types.
package meta
import (
"encoding"
"net/url"
)
// URL implements [encoding] interfaces on top of [url.URL].
type URL struct{ url.URL }
var (
_ encoding.TextAppender = new(URL)
_ encoding.TextMarshaler = new(URL)
_ encoding.TextUnmarshaler = new(URL)
)
func (u *URL) MarshalText() (data []byte, err error) { return u.MarshalBinary() }
func (u *URL) AppendText(data []byte) ([]byte, error) { return u.AppendBinary(data) }
func (u *URL) UnmarshalText(data []byte) error { return u.UnmarshalBinary(data) }