Mein erstes Go Programm

Hier nur in Kürze was zu tun war um ein erstes Go Programm zu starten:

vi ~/.bashrc

Eintragen:
export GOROOT=$HOME/go
export GOARCH=386
export GOOS=linux

Dann weiter:
. ~/.bashrc
hg clone -r release http://go.googlecode.com/hg/ $GOROOT
cd go
cd src
./all.bash
cd cmd/8g
vi hello.go
./8g hello.go
./8l hello.8
./8.out

hello, world

Es hat also tadellos geklappt! Danke Google, danke SuseLinux 11.1.

Der Inhalt von hello.go:

rainer@linux:~/go/src/cmd/8g> cat hello.go
package main

import "fmt"

func main() {
fmt.Printf("hello, world\n")
}

Bin gespannt, ob es bei Euch auch so reibungslos läuft!

#8

Falls stubs-32.h Probleme

Falls stubs-32.h Probleme macht...
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: Datei oder Verzeichnis nicht gefunden

Dann fehlt vermutlich die 32Bit Version der glibc-devel (glibs-devel-32bit).
Oder Du hast ein 64Bit System, dann muss GOARCH auf amd64 stehen.

#7

Falls hg nicht vorhanden ist,

Falls hg nicht vorhanden ist, muss man das Paket "mercurial" installieren!

Neueste Kommentare

Drupal Theme by proxiss GmbH, mini icons by brandspankingnew.