Skip to content

Commit

Permalink
refactor: fix linter error S1017 in gh.RepositoryOwnerAndNameFromPath
Browse files Browse the repository at this point in the history
Error: S1017: should replace this `if` statement with an unconditional `strings.TrimPrefix` (gosimple)
  • Loading branch information
crhntr committed Jul 12, 2023
1 parent 7f95c6b commit 10b87b9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions internal/gh/uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ func RepositoryOwnerAndNameFromPath(urlStr string) (owner, repo string, err erro
err = fmt.Errorf("failed to parse owner and repo name from URI %q: %w", urlStr, err)
}
}()
if strings.HasPrefix(urlStr, "[email protected]:") {
urlStr = strings.TrimPrefix(urlStr, "[email protected]:")
}
urlStr = strings.TrimPrefix(urlStr, "[email protected]:")
u, err := url.Parse(urlStr)
if err != nil {
return "", "", err
Expand Down

0 comments on commit 10b87b9

Please sign in to comment.