My Go Woes

2 min read

Code
Image Credit Code An App


Tiffanys-MacBook-Pro:bin tiffanywhite$ cd ~
Tiffanys-MacBook-Pro:~ tiffanywhite$ export GOPATH=$GO/go
Tiffanys-MacBook-Pro:~ tiffanywhite$ export PATH=$PATH:$GOPATH/bin
Tiffanys-MacBook-Pro:~ tiffanywhite$ cd ~/Go/Projects/bin
Tiffanys-MacBook-Pro:bin tiffanywhite$ go install
can't load package: package .: no buildable Go source files in /Users/tiffanywhite/Go/Projects/bin
Tiffanys-MacBook-Pro:bin tiffanywhite$ go install
can't load package: package .: no buildable Go source files in /Users/tiffanywhite/Go/Projects/bin
Tiffanys-MacBook-Pro:bin tiffanywhite$ go install
can't load package: package .: no buildable Go source files in /Users/tiffanywhite/Go/Projects/bin
Tiffanys-MacBook-Pro:bin tiffanywhite$ GOPATH/greet
-bash: GOPATH/greet: No such file or directory
Tiffanys-MacBook-Pro:bin tiffanywhite$ mkdir $GOPATH/greet
mkdir: /go: No such file or directory
Tiffanys-MacBook-Pro:bin tiffanywhite$ cd ~
Tiffanys-MacBook-Pro:~ tiffanywhite$ GOPATH/greet
-bash: GOPATH/greet: No such file or directory
Tiffanys-MacBook-Pro:~ tiffanywhite$ mkdir $GOPATH/greet
mkdir: /go: No such file or directory
Tiffanys-MacBook-Pro:~ tiffanywhite$ mkdir -p $GOPATH/greet
mkdir: /go/greet: Permission denied
Tiffanys-MacBook-Pro:~ tiffanywhite$ sudo mkdir -p $GOPATH/greet
Password:
Tiffanys-MacBook-Pro:~ tiffanywhite$ go install
can't load package: package .: no buildable Go source files in /Users/tiffanywhite
Tiffanys-MacBook-Pro:~ tiffanywhite$ go install greet
can't load package: package greet: cannot find package "greet" in any of:
/usr/local/go/src/greet (from $GOROOT)
/go/src/greet (from $GOPATH)
Tiffanys-MacBook-Pro:~ tiffanywhite$ cd $GOPATH/greet
Tiffanys-MacBook-Pro:greet tiffanywhite$ go install
can't load package: package .: no buildable Go source files in /go/greet
Tiffanys-MacBook-Pro:greet tiffanywhite$

First of all, want to say a big sorry for being AWOL– been really sick and am still kinda sick but feeling much better today. I have a few posts for different blogs to catch up with but this and my non-trad Mac student blog are my favorites so you guys get the updates.

Anyway. Go. The horror, as you can see by my terminal code up above.

Code Newbie has this thing called Code Club where you can sit in a friendly environment and learn code with other interested parties. We were doing this cli.go Codegangsta repo on Github. Installing Go was painless– it was the language we were working with if you didn’t guess. Setting up the $GOPATH? Nightmare. Then after getting the $GOPATH and repo installed and set up we couldn’t figure out the rest of how to get the greet.go file to run. We ended the session with no Go files being run.

The guys in the Code Club were way ahead of me as far as their experience with development. But today I tried to get it working. To my frustration. Anyone have any guess?

CC BY-SA 4.0 My Go Woes by Tiffany White is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.