Skip to content

chore: color value_source for deployment values #9922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Sep 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Linting
  • Loading branch information
Emyrk committed Sep 29, 2023
commit 93aa42689a4b1dad7feb3f389b48ce856dcc74b1
12 changes: 6 additions & 6 deletions cli/clibase/option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,14 @@ func compareValues(t *testing.T, exp, found clibase.Option) {
// empty string '""' for nil slices/maps/etc.
// So use json to compare.

expJson, err := json.Marshal(exp.Value)
expJSON, err := json.Marshal(exp.Value)
require.NoError(t, err, "marshal")
foundJson, err := json.Marshal(found.Value)
foundJSON, err := json.Marshal(found.Value)
require.NoError(t, err, "marshal")

expJson = normalizeJSON(expJson)
foundJson = normalizeJSON(foundJson)
assert.Equalf(t, string(expJson), string(foundJson), "option value %q", exp.Name)
expJSON = normalizeJSON(expJSON)
foundJSON = normalizeJSON(foundJSON)
assert.Equalf(t, string(expJSON), string(foundJSON), "option value %q", exp.Name)
} else {
assert.Equal(t,
exp.Value.String(),
Expand All @@ -364,7 +364,7 @@ func compareValues(t *testing.T, exp, found clibase.Option) {
// normalizeJSON handles the fact that an empty map/slice is not the same
// as a nil empty/slice. For our purposes, they are the same.
func normalizeJSON(data []byte) []byte {
if bytes.Compare(data, []byte("[]")) == 0 || bytes.Compare(data, []byte("{}")) == 0 {
if bytes.Equal(data, []byte("[]")) || bytes.Equal(data, []byte("{}")) {
return []byte("null")
}
return data
Expand Down