Skip to content

Commit

Permalink
GOCBC-1582: Don't pass math.MaxUint32 to fmt.Errorf
Browse files Browse the repository at this point in the history
Motivation
==========
Passing MaxUint32 as an int value to Errorf results in a compilation error in 32-bit systems

Change
======
Don't print math.MaxUint32 in search.convertUint64ToUnit32

Change-Id: Ib103b8975401f3c33db51a8421075bc61edaaf4e
Reviewed-on: https://review.couchbase.org/c/gocb/+/206658
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Charles Dixon <chvckd@gmail.com>
  • Loading branch information
DemetrisChr committed Mar 4, 2024
1 parent 803cc95 commit 02efb9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion search/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (i Internal) MapFacetsToPs(facets map[string]Facet) (map[string]*search_v1.
// value won't be truncated by uint32.
func convertUint64ToUnit32(in uint64) (uint32, error) {
if in > uint64(math.MaxUint32) {
return 0, fmt.Errorf("value: %d overflows uint32: %d", in, math.MaxUint32)
return 0, fmt.Errorf("value: %d overflows uint32", in)
}

return uint32(in), nil
Expand Down

0 comments on commit 02efb9b

Please sign in to comment.