I am following instructions in https://golang.org/doc/code.html#Workspaces link and I build my first Go program.
So, I tried to make library with this instruction = https://golang.org/doc/code.html#Library
and everything is perfect until building hello.go, its gives me this error.
/hello.go:10:13: undefined: stringutil.Reverse
I've already rebuild my reverse.go.
Thats my code:
package main
import (
"fmt"
"github.com/d35k/stringutil"
)
func main() {
fmt.Printf(stringutil.Reverse("!oG ,olleH"))
}
that's my reverse.go (same as docs)
package stringutil
func reverse(s string) string {
r := []rune(s)
for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
r[i], r[j] = r[j], r[i]
}
return string(r)
}
and my gopath variable
export GOPATH=$HOME/GoLang
and my files ar in
GoLang/src/github.com/mygithubusername/