stefanmaric / g Goto Github PK
View Code? Open in Web Editor NEWSimple go version manager, gluten-free
License: MIT License
Simple go version manager, gluten-free
License: MIT License
Recently, when running g self-upgrade
I get the following error:
/home/[username]/go/bin/g: 748: /home/[username]/go/bin/g: tmp: parameter not set
Content of my .bashrc
:
[...]
export GOPATH="$HOME/go"; export GOROOT="$HOME/.go"; export PATH="$GOPATH/bin:$PATH"; # g-install: do NOT edit, see https://github.com/stefanmaric/g
Is there anything I can add to help debugging this?
Sorry, I opened a PR without reading the contributing guidelines.
I'm proposing to support using go env
as fallback for explicitly setting GOPATH
and GOROOT
. Go will read those values from a config file, e.g. ~/.config/go/env`, and thus setting them in the environment is not required.
Whenever I try installing any version of Go lower than 1.5, I get the following error:
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
I believe this is because the script tries downloading from https://dl.google.com/go/go1.4.darwin-amd64.tar.gz, but if you go to https://golang.org/dl/ , there are no such links that follow the format that the script expects. It seems as if they only started following that format with 1.5 and later.
g install latest
should fetch and install latest golang version (currently v1.13.5) using the following url: https://dl.google.com/go/go1.13.5.darwin-amd64.tar.gz
g install latest
attempts to fetch https://dl.google.com/go/go1.13.5.darwin-386.tar.gz which returns a 404 due to bad $arch
variable
Use uname -m
instead of uname -a
when setting $arch
.
g
is such a vague command name and there is no way to find out what the tool is, even when running g --help
. Please add the repo URL and possibly a description.
n let's you switch between the different versions you have installed by running n <version>
- it would be nice if there was a similar ability here. Or if there is already, how do you do so? There's g run <version>
but that does not seem to be persistent.
When installing this using a script it would be nice to be able to do the following:
wget -O g-install.sh https://git.io/g-install
sudo chmod ug+x g-install.sh
yes | ./g-install.sh
The yes
command prints out "y" to the input stream of the command it is piped to. This is to prevent having to manually type "y" whilst installing g and the latest version of Go.
The yes
command works with most other scripts, including the installer for n
(Node version manager).
Running any "g" command gives error:
ERROR: $GOPATH and $GOROOT environment variables are required.
But
#go env | grep "GOR|GOPA"
GOPATH="/home/kroning/go"
GOROOT="/usr/lib/go-1.18"
Ubuntu 22.04
It would be great to keep the usage of g
similar to n
. For example, n ls
lists all the available node versions, but the corresponding command in g
is g list-all
. Is there any reason why ?
I am unable to reach git.io. The download links may have to be changed
Would be great to have a formula for homebrew. I can contribute if interested.
Describe the bug
Can not install/download Go version below 1.16. i.e: 1.13 and 1.15
To Reproduce
Steps to reproduce the behavior:
g list-all
. Version 1.13 and 1.15 exist on the list.g install 1.13
Error output
selected: 1.13
ERROR: invalid version 1.13
Environment
Please give us more info about the system you're getting issues at by running the following commands (copy & paste into your terminal and hit ENTER) and replacing the content here with the output of your terminal:
echo Architecuture: arm64
echo Full uname: Darwin my-mac.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 arm64
echo Dollar-sign zero expansion: -zsh
echo SHELL: /bin/zsh
echo /etc/shells content:
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.
/bin/bash
/bin/csh
/bin/dash
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
echo go location: /Users/myusername/go/bin/go
go version go1.16 darwin/arm64
echo g location: /Users/myusername/go/bin/g
0.9.0
echo GOROOT: /Users/myusername/.go
echo GOPATH: /Users/myusername/go
Additional context
Add any other context about the problem here.
getting this error in fish shell
[~]$ command -v g
alias g=git
// Conflict with git plugin alias in zsh
Hi @stefanmaric, go to the masses, add brew! :)
brew install g
host git.io
Host git.io not found: 2(SERVFAIL)
Hey there,
you are listing various g alternatives but you are missing goenv
. Do you mind adding it?
Best
Describe the bug
ERROR: invalid version
To Reproduce
g install latest
Error output
ERROR: invalid version
Environment
Please give us more info about the system you're getting issues at by running the following commands (copy & paste into your terminal and hit ENTER) and replacing the content here with the output of your terminal:
echo Architecuture: x86_64
echo Full uname: Linux Cyshall-Desktop 5.15.79.1-microsoft-standard-WSL2 #1 SMP Wed Nov 23 01:01:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
echo Dollar-sign zero expansion: "/usr/bin/zsh"
echo SHELL: "/usr/bin/zsh"
echo /etc/shells content:
/bin/sh
/bin/bash
/usr/bin/bash
/bin/rbash
/usr/bin/rbash
/usr/bin/sh
/bin/dash
/usr/bin/dash
/usr/bin/tmux
/usr/bin/screen
/bin/zsh
/usr/bin/zsh
echo go location: go version go1.20 linux/amd64
echo g location: /root/.go/bin/g && 0.9.1
echo GOROOT: "/root/.g/goT"
echo GOPATH: "/root/.go"
**Additional context**
Add any other context about the problem here.
Even though README says that default values are:
GOROOT: $HOME/.go
GOPATH: $HOME/go
Upon g
installation, the GOPATH
variable in my config.fish
is set to $HOME/.go
, which then mess up everything, because upon installation of any version the g
binary is removed. Not sure if it is only Fish specific or affects also other shells.
When I have corrected manually this error, everything worked as expected.
To Reproduce
Steps to reproduce the behavior:
curl -sSL https://git.io/g-install | sh -s
g install 1.22.1
Error output
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Environment
Windows MSYS2 zsh
Additional context
Hi @stefanmaric thanks for this version manager.
Is it possible to provide a flag to the installer to specify the dotfile for shell.
I'm using the installer in an ansible role (https://galaxy.ansible.com/damianoneill/smg). Ansible uses a non-login shell over ssh, therefore for bash this will always select ~/.bashrc where ideally I want to update the dotfile for the login shell i.e. ~/.bash_profile.
Therefore if you could provide a way for me to overload the get_dotfile_for_shell response that would be fantastic.
Alternatively, if you have another suggestion that would be great.
Thanks,
Damian.
Thanks for the nice tool that support fish
! Yey!
Just small feedback on the naming of the tool. Single character naming is I think not very fortunate because it might collide with user's aliases or some other utilities. In this case, I have a conflict with git aliases (https://github.com/simnalamburt/cgitc) and I can imagine there will be quiet some people who might have same problem.
Do you know if simply renaming the installed binary will break things or not?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.