{"id":26608138,"url":"https://github.com/mobydeck/getgo","last_synced_at":"2025-03-23T23:38:15.986Z","repository":{"id":282463626,"uuid":"948654087","full_name":"mobydeck/getgo","owner":"mobydeck","description":"A command-line tool for downloading, installing, and managing Go versions across multiple platforms.","archived":false,"fork":false,"pushed_at":"2025-03-14T19:24:00.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T20:23:12.735Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/mobydeck.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}},"created_at":"2025-03-14T18:02:14.000Z","updated_at":"2025-03-14T19:24:03.000Z","dependencies_parsed_at":"2025-03-14T20:23:14.594Z","dependency_job_id":"2668618c-341d-4a5e-bbc3-9c295049f68d","html_url":"https://github.com/mobydeck/getgo","commit_stats":null,"previous_names":["mobydeck/getgo"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobydeck%2Fgetgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobydeck%2Fgetgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobydeck%2Fgetgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobydeck%2Fgetgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mobydeck","download_url":"https://codeload.github.com/mobydeck/getgo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245186921,"owners_count":20574553,"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","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":[],"created_at":"2025-03-23T23:38:15.562Z","updated_at":"2025-03-23T23:38:15.980Z","avatar_url":"https://github.com/mobydeck.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getgo\n\nA command-line tool for downloading, installing, and managing Go versions across multiple platforms.\n\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n\n## Overview\n\n`getgo` simplifies the process of downloading and setting up Go environments on Linux, macOS, and Windows.\nIt allows you to:\n\n- Download any version of Go (including the latest)\n- Extract it to a specified location (install_path)\n- Set GOROOT to the versioned Go directory (install_path/go[version])\n- Automatically set up the necessary environment variables (optional)\n- Customize your GOPATH location\n- Create a `.envrc` file for use with direnv\n\n## Features\n\n- Cross-platform support (Linux, macOS, Windows)\n- Automatic detection of OS and architecture\n- Support for downloading the latest stable version\n- Home directory expansion in paths (`~` and `~/path`)\n- Progress bar with download status\n- Colored output for better readability\n- Proper extraction for both .tar.gz (Linux/macOS) and .zip (Windows) archives\n- **Optional environment variable setup** in shell configuration files\n- Customizable GOPATH location\n- Support for direnv via `.envrc` file generation\n\n## Installation\n\n### From Source\n\n1. Clone the repository\n\n2. Build the binary:\n   ```\n   go build -o getgo\n   ```\n\n3. Move the binary to a location in your PATH:\n   ```\n   # Linux/macOS\n   sudo mv getgo /usr/local/bin/\n\n   # Windows (run as Administrator)\n   move getgo.exe C:\\Windows\\System32\\\n   ```\n\n## Usage\n\n```\ngetgo [options] [version] [install_path]\n```\n\n### Examples\n\n- Install the latest Go version in the current directory:\n  ```\n  getgo\n  ```\n\n- Install the latest Go version in a specific directory:\n  ```\n  getgo latest ~/.go\n  # or \n  getgo - ~/.go\n  ```\n\n- Install a specific Go version in the current directory:\n  ```\n  getgo 1.23.1\n  ```\n\n- Install a specific Go version in a specific directory:\n  ```\n  getgo 1.23.1 /usr/local/go\n  ```\n\n- Install a specific Go version in your home directory:\n  ```\n  getgo 1.23.1 ~\n  ```\n\n- Install Go with a custom GOPATH:\n  ```\n  getgo --path ~/custom/gopath\n  # or using the shorthand\n  getgo -p ~/custom/gopath\n  ```\n\n- Install Go with automatic environment setup:\n  ```\n  getgo -u\n  # or\n  getgo --unattended\n  ```\n\n- Create a .envrc file for direnv:\n  ```\n  getgo --envrc .\n  # or specify a different path\n  getgo --envrc ~/project\n  ```\n\n### Options\n\n- `-h`, `--help`: Show usage information\n- `-u`, `--unattended`: Automatically set up environment variables (default: disabled)\n- `-p`, `--path PATH`: Set custom GOPATH (default is $HOME/go)\n- `--envrc PATH`: Create or update a .envrc file with Go environment variables at the specified path\n\n## Automatic Environment Setup\n\nBy default, `getgo` will not modify your environment variables. If you want to automatically set up the required\nenvironment variables, use the `-u` or `--unattended` flag:\n\n### On Linux/macOS\n\n- Detects your shell type (bash, zsh, fish)\n- Adds the necessary export statements to your shell configuration file (`.bashrc`, `.zshrc`, etc.)\n- Provides instructions on how to apply the changes to your current shell\n\n### On Windows\n\n- Uses PowerShell to set user-level environment variables\n- Updates your PATH to include Go binary directories\n- No manual configuration required\n\n## Using with direnv\n\nIf you prefer to use [direnv](https://direnv.net/) to manage your environment variables, you can use the `--envrc` flag\nto create or update a `.envrc` file:\n\n```\ngetgo --envrc .\n```\n\nThis will:\n- Create a new `.envrc` file if it doesn't exist\n- Append Go environment variables to an existing `.envrc` file if it doesn't already contain Go settings\n- Leave the file unchanged if it already contains Go environment variables\n\nThis behavior ensures that your existing direnv setup is preserved while adding the necessary Go environment variables.\n\nAfter the `.envrc` file is created or updated, you can use `direnv allow` to enable the environment variables.\n\n## Environment Variables\n\nThe following environment variables are set up by `getgo` when using the `-u` flag or `--envrc`:\n\n### Linux/macOS\n\n```\nexport GOROOT=/install_path/go[version]  # e.g., /home/user/.go/go1.23.1\nexport GOPATH=/path/to/custom/gopath     # Customizable with --path flag\nexport PATH=$PATH:$GOPATH/bin:$GOROOT/bin\n```\n\n### Windows\n\n```\nGOROOT=C:\\install_path\\go[version]       # e.g., C:\\Users\\user\\.go\\go1.23.1\nGOPATH=C:\\path\\to\\custom\\gopath          # Customizable with --path flag\nPATH=%PATH%;%GOPATH%\\bin;%GOROOT%\\bin\n```\n\n## How It Works\n\n1. Determines the appropriate Go version to download (latest or specified)\n2. Checks if the version already exists at the destination\n3. Downloads the appropriate archive for your OS and architecture\n4. Extracts the archive to the specified installation directory\n5. Sets up the directory structure with versioned Go installations (e.g., install_path/go1.23.1)\n6. Sets GOROOT to point to the versioned Go directory (install_path/go[version])\n7. Optionally configures environment variables in your shell configuration files (with `-u` flag)\n8. Optionally creates or updates a `.envrc` file for use with direnv (with `--envrc` flag), preserving existing content\n\n## License\n\nMIT License\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobydeck%2Fgetgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobydeck%2Fgetgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobydeck%2Fgetgo/lists"}