Inhaltsverzeichnis:

golang - install / hello world

2023-09-28 / 2024-06-04

Notizen um golang unter Linux zu programmieren

Install

Aktuelle Verison von GO runterladen https://go.dev/dl/

sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go*.linux-amd64.tar.gz

"debian"
nano .profile

"manjaro"
nano .bashrc
nano .zshrc

#Zeile unten anfügen
export PATH=$PATH:/usr/local/go/bin

Installierte Version abfragen

go version

Links

https://go.dev/
https://gobyexample.com/
https://go.dev/doc/tutorial/
https://www.youtube.com/watch?v=yyUHQIec83I
https://www.youtube.com/watch?v=eqSjKOPt7dg

hello world

mkdir  ~/m~/m~go && cd  ~/m~/m~go
go mod init r4g9.l11/svn/m~/m~go

nano ~/m~/m~go/hello.go
package main

import "fmt"

func main() {
	fmt.Println("hello world")
}

go run hello.go
go build hello.go