Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Builtin: semver #2

@shykes

Description

@shykes

I am trying to port a Dagger module from Go to Dang, and it calls the golang.org/x/mod/semver package to check if a version string is valid semver. Relevant snippet:

	version := strings.TrimPrefix(tag, "sdk/typescript/")
	versionFlag := strings.TrimPrefix(version, "v")
	if !semver.IsValid(version) {
		versionFlag = "prepatch"
	}

If Dang had a semver builtin, I could port this code without hacky workarounds like building & executing a semver-parsing CLI tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions