摘要:
DB package DB import ( Model "GoGinmod/GOginzuoY/model" "fmt" _ "github.com/go-sql-driver/mysql" "github.com/jmoiron/sqlx" ) var db *sqlx.DB func Init 阅读全文
摘要:
package main import "fmt" type animal interface { move() eat(string) } type cat struct { name string feet int8 } type chicken struct { feet int8 } fun 阅读全文
摘要:
package main import ( "fmt" "os" ) type stu struct { id int64 name string } type stuS struct { stuMap map[int64]stu } func (s stuS) add() { var ( id i 阅读全文
摘要:
package main import ( "fmt" "os" ) var ( allSt map[int64]*student ) type student struct { id int64 name string } func newStudent(id int64, name string 阅读全文
摘要:
package main import "fmt" func main() { var a = [...]int{1, 3, 5, 7, 9} for i := 0; i < len(a); i++ { for k := 0; k < i; k++ { aa := a[i] + a[k] if aa 阅读全文
摘要:
package main import "fmt" func main() { var aa int a := [...]int{1, 2, 3, 8, 5} //遍历数组 key 用_ 舍弃 j =value 定义一个变量相加 for _, j := range a { aa = aa + j } 阅读全文