golang flag包简单例子
摘要:package mainimport ( "flag" "fmt")var workers int;func main() { flag.IntVar(&workers,"r", 1, "concurrent processing ,default 1 .") flag.Parse(...
阅读全文
golang函数调用计时
摘要:package mainimport ( "log" "time")func f() { defer timeoutCheck("f slow", time.Now()) time.Sleep(time.Second)}func timeoutCheck(tag string...
阅读全文