Skip to content

The script to install golang env requires golang #1449

Closed

Description

@priyasiddharth

cmd_output_b('go', 'get', './...', cwd=repo_src_dir, env=env)

The introduction mentions...

If one of your developers doesn’t have node installed but modifies a JavaScript file, pre-commit automatically handles downloading and building node to run eslint without root.

I would assume golang would be installed automatically in a similar manner.

Is this reasonable?

thank you
Siddharth

Activity

  1. asottile commented on May 11, 2020

    @asottile
    Member

    So pre-commit has various levels of language support currently. This is roughly outlined in the contributing guidelines.

    the example language there (node) is a "first class" language which pre-commit will bootstrap if it doesn't exist.

    go is unfortunately currently in the "second class" language type which means that the user needs to have a go toolchain set up already.

    a patch to improve this would be appreciated, but it's understandable that some of the languages won't be bootstrappable from scratch.

  2. xenowits commented on Jan 25, 2022

    @xenowits

    So pre-commit has various levels of language support currently. This is roughly outlined in the contributing guidelines.

    the example language there (node) is a "first class" language which pre-commit will bootstrap if it doesn't exist.

    go is unfortunately currently in the "second class" language type which means that the user needs to have a go toolchain set up already.

    a patch to improve this would be appreciated, but it's understandable that some of the languages won't be bootstrappable from scratch.

    Hi @asottile . I'hv go toolchain already setup but I'm unable to use go repo hooks (https://github.com/corverroos/fiximports). My local .pre-commit-config.yaml has:

    repos:
      -   repo: https://github.com/corverroos/fiximports
          rev: 258e9de8481700360dd4b65a9183c1ba4874c66c
          hooks:
            -   id: go-fiximports
    

    Says AssertionError: For now, pre-commit requires system-installed golang. Can you help?

  3. asottile commented on Jan 25, 2022

    @asottile
    Member

    don't comment on old issues, especially when they are not your problem

    make a new issue and fill out the issue template

  4. locked as off topic and limited conversation to collaborators on Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions