Skip to content

Commit

Permalink
improve regex for go version update (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
meorphis authored Oct 8, 2024
1 parent b40c6fe commit 1d81b76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/updaters/go/github-imports-go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class GithubImportsGo extends DefaultUpdater {
}

return content.replace(
/"(https:\/\/pkg.go.dev\/)?github\.com\/([^/]+)\/([^/]+)(\/v([1-9]\d*))?(\/[^"]+)?"/g,
/"(https:\/\/pkg.go.dev\/)?github\.com\/([^/"\n]+)\/([^/"\n]+)(\/v([1-9]\d*))?(\/[^"\n]+)?"/g,
(_, prefix, user, repo, ___, ____, path) =>
`"${prefix ?? ''}github.com/${user}/${repo}${
this.version.major < 2 ? '' : '/v' + this.version.major.toString()
Expand Down

0 comments on commit 1d81b76

Please sign in to comment.