我正在运行 go1.6 并且在 GOPATH (/Users/bweidlich/Projects/go) 中运行“go build”时出现以下错误
main.go:6:2: cannot find package "github.com/spf13/viper" in any of:
/usr/local/go/src/github.com/spf13/viper (from $GOROOT)
/Users/bweidlich/Projects/go/src/github.com/spf13/viper (from $GOPATH)
项目结构:
bin/
glide.lock
glide.yaml
go.iml
logs/
main.go
pkg/
src/
vendor/
github.com/
deckarep/gosx-notifier
spf13/viper
gizak/termui
main.go
package main
import (
"fmt"
"github.com/gizak/termui" <--- doesn't resolve
"github.com/spf13/viper" <--- doesn't resolve
"log"
"bweidlich/dash"
"net/http"
"os"
"os/exec"
"time"
)