Coder Social home page Coder Social logo

canha / golang-tools-install-script Goto Github PK

View Code? Open in Web Editor NEW
527.0 527.0 138.0 103 KB

Simple Bash script to automate Go language tools single user installation or even removal.

License: Apache License 2.0

Shell 100.00%
bash fish-shell golang installer linux macos shell

golang-tools-install-script's People

Contributors

canha avatar carlosas avatar dialex avatar elimisteve avatar hamzaanis avatar iamcalledrob avatar imvexed avatar lfkeitel avatar majorthorn avatar mxrch avatar nepomuceno avatar puckzxz avatar re3turn avatar simp7 avatar unixabg avatar vhaidamaka avatar zelazna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

golang-tools-install-script's Issues

--remove $GOPATH

When removing the Go, shouldn't the script handle the $GOPATH and remove it automatically which would be $HOME/go because in the current script when we reinstall it asks to delete $GOPATH manually?

Problem when downloading from storage.googleapis.com

I love this script. I've been using it for years. But today (and some other times also) I get a 403 Forbidden error while tring to execute it on my Debian 11 VPS:

`yamn@debian:~/golang-tools-install-script-master$ bash goinstall.sh

Downloading go1.20.6.linux-amd64.tar.gz ...
--2023-11-09 10:45:18-- https://storage.googleapis.com/golang/go1.20.6.linux-amd64.tar.gz
Resolving storage.googleapis.com (storage.googleapis.com)... 2a00:1450:400e:80f::201b, 2a00:1450:400e:811::201b, 2a00:1450:400e:805::201b, ...
Connecting to storage.googleapis.com (storage.googleapis.com)|2a00:1450:400e:80f::201b|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2023-11-09 10:45:18 ERROR 403: Forbidden.`

Can you help?

SEC3

script doesn't parse mkdir properly

Line 58: mkdir -p "$HOME/go/{src,pkg,bin}"

This actually produces a folder at ~/go/ called "{src,pkg,bin}", not three separate folders.

I suggest changing the line to:

for folder in {src,pkg,bin};do mkdir -p ${folder};done

consider installing git as dependency for "go get"

$> curl -L https://git.io/vQhTU | bash
$> source /root/.bashr
$> go get -u github.com/cli/cli
go: missing Git command. See https://golang.org/s/gogetcmd
package github.com/cli/cli: exec: "git": executable file not found in $PATH

maybe a message would be enough tho

Syntax error if `profile` file doesn't have trailing newline

Hey thanks for putting this together. Wanted to let you know about a bug that exists when the profile file (e.g. .zshrc doesn't have a trailing newline. This script writes Go path variables to the end like so:

# GoLang
export GOROOT=/Users/user/.go
export PATH=$GOROOT/bin:$PATH
export GOPATH=/Users/user/go
export PATH=$GOPATH/bin:$PATH

Say there's no trailing newline in that file and the last line happens to be something like:

export NODE_OPTIONS="--max-old-space-size=16000"

That results in this script writing:

export NODE_OPTIONS="--max-old-space-size=16000"# GoLang
export GOROOT=/Users/user/.go
export PATH=$GOROOT/bin:$PATH
export GOPATH=/Users/user/go
export PATH=$GOPATH/bin:$PATH

Which will cause a bad option error for any node apps launching from the console. That likely affects other variables at the end as well.

Can't show go version

Hi ,canha
i run your script to setup go in my ubuntu machine . i'm just trying to check go version from konsole
but it showing command not found and how can i run my first program in go please help me regrading this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.