Skip to content

Commit 8a8905c

Browse files
authored
[plan] Plan.Definitions add omitempty (#171)
## Summary I'm adding omitempty to Plan.Definitions. I'm not adding it to Plan.DevPackages and Plan.RuntimePackages. Because it explains to a reader that these are empty. These fields are so core and commonly used that I think we want to make an exception for them. ## How was it tested? compiles
1 parent 333c193 commit 8a8905c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

planner/plansdk/plansdk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type Plan struct {
5252
// Ex: python main.py
5353
StartStage *Stage `json:"start_stage,omitempty"`
5454

55-
Definitions []string `cue:"[...string]" json:"definitions"`
55+
Definitions []string `cue:"[...string]" json:"definitions,omitempty"`
5656
// Errors from plan generation. This usually means
5757
// the user application may not be buildable.
5858
Errors []PlanError `json:"errors,omitempty"`

testdata/zig/zig-hello-world/plan.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@
1717
"input_files": [
1818
"./zig-out/bin/"
1919
]
20-
},
21-
"definitions": null
20+
}
2221
}

0 commit comments

Comments
 (0)