fix: version param name change in tools
@@ -33,7 +33,7 @@ var (
v2BeginRegex = regexp.MustCompile("^```\\s*yaml\\s*\\$\\(go\\)\\s*&&\\s*\\$\\((track2|v2)\\)")
v2EndRegex = regexp.MustCompile("^\\s*```\\s*$")
newClientMethodNameRegex = regexp.MustCompile("^New.+Client$")
- versionLineRegex = regexp.MustCompile(`version\s*=\s*\".*v\d+\.\d+\.\d+\"`)
+ versionLineRegex = regexp.MustCompile(`moduleVersion\s*=\s*\".*v\d+\.\d+\.\d+\"`)
changelogVersionRegex = regexp.MustCompile(`##\s*(?P<version>\d+\.\d+\.\d+)\s*\((\d{4}-\d{2}-\d{2}|Unreleased)\)`)
packageConfigRegex = regexp.MustCompile(`\$\((package-.+)\)`)
)
@@ -233,7 +233,7 @@ func ReplaceVersion(packageRootPath string, newVersion string) error {
if b, err = ioutil.ReadFile(path); err != nil {
return err
}
- contents := versionLineRegex.ReplaceAllString(string(b), "version = \"v"+newVersion+"\"")
+ contents := versionLineRegex.ReplaceAllString(string(b), "moduleVersion = \"v"+newVersion+"\"")
return ioutil.WriteFile(path, []byte(contents), 0644)
}
