Skip to content
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

✨ Changed jsonScorecardResultV2 type Public #1682

Merged
merged 6 commits into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
6 changes: 3 additions & 3 deletions pkg/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func (s jsonFloatScore) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("%.1f", s)), nil
}

//nolint:govet
type jsonScorecardResultV2 struct {
// JSONScorecardResultV2 exports results as JSON for new detail format.
type JSONScorecardResultV2 struct {
Date string `json:"date"`
Repo jsonRepoV2 `json:"repo"`
Scorecard jsonScorecardV2 `json:"scorecard"`
Expand Down Expand Up @@ -125,7 +125,7 @@ func (r *ScorecardResult) AsJSON2(showDetails bool,
}

encoder := json.NewEncoder(writer)
out := jsonScorecardResultV2{
out := JSONScorecardResultV2{
Repo: jsonRepoV2{
Name: r.Repo.Name,
Commit: r.Repo.CommitSHA,
Expand Down
2 changes: 1 addition & 1 deletion pkg/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ func TestJSONOutput(t *testing.T) {
// the calls to Unmarshall() and Marshall() below.

// Unmarshall expected output.
var js jsonScorecardResultV2
var js JSONScorecardResultV2
if err := json.Unmarshal(expected.Bytes(), &js); err != nil {
t.Fatalf("%s: json.Unmarshal: %s", tt.name, err)
}
Expand Down