many: minor cosmetic changes (#529)
This commit is contained in:
parent
b9c1419ab0
commit
5f05f8a43a
1 changed files with 21 additions and 21 deletions
|
|
@ -189,7 +189,7 @@ type ResourceContents struct {
|
|||
Meta Meta `json:"_meta,omitempty"`
|
||||
}
|
||||
|
||||
func (r ResourceContents) MarshalJSON() ([]byte, error) {
|
||||
func (r *ResourceContents) MarshalJSON() ([]byte, error) {
|
||||
// If we could assume Go 1.24, we could use omitzero for Blob and avoid this method.
|
||||
if r.URI == "" {
|
||||
return nil, errors.New("ResourceContents missing URI")
|
||||
|
|
@ -197,7 +197,7 @@ func (r ResourceContents) MarshalJSON() ([]byte, error) {
|
|||
if r.Blob == nil {
|
||||
// Text. Marshal normally.
|
||||
type wireResourceContents ResourceContents // (lacks MarshalJSON method)
|
||||
return json.Marshal((wireResourceContents)(r))
|
||||
return json.Marshal((wireResourceContents)(*r))
|
||||
}
|
||||
// Blob.
|
||||
if r.Text != "" {
|
||||
|
|
|
|||
Loading…
Reference in a new issue