質問編集履歴

3

内容にタイトルが合ってないので修正

2017/07/03 00:21

投稿

shi_ue
shi_ue

スコア4437

test CHANGED
@@ -1 +1 @@
1
- http.ResponseWriteのヘダーの変更
1
+ typeを返すメソ値を変更すると、なぜ親の値が変更されるのか?
test CHANGED
File without changes

2

ソースを修正

2017/07/03 00:20

投稿

shi_ue
shi_ue

スコア4437

test CHANGED
File without changes
test CHANGED
@@ -14,6 +14,20 @@
14
14
 
15
15
  ```go
16
16
 
17
+ package main
18
+
19
+
20
+
21
+ import (
22
+
23
+ "net/http"
24
+
25
+ "fmt"
26
+
27
+ )
28
+
29
+
30
+
17
31
  func main() {
18
32
 
19
33
  http.HandleFunc("/test.json",
@@ -24,9 +38,9 @@
24
38
 
25
39
  w.Header().Set("Content-type:","application/json; charset=utf-8")
26
40
 
27
- fmt.Fprintf(w, "{result: true}");
41
+ fmt.Fprintf(w, "{result: true}")
28
42
 
29
- }
43
+ },
30
44
 
31
45
  )
32
46
 

1

初心者マーク付けた

2017/07/02 08:03

投稿

shi_ue
shi_ue

スコア4437

test CHANGED
File without changes
test CHANGED
File without changes