Skip to content

Commit 2166282

Browse files
authored
Build arm + arm64 binaries for linux and windows (#790)
* Build arm + arm64 binaries for linux and windows * Type MaxInt64 to avoid overflow on 32 bits arch On a 32 bits arch, math.MaxIn64 is interpreted as an int, and therefore overflows. This causes compilation to build on those platforms.
1 parent 322e0b1 commit 2166282

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.goreleaser.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ builds:
1616
mod_timestamp: '{{ .CommitTimestamp }}'
1717
targets:
1818
- linux_amd64
19+
- linux_arm64
20+
- linux_arm
1921
- windows_amd64
22+
- windows_arm64
23+
- windows_arm
2024
- darwin_amd64
2125
- darwin_arm64
2226
- id: tomljson
@@ -31,7 +35,11 @@ builds:
3135
mod_timestamp: '{{ .CommitTimestamp }}'
3236
targets:
3337
- linux_amd64
38+
- linux_arm64
39+
- linux_arm
3440
- windows_amd64
41+
- windows_arm64
42+
- windows_arm
3543
- darwin_amd64
3644
- darwin_arm64
3745
- id: jsontoml
@@ -46,7 +54,11 @@ builds:
4654
mod_timestamp: '{{ .CommitTimestamp }}'
4755
targets:
4856
- linux_amd64
57+
- linux_arm64
58+
- linux_arm
4959
- windows_amd64
60+
- windows_arm64
61+
- windows_arm
5062
- darwin_amd64
5163
- darwin_arm64
5264
universal_binaries:

marshaler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func (enc *Encoder) encode(b []byte, ctx encoderCtx, v reflect.Value) ([]byte, e
312312
case reflect.Uint64, reflect.Uint32, reflect.Uint16, reflect.Uint8, reflect.Uint:
313313
x := v.Uint()
314314
if x > uint64(math.MaxInt64) {
315-
return nil, fmt.Errorf("toml: not encoding uint (%d) greater than max int64 (%d)", x, math.MaxInt64)
315+
return nil, fmt.Errorf("toml: not encoding uint (%d) greater than max int64 (%d)", x, int64(math.MaxInt64))
316316
}
317317
b = strconv.AppendUint(b, x, 10)
318318
case reflect.Int64, reflect.Int32, reflect.Int16, reflect.Int8, reflect.Int:

0 commit comments

Comments
 (0)