File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ func main() {
21
21
"5aa21c7ae54af10017dc93f8" , // 一个想法不一定对
22
22
}
23
23
24
- s1 := rand .NewSource (time .Now ().UnixNano ())
25
- r1 := rand .New (s1 )
26
- topicdIndex := r1 .Intn (len (topics ))
24
+ s := rand .NewSource (time .Now ().UnixNano ())
25
+ r := rand .New (s )
26
+ topicdIndex := r .Intn (len (topics ))
27
27
url := "https://app.jike.ruguoapp.com/1.0/squarePosts/list"
28
28
jsonStr := []byte (`{"topicId": "` + topics [topicdIndex ] + `", "limit": 20}` )
29
29
req , err := http .NewRequest ("POST" , url , bytes .NewBuffer (jsonStr ))
@@ -43,11 +43,8 @@ func main() {
43
43
panic (err )
44
44
}
45
45
46
- s2 := rand .NewSource (time .Now ().UnixNano ())
47
- r2 := rand .New (s2 )
48
-
49
46
contentData := dat ["data" ].([]interface {})
50
- contentIndex := r2 .Intn (len (contentData ))
47
+ contentIndex := r .Intn (len (contentData ))
51
48
content := contentData [contentIndex ].(map [string ]interface {})
52
49
fmt .Println (content ["content" ].(string ))
53
50
fmt .Println ("--" , (content ["topic" ].(map [string ]interface {})["content" ].(string )))
You can’t perform that action at this time.
0 commit comments