klauspost / cpuid

CPU feature identification for Go
MIT License
1.01k stars 125 forks source link

How to detect the cpu architecture (arm64 vs amd64 vs arm) #145

Closed hellt closed 1 week ago

hellt commented 1 week ago

Hi @klauspost What would you say should be the method to detect if the cpu architecture is one of amd64 or arm64?

klauspost commented 1 week ago

Honestly, I would just use runtime.GOARCH which is a constant anyway, so resolvable at compile time.