This is a development instance of xesite. Things here are probably unfinished or in drafting. Don't take anything here super seriously. If you want to share this to an online aggregator, please don't. Drafts are not finalized yet for a reason. Please don't be the reason I need to implement more advanced security than just obscurity.

Why is GitHub Actions installing Go 1.2 when I specify Go 1.20?

Read time in minutes: 1

hero image hime
Image generated by Ligne Claire -- masterpiece, 1girl, green hair, ligne claire, sunset, depth of field, black, yellow, blue, orange, haze

Because YAML parsing is horrible. YAML supports floating point numbers and the following floating point numbers are identical:

  - 1.2
  - 1.20

To get this working correctly, you need to quote the version number:

- name: Set up Go
  uses: actions/setup-go@v4
    go-version: "1.20"

This will get you Go version 1.20.x, not Go version 1.2.x.

Cadey is coffee
<Cadey> I hate YAML.

Worse, this problem will only show up about once every 5 years, so I'm going to add a few blatant SEO farming sentences here:

  • Why is GitHub Actions installing Go 1.3 when I specify Go 1.30?
  • Why is GitHub Actions installing Go 1.4 when I specify Go 1.40?
  • Why is GitHub Actions installing Go 1.5 when I specify Go 1.50?
  • Why is GitHub Actions installing Go 1.6 when I specify Go 1.60?
  • Why is GitHub Actions installing Go 1.7 when I specify Go 1.70?
  • Why is the GitHub Actions AI reconstructing my entire program in Go 1.8 instead of Go 1.80 like I told it to?
  • Why is Go 2.0 not out yet?
  • .i mu'i ma loi proga cu se mabla?
  • Why has everything gone to hell after they discovered that weird rock in Kenya?
  • Why is GitHub Actions installing Python 3.1 when I specify Python 3.10?

Quote your version numbers.

This article was posted on M05 05 2023. Facts and circumstances may have changed since publication. Please contact me before jumping to conclusions if something seems wrong or unclear.

Tags: go yaml

This post was not WebMentioned yet. You could be the first!

The art for Mara was drawn by Selicre.

The art for Cadey was drawn by ArtZora Studios.

Some of the art for Aoi was drawn by @Sandra_Thomas01.