cloudflare / cfssl

CFSSL: Cloudflare's PKI and TLS toolkit

Home Page:https://cfssl.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined: strings.CutPrefix

Hanoboo opened this issue · comments

commented

When I executed the install command an error was returned, but my go version was greater than the required 1.18.

  • Installation command

    go install github.com/cloudflare/cfssl/cmd/...@latest

  • Error message

  # github.com/prometheus/common/model
  go/pkg/mod/github.com/prometheus/common@v0.48.0/model/metric.go:363:33: undefined: strings.CutPrefix
  note: module requires Go 1.20

anyone has answer for this issue? i did reinstall go 1.20 version

The problem when i try to build an image of my app to extract some metric and this happend in build binary step
image

So i think in your Dockerfile you need to change to golang image version:
37cbf756c82f6971303e
and you may need to change your system go version to >= 1.20
image
by doing:
Go to this link: https://go.dev/dl/
scroll down you will see:
image
click on that, scroll down to 1.20
image

  • cd Downloads
  • sudo tar -C /usr/local -xzf go1.20.linux-amd64.tar.gz
  • vim .zshrc
    -and add this line to .zshrc: - export PATH=$PATH:/usr/local/go/bin
    image
  • source .zshrc
  • go version
    ! After that you may need to restart vscode or computer so the vs can re detect the new go version
    image

and then i can build the image
image

you may dont need to change the go system version, only need to change 1 line in Dockerfile to 1.20