Skip to content

Commit

Permalink
more changes to make docker tests work with go1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
quasilyte committed Oct 14, 2021
1 parent ca08729 commit 4b7bdbb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
12 changes: 6 additions & 6 deletions _test/install/binary_gopath/expected3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
/usr/local/go/src/encoding/json/stream.go:456:25: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/asn1/marshal_test.go:281:28: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/asn1/marshal_test.go:303:28: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/base32/base32_test.go:99:4: exprUnparen: the parentheses around p.encoded[len(p.encoded)-1] == '=' are superfluous (rules.go:21)
/usr/local/go/src/encoding/binary/binary_test.go:447:5: boolComparison: omit bool literal in expression (rules1.go:9)
/usr/local/go/src/encoding/binary/binary_test.go:450:5: boolComparison: omit bool literal in expression (rules1.go:9)
/usr/local/go/src/encoding/base32/base32_test.go:98:4: exprUnparen: the parentheses around p.encoded[len(p.encoded)-1] == '=' are superfluous (rules.go:21)
/usr/local/go/src/encoding/binary/binary_test.go:446:5: boolComparison: omit bool literal in expression (rules1.go:9)
/usr/local/go/src/encoding/binary/binary_test.go:449:5: boolComparison: omit bool literal in expression (rules1.go:9)
/usr/local/go/src/encoding/gob/codec_test.go:351:6: boolComparison: omit bool literal in expression (rules1.go:9)
/usr/local/go/src/encoding/gob/codec_test.go:1402:23: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/gob/codec_test.go:1415:23: interfaceAddr: taking address of interface-typed value (rules.go:27)
Expand All @@ -26,8 +26,8 @@
/usr/local/go/src/encoding/json/decode_test.go:2379:24: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/json/decode_test.go:2407:6: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/json/decode_test.go:2526:12: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/json/stream_test.go:189:25: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/json/stream_test.go:305:34: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/json/stream_test.go:419:22: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/json/stream_test.go:188:25: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/json/stream_test.go:304:34: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/json/stream_test.go:418:22: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/json/tagkey_test.go:105:22: interfaceAddr: taking address of interface-typed value (rules.go:27)
/usr/local/go/src/encoding/xml/marshal_test.go:391:9: interfaceAddr: taking address of interface-typed value (rules.go:27)
4 changes: 3 additions & 1 deletion _test/install/binary_gopath/test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ release=$1

apk update && apk add git

export GO111MODULE=off

cd /root

wget "https://github.com/quasilyte/go-ruleguard/releases/download/$release/ruleguard-linux-amd64.zip"
unzip ruleguard-linux-amd64.zip

go get -v -u github.com/quasilyte/go-ruleguard/dsl
go get -v -u github.com/quasilyte/ruleguard-rules-test
go get -v -u github.com/quasilyte/ruleguard-rules-test/...

./ruleguard -rules /root/rules.go /root/target.go &> actual.txt || true
diff -u actual.txt /root/expected.txt
Expand Down
12 changes: 6 additions & 6 deletions _test/install/binary_nogopath/expected3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
/usr/local/go/src/encoding/json/stream.go:456:25: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/asn1/marshal_test.go:281:28: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/asn1/marshal_test.go:303:28: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/base32/base32_test.go:99:4: exprUnparen: the parentheses around p.encoded[len(p.encoded)-1] == '=' are superfluous (rules.go:23)
/usr/local/go/src/encoding/binary/binary_test.go:447:5: boolComparison: omit bool literal in expression (rules1.go:9)
/usr/local/go/src/encoding/binary/binary_test.go:450:5: boolComparison: omit bool literal in expression (rules1.go:9)
/usr/local/go/src/encoding/base32/base32_test.go:98:4: exprUnparen: the parentheses around p.encoded[len(p.encoded)-1] == '=' are superfluous (rules.go:23)
/usr/local/go/src/encoding/binary/binary_test.go:446:5: boolComparison: omit bool literal in expression (rules1.go:9)
/usr/local/go/src/encoding/binary/binary_test.go:449:5: boolComparison: omit bool literal in expression (rules1.go:9)
/usr/local/go/src/encoding/gob/codec_test.go:351:6: boolComparison: omit bool literal in expression (rules1.go:9)
/usr/local/go/src/encoding/gob/codec_test.go:1402:23: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/gob/codec_test.go:1415:23: interfaceAddr: taking address of interface-typed value (rules.go:29)
Expand All @@ -26,8 +26,8 @@
/usr/local/go/src/encoding/json/decode_test.go:2379:24: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/json/decode_test.go:2407:6: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/json/decode_test.go:2526:12: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/json/stream_test.go:189:25: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/json/stream_test.go:305:34: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/json/stream_test.go:419:22: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/json/stream_test.go:188:25: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/json/stream_test.go:304:34: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/json/stream_test.go:418:22: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/json/tagkey_test.go:105:22: interfaceAddr: taking address of interface-typed value (rules.go:29)
/usr/local/go/src/encoding/xml/marshal_test.go:391:9: interfaceAddr: taking address of interface-typed value (rules.go:29)
6 changes: 3 additions & 3 deletions _test/install/binary_nogopath/test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ unzip ruleguard-linux-amd64.zip
go mod init test
go get -v -u github.com/quasilyte/go-ruleguard/dsl@master
go get -v -u github.com/quasilyte/ruleguard-rules-test@master
go get -v -u github.com/quasilyte/ruleguard-rules-test/sub2@master

./ruleguard -rules rules.go /root/target.go &> actual.txt || true
diff -u actual.txt /root/expected.txt

./ruleguard -e 'm.Match(`$f($*_, ($x), $*_)`)' /root/target.go &> actual.txt || true
diff -u actual.txt /root/expected2.txt

# TODO: make it work with `go mod vendor` properly.
unset GO111MODULE
export GO111MODULE=off
cd /usr/local/go
go get -v -u github.com/quasilyte/go-ruleguard/dsl
go get -v -u github.com/quasilyte/ruleguard-rules-test
go get -v -u github.com/quasilyte/ruleguard-rules-test/...
CGO_ENABLED=0 /root/test/ruleguard -rules /root/rules.go ./src/encoding/... &> actual.txt || true
diff -u actual.txt /root/expected3.txt

Expand Down

0 comments on commit 4b7bdbb

Please sign in to comment.