Skip to main content

my first 'go' program

installing and running my first go program on an ubuntu system.

[ the version of linux I'm running ]
terry@terry-HP:/etc$ pwd
/etc
terry@terry-HP:/etc$ cat lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.04
DISTRIB_CODENAME=natty
DISTRIB_DESCRIPTION="Ubuntu 11.04"
terry@terry-HP:/etc$ 

[ a little bit more about my machine ]
terry@terry-HP:~/goProjects/helloWorld$ uname -a
Linux terry-HP 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:07:17 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
terry@terry-HP:~/goProjects/helloWorld$ 

where to go to for updates to installing 'go'
http://golang.org/doc/install.html

From Blogger Pictures

install the 'gcc' tool chain..
sudo apt-get install bison gawk gcc libc6-dev make

[ screenshot of 'gcc' install command ]
From Blogger Pictures

[ one more egregious screenshot of the 'gcc' tool chain installation ]
From Blogger Pictures

first test whether 'hg' is installed ( mercurial )

From Blogger Pictures


install the 'python' tool chain..
sudo apt-get install python-setuptools python-dev build-essential

[ a screenshot of the python tools being installed ]
From Blogger Pictures

now install the mercurial version control software
sudo easy_install mercurial

[ a screenshot of installing mercurial ]
From Blogger Pictures

[ another egregious screenshot of mercurial ]
From Blogger Pictures

now test whether the mercurial software was installed successfully


terry@terry-HP:/etc$ hg
Mercurial Distributed SCM

basic commands:

add add the specified files on the next commit
annotate show changeset information by line for each file
clone make a copy of an existing repository
commit commit the specified files or all outstanding changes
diff diff repository (or selected files)
export dump the header and diffs for one or more changesets
forget forget the specified files on the next commit
init create a new repository in the given directory
log show revision history of entire repository or files
merge merge working directory with another revision
pull pull changes from the specified source
push push changes to the specified destination
remove remove the specified files on the next commit
serve start stand-alone webserver
status show changed files in the working directory
summary summarize working directory state
update update working directory (or switch revisions)

use "hg help" for the full list of commands or "hg -v" for details
terry@terry-HP:/etc$

a screenshot of testing the hg, mercurial, install.

From Blogger Pictures

pull down from the mercurial software repository the 'go' compiler...
hg clone -u release https://go.googlecode.com/hg/ go

a screenshot of 'hg' pulling down the 'go' compiler source code
From Blogger Pictures

[ another egregious screenshot of 'hg' pulling down the 'go' compiler source code ]
From Blogger Pictures

where the go source code was deposited too..
From Blogger Pictures

compile the 'go' source code
cd go/src
./all.bash 

on the bash console typing the command to compile the 'go' compiler's source code..
From Blogger Pictures

[ a screenshot of the cpus' being pegged ]
From Blogger Pictures

[ a screenshot of 'go' after a successful install ]
From Blogger Pictures

writing my first 'go' program
package main

import "fmt"

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


[ a screenshot of the source code to my first 'go' program ]

From Blogger Pictures

[ another screenshot of the source code to my first 'go' program ]

From Blogger Pictures

need to setup my environment variables so that my 'go' compiler commands are on my 'path'..

vi .bashrc


entering the command to add the 'go' compiler to the linux environment path..

From Blogger Pictures

exporting the 'go' compiler to the 'path' environment variable..

From Blogger Pictures

[ updating the environment variables so that the 'path' variable reflects the 'go' export to the path environment variable ]

source .bashrc


screenshot of 'sourcing' the environment variable file..
From Blogger Pictures

[ compile, link, and run my first 'go' program ]
6g hello.go 
6l hello.6 
./6.out 


[ a screenshot of compiling and running my first 'go' program ]
From Blogger Pictures

Comments

Popular posts from this blog

clonezilla - creating a wifi ad-hoc hotspot and running a ssh server

Here are some notes on connecting to a wifi-hotspot from a running clonezilla
live-cd.

[ target machine to save a backup hard-disk clone/image ]
[ target machine is also running a wifi hotspot and an ssh server ]
Ubuntu 11.04 - Natty Narwhal

terry@terry-HP:~$ uname -a
Linux terry-HP 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:07:17 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
terry@terry-HP:~$

[ Creating an 'ad-hoc' wifi spot ]
Click the 'up down arrow' icon ( or what have you )


[ choose menu item to create a wifi ad-hoc hotspot ]

[ create the ad-hoc wifi hotspot ]

[ the eth1 connection is the created ad-hoc network with an essid of 'terry' ]

[ the ad-hoc wifi hotspot is now visible on the 'host' computer and other computer as well now ]

[ enter the following on the machine being cloned with clonezilla
[ at the appropriate place in the clonezilla backup image step ]
terry@terry-HP:~$ ip link set wlan0 down
terry@terry-HP:~$ iwconfig wlan0 mode ad-hoc
terry@…

Translators, maps, conduits, and containers

Interpreters
The Amiga had a hardware emulator which transformed instruction to instruction to a dedicated x86 hardware interpreter in the Amiga could run Microsoft DOS spreadsheet programs in the Amiga OS.

MS-DOS on Amiga via Sidecar or Bridgeboard[edit]
MS-DOS compatibility was a major issue during the early years of the Amiga's lifespan in order to promote the machine as a serious business machine. In order to run the MS-DOS operating system, Commodore released the Sidecar for the Amiga 1000, basically a 8088 board in a closed case that connected to the side of the Amiga. Clever programming (a library named Janus, after the two-faced Roman god of doorways) made it possible to run PC software in an Amiga window without use of emulation. At the introduction of the Sidecar the crowd was stunned to see the MS-DOS version of Microsoft Flight Simulator running at full speed in an Amiga window on the Workbench.

Later the Sidecar was implemented on an expansion card named "Bridgebo…

Use Gwenview to upload images to picasaweb.google.com

Use Gwenview to upload images to https://picasaweb.google.com/

install the following KDE4 plugins:

terry@narwhal:~/download$ sudo apt-get install kipi-plugins
From Linux Clicks...
the Gwenview application...

From Linux Clicks...