Files
atlantis/server/core/config/raw/raw.go
Sarvar Muminov 7a927c050b Moving config files to core/config (#2036)
* Moving config files to core/config

* fix package names

* fix package dependencies

* linting fixes

* more linting fixes

* ran golangci-lint run --fix
2022-02-03 11:06:04 -08:00

21 lines
656 B
Go

// Package raw contains the golang representations of the YAML elements
// supported in atlantis.yaml. The structs here represent the exact data that
// comes from the file before it is parsed/validated further.
package raw
import (
version "github.com/hashicorp/go-version"
"github.com/pkg/errors"
)
// VersionValidator helper function to validate binary version.
// Function implements ozzo-validation::Rule.Validate interface.
func VersionValidator(value interface{}) error {
strPtr := value.(*string)
if strPtr == nil {
return nil
}
_, err := version.NewVersion(*strPtr)
return errors.Wrapf(err, "version %q could not be parsed", *strPtr)
}