mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-29 20:08:31 +00:00
* Moving config files to core/config * fix package names * fix package dependencies * linting fixes * more linting fixes * ran golangci-lint run --fix
21 lines
656 B
Go
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)
|
|
}
|