示例代码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过程中,两种打印方式,为什么打印的结果不同呢?
拉莫斯之舞
德玛西亚99
相关分类