Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get undefined: atomic.Bool

Tags:

go

I see below error while building the code.

+ go build -a -ldflags '-X main.vendorVersion=vpcBlockDriver- -extldflags "-static"' -o /go/bin/ibm-vpc-block-csi-driver ./cmd/
# k8s.io/component-base/metrics
vendor/k8s.io/component-base/metrics/registry.go:35:29: undefined: atomic.Bool
note: module requires Go 1.19

All I did was to update dependencies to 1.26.1

This is the code base - https://github.com/ambiknai/ibm-vpc-block-csi-driver/tree/1.26 My go version - go version go1.20 linux/amd64

like image 675
ambikanair Avatar asked Oct 31 '25 12:10

ambikanair


1 Answers

You need to upgrade your repo's Go version as it's still 1.18.

Changing it in this file and re-compiling would work as it looks like your dev environment already has 1.20

enter image description here

like image 136
Rafet Avatar answered Nov 02 '25 15:11

Rafet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!