LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 11-12-2009, 08:44 AM   #1
vital_101
Member
 
Registered: Jul 2005
Location: Mount Pleasant, Michigan
Distribution: Ubuntu Jaunty 9.04
Posts: 82

Rep: Reputation: Disabled
Setting Environment Variables for Google GoLang


Hey everyone,

I'm trying to get Google's new language "Go" working on my machine, but I'm having some trouble setting the environment variables.

Google asks you to set the following:
Quote:
$GOROOT
The root of the Go tree. Typically this is $HOME/go but it can be any directory.
$GOOS and $GOARCH
The name of the target operating system and compilation architecture. Choices for $GOOS are linux, darwin (Mac OS X 10.5 or 10.6), and nacl (Native Client, an incomplete port). Choices for $GOARCH are amd64 (64-bit x86, the most mature port), 386 (32-bit x86), and arm (32-bit ARM, an incomplete port). The valid combinations are linux/amd64, linux/arm, linux/386, darwin/amd64, darwin/386, and nacl/386.
$GOBIN (optional)
The location where binaries will be installed. If you set $GOBIN, you need to ensure that it is in your $PATH so that newly built Go-specific command such as the compiler can be found during the build. The default, $HOME/bin, may already be in your $PATH.

Note that $GOARCH and $GOOS identify the target environment, not the environment you are running on. In effect, you are always cross-compiling.
I edited my .bashrc to look like this at the end:
Code:
export $GOROOT=$HOME/go/
export $GOOS=linux
export $GOARCH=386
Am I doing something wrong? Because no matter what I try it doesn't seem to work. I don't have much experience with environment variables, but it seems fairly straight forward.

Thanks!
 
Old 11-12-2009, 09:00 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You shouldn't have $ signs on the left hand side of the equals sign. $VAR means to get the contents of variable VAR. So, you should have, e.g.

export GOROOT=$HOME/go
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up environment variables amita0204 Linux - Newbie 1 12-23-2008 04:17 PM
Setting and getting environment variables??? Sulman Shah Fedora 2 12-13-2006 06:33 PM
Environment variables setting... simjii SUSE / openSUSE 4 11-19-2005 07:50 PM
Setting Environment Variables farzan Linux - Newbie 2 08-07-2004 09:13 AM
setting environment variables rezza Linux - Distributions 2 04-09-2003 08:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 01:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration