code: func (u *DockerRegistryURL) MarshalJSON() ([]byte, error) {
  	// Using the alias type allows it to have all the same fields as the
  	// DockerRegistryURL but avoids a loop when marshalling since it will not
  	// have the same MarshalJSON method.
  	type Alias DockerRegistryURL
  	ui := ""
  	if u != nil && u.Userinfo != nil {
  		ui = u.Userinfo.String()
  	}
  	return json.Marshal(&struct {
  		Userinfo string `json:",omitempty"`
  		*Alias
  	}{
  		Userinfo: ui,
  		Alias:    (*Alias)(u),
  	})
  }
docs: // MarshalJSON implements marshalling which will maintain the url.Userinfo
  // details which are normally lost due to lack of exported fields.