Skip to content

Commit

Permalink
refactor: use values instead of pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrgm committed Jul 9, 2022
1 parent 595a023 commit e578227
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions github/repos_codeowners.go
Expand Up @@ -17,13 +17,13 @@ type CodeownersErrors struct {

// CodeownersError represents a syntax error detected in the CODEOWNERS file.
type CodeownersError struct {
Line *int `json:"line"`
Column *int `json:"column"`
Kind *string `json:"kind"`
Source *string `json:"source"`
Suggestion *string `json:"suggestion"`
Message *string `json:"message"`
Path *string `json:"path"`
Line int `json:"line"`
Column int `json:"column"`
Kind string `json:"kind"`
Source string `json:"source"`
Suggestion *string `json:"suggestion,omitempty"`
Message string `json:"message"`
Path string `json:"path"`
}

// GetCodeownersErrors lists any syntax errors that are detected in the CODEOWNERS file.
Expand Down
24 changes: 12 additions & 12 deletions github/repos_codeowners_test.go
Expand Up @@ -46,13 +46,13 @@ func TestRepositoriesService_GetCodeownersErrors(t *testing.T) {
want := &CodeownersErrors{
Errors: []*CodeownersError{
{
Line: Int(1),
Column: Int(1),
Kind: String("Invalid pattern"),
Source: String("***/*.rb @monalisa"),
Line: 1,
Column: 1,
Kind: "Invalid pattern",
Source: "***/*.rb @monalisa",
Suggestion: String("Did you mean **/*.rb?"),
Message: String("Invalid pattern on line 3: Did you mean **/*.rb?\n\n ***/*.rb @monalisa\n ^"),
Path: String(".github/CODEOWNERS"),
Message: "Invalid pattern on line 3: Did you mean **/*.rb?\n\n ***/*.rb @monalisa\n ^",
Path: ".github/CODEOWNERS",
},
},
}
Expand Down Expand Up @@ -81,13 +81,13 @@ func TestCodeownersErrors_Marshal(t *testing.T) {
u := &CodeownersErrors{
Errors: []*CodeownersError{
{
Line: Int(1),
Column: Int(1),
Kind: String("Invalid pattern"),
Source: String("***/*.rb @monalisa"),
Line: 1,
Column: 1,
Kind: "Invalid pattern",
Source: "***/*.rb @monalisa",
Suggestion: String("Did you mean **/*.rb?"),
Message: String("Invalid pattern on line 3: Did you mean **/*.rb?\n\n ***/*.rb @monalisa\n ^"),
Path: String(".github/CODEOWNERS"),
Message: "Invalid pattern on line 3: Did you mean **/*.rb?\n\n ***/*.rb @monalisa\n ^",
Path: ".github/CODEOWNERS",
},
},
}
Expand Down

0 comments on commit e578227

Please sign in to comment.