golang-module / carbon

A simple, semantic and developer-friendly golang package for time

Home Page:https://pkg.go.dev/github.com/golang-module/carbon/v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build for windows_386 (untyped int constant) overflows int

iTanken opened this issue · comments

Hello,

I encountered an issue with the following code:

github.com\golang-module\carbon\v2\calendar\lunar\lunar.go:161:31

golang version: 1.20.13

carbon version: 2.3.6

I expected to get:

exit status 0

But I actually get:

failed to build for windows_386: exit status 1: # github.com/golang-module/carbon/v2/calendar/lunar
vendor\github.com\golang-module\carbon\v2\calendar\lunar\lunar.go:161:31: -2206512000 (untyped int constant) overflows int

exit status 1

Thanks!

failed when install?

failed when install?

when building 32-bit programs

安装时没问题,交叉编译时出错吗?

The issue body's language is not English, translate it automatically, please use English next time. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


There is no problem during installation, but is there an error when cross-compiling?

安装时没问题,交叉编译时出错吗?

嗯,64 位编译运行没有问题,设置 GOARCH=386 编译 32 位程序的时候 lunar.go 第 161 行 int 溢出。

v2.3.5 在 32位环境下是编译运行正常的。

The issue body's language is not English, translate it automatically, please use English next time. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


There is no problem during installation. Is there an error during cross compilation?

Well, there is no problem in 64-bit compilation and operation. When setting GOARCH=386 to compile a 32-bit program, int overflows in line 161 of lunar.go.

v2.3.5 compiles and runs normally in a 32-bit environment.