Skip to content

Commit

Permalink
✨ Changed jsonScorecardResultV2 type Public
Browse files Browse the repository at this point in the history
- Fixes #1673
  • Loading branch information
naveensrinivasan committed Feb 27, 2022
1 parent 7610519 commit 59c4afc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ func (s jsonFloatScore) MarshalJSON() ([]byte, error) {
}

//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 +126,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

0 comments on commit 59c4afc

Please sign in to comment.