mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 00:38:33 +02:00
fixed json output for ls-routes and its API and homepage api
This commit is contained in:
@@ -27,8 +27,11 @@ func (u URL) String() string {
|
||||
return u.URL.String()
|
||||
}
|
||||
|
||||
func (u URL) MarshalText() (text []byte, err error) {
|
||||
return []byte(u.String()), nil
|
||||
func (u URL) MarshalJSON() (text []byte, err error) {
|
||||
if u.URL == nil {
|
||||
return []byte("null"), nil
|
||||
}
|
||||
return []byte("\"" + u.URL.String() + "\""), nil
|
||||
}
|
||||
|
||||
func (u URL) Equals(other *URL) bool {
|
||||
|
||||
Reference in New Issue
Block a user