swaggest / swgui

Embedded Swagger UI for Go
https://pkg.go.dev/github.com/swaggest/swgui
Apache License 2.0
51 stars 8 forks source link

Issue compiling #18

Closed egandro closed 3 years ago

egandro commented 3 years ago
 $ go get github.com/swaggest/swgui/...
go: downloading golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2
go: downloading golang.org/x/text v0.3.2
# github.com/vearutop/statigz
/home/pi/.golib/pkg/mod/github.com/vearutop/statigz@v1.1.1/server.go:265:22: constant 9223372036854775807 overflows int

My GO version: $ go version go version go1.16.2 linux/arm

egandro commented 3 years ago

I sort of got it.

size is set to maxint64. It is a int32 variable - so this causes the overflow.

vearutop commented 3 years ago

Thank you for raising this issue, please try latest version v1.2.2 that should work properly.

egandro commented 3 years ago

Thank you!

egandro commented 3 years ago

Thank you for raising this issue, please try latest version v1.2.2 that should work properly.

Let me do an academic remark. It's 100% academic. We size_t of a file is afaik 64bit also on a 32bit Linux. So you might change the size to the coresponding type of the fstat() function.

I doubt that this will be ever a problem.