Showing posts with label bash. Show all posts
Showing posts with label bash. Show all posts

Friday, November 13, 2009

fatal error: can't find import: fmt?

If you have those problem - it means that you should define $GOROOT, $GOOS and $GOARCH variables. And if you are very lazy (as me :) ) you'l need a bash script to define vars and compile source code. So create new file, for expample "compile" and add to it


#!/bin/bash
export GOROOT=/home/your-name/hg
export GOOS=linux
export GOARCH=386
8g main.go
8l main.8
./8.out
read -p "Press [enter] to continue..."



If script doesn't work - cher path to the bash (for me it's /bin/bash), path to /hg and architecture. Also if you have 64-bit x86 system - you should write instead 8 write 6. If 32-bit x86, and more - 8.
And don't forget put execution rights ot this file.