Skip to content

Commit

Permalink
same validation corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
AtzeDeVries committed Dec 20, 2023
1 parent d964ee6 commit 5e5d1ec
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ func repoURL() (string, error) {
if err != nil {
return "", err
}
//origin := strings.Fields(remote.String())[1]

return gitRemoteParser(remote.String())
}

Expand Down
5 changes: 1 addition & 4 deletions metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ func TestGitRemoteParser(t *testing.T) {
t.Run(testname, func(t *testing.T) {
got, err := gitRemoteParser(tt.remote)
if got == tt.want &&
(errors.Is(err, tt.err) || // This is to compare if the error is of the same type, which
// happen when both errors are nil,
// The line below is to compare if the error message is the same as string
err.Error() == tt.err.Error()) {
(errors.Is(err, tt.err) || err.Error() == tt.err.Error()) {
return
}
t.Errorf("\n got: %s,%v \nwant: %s,%v", got, err, tt.want, tt.err)
Expand Down

0 comments on commit 5e5d1ec

Please sign in to comment.