Skip to content

Commit

Permalink
Remove warning prefix from message used in error
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoriano committed Oct 5, 2023
1 parent e4c227c commit e9c89eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code/go/internal/validator/folder_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ func (v *validator) Validate() specerrors.ValidationErrors {
switch v.spec.Release() {
case "", "ga": // do nothing
case "beta":
if v.pkg.Version.Major() > 0 && v.pkg.Version.Prerelease() == "" {
if v.pkg.IsGA() {
errs = append(errs,
specerrors.NewStructuredErrorf("spec for [%s] defines beta features which can't be enabled for packages with a stable semantic version", v.pkg.Path(v.folderPath)),
)
} else {
message := fmt.Sprintf("Warning: package with non-stable semantic version and active beta features (enabled in [%s]) can't be released as stable version.", v.pkg.Path(v.folderPath))
message := fmt.Sprintf("package with non-stable semantic version and active beta features (enabled in [%s]) can't be released as stable version.", v.pkg.Path(v.folderPath))
if common.IsDefinedWarningsAsErrors() || v.pkg.SpecVersion.Major() >= 3 {
err = errors.New(message)
errs = append(errs, specerrors.NewStructuredError(err, specerrors.CodePrereleaseFeatureOnGAPackage))
} else {
log.Printf(message)
log.Print("Warning: ", message)
}
}
default:
Expand Down

0 comments on commit e9c89eb

Please sign in to comment.