MarshalJSON implements the json.Marshaler interface for URL.
()
| 216 | |
| 217 | // MarshalJSON implements the json.Marshaler interface for URL. |
| 218 | func (u URL) MarshalJSON() ([]byte, error) { |
| 219 | if u.URL != nil { |
| 220 | return json.Marshal(u.URL.String()) |
| 221 | } |
| 222 | return []byte("null"), nil |
| 223 | } |
| 224 | |
| 225 | // OAuth2 is the oauth2 client configuration. |
| 226 | type OAuth2 struct { |