Documentation
¶
Index ¶
- Constants
- func Canonical(v string) (canonical string, err error)
- func CanonicalWithGoPrefix(v string) (canonical string, err error)
- func DetermineEmbeddedVersion(ctx context.Context, fs *embed.FS, versionFilePath *string) (version string, err error)
- func DetermineVersionFromFile(ctx context.Context, fs filesystem.FS, versionFilePath string) (version string, err error)
- func SanitiseVersionMajor(version string) (majorMinor string, err error)
- func SanitiseVersionMajorMinor(version string) (majorMinor string, err error)
- func TrimGoPrefix(v string) string
Constants ¶
const (
DefaultVersionFile = "module.properties"
)
Variables ¶
This section is empty.
Functions ¶
func Canonical ¶
Canonical will return the canonical form of the version with the .MAJOR .MINOR and .PATCH whilst discarding build information It will return an error if the version is not valid semver (unlike Canonical() in golang.org/x/mod/semver) Use CanonicalWithGoPrefix() if you want the 'v' prefix for compatibility with golang.org/x/mod/semver
func CanonicalWithGoPrefix ¶
CanonicalWithGoPrefix will return the canonical form of the version with the .MAJOR .MINOR and .PATCH whilst discarding build information It will return an error if the version is not valid semver (unlike Canonical() in golang.org/x/mod/semver) It will prepend 'v' if necessary for compatibility with 'golang.org/x/mod/semver'. Use Canonical() if you don't want the 'v' prefix
func DetermineEmbeddedVersion ¶ added in v1.84.0
func DetermineEmbeddedVersion(ctx context.Context, fs *embed.FS, versionFilePath *string) (version string, err error)
DetermineEmbeddedVersion retrieves the version information of a project from embedded files.
func DetermineVersionFromFile ¶ added in v1.84.0
func DetermineVersionFromFile(ctx context.Context, fs filesystem.FS, versionFilePath string) (version string, err error)
DetermineVersionFromFile retrieves the information about the version of a project based on a version file generated by [autoversion](https://github.com/ARMmbed/autoversion). The Canonical version is returned.
func SanitiseVersionMajor ¶
SanitiseVersionMajor will return the major part of the version with the 'v' prefix
func SanitiseVersionMajorMinor ¶
SanitiseVersionMajorMinor will return the major and minor parts of the version with the 'v' prefix
func TrimGoPrefix ¶
TrimGoPrefix will trim the 'v' prefix from a string
Types ¶
This section is empty.