gocql软件包golang在同一安装中的两个文件版本

getting this error when trying to run a go file (which should run)

clusterCfg.ConnectTimeout undefined (type *gocql.ClusterConfig has no field 
or method ConnectTimeout)
  1. When I look at the documentation of go 1.7 I find that ClusterConfig does have a field ConnectTimeout. (go version = 1.7).
  2. If I go to the github.com directory in my go path I find a directory gocql. In this directory I find a file cluster.go which contains a definition for a struct ClusterConfig which does not have ConnectTimeout only a field Timeout.

go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/developer/gocode"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-
map=/tmp/go-build098468995=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

    {
        "Dir": "/home/developer/gocode/src/github.com/gocql/gocql",
        "ImportPath": "github.com/gocql/gocql",
        "Name": "gocql",
        "Doc": "Package gocql implements a fast and robust Cassandra driver 
         for the Go programming language.",
        "Target": 
        "/home/developer/gocode/pkg/linux_amd64/github.com/gocql/gocql.a",
        "Root": "/home/developer/gocode",
        "GoFiles": [
            "address_translators.go",
            "cluster.go",
            "compressor.go",
            "conn.go",
            "connectionpool.go",
            "control.go",
            "debug_off.go",
            "doc.go",
            "errors.go",
            "events.go",
            "filters.go",
            "frame.go",
            "helpers.go",
            "host_source.go",
            "marshal.go",
            "metadata.go",
            "policies.go",
            "prepared_cache.go",
            "query_executor.go",
            "ring.go",
            "session.go",
            "token.go",
            "topology.go",
            "uuid.go"
        ],
        "IgnoredGoFiles": [
            "batch_test.go",
            "cass1batch_test.go",
            "cassandra_test.go",
            "compressor_test.go",
            "conn_test.go",
            "debug_on.go",
            "errors_test.go",
            "events_ccm_test.go",
            "fuzz.go",
            "marshal_test.go",
            "session_test.go",
            "stress_test.go",
            "topology_test.go",
            "tuple_test.go",
            "udt_test.go",
            "uuid_test.go",
            "wiki_test.go"
        ],
        "Imports": [
            "bufio",
            "bytes",
            "crypto/md5",
            "crypto/rand",
            "crypto/tls",
            "crypto/x509",
            "encoding/binary",
            "encoding/hex",
            "encoding/json",
            "errors",
            "fmt",
            "github.com/gocql/gocql/internal/lru",
            "github.com/gocql/gocql/internal/murmur",
            "github.com/gocql/gocql/internal/streams",
            "github.com/golang/snappy",
            "github.com/hailocab/go-hostpool",
            "golang.org/x/net/context",
            "gopkg.in/inf.v0",
            "io",
            "io/ioutil",
            "log",
            "math",
            "math/big",
            "math/rand",
            "net",
            "reflect",
            "regexp",
            "runtime",
            "sort",
            "strconv",
            "strings",
            "sync",
            "sync/atomic",
            "time",
            "unicode"
        ],
        "Deps": [
            "bufio",
            "bytes",
            "container/list",
            "context",
            "crypto",
            "crypto/aes",
            "crypto/cipher",
            "crypto/des",
            "crypto/dsa",
            "crypto/ecdsa",
            "crypto/elliptic",
            "crypto/hmac",
            "crypto/md5",
            "crypto/rand",
            "crypto/rc4",
            "crypto/rsa",
            "crypto/sha1",
            "crypto/sha256",
            "crypto/sha512",
            "crypto/subtle",
            "crypto/tls",
            "crypto/x509",
            "crypto/x509/pkix",
            "encoding",
            "encoding/asn1",
            "encoding/base64",
            "encoding/binary",
            "encoding/hex",
            "encoding/json",
            "encoding/pem",
            "errors",
            "fmt",
            "github.com/gocql/gocql/internal/lru",
            "github.com/gocql/gocql/internal/murmur",
            "github.com/gocql/gocql/internal/streams",
            "github.com/golang/snappy",
            "github.com/hailocab/go-hostpool",
            "golang.org/x/net/context",
            "gopkg.in/inf.v0",
            "hash",
            "hash/crc32",
            "internal/nettrace",
            "internal/race",
            "internal/singleflight",
            "internal/syscall/unix",
            "io",
            "io/ioutil",
            "log",
            "math",
            "math/big",
            "math/rand",
            "net",
            "os",
            "path/filepath",
            "reflect",
            "regexp",
            "regexp/syntax",
            "runtime",
            "runtime/cgo",
            "runtime/internal/atomic",
            "runtime/internal/sys",
            "sort",
            "strconv",
            "strings",
            "sync",
            "sync/atomic",
            "syscall",
            "time",
            "unicode",
            "unicode/utf16",
            "unicode/utf8",
            "unsafe"
        ],
        "TestGoFiles": [
            "address_translators_test.go",
            "cluster_test.go",
            "common_test.go",
            "control_test.go",
            "events_test.go",
            "filters_test.go",
            "frame_test.go",
            "framer_bench_test.go",
            "host_source_test.go",
            "metadata_test.go",
            "policies_test.go",
            "ring_test.go",
            "session_connect_test.go",
            "token_test.go"
        ],
        "TestImports": [
            "bytes",
            "compress/gzip",
            "flag",
            "fmt",
            "github.com/hailocab/go-hostpool",
            "golang.org/x/net/context",
            "io/ioutil",
            "log",
            "math/big",
            "net",
            "os",
            "sort",
            "strconv",
            "strings",
            "sync",
            "testing",
            "time"
        ]
    }

What have I done wrong? How can I have 2 versions of the same file? How do I fix it?

doushijiao0679
doushijiao0679 赞赏该编辑的目的是达到什么目的,但是会首选并回答。
大约 3 年之前 回复
dongningce9075
dongningce9075 在其中一个应用程序空间中运行grep-R供应商会报告该单词的许多实例,但没有明显的目录
大约 3 年之前 回复
ds2128629
ds2128629 在调用时,cqlsh显示:[cqlsh5.0.1|卡桑德拉2.2.3|CQL规范3.3.1|本机协议v4]
大约 3 年之前 回复
doujianjian2060
doujianjian2060 编辑以回答captncraig问题
大约 3 年之前 回复
dongxiequ3724
dongxiequ3724 阿德里安(Adrian),我如何找到该包的版本?
大约 3 年之前 回复
doutenglou6588
doutenglou6588 在github.com上方,没有一个叫做“供应商”的东西,它是一个包含多个项目(应用程序)的Workspace目录。没有同事可以看到此错误。
大约 3 年之前 回复
doujiao0110
doujiao0110 列表-jsongithub.com/gocql/gocql显示了什么?
大约 3 年之前 回复
dshnx48866
dshnx48866 您是什么意思?“当我查看go1.7的文档时,我发现ClusterConfig确实有一个ConnectTimeout字段。”?gocql不是stdlib的一部分,因此它不应出现在任何版本的Go的文档中,并且库的版本与Go的版本无关。
大约 3 年之前 回复
dongxingguo1978
dongxingguo1978 在主应用程序目录中是否有供应商目录?
大约 3 年之前 回复

1个回答



这不是答案,而是解决方案。 而不是继续尝试挽救虚拟机,我只是得到了另一个映像,然后从那里继续。</ p>
</ div>

展开原文

原文

It is not an answer, but is a solution. Rather than continue trying to salvage the vm I merely got another image and proceeded from there.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐