forked from mirror/ants
optimize example code
This commit is contained in:
parent
869bcf840e
commit
b0a859aff4
|
@ -33,14 +33,14 @@ import (
|
|||
|
||||
var sum int32
|
||||
|
||||
func myFunc(i interface{}) error {
|
||||
func myFunc(i interface{}) {
|
||||
n := i.(int32)
|
||||
atomic.AddInt32(&sum, n)
|
||||
fmt.Printf("run with %d\n", n)
|
||||
return nil
|
||||
}
|
||||
|
||||
func demoFunc() error {
|
||||
func demoFunc() {
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
fmt.Println("Hello World!")
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue