From 5c6d69a69cbc4961a5779a5cca9200b25eb33b80 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Sun, 14 Mar 2021 22:32:45 +0100 Subject: [PATCH] zfs: PropertySource: set type to uint32 so that `enumer`-generated code is platform-independent make zrepl-bin test-platform-bin vet lint GOOS=freebsd GOARCH=386 make[2]: Entering directory '/src' GO111MODULE=on go build -mod=readonly -ldflags "-X github.com/zrepl/zrepl/version.zreplVersion=v0.3.1-20-g07f2bff" -o "artifacts/zrepl-freebsd-386" zfs/propertysource_enumer.go:41:9: constant 18446744073709551615 overflows PropertySource zfs/propertysource_enumer.go:48:66: constant 18446744073709551615 overflows PropertySource zfs/propertysource_enumer.go:57:23: constant 18446744073709551615 overflows PropertySource fixes #429 --- zfs/propertysource_enumer.go | 6 +++--- zfs/zfs.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zfs/propertysource_enumer.go b/zfs/propertysource_enumer.go index 41db54f..4f93d76 100644 --- a/zfs/propertysource_enumer.go +++ b/zfs/propertysource_enumer.go @@ -38,14 +38,14 @@ func (i PropertySource) String() string { return _PropertySourceName_3 case i == 32: return _PropertySourceName_4 - case i == 18446744073709551615: + case i == 4294967295: return _PropertySourceName_5 default: return fmt.Sprintf("PropertySource(%d)", i) } } -var _PropertySourceValues = []PropertySource{1, 2, 4, 8, 16, 32, 18446744073709551615} +var _PropertySourceValues = []PropertySource{1, 2, 4, 8, 16, 32, 4294967295} var _PropertySourceNameToValueMap = map[string]PropertySource{ _PropertySourceName_0[0:5]: 1, @@ -54,7 +54,7 @@ var _PropertySourceNameToValueMap = map[string]PropertySource{ _PropertySourceName_2[0:4]: 8, _PropertySourceName_3[0:9]: 16, _PropertySourceName_4[0:8]: 32, - _PropertySourceName_5[0:3]: 18446744073709551615, + _PropertySourceName_5[0:3]: 4294967295, } // PropertySourceString retrieves an enum value from the enum constants string name. diff --git a/zfs/zfs.go b/zfs/zfs.go index c26bcd1..574f67a 100644 --- a/zfs/zfs.go +++ b/zfs/zfs.go @@ -1446,7 +1446,7 @@ func tryDatasetDoesNotExist(expectPath string, stderr []byte) *DatasetDoesNotExi } //go:generate enumer -type=PropertySource -trimprefix=Source -type PropertySource uint +type PropertySource uint32 const ( SourceLocal PropertySource = 1 << iota