Golang

kind: golang

source condition target

source

The Golang "source" retrieves the Golang version matching then versioning rule.

condition

The Golang "condition" checks if the Golang version matching then versioning rule exist.

target

the Golang "target" is not supported.

Parameter

Name Type Description Required
age object

age defines the minimum or maximum age of a release to be considered valid. It accepts a duration string (e.g., “24h”, “7d”).

Compatible:

  • source
  • condition

Remarks: If age is specified, the Updatecli retrieves the release date of each Golang version from a git repository. This has significant performance implications, as it requires fetching git tags and their associated commit dates. Use wisely.

    maximum string Maximum defines the maximum age of a release to be considered valid. It accepts a duration string (e.g., “24h”, “7d”, “3w”, “1y”). Accepted time units are “h” for hours, “d” for days, “w” for weeks, “mo” for months, and “y” for years. If no unit is provided, hours are assumed.
    minimum string Minimum defines the minimum age of a release to be considered valid. It accepts a duration string (e.g., “24h”, “7d”, “3w”, “1y”). Accepted time units are “h” for hours, “d” for days, “w” for weeks, “mo” for months, and “y” for years. If no unit is provided, hours are assumed.
version string

Version defines a specific golang version

Compatible:

  • condition
versionfilter object

versionfilter provides parameters to specify version pattern and its type like regex, semver, or just latest.

Compatible:

  • source
    kind string specifies the version kind such as semver, regex, or latest
    pattern string specifies the version pattern according the version kind for semver, it is a semver constraint for regex, it is a regex pattern for time, it is a date format
    regex string specifies the regex pattern, used for regex/semver and regex/time. Output of the first capture group will be used.
    replaceall object replaceAll applies a regex replacement to version strings before filtering. This is useful for transforming versions (e.g., curl-8_15_0 to curl-8.15.0) before regex extraction.
    strict boolean strict enforce strict versioning rule. Only used for semantic versioning at this time

Example

# updatecli.yaml
name: "Golang example"

sources:
  default:
    name: Get Golang version
    kind: golang
    spec:
      versionfilter:
        kind: semver
        pattern: "1.15.x"

conditions:
  # The version to check is inherited from source "default"
  default:
    name: Checks that golang version from source default exists
    kind: golang
    sourceid: default

  nosourceinput:
    disablesourceinput: true
    name: Checks that golang version 1.20.1 exists
    kind: golang
    spec:
      version: "1.20.1"
Top