diff --git a/.travis.yml b/.travis.yml index d20e23e..61b9425 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,17 @@ language: go -dist: xenial -go: - - 1.12.x - - 1.13.x +arch: + - amd64 + - arm64 +dist: focal +go: 1.15.x script: - diff -u <(echo -n) <(gofmt -d *.go) - diff -u <(echo -n) <(golint $(go list -e ./...) | grep -v YAMLToJSON) - GO111MODULE=on go vet . - GO111MODULE=on go test -v -race ./... + - if [[ $TRAVIS_CPU_ARCH == "arm64" ]]; then + GOARCH=arm GOARM=7 GO111MODULE=on go test -v ./...; + fi - git diff --exit-code install: - GO111MODULE=off go get golang.org/x/lint/golint diff --git a/yaml_test.go b/yaml_test.go index 8572c73..814af2b 100644 --- a/yaml_test.go +++ b/yaml_test.go @@ -5,6 +5,7 @@ import ( "fmt" "math" "reflect" + "runtime" "sort" "strconv" "testing" @@ -22,6 +23,9 @@ type MarshalTest struct { } func TestMarshal(t *testing.T) { + if runtime.GOARCH == "arm" { + t.Skip("constant 9223372036854775807 overflows int") + } f32String := strconv.FormatFloat(math.MaxFloat32, 'g', -1, 32) s := MarshalTest{"a", math.MaxInt64, math.MaxFloat32} e := []byte(fmt.Sprintf("A: a\nB: %d\nC: %s\n", math.MaxInt64, f32String))