Skip to content

Commit 7235111

Browse files
authored
refactor: enable linter rule QF1004 for 'Use strings.ReplaceAll when possible' (#99)
refactor: enable linter QF1004 'Use strings.ReplaceAll instead of strings.Replace'
1 parent 7552617 commit 7235111

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ linters:
3737
- '-QF1001' # disable rule 'Apply De Morgan’s law'
3838
- '-QF1012' # disable rule 'Use fmt.Fprintf instead of x.Write(fmt.Sprintf(...))'
3939
- '-QF1003' # disable rule 'Convert if/else-if chain to tagged switch'
40-
- '-QF1004' # disable rule 'Use strings.ReplaceAll instead of strings.Replace'
4140
# https://golangci-lint.run/usage/linters/#staticcheck
4241
# https://staticcheck.dev/docs/configuration/options/#initialisms
4342
initialisms:

internal/pkg/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ func InstallProjectDependencies(
524524
// In the future, this function can be extended to support other Git hosts, such as GitLab.
525525
// TODO, @cchensh, we should get prepared for other non-Git hosts and refactor the create pkg
526526
func generateGitZipFileURL(templateURL string, gitBranch string) string {
527-
zipURL := strings.Replace(templateURL, ".git", "", -1) + "/archive/refs/heads/"
527+
zipURL := strings.ReplaceAll(templateURL, ".git", "") + "/archive/refs/heads/"
528528

529529
if gitBranch == "" {
530530
mainURL := zipURL + "main.zip"

0 commit comments

Comments
 (0)