01 2023 档案

go 格式化输出
摘要:直接上代码: package main import "fmt" func main() { // %s s1 := "hello" s2 := []byte("world") fmt.Printf("string: %s, slice: %s\n", s1, s2) // string: hell 阅读全文

posted @ 2023-01-14 14:41 进击的davis 阅读(35) 评论(0) 推荐(0)

go time的定时器简单总结
摘要:go的标准库中的time包为我们提供了多个定时器的接口,总共分为以下几个: time.After,到了给定的duration的时间时,返回可读chan,也不会阻止程序运行,相当于一个消息通知 time.Sleep,在给定的duration中,阻塞当前goroutine,过了休眠时间,goroutin 阅读全文

posted @ 2023-01-04 10:51 进击的davis 阅读(186) 评论(0) 推荐(0)

导航