Skip to content

Commit 0211b70

Browse files
committed
lint fix
1 parent 26271d5 commit 0211b70

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pkg/testcoverage/badgestorer/github.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func NewGithub(cfg Git) Storer {
3131
return &githubStorer{cfg: cfg}
3232
}
3333

34+
//nolint:maintidx // relax
3435
func (s *githubStorer) Store(data []byte) (bool, error) {
3536
git := s.cfg
3637
client := github.NewClient(nil).WithAuthToken(git.Token)
@@ -62,13 +63,17 @@ func (s *githubStorer) Store(data []byte) (bool, error) {
6263
git.FileName,
6364
&github.RepositoryContentGetOptions{Ref: git.Branch},
6465
)
66+
6567
var ghErr *github.ErrorResponse
66-
if errors.As(err, &ghErr) && ghErr.Response != nil && ghErr.Response.StatusCode == http.StatusNotFound { // coverage-ignore
68+
if errors.As(err, &ghErr) &&
69+
ghErr.Response != nil && ghErr.Response.StatusCode == http.StatusNotFound { // coverage-ignore
6770
return updateBadge(nil) // when badge is not found create it
6871
}
72+
6973
if httpResp != nil && httpResp.StatusCode == http.StatusNotFound { // coverage-ignore
70-
return updateBadge(nil)
74+
return updateBadge(nil) // when badge is not found create it
7175
}
76+
7277
if err != nil { // coverage-ignore
7378
return false, fmt.Errorf("get badge content: %w", err)
7479
}

pkg/testcoverage/badgestorer/github_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func deleteFile(t *testing.T, cfg Git) {
102102
cfg.Repository,
103103
cfg.FileName,
104104
&github.RepositoryContentFileOptions{
105-
Message: github.String("delete testing badge " + cfg.FileName),
105+
Message: github.Ptr("delete testing badge " + cfg.FileName),
106106
Branch: &cfg.Branch,
107107
SHA: fc.SHA,
108108
},

0 commit comments

Comments
 (0)