From dac9cf4218d1491f0c0796e4802e4fa834344893 Mon Sep 17 00:00:00 2001 From: Thomas Tendyck Date: Wed, 3 Apr 2024 15:17:46 +0200 Subject: [PATCH] allow building newer go module versions --- _ertgo | 2 +- ego/cmd/newer-go-ver-test/go.mod | 7 +++++++ ego/cmd/newer-go-ver-test/main.go | 7 +++++++ ego/cmd/newer-go-ver-test/testmod/go.mod | 3 +++ ego/cmd/newer-go-ver-test/testmod/testmod.go | 7 +++++++ src/integration_test.sh | 8 ++++++++ 6 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 ego/cmd/newer-go-ver-test/go.mod create mode 100644 ego/cmd/newer-go-ver-test/main.go create mode 100644 ego/cmd/newer-go-ver-test/testmod/go.mod create mode 100644 ego/cmd/newer-go-ver-test/testmod/testmod.go diff --git a/_ertgo b/_ertgo index 211aa31..446860f 160000 --- a/_ertgo +++ b/_ertgo @@ -1 +1 @@ -Subproject commit 211aa319e9c399e7ea0d59d9ade1386587ded4e9 +Subproject commit 446860fe00717d4e7e99759ba07338295c4994af diff --git a/ego/cmd/newer-go-ver-test/go.mod b/ego/cmd/newer-go-ver-test/go.mod new file mode 100644 index 0000000..8994947 --- /dev/null +++ b/ego/cmd/newer-go-ver-test/go.mod @@ -0,0 +1,7 @@ +module example.com/newer-go-ver-test + +go 1.99 + +replace example.com/testmod => ./testmod + +require example.com/testmod v0.0.0-00010101000000-000000000000 diff --git a/ego/cmd/newer-go-ver-test/main.go b/ego/cmd/newer-go-ver-test/main.go new file mode 100644 index 0000000..742c2e0 --- /dev/null +++ b/ego/cmd/newer-go-ver-test/main.go @@ -0,0 +1,7 @@ +package main + +import "example.com/testmod" + +func main() { + testmod.Hello() +} diff --git a/ego/cmd/newer-go-ver-test/testmod/go.mod b/ego/cmd/newer-go-ver-test/testmod/go.mod new file mode 100644 index 0000000..7b8bf8f --- /dev/null +++ b/ego/cmd/newer-go-ver-test/testmod/go.mod @@ -0,0 +1,3 @@ +module example.com/testmod + +go 1.98 diff --git a/ego/cmd/newer-go-ver-test/testmod/testmod.go b/ego/cmd/newer-go-ver-test/testmod/testmod.go new file mode 100644 index 0000000..7081dd2 --- /dev/null +++ b/ego/cmd/newer-go-ver-test/testmod/testmod.go @@ -0,0 +1,7 @@ +package testmod + +import "fmt" + +func Hello() { + fmt.Println("hello from testmod") +} diff --git a/src/integration_test.sh b/src/integration_test.sh index 6da186d..f5b49bf 100755 --- a/src/integration_test.sh +++ b/src/integration_test.sh @@ -98,3 +98,11 @@ run ego sign enclave2.json keyid2=$(ego run sealkeyid-test) echo 'test keyid1 = keyid2' test "$keyid1" = "$keyid2" + +# Test building module with newer go version +mkdir "$tPath/newer-go-ver-test" +cd "$egoPath/ego/cmd/newer-go-ver-test" +run ego-go build -o "$tPath/newer-go-ver-test" +cd "$tPath/newer-go-ver-test" +run ego sign newer-go-ver-test +run ego run newer-go-ver-test