示例代码packagemainimport("fmt""time")typenewFieldstringfunc(fnewField)print(){fmt.Println(f)}funcmain(){data:=[]newField{"one","two","thred"}for_,v:=rangedata{gov.print()//printonetwothreegofunc(){fmt.Println(v)}()//printthreethreethree}time.Sleep(3*time.Second)}疑问range过程中,两种打印方式,为什么打印的结果不同呢?
qq_遁去的一_1
拉莫斯之舞
德玛西亚99
随时随地看视频慕课网APP
相关分类