package internal import "net/url" type URL struct { *url.URL } func (u *URL) MarshalText() ([]byte, error) { return []byte(u.URL.String()), nil } func (u *URL) UnmarshalText(buf []byte) error { var err error u.URL, err = url.Parse(string(buf)) if err != nil { return err } return nil } func MustURL(arg string) *URL { u, err := url.Parse(arg) if err != nil { panic(err) } return &URL{u} }