shunfei/cronsun

编译问题

Closed this issue · 4 comments

  1. go version go1.11.1 darwin/amd64
    master 分支

  2. macos Mojave 10.14 (18A391)

  3. 按照Getting started操作, 执行报错

export GO111MODULE=on
go get -u github.com/shunfei/cronsun

报错信息:

go: cannot find main module; see 'go help modules'

新开一个shell,这样试试:

go get -u github.com/shunfei/cronsun
export GO111MODULE=on
cd $GOPATH/src/github.com/shunfei/cronsun
go mod vendor
sh build.sh
# github.com/coreos/etcd/clientv3
goworkspace/src/github.com/coreos/etcd/clientv3/auth.go:116:72: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.AuthEnable
goworkspace/src/github.com/coreos/etcd/clientv3/auth.go:121:74: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.AuthDisable
goworkspace/src/github.com/coreos/etcd/clientv3/auth.go:126:100: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserAdd
goworkspace/src/github.com/coreos/etcd/clientv3/auth.go:131:86: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserDelete
goworkspace/src/github.com/coreos/etcd/clientv3/auth.go:136:122: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserChangePassword
goworkspace/src/github.com/coreos/etcd/clientv3/auth.go:141:104: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserGrantRole
goworkspace/src/github.com/coreos/etcd/clientv3/auth.go:146:80: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserGet
goworkspace/src/github.com/coreos/etcd/clientv3/auth.go:151:72: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserList
goworkspace/src/github.com/coreos/etcd/clientv3/auth.go:156:106: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.UserRevokeRole
goworkspace/src/github.com/coreos/etcd/clientv3/auth.go:161:80: cannot use auth.callOpts (type []"github.com/coreos/etcd/vendor/google.golang.org/grpc".CallOption) as type []"go.etcd.io/etcd/vendor/google.golang.org/grpc".CallOption in argument to auth.remote.RoleAdd
goworkspace/src/github.com/coreos/etcd/clientv3/auth.go:161:80: too many errors

执行go get -u github.com/shunfei/cronsun有报错

那就这样吧:

git clone https://github.com/shunfei/cronsun.git $GOPATH/src/github.com/shunfei/cronsun
cd $GOPATH/src/github.com/shunfei/cronsun
export GO111MODULE=on
go mod vendor
sh build.sh

看你上面的,应该代码已经clone下来的了,git clone 应该可以省掉

OK了