File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,11 @@ compile = "bash -c 'echo hello > {tempdir}/hello'"
3
3
execute = " env AWKPATH={basedir} awk -f {path}"
4
4
bundle = " false"
5
5
list_dependencies = " sed 's/^@include \"\\ (.*\\ )\" $/\\ 1/ ; t ; d' {path}"
6
+
7
+ [languages .go ]
8
+ # Because of Go modules, go run does not work outside a module.
9
+ # With -C option, go run changes directory and executes otherwise normally.
10
+ # We need to add the prefix ../../ because {path} is something like examples/go/helloworld.test.go
11
+ # and the argument is interpreted relative to ./examples/go.
12
+ # -C option is available in Go >=1.20.
13
+ execute = " go run -C ./examples/go ../../{path}"
Original file line number Diff line number Diff line change
1
+ module example-go
2
+
3
+ go 1.20
Original file line number Diff line number Diff line change 3
3
package main
4
4
5
5
import (
6
- "fmt "
7
- "./helloworld "
6
+ "example-go/helloworld "
7
+ "fmt "
8
8
)
9
9
10
10
func main () {
11
- fmt .Printf ("%s\n " , helloworld .GetHelloWorld ())
11
+ fmt .Printf ("%s\n " , helloworld .GetHelloWorld ())
12
12
}
You can’t perform that action at this time.
0 commit comments