Skip to content

Commit f7c4f18

Browse files
committed
Update golang example
1 parent 3e0b0f6 commit f7c4f18

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

test/func_samples/function.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
package main
22

3-
import "fmt"
3+
import (
4+
"encoding/json"
5+
"fmt"
6+
)
47

5-
// GET /test/result/go_test.json
68
func main() {
7-
fmt.Println("{\"hello\": \"world\"}")
9+
// GET /test/result/golang_string
10+
fmt.Println("Hello, Golang!")
11+
12+
// GET /test/result/golang.json
13+
greet := map[string]string{"hello": "golang"}
14+
j, _ := json.Marshal(greet)
15+
fmt.Println(string(j))
816
}

test/result/go_test.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)