Go shell environment

1 view
Skip to first unread message

Barret Rhoden

unread,
Jul 15, 2015, 4:38:44 PM7/15/15
to aka...@googlegroups.com
Kevin -

What setup do you use for your shells regarding the Go variables like
GOOS? Do you have a bash function to toggle between linux and akaros
or something along those lines?

I'm in the market for updating my stuff, and figured I'd ask on the list
in case others are curious.

Kevin Klues

unread,
Jul 15, 2015, 5:25:57 PM7/15/15
to akaros
I have a .bash_akaros file in my home directory that I source in my
normal .bashrc with the following contents:

https://github.com/klueska/akaros-devel-docker/blob/master/docker/home/.bash_akaros

With these variables in place, you will always use the go-akaros
toolchain for any go development you do, but the toolchain works for
compiling both akaros and linux code, depending on your settings for
GOOS and GOARCH. I typically just export these manually for akaros
(GOOS=akaros, GOARCH=amd64) and then unset them if I want to build for
linux (which is rare, but I leave this as my default because I like to
explicitly set these variables myself). I could see a use case for
also setting the following bash functions though:

function go-akaros-toolchain() {
# sets the go command to work with the go-akaros toolchain
}
function go-system-toolchain() {
# sets the go command to work with the system installed toolchain
}
function go-akaros-export() {
# Export the GOOS and GOARCH variables for akaros
}
function go-system-export() {
# unset GOOS and GOARCH so the system defaults will be used
}

I can put these together relatively soon if it will help.

Kevin

--
~Kevin

Reply all
Reply to author
Forward
0 new messages