question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tighten up Go version specification

See original GitHub issue

The problem

I just tried to specify a build matrix that includes the latest beta, go1.15beta1 (using stable: 'false'). This failed because go1.15beta1 is not a valid version - 1.15.0-beta1 is the valid version according to setup-go (note the lack of go prefix, and the addition of .0-).

Background

Go versions are not semver: https://github.com/golang/go/issues/27255#issuecomment-424812737

(I note the discussion in https://github.com/golang/go/issues/32450, but caution there is no specific plan)

For example, here is a list of valid Go versions (i.e. the result of go version):

  • go1.14
  • go1.14.1
  • go1.15beta1

The issue is that currently the user of setup-go has to perform two steps of translation: drop the go prefix, and think about how to translate to the “semver equivalent”.

Proposal (breaking change)

I’d like to propose that specifying Go versions in the default case, i.e. an exact version specification, follows the output of go version. Hence:

- uses: actions/setup-go@v2
  with:
    go-version: 'go1.14'

means “use go1.14” rather than “use the latest go1.14.x”.

If the semver-like specification is required, then I propose that a special prefix is used, perhaps ~:

- uses: actions/setup-go@v2
  with:
    go-version: '~^v1.14.0' 

To my understanding this is a breaking change (hence v3 candidate) but I wanted to raise the issue for discussion in any case.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:10
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ncwcommented, Jul 24, 2020

I’ve just been bitten by this too. Working out that the go release tagged ‘go1.15beta1’ needs go-version: 'v1.15.0-beta1' is non trivial!

1reaction
mvdancommented, Mar 3, 2022

Note that v3.0.0 has now dropped the stable input, so betas and RCs work by default. They have also switched to a slightly more consistent form of semver for the version strings. See https://github.com/actions/setup-go/issues/191.

I still think it would be good to support Go versions as named by upstream, but at least now the behavior is more consistent.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Go Programming Language Specification
This is the reference manual for the Go programming language. The pre-Go1.18 version, without generics, can be found here.
Read more >
Go standards and style guidelines - GitLab Docs
Go standards and style guidelines. This document describes various guidelines and best practices for GitLab projects using the Go language.
Read more >
Semantic Versioning 2.0.0 | Semantic Versioning
If the dependency specifications are too tight, you are in danger of version lock (the inability to upgrade a package without having to...
Read more >
Versioning - Renovate Docs
Renovate interprets versions correctly out-of-the-box most of the time. ... cargo , composer , conan , debian , docker , git , go-mod-directive...
Read more >
6.5. Bolt Installation | American Institute of Steel Construction
What is the definition of a snug-tight connection and when is it allowed? The RCSC Specification defines a snug-tightened joint as a joint...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found