随笔分类 -  go

摘要:package main import ( "fmt" "sync" ) var wg sync.WaitGroup func hello(i int) { defer wg.Done() fmt.Print(i, "hello hello\n") } func main() { for i := 阅读全文
posted @ 2022-07-10 12:01 leo0362 阅读(18) 评论(0) 推荐(0) 编辑
摘要:package main import ( "bufio" "fmt" "net" ) func process(conn net.Conn) { defer conn.Close() for { reader := bufio.NewReader(conn) var buf [124]byte n 阅读全文
posted @ 2022-07-09 18:36 leo0362 阅读(20) 评论(0) 推荐(0) 编辑
摘要:package domysql /** * mysql 数据库操作封装包 */ import ( "fmt" _ "github.com/go-sql-driver/mysql" "github.com/jmoiron/sqlx" ) // 定义数据表结构体 type User struct { I 阅读全文
posted @ 2022-06-24 14:28 leo0362 阅读(43) 评论(0) 推荐(0) 编辑
摘要:package main import ( "fmt" "reflect" ) func mathStduy() { var a int = 5 var b int = 6 c := a + b fmt.Printf("c: %v\n", c) d := b - a fmt.Printf("d: % 阅读全文
posted @ 2022-06-23 11:19 leo0362 阅读(16) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示