Skip to content

Commit

Permalink
✨ Changed jsonScorecardResultV2 type Public (#1682)
Browse files Browse the repository at this point in the history
* ✨ Changed jsonScorecardResultV2 type Public

- Fixes #1673

* Update pkg/json.go

Co-authored-by: Stephen Augustus (he/him) <[email protected]>

* Fixed the govet warning by including nolint

Fixed the govet linter warning by including  nolint.

Co-authored-by: Stephen Augustus (he/him) <[email protected]>
  • Loading branch information
naveensrinivasan and justaugustus authored Feb 28, 2022
1 parent 4635570 commit ddb0fe3
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 ddb0fe3

Please sign in to comment.