Skip to content

Commit 9c63767

Browse files
authored
Merge pull request #417 from online-judge-tools/fix/verify-csharp-go
Update C# and Go
2 parents 4ee2172 + 7025a38 commit 9c63767

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

.github/workflows/verify.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ jobs:
3737
# required only if you want to verify C# script files
3838
- uses: actions/setup-dotnet@v3
3939
with:
40-
dotnet-version: '3.1.101'
40+
dotnet-version: '6.0.413'
4141
- name: Install dependencies (C#)
42-
run: dotnet tool install --global dotnet-script --version 1.4.0
42+
run: dotnet tool install --global dotnet-script --version 1.3.0
4343

4444
# required only if you want to verify Go code
4545
- name: Install dependencies (Go)
4646
uses: actions/setup-go@v4
47+
with:
48+
go-version: '1.20.7'
4749

4850
# required only if you want to verify Ruby code
4951
- name: Install dependencies (Ruby)

.verify-helper/config.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@ compile = "bash -c 'echo hello > {tempdir}/hello'"
33
execute = "env AWKPATH={basedir} awk -f {path}"
44
bundle = "false"
55
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}"

examples/go/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module example-go
2+
3+
go 1.20

examples/go/helloworld.test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
package main
44

55
import (
6-
"fmt"
7-
"./helloworld"
6+
"example-go/helloworld"
7+
"fmt"
88
)
99

1010
func main() {
11-
fmt.Printf("%s\n", helloworld.GetHelloWorld())
11+
fmt.Printf("%s\n", helloworld.GetHelloWorld())
1212
}

0 commit comments

Comments
 (0)