Golang multithreaded brush code implementation
- 2020-06-03 06:53:44
- OfStack
Golang multithreaded brush code implementation
Write swipe directly in Go.
package main
import (
"fmt"
"net/http"
)
func vote(a chan int) {
for i := 0; i <= 1000; i++ {
http.Get("http://survey.news.ifeng.com/accumulator_ext.php?callback=jQuery1820030119983945041895_1490671752116&key=customLiveaway_support_552&format=js&_=1490671777810")
}
a <- 0
}
func main() {
a := make(chan int, 30)
for i := 0; i < 30; i++ {
go vote(a)
}
for b := range a {
fmt.Println(b)
}
}
The above code can be voted 3W.
Offhand, I swiped nearly 30W.
Above is Golang multithreaded brush the realization code explanation, if you have any questions please leave a message or to the community discussion, thank you for reading, I hope to help you, thank you for the support of this site!