Skip to content

Commit a16b261

Browse files
timvwclaude
andcommitted
fix: simplify branch name filtering to satisfy linter
Remove redundant HasPrefix check before TrimPrefix call. The strings.TrimPrefix function is safe to call unconditionally as it returns the original string if the prefix doesn't exist. Fixes linter error: S1017: should replace this `if` statement with an unconditional `strings.TrimPrefix` (gosimple) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 80f461e commit a16b261

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

main.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ func getAvailableBranches() ([]string, error) {
178178
}
179179

180180
// For remote branches, strip the origin/ prefix
181-
if strings.HasPrefix(branch, "origin/") {
182-
branch = strings.TrimPrefix(branch, "origin/")
183-
}
181+
branch = strings.TrimPrefix(branch, "origin/")
184182

185183
// Skip if branch name is just "origin" or other remote names
186184
if branch == "origin" || branch == "upstream" {

0 commit comments

Comments
 (0)