Skip to content

math.MaxUint32 overflows int on 32-bit platforms #449

@vidhut-singh

Description

@vidhut-singh

Description:

When attempting to build on a 32-bit platform or using a 32-bit cross-compilation target (e.g. GOARCH=386), the build fails with the following error:

../go/pkg/mod/github.com/infobloxopen/atlas-app-toolkit@v1.4.0/gateway/errors.go:212:14: constant 4294967295 overflows int32

This happens because math.MaxUint32 is an untyped constant with a value of 4294967295, which exceeds the maximum value representable by an int on 32-bit platforms (which is 2,147,483,647).

Steps to Reproduce:

GOARCH=386 go build ./...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions