为什么我不能从另一个函数调用init函数,init()是正确的函数,为什么我不能只调用init函数,我应该更改golangRFC以使其发生吗packagemainimport("fmt")funcinit(){fmt.Println("Hello,playground")}funcmain(){goinit()fmt.Println("Hello,playground")}错误:./prog.go:12:8:undefined:init 最佳答案 TheGoProgrammingLanguageSpecificationPackag
给定以下python字典列表:results=[[{'id':'001','result':[0,0,0,0,1]},{'id':'002','result':[1,1,1,1,1]},{'id':'003','result':[0,1,1,None,None]},{'id':'004','result':[0,None,None,1,0]},{'id':'005','result':[1,0,None,1,1]},{'id':'006','result':[0,0,0,1,1]}],[{'id':'001','result':[1,0,1,0,1]},{'id':'002','res
我想从Insert函数调用GetUsers,但我不知道。funcGetUsers(cecho.Context)error{result:=models.GetUsers()returnc.Render(http.StatusOK,"users.html",result)}funcInsert(cecho.Context)error{models.Insert()returnc.GetUsers()} 最佳答案 您只需使用GetUsers即可从Insert调用它。funcInsert(cecho.Context)error{model