MCPcopy Index your code
hub / github.com/github/copilot-sdk / goJSONOmitSuffix

Function goJSONOmitSuffix

scripts/codegen/go.ts:389–392  ·  view source on GitHub ↗
(required: boolean, goType: string)

Source from the content-addressed store, hash-verified

387}
388
389function goJSONOmitSuffix(required: boolean, goType: string): string {
390 if (required) return "";
391 return goTypeIsSlice(goType) || goTypeIsMap(goType) ? ",omitzero" : ",omitempty";
392}
393
394function goJSONTag(jsonName: string, required: boolean, goType: string): string {
395 return `json:"${jsonName}${goJSONOmitSuffix(required, goType)}"`;

Callers 1

goJSONTagFunction · 0.85

Calls 2

goTypeIsSliceFunction · 0.85
goTypeIsMapFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…