MarshalJSON implements the json.Marshaler interface for URL.
()
| 229 | |
| 230 | // MarshalJSON implements the json.Marshaler interface for URL. |
| 231 | func (u URL) MarshalJSON() ([]byte, error) { |
| 232 | if u.URL != nil { |
| 233 | return json.Marshal(u.String()) |
| 234 | } |
| 235 | return []byte("null"), nil |
| 236 | } |
| 237 | |
| 238 | // OAuth2 is the oauth2 client configuration. |
| 239 | type OAuth2 struct { |