Failed to create freegeoip in Golang

Not familiar with Go, but I'm trying to set up freegeoip and keep getting this error when I try to build it:

go get github.com/fiorix/freegeoip
cd ~/go/src/github.com/fiorix/freegeoip
go build

../../oschwald/maxminddb-golang/decoder.go:4:2: import "bytes": cannot find package
db.go:8:2: import "compress/gzip": cannot find package
../../oschwald/maxminddb-golang/decoder.go:5:2: import "encoding/binary": cannot find package
encoder.go:8:2: import "encoding/csv": cannot find package
../../robertkrimen/otto/script.go:5:2: import "encoding/gob": cannot find package
../../robertkrimen/otto/builtin.go:4:2: import "encoding/hex": cannot find package
encoder.go:9:2: import "encoding/json": cannot find package
encoder.go:10:2: import "encoding/xml": cannot find package
db.go:9:2: import "errors": cannot find package
db.go:10:2: import "fmt": cannot find package
../../robertkrimen/otto/dbg/dbg.go:62:2: import "io": cannot find package
../../robertkrimen/otto/parser/parser.go:40:2: import "io/ioutil": cannot find package
../../robertkrimen/otto/dbg/dbg.go:63:2: import "log": cannot find package
../../robertkrimen/otto/builtin.go:5:2: import "math": cannot find package
../../oschwald/maxminddb-golang/decoder.go:7:2: import "math/big": cannot find package
../../robertkrimen/otto/builtin_math.go:5:2: import "math/rand": cannot find package
../../oschwald/maxminddb-golang/reader.go:7:2: import "net": cannot find package
db.go:14:2: import "net/http": cannot find package
../../robertkrimen/otto/builtin.go:6:2: import "net/url": cannot find package
../../howeyc/fsnotify/fsnotify_linux.go:12:2: import "os": cannot find package
db.go:16:2: import "path/filepath": cannot find package
../../oschwald/maxminddb-golang/decoder.go:8:2: import "reflect": cannot find package
../../robertkrimen/otto/dbg/dbg.go:65:2: import "regexp": cannot find package
package github.com/fiorix/freegeoip
    imports runtime: import "runtime": cannot find package
../../robertkrimen/otto/parser/error.go:5:2: import "sort": cannot find package
../../robertkrimen/otto/token/token.go:5:2: import "strconv": cannot find package
../../howeyc/fsnotify/fsnotify_linux.go:13:2: import "strings": cannot find package
../../howeyc/fsnotify/fsnotify_linux.go:14:2: import "sync": cannot find package
../../howeyc/fsnotify/fsnotify_linux.go:15:2: import "syscall": cannot find package
../../robertkrimen/otto/builtin_date.go:5:2: import "time": cannot find package
../../robertkrimen/otto/dbg/dbg.go:68:2: import "unicode": cannot find package
../../robertkrimen/otto/builtin.go:10:2: import "unicode/utf16": cannot find package
../../robertkrimen/otto/parser/lexer.go:11:2: import "unicode/utf8": cannot find package
../../howeyc/fsnotify/fsnotify_linux.go:16:2: import "unsafe": cannot find package

      

EDIT: My GOPATH & GOROOT are:

GOROOT=/usr/local/go
GOPATH=$HOME/go

      

+3


source to share





All Articles