1

I tried running go get -u github.com/fxamacker/cbor/v2, but I get this error:

package github.com/fxamacker/cbor/v2: cannot find package "github.com/fxamacker/cbor/v2" in any of:
    /usr/local/go/src/github.com/fxamacker/cbor/v2 (from $GOROOT)
    /go/src/github.com/fxamacker/cbor/v2 (from $GOPATH)

I get the same error when I run without the -u flag.

I am using Go 1.10 because one of the requirements for my project is that it supports Windows Vista, and Go 1.10 is the latest version of Go that will build for Vista (source).

Here is a Dockerfile to reproduce this:

FROM golang:1.10.8-alpine@sha256:549535d72baf28b3d1470ef9fcc6d4e0cb52c7fc3012655a659b65eaf942ec63 as builder

RUN apk add --no-cache git

ENV GOOS=windows

ARG GOARCH

RUN go get -u github.com/fxamacker/cbor/v2

You can reproduce with the issue with the following command:

docker build -t test --build-arg GOARCH=386 .

This project is still available: https://pkg.go.dev/github.com/fxamacker/cbor/v2

Why does my go get fail?

I looked at the go.mod for the package. It requires a minimum go of 1.12 on master. Could this be why the go get fails?

Shane Bishop
  • 3,905
  • 4
  • 17
  • 47
  • 1
    Yes, it is still available: https://pkg.go.dev/github.com/fxamacker/cbor/v2. Please update to a supported version of Go. – JimB May 05 '22 at 16:17
  • I am using Go 1.10 because one of the requirements for my project is that it supports Windows Vista, and Go 1.10 is the latest version of Go that will build for Vista. – Shane Bishop May 05 '22 at 16:23
  • Most go packages only support modules, which were introduced in go1.11 many years ago. v2 of that package was released for go1.12 using modules in 2020. – JimB May 05 '22 at 16:28
  • I assume then that I could do something like `go get github.com/fxamacker/cbor@` and that might work, assuming the version is one old enough to support Go 1.10? – Shane Bishop May 05 '22 at 16:37
  • Using `@` to specify the version in `go get` also doesn't work, presumably because Go 1.10 doesn't support that. – Shane Bishop May 05 '22 at 16:41
  • You can always manually clone a repo into GOPATH or `vendor/`, but seeing how that project didn't exist before modules, you may run into other problems with dependencies. – JimB May 05 '22 at 17:08
  • Did you try to build a program using a more recent version or go and try to run it on Vista? Or you MUST develop it on Vista? – Tiago Peczenyj May 05 '22 at 20:18
  • Windows Vista End Of Life was over 5 years ago (https://learn.microsoft.com/en-us/lifecycle/products/windows-vista ) these kinds of problems should be expected when running out dated operating systems. – erik258 May 06 '22 at 16:46

0 Answers0