{"id":13459993,"url":"https://github.com/voidint/g","last_synced_at":"2025-10-23T08:02:56.924Z","repository":{"id":35131459,"uuid":"183450906","full_name":"voidint/g","owner":"voidint","description":"Golang Version Manager","archived":false,"fork":false,"pushed_at":"2025-09-17T02:08:29.000Z","size":7235,"stargazers_count":2501,"open_issues_count":13,"forks_count":241,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-10-23T08:02:16.244Z","etag":null,"topics":["golang","version-manager"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/voidint/g","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voidint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-04-25T14:27:41.000Z","updated_at":"2025-10-23T03:46:10.000Z","dependencies_parsed_at":"2023-12-27T14:44:45.652Z","dependency_job_id":"180270ec-28ce-46ca-82d0-265a132d756e","html_url":"https://github.com/voidint/g","commit_stats":{"total_commits":251,"total_committers":11,"mean_commits":"22.818181818181817","dds":"0.13147410358565736","last_synced_commit":"91c81961ff8367f31e7293472c2c6fe260ebb80d"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/voidint/g","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidint%2Fg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidint%2Fg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidint%2Fg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidint%2Fg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voidint","download_url":"https://codeload.github.com/voidint/g/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidint%2Fg/sbom","scorecard":{"id":1239124,"data":{"date":"2025-10-13","repo":{"name":"github.com/voidint/g","commit":"a4bca5880ca02252507f92bc1ce8c7351858419a"},"scorecard":{"version":"v5.3.1-0.20251012233417-af419a5f4ac8","commit":"af419a5f4ac865788a844e5a2e726681cf4ff42b"},"score":3,"checks":[{"name":"Maintained","score":3,"reason":"1 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/makefile.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 3/26 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/makefile.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/voidint/g/makefile.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/makefile.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/voidint/g/makefile.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/makefile.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/voidint/g/makefile.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/makefile.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/voidint/g/makefile.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/makefile.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/voidint/g/makefile.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/makefile.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/voidint/g/makefile.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.8.0 not signed: https://api.github.com/repos/voidint/g/releases/231499904","Warn: release artifact v1.7.0 not signed: https://api.github.com/repos/voidint/g/releases/164291661","Warn: release artifact v1.6.0 not signed: https://api.github.com/repos/voidint/g/releases/132284095","Warn: release artifact v1.5.2 not signed: https://api.github.com/repos/voidint/g/releases/119923303","Warn: release artifact v1.5.1 not signed: https://api.github.com/repos/voidint/g/releases/115698791","Warn: release artifact v1.8.0 does not have provenance: https://api.github.com/repos/voidint/g/releases/231499904","Warn: release artifact v1.7.0 does not have provenance: https://api.github.com/repos/voidint/g/releases/164291661","Warn: release artifact v1.6.0 does not have provenance: https://api.github.com/repos/voidint/g/releases/132284095","Warn: release artifact v1.5.2 does not have provenance: https://api.github.com/repos/voidint/g/releases/119923303","Warn: release artifact v1.5.1 does not have provenance: https://api.github.com/repos/voidint/g/releases/115698791"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3605 / GHSA-7vpp-9cxj-q8gv","Warn: Project is vulnerable to: GO-2024-2698 / GHSA-rhh4-rh7c-7r5v","Warn: Project is vulnerable to: GO-2025-3922 / GHSA-jc7w-c686-c4v9","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: PYSEC-2023-117 / GHSA-mrwq-x4v8-fh7p"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/af419a5f4ac865788a844e5a2e726681cf4ff42b/docs/checks.md#sast"}}]},"last_synced_at":"2025-10-23T08:02:18.850Z","repository_id":35131459,"created_at":"2025-10-23T08:02:18.850Z","updated_at":"2025-10-23T08:02:18.850Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280583897,"owners_count":26355258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-23T02:00:06.710Z","response_time":142,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","version-manager"],"created_at":"2024-07-31T10:00:33.556Z","updated_at":"2025-10-23T08:02:56.917Z","avatar_url":"https://github.com/voidint.png","language":"Go","readme":"# g\n\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/voidint/g)\n[![GoDoc](https://godoc.org/github.com/voidint/g?status.svg)](https://godoc.org/github.com/voidint/g)\n[![codecov](https://codecov.io/gh/voidint/g/branch/master/graph/badge.svg)](https://codecov.io/gh/voidint/g)\n[![codebeat badge](https://codebeat.co/badges/0b4bf243-95da-444c-b163-6cb8a35d1f8d)](https://codebeat.co/projects/github-com-voidint-g-master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/voidint/g)](https://goreportcard.com/report/github.com/voidint/g)\n\n[简体中文 🇨🇳](./README_CN.md)\n\n**Note:** The master branch may still be under development and may not represent a stable version. Please download stable versions of the source code through tags or download compiled binary executables through [release](https://github.com/voidint/g/releases).\n\n`g` is a command-line tool for Linux, macOS, and Windows that provides convenient management and switching of multiple versions of the [Go](https://golang.org/) environment.\n\n[![asciicast](https://asciinema.org/a/356685.svg)](https://asciinema.org/a/356685)\n\n## Features\n\n- Support for listing available versions of Go for installation\n- Support for listing installed versions of Go\n- Support for installing multiple versions of Go locally\n- Support for uninstalling installed versions of Go\n- Support for freely switching between installed versions of Go\n- Support for clearing package file cache\n- Support for self-updating software (\u003e= 1.5.0)\n- Support for clean uninstallation of the software (\u003e= 1.5.0)\n\n## Installation\n\n### Automated Installation\n\n- Linux/macOS (bash/zsh)\n\n  ```shell\n  # It is recommended to clear the `GOROOT`, `GOBIN`, and other environment variables before installation.\n  $ curl -sSL https://raw.githubusercontent.com/voidint/g/master/install.sh | bash\n  $ cat \u003c\u003c 'EOF' \u003e\u003e ~/.bashrc\n  # Check if the alias 'g' exists before trying to unalias it\n  if [[ -n $(alias g 2\u003e/dev/null) ]]; then\n      unalias g\n  fi\n  EOF\n  $ source \"$HOME/.g/env\"\n  ```\n\n- Windows (pwsh)\n\n  ```pwsh\n  $ iwr https://raw.githubusercontent.com/voidint/g/master/install.ps1 -useb | iex\n  ```\n\n### Manual Installation(for Linux/macOS)\n- Create a directory for `g` (recommended: `~/.g`)\n- Download the binary compressed file from [releases](https://github.com/voidint/g/releases) and unzip it into the `bin` subdirectory of the `g` directory (i.e. `~/.g/bin`).\n- Write necessary environment variables into `~/.g/env` file.\n\n  ```shell\n  $ cat \u003e~/.g/env \u003c\u003c'EOF'\n  #!/bin/sh\n  # g shell setup\n  export GOROOT=\"${HOME}/.g/go\"\n  [ -z \"$GOPATH\" ] \u0026\u0026 export GOPATH=\"${HOME}/go\"\n  export PATH=\"${HOME}/.g/bin:${GOROOT}/bin:${GOPATH}/bin:$PATH\"\n  export G_MIRROR=https://golang.google.cn/dl/\n  EOF\n  ```\n\n- Import `~/.g/env` into the shell environment configuration files (e.g. `~/.bashrc`, `~/.zshrc`...).\n\n  ```shell\n  $ cat \u003e\u003e~/.bashrc \u003c\u003c'EOF'\n  if [[ -n $(alias g 2\u003e/dev/null) ]]; then\n      unalias g\n  fi\n  [ -s \"${HOME}/.g/env\" ] \u0026\u0026 \\. \"${HOME}/.g/env\"  # g shell setup\n  EOF\n  ```\n\n- Enable environment variables.\n  ```shell\n  $ source ~/.bashrc # source ~/.zshrc\n  ```\n\n### Manual Installation (for Windows PowerShell)\n\n- Create a directory: `mkdir ~/.g/bin`\n- Download the binary compressed file for Windows version from [releases](https://github.com/voidint/g/releases), and after unzipping it, put it in the ~/.g/bin directory.\n- The default binary file name is `g.exe`, if you have already used `g` as an abbreviation for Git command, you can change `g.exe` to another name, such as `gvm.exe`.\n- Run the command `code $PROFILE`, this command will open the default PowerShell configuration file using VSCode.\n- Add the following content to the default PowerShell configuration file:\n\n  ```ps1\n  $env:GOROOT=\"$HOME\\.g\\go\"\n  $env:Path=-join(\"$HOME\\.g\\bin;\", \"$env:GOROOT\\bin;\", \"$env:Path\")\n  ```\n\n- Open the PowerShell terminal again, and you can use the `g` or `gvm` command.\n\n## Usage\n\nTo query the currently available stable versions of Go for installation:\n\n```shell\n$ g ls-remote stable\n  1.19.10\n  1.20.5\n```\n\nTo install a specific version of Go (e.g., 1.20.5):\n\n```shell\n$ g install 1.14.7\nDownloading 100% [===============] (92/92 MB, 12 MB/s)\nComputing checksum with SHA256\nChecksums matched\nNow using go1.20.5\n```\n\nTo query the list of installed Go versions:\n\n```shell\n$ g ls\n  1.19.10\n* 1.20.5\n```\n\nTo list all available Go versions for installation:\n\n```shell\n$ g ls-remote\n  1\n  1.2.2\n  1.3\n  1.3.1\n  ...\n  1.19.10\n  1.20rc1\n  1.20rc2\n  1.20rc3\n  1.20\n  1.20.1\n  1.20.2\n  1.20.3\n  1.20.4\n* 1.20.5\n```\n\nTo switch to another installed Go version:\n\n```shell\n$ g use 1.19.10\ngo version go1.19.10 darwin/arm64\n```\n\nTo uninstall a specific installed Go version:\n\n```shell\n$ g uninstall 1.19.10\nUninstalled go1.19.10\n```\n\nTo clear the package file cache for Go installations:\n\n```shell\n$ g clean\nRemove go1.18.10.darwin-arm64.tar.gz\nRemove go1.19.10.darwin-arm64.tar.gz\nRemove go1.20.5.darwin-arm64.tar.gz\n```\n\nTo view the version information of `g` itself:\n\n``` shell\ng version 1.5.0\nbuild: 2023-01-01T21:01:52+08:00\nbranch: master\ncommit: cec84a3f4f927adb05018731a6f60063fd2fa216\n```\n\nTo update `g` software itself:\n\n```shell\n$ g self update\nYou are up to date! g v1.5.0 is the latest version.\n```\n\nTo uninstall the `g` software itself:\n\n```shell\n$ g self uninstall\nAre you sure you want to uninstall g? (Y/n)\ny\nRemove /Users/voidint/.g/bin/g\nRemove /Users/voidint/.g\n```\n\n## FAQ\n\n\n\n- What is the purpose of the environment variable `G_MIRROR`?\n\n  Due to the restricted access to the Golang official website in mainland China, it has become difficult to query and download go versions. Therefore, the environment variable `G_MIRROR` can be used to specify one or multiple mirror sites (separated by commas) from which g will query and download available go versions. The known available mirror sites are as follows:\n\n  - Go official mirror site: https://golang.google.cn/dl/\n  - Alibaba Cloud: https://mirrors.aliyun.com/golang/\n  - Nanjing University: https://mirrors.nju.edu.cn/golang/\n  - Huazhong University of Science and Technology: https://mirrors.hust.edu.cn/golang/\n  - University of Science and Technology of China: https://mirrors.ustc.edu.cn/golang/\n\n- What URLs can be used as values for `G_MIRROR`?\n\n  `g` retrieves Go version information by parsing web pages and implements several version collectors for specific page structures. Currently supported collectors include:\n\n  - **Official Collector**: For Go official website. Any page with HTML structure identical to the Go official download page (e.g. `https://go.dev/dl/`) can use this collector. Example: `G_MIRROR=official|https://golang.google.cn/dl/`, where the part before `|` is the collector name and the part after is the target page URL.\n  - **FancyIndex Collector**: For pages rendered by Nginx FancyIndex module. Example: `G_MIRROR=fancyindex|https://mirrors.aliyun.com/golang/`.\n  - **AutoIndex Collector**: For pages rendered by Nginx AutoIndex module. Example: `G_MIRROR=autoindex|https://mirrors.ustc.edu.cn/golang/`.\n\n- What is the purpose of the environment variable `G_EXPERIMENTAL`?\n\n  When the value of this environment variable is set to true, it enables all experimental features.\n\n- What is the purpose of the environment variable `G_HOME`?\n\n  By convention, g uses the `~/.g` directory as its home directory. If you want to customize the home directory (especially for Windows users), you can use the G_HOME environment variable to switch to another directory. Since this feature is still experimental, it requires enabling the experimental feature switch `G_EXPERIMENTAL=true` to take effect. Please note that this solution is not perfect, which is why it is classified as an experimental feature. For more details, please refer to [#18](https://github.com/voidint/g/issues/18).\n\n- On macOS, when installing a go version, g throws an error message saying `[g] Installation package not found.` What is the reason?\n\n  The Go official support for ARM architecture on macOS was introduced in version [1.16](https://go.dev/doc/go1.16#darwin). Therefore, go installation packages of version 1.15 and earlier cannot be installed on ARM-based macOS systems. If you attempt to install these versions, g will throw an error message `[g] Installation package not found.`\n\n- Does g support network proxy?\n\n  Yes, it supports network proxy. You can set the network proxy address in environment variables such as `HTTP_PROXY`, `HTTPS_PROXY`, `http_proxy`, and `https_proxy`.\n\n- Which versions of Windows are supported?\n\n  Since g relies on symbolic links, the operating system must be Windows Vista or above.\n\n- Why doesn't g work after installing it on Windows?\n\n  This may be because the downloaded and installed files are not added to the `$Path`. You need to manually add `$Path` to the user's environment variables. For convenience, you can run the `path.ps1` PowerShell script provided in the project and then restart your computer.\n\n- After installing a go version using g, when running the `go version` command, the output shows a different version than the one installed. Is this a bug?\n\n  This is likely due to an incorrect setting of the `PATH` environment variable in the current shell environment (it is recommended to run `which go` to see the path of the go binary file). By default, the path to the go binary file should be `~/.g/go/bin/go`. If it is not this path, it means that the PATH environment variable is set incorrectly.\n\n- Does g support compiling and installing from source code?\n\n  No, it does not support compiling and installing from source code.\n\n## Acknowledgement\n\nThanks to tools like [nvm](https://github.com/nvm-sh/nvm), [n](https://github.com/tj/n), [rvm](https://github.com/rvm/rvm) for providing valuable ideas.\n","funding_links":[],"categories":["Go","Language-Specific Tools","语言资源库","Golang生态圈Dev\u0026Ops工具与服务","Version-Switch-Tools","Version Managers"],"sub_categories":["Go","go"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidint%2Fg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoidint%2Fg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidint%2Fg/lists"}