回答編集履歴

2

例の追加

2021/05/08 18:17

投稿

taC-h
taC-h

スコア289

test CHANGED
@@ -5,3 +5,35 @@
5
5
  https://teratail.com/questions/79709
6
6
 
7
7
  ポインタを渡せば良いです
8
+
9
+
10
+
11
+ ```go
12
+
13
+ import "fmt"
14
+
15
+ func a(fn func()){fn()}
16
+
17
+ func b(str *string){
18
+
19
+ *str = "hoge"
20
+
21
+ }
22
+
23
+ func main(){
24
+
25
+ str := ""
26
+
27
+ a(func(){
28
+
29
+ b(&str)
30
+
31
+ })
32
+
33
+ fmt.Println(str)
34
+
35
+ }
36
+
37
+
38
+
39
+ ```

1

書きかけのままの投稿を修正

2021/05/08 18:17

投稿

taC-h
taC-h

スコア289

test CHANGED
@@ -1,7 +1,7 @@
1
1
  クロージャを使うと良いと思います
2
2
 
3
- ```go
3
+ 詳しくはこちらをどうぞ
4
4
 
5
- func HandlerUserConfirm(w http.ResponseWriter, req *http.Request,)
5
+ https://teratail.com/questions/79709
6
6
 
7
- ```
7
+ ポインタを渡せば良いです