Skip to content

Commit 43c6929

Browse files
author
Lucian Jones
committed
Remove unnecessary omitempty guards
1 parent d27590e commit 43c6929

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

plan.go

+7-14
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@ func (e *executionStepResult) MarshalJSON() ([]byte, error) {
3939
j := toMarshal{
4040
Executed: e.executed,
4141
TimeTaken: e.timeTaken.String(),
42+
Error: e.error,
4243
}
43-
44-
if e.error != nil {
45-
j.Error = e.error
46-
}
47-
4844
return json.Marshal(&j)
4945
}
5046

@@ -62,15 +58,12 @@ func (s *QueryPlanStep) MarshalJSON() ([]byte, error) {
6258
Then []*QueryPlanStep
6359
}
6460
j := toMarshal{
65-
ServiceURL: s.ServiceURL,
66-
ParentType: s.ParentType,
67-
SelectionSet: formatSelectionSetSingleLine(ctx, nil, s.SelectionSet),
68-
InsertionPoint: s.InsertionPoint,
69-
Then: s.Then,
70-
}
71-
72-
if s.executionResult != nil {
73-
j.ExecutionStepResult = s.executionResult
61+
ServiceURL: s.ServiceURL,
62+
ParentType: s.ParentType,
63+
SelectionSet: formatSelectionSetSingleLine(ctx, nil, s.SelectionSet),
64+
InsertionPoint: s.InsertionPoint,
65+
Then: s.Then,
66+
ExecutionStepResult: s.executionResult,
7467
}
7568

7669
return json.Marshal(&j)

0 commit comments

Comments
 (0)