Open yiGmMk opened 2 years ago
https://programnotes.cn/go-technique/index.html
go-repo code snippet 判断机器位数 1const intSize = 32 << (^uint(0) >> 63) 在64平台系统: 1. uint(0)在平台底层是0x0000000000000000 2. ^uint(0)在平台底层是0xFFFFFFFFFFFFFFFF 3. ^uint(0) >> 63 在底层平台是0x00
https://programnotes.cn/go-technique/index.html
go-repo code snippet 判断机器位数 1const intSize = 32 << (^uint(0) >> 63) 在64平台系统: 1. uint(0)在平台底层是0x0000000000000000 2. ^uint(0)在平台底层是0xFFFFFFFFFFFFFFFF 3. ^uint(0) >> 63 在底层平台是0x00