spf13 / spf13/cast

cast string to uint64 and uint32 failed on arm32

Open
#217 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
4k
Forks
337
Avg merge
15m
Merged PRs (30d)
1

Description

cast max uint32 string to uint32:
cast.ToUint32E("4294967295") returns 0 and err: unable to cast "4294967295" of type string to uint32

cast max uint64 string to uint64:
cast.ToUint64E("18446744073709551615") returns 0 and err: unable to cast "18446744073709551615" of type string to uint64

The cases above work fine in v1.4.1.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two cast.ToUint32E and cast.ToUint64E calls on arm32, then compare their behavior with v1.4.1. Trace the string-to-integer conversion path and verify that both maximum unsigned values cast successfully without an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.