I have always wanted to check out the Go language sooner but unfortunately enough couldn’t have a go… Today I googled if there are any debian packages for Google Go and luckily I found one… It’s of course not an official release from the Go team. Still it interested me. I downloaded the file and installed the package. Yeah, it works! This is the first time I am playing with Go, so no issues have been encountered. But the debian package requires me to overwrite some of the GCC files. Again, I am not a serious C/C++ programmer, so I don’t know if that has damaged my GCC to any extent.
Oh yeah, I forgot to mention I am on Ubuntu 9.04 🙂 I downloaded the package from this link: http://drop.io/gccgodeb/asset/gccgo-4-5-0-1-i386-deb
It’s nearly a 27 MB of download. I downloaded and double clicked to install it. The installation failed with some errors. So, I pointed back to the Original Source Page (Author’s Blog Post) of the package and re-read carefully. I had to use the command line to set “–force-overwrite” mode to the dpkg utility so that it could overwrite files at it’s discretion. Here’s the command:
|
sudo dpkg --force-overwrite -i gccgo_4.5.0-1_i386.deb |
Now, for quick demo, I downloaded the sample “Hello World!” source code from the official Go website at http://golang.org/ 🙂 (Hey, wasn’t it http://go-lang.org the last time I visited it? No way, both URL works now 😀 )
|
package main import "fmt" func main() { fmt.Printf("Hello, ??\n") } |
PS: I am sorry that my Syntax Highlighter doesn’t yet have the Go syntax highlighting patterns. Neither does my code editor! But still I used the code block, just out of a good practice! 😛
Then I compiled the source (after naming it masnun.go) with the following command:
It created the file a.out . I ran it from the command line again:
|
masnun@ubuntu:~/Desktop$ ./a.out Hello, ?? masnun@ubuntu:~/Desktop$ |
It was pretty easy in fact! I am going to play with Go at my leisure to check out what it has to provide the developers with… I love Python, let’s see if Go can give me anything more than Python 🙂
Thanks to Google, we have another programming language to do our bidding! Happy programming!