Using pre-commit hook https://github.com/zricethezav/gitleaks throws an error Executable `go` not found

.pre-commit-config.yaml

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.4.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-added-large-files
      - id: detect-private-key
      - id: check-xml
      - id: check-shebang-scripts-are-executable
      - id: file-contents-sorter
        files: requirements.txt|\.gitignore|\.dockerignore

  - repo: https://github.com/zricethezav/gitleaks
    rev: v8.15.3
    hooks:
      - id: gitleaks

Snippet of the gitlab's CI/CD

[INFO] Installing environment for https://github.com/zricethezav/gitleaks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('go', 'install', './...')
return code: 1
expected return code: 0
stdout:
    Executable `go` not found
stderr: (none)
Check the log at /root/.cache/pre-commit/pre-commit.log

Guessing I need to install go into the registry.gitlab.com/yesolutions/docker-pre-commit docker image and I do not know how to do that or if that is even possible.