diff --git a/.golangci.yml b/.golangci.yml index 6091759f..83fd58ba 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -37,7 +37,6 @@ linters: - '-QF1001' # disable rule 'Apply De Morgan’s law' - '-QF1012' # disable rule 'Use fmt.Fprintf instead of x.Write(fmt.Sprintf(...))' - '-QF1003' # disable rule 'Convert if/else-if chain to tagged switch' - - '-QF1004' # disable rule 'Use strings.ReplaceAll instead of strings.Replace' # https://golangci-lint.run/usage/linters/#staticcheck # https://staticcheck.dev/docs/configuration/options/#initialisms initialisms: diff --git a/internal/pkg/create/create.go b/internal/pkg/create/create.go index 74c029c3..ac23b9dc 100644 --- a/internal/pkg/create/create.go +++ b/internal/pkg/create/create.go @@ -524,7 +524,7 @@ func InstallProjectDependencies( // In the future, this function can be extended to support other Git hosts, such as GitLab. // TODO, @cchensh, we should get prepared for other non-Git hosts and refactor the create pkg func generateGitZipFileURL(templateURL string, gitBranch string) string { - zipURL := strings.Replace(templateURL, ".git", "", -1) + "/archive/refs/heads/" + zipURL := strings.ReplaceAll(templateURL, ".git", "") + "/archive/refs/heads/" if gitBranch == "" { mainURL := zipURL + "main.zip"