gridscale / gridscale/gsclient-go

Optional field with json tag "omitempty" should be type of pointer.

Open
#159 0 comments 0 reactions 0 assignees View on GitHub
breaking-change
Dominant language
Go
Stars
8
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Optional field with json tag "omitempty" should be type of pointer, since the optional fields usually accepts 3 types of input: nil (omitted when the field is nil), empty (Should not be omitted. eg: "" for string, 0 for int), and not empty. E.g:
Labels []string `json:"labels,omitempty"`

should be

Labels *[]string `json:"labels,omitempty"`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.