标签:fun string cal printf print http port 并发 pack
玩玩
package main import ( "fmt" "strings" "sync" ) var wait sync.WaitGroup func main() { wait.Add(1) toUpperAsync("Hello Callback!", func(v string) { fmt.Printf("Callback: %s\n", v) wait.Done() }) println("Waiting async response...") wait.Wait() } func toUpperAsync(word string, f func(string)) { go func() { f(strings.ToUpper(word)) }() }
标签:fun string cal printf print http port 并发 pack
原文地址:https://www.cnblogs.com/aguncn/p/11862444.html