GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Disable automatic toolchain switching in golang · Issue #3300 · pre-commit/pre-commit

Disable automatic toolchain switching in golang #3300

New issue
Copy link
New issue
Copy link
Closed
#3304
Closed
Disable automatic toolchain switching in golang#3300
#3304
Copy link

Description

@AleksaC
AleksaC
opened on Sep 16, 2024
Issue body actions

search you tried in the issue tracker

toolchain

describe your issue

In version 1.21 go introduced automatic toolchain switching, which basically means downloading the go version specified in the go.mod file if it's newer than the one being used.

This is the cause of #3149. In that case the command failed only because the helm docs set go 1.22 in go.mod. Had they set 1.22.0 that version would have been downloaded and the build would work.

This may not be bad if language_version isn't specified, because autoupdate would only break in case the full version isn't specified like the above. However, this breaks the language_version if it is specified. Here's an example:

default_language_version:
  golang: "1.21.0"

repos:
- repo: https://github.com/golangci/golangci-lint
  rev: v1.61.0  # uses go 1.22.1
  hooks:
    - id: golangci-lint-config-verify
$ ~/.cache/pre-commit/repoka9x_fj6/golangenv-1.21.0/bin/golangci-lint version
golangci-lint has version (devel) built with go1.22.1 from (a1d6c560de1a193a0c68ffed68cd5928ef39e884, modified: true, mod sum: "") on 2024-09-09T14:33:19Z

pre-commit --version

pre-commit 3.8.0

.pre-commit-config.yaml

default_language_version:
  golang: "1.21.0"

repos:
- repo: https://github.com/golangci/golangci-lint
  rev: v1.61.0  # uses go 1.22.1
  hooks:
    - id: golangci-lint-config-verify

~/.cache/pre-commit/pre-commit.log (if present)

No response

Activity

  1. AleksaC
    changed the title [-]Disable automatic toolchain switching[/-] [+]Disable automatic toolchain switching in golang[/+] on Sep 16, 2024
  2. asottile commented on Sep 17, 2024

    @asottile
    asottile
    on Sep 17, 2024
    Member
    More actions

    would you like to send a patch?

  3. AleksaC commented on Sep 17, 2024

    @AleksaC
    AleksaC
    on Sep 17, 2024
    ContributorAuthor
    More actions

    Yes, I'll look into it soon!

  4. asottile
    closed this as completedin #3304on Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.