Go: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
(Created page with "<syntaxhighlight lang="bash"> cat << EXE | sudo bash apt-get update;echo apt list -a --upgradable apt-get install -y golang-go EXE </syntaxhighlight> == References== {| |valign="top"| * [https://medium.com/hprog99/getting-started-with-go-installation-setup-and-your-first-hello-world-program-fbfe940afae7 Go » Getting Started] * [https://github.com/fission/examples/tree/master/go Go » K8s » Fission] * [https://go.dev/doc/install Go » Install] * [https://go.dev/ Go] |...")
 
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 3: Line 3:
apt-get update;echo
apt-get update;echo
apt list -a --upgradable
apt list -a --upgradable
apt-get install -y golang-go
apt-get install -y golang-1.23-go
update-alternatives --install /usr/local/bin/go go /usr/lib/go-1.23/bin/go 1983
update-alternatives --install /usr/local/bin/gofmt gofmt /usr/lib/go-1.23/bin/gofmt 1983
EXE
EXE
export GOPATH=/usr/lib/go-1.23
export PATH=$PATH:$GOPATH/bin
</syntaxhighlight>
==Playground==
{|
| colspan="2" |
<syntaxhighlight lang="bash">
mkdir -p /opt/${USER}/chorke/academia/var/playground/go
ls -lah  /opt/${USER}/chorke/academia/var/playground/go
ln -s    /opt/${USER}/chorke/academia/var/playground/go ${HOME}/Documents/go-playground
</syntaxhighlight>
| valign="top" |
<syntaxhighlight lang="bash">
ls -lah ${HOME}/Documents/go-playground/
cd      ${HOME}/Documents/go-playground/
nano main.go
</syntaxhighlight>
|-
| colspan="3" |
----
|-
| valign="top" |
<syntaxhighlight lang="bash">
sudo apt purge -y golang-go
apt info golang-1.23-go
apt search golang-go
</syntaxhighlight>
| valign="top" |
<syntaxhighlight lang="bash">
sudo update-alternatives --config go
update-alternatives --query gofmt
update-alternatives --query go
</syntaxhighlight>
| valign="top" |
<syntaxhighlight lang="bash">
go version $(which gofmt)
go version
which go
</syntaxhighlight>
</syntaxhighlight>
|-
| colspan="3" |
----
|-
| valign="top" |
| valign="top" |
| valign="top" |
|}


== References==
== References==
{|
{|
|valign="top"|
|valign="top"|
* [https://gist.github.com/ReSearchITEng/a7e9202131118a321b33afe2e2c663fc Go » Update Alternatives » Ubuntu]
* [https://gist.github.com/bench/a61a7d376ac49761b27a Go » Update Alternatives » Alpine]
* [https://medium.com/hprog99/getting-started-with-go-installation-setup-and-your-first-hello-world-program-fbfe940afae7 Go » Getting Started]
* [https://medium.com/hprog99/getting-started-with-go-installation-setup-and-your-first-hello-world-program-fbfe940afae7 Go » Getting Started]
* [https://github.com/fission/examples/tree/master/go Go » K8s » Fission]
* [https://github.com/fission/examples/tree/master/go Go » K8s » Fission]
* [https://go.dev/doc/install Go » Install]
* [https://go.dev/doc/install Go » Install]
* [https://go.dev/ Go]
* [https://go.dev/ Go]
|valign="top"|
|valign="top"|
|-
|colspan="3"|
----
|-
|valign="top"|
* [[Helm/PostgreSQL|Helm » PostgreSQL]]
* [[Helm/MariaDB|Helm » MariaDB]]
* [[Helm/Fission|Helm » Fission]]
* [[Helm/GitLab|Helm » GitLab]]
* [[Helm/MinIO|Helm » MinIO]]
* [[Helm/Keda|Helm » Keda]]
* [[Helm]]


|valign="top"|
|valign="top"|

Latest revision as of 17:09, 25 November 2024

cat << EXE | sudo bash
apt-get update;echo
apt list -a --upgradable
apt-get install -y golang-1.23-go
update-alternatives --install /usr/local/bin/go go /usr/lib/go-1.23/bin/go 1983
update-alternatives --install /usr/local/bin/gofmt gofmt /usr/lib/go-1.23/bin/gofmt 1983
EXE

export GOPATH=/usr/lib/go-1.23
export PATH=$PATH:$GOPATH/bin

Playground

mkdir -p /opt/${USER}/chorke/academia/var/playground/go
ls -lah  /opt/${USER}/chorke/academia/var/playground/go
ln -s    /opt/${USER}/chorke/academia/var/playground/go ${HOME}/Documents/go-playground
ls -lah ${HOME}/Documents/go-playground/
cd      ${HOME}/Documents/go-playground/
nano main.go

sudo apt purge -y golang-go
apt info golang-1.23-go
apt search golang-go
sudo update-alternatives --config go
update-alternatives --query gofmt
update-alternatives --query go
go version $(which gofmt)
go version
which go

References