File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -103,9 +103,10 @@ func (r *Runner) Run() {
103103 //}
104104
105105 for t := 0 ; t < k ; t ++ {
106+ j := i
106107 task := func () {
107- log .Debugf (" %d %s %d" , t , urls [i - 1 ], i )
108- Start2 (urls [i - 1 ], hashmap ) // Start k goroutines
108+ log .Debugf ("Running Submit %d url is %s %d" , t , urls [j ], j )
109+ Start2 (urls [j ], hashmap ) // Start k goroutines
109110 wg .Done ()
110111 }
111112 if i == len (urls ) {
Original file line number Diff line number Diff line change @@ -37,15 +37,19 @@ func ReadFile(path string) (urls []string, err error) {
3737 if strings .TrimSpace (str ) == "" {
3838 continue
3939 }
40- // 如果str结尾存在\r\n,则去掉
41- if strings .HasSuffix (str , "\r " ) {
42- str = strings .TrimSuffix (str , "\r \n " )
43- }
4440 // 如果str结尾存在\n,则去掉
4541 if strings .HasSuffix (str , "\n " ) {
4642 str = strings .TrimSuffix (str , "\n " )
4743 }
48- log .Debugf ("The url is : " , str )
44+ // 如果str结尾存在\r,则去掉
45+ if strings .HasSuffix (str , "\r " ) {
46+ str = strings .TrimSuffix (str , "\r " )
47+ }
48+ //// 如果str结尾存在\r\n,则去掉
49+ //if strings.HasSuffix(str, "\r\n") {
50+ // str = strings.TrimSuffix(str, "\r\n")
51+ //}
52+ log .Debugf ("The url is : %s" , str )
4953 lins = append (lins , str )
5054 }
5155 return lins , nil
You can’t perform that action at this time.
0 commit comments