-
Notifications
You must be signed in to change notification settings - Fork 1k
fix(status): fix Constraint
& Version
json output
#976
fix(status): fix Constraint
& Version
json output
#976
Conversation
could you say a little more about what larger problem this is fixing? just so i can keep up with what all is happening |
oops! sorry 😅 yes, so in json output, Updated the first comment with output examples to make it easy to understand 😊 |
Constraint
& Version
outputConstraint
& Version
output
Constraint
& Version
outputConstraint
& Version
json output
53a432e
to
afb281e
Compare
Constraint
& Version
json outputConstraint
& Version
json output
Added table tests for BasicLine output for different output types. Also added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of adding new field types, what if we implement MarshalJSON
and do the conversions there directly (perhaps using an intermediate type, like we do with Manifest.MarshalTOML
?
this strikes me as preferable to having duplicate fields in the main struct itself. thoughts?
cmd/dep/status_test.go
Outdated
} | ||
|
||
func TestBasicStatusGetConsolidatedConstraint(t *testing.T) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: unnecessary newline
Replace `Constraint` & `Version` with their json alternative forms `JSONConstraint` and `JSONVersion`.
Add table tests for BasicLine output for each output type and tests for getConsolidatedConstraint() & getConsolidatedVersion().
afb281e
to
bd3ba74
Compare
Added Also,
|
Add `rawStatus` struct and use `marshalJSON()` to convert `BasicStatus` to `rawStatus`.
bd3ba74
to
c6b462b
Compare
yeah, i...don't even remember the original motivation for this LGTM - merge at your convenience! |
What does this do / why do we need it?
Replace
Constraint
&Version
with their json alternative formsJSONConstraint
andJSONVersion
.Constraint
andVersion
are always empty now.dep status
ongolang/dep
,before:
with this change:
What should your reviewer look out for in this PR?
Implementation correctness.
Do you need help or clarification on anything?
No.
Which issue(s) does this PR fix?
No open issue.