Skip to content

Commit

Permalink
Fix compilation option of Go
Browse files Browse the repository at this point in the history
  • Loading branch information
koba-e964 committed Aug 12, 2023
1 parent 774f7f3 commit dea2943
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .verify-helper/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@ compile = "bash -c 'echo hello > {tempdir}/hello'"
execute = "env AWKPATH={basedir} awk -f {path}"
bundle = "false"
list_dependencies = "sed 's/^@include \"\\(.*\\)\"$/\\1/ ; t ; d' {path}"

[languages.go]
# Because of Go modules, go run does not work outside a module.
# With -C option, go run changes directory and executes otherwise normally.
# We need to add the prefix ../../ because {path} is something like examples/go/helloworld.test.go
# and the argument is interpreted relative to ./examples/go.
# -C option is available in Go >=1.20.
execute = "go run -C ./examples/go ../../{path}"
6 changes: 3 additions & 3 deletions examples/go/helloworld.test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
package main

import (
"fmt"
"./helloworld"
"example-go/helloworld"
"fmt"
)

func main() {
fmt.Printf("%s\n", helloworld.GetHelloWorld())
fmt.Printf("%s\n", helloworld.GetHelloWorld())
}

0 comments on commit dea2943

Please sign in to comment.