golang的fmt包实现了格式化I/O函数: package main import "fmt" type Human struct { Name string } func main() { //普通占位符 var people = Human{Name: "咸鱼兆"} // %+v 添加字段名,输出相应值的默认格式 fmt.Printf("%+v\n", people) //相应值用go语法形式输出 fmt.Printf("%#v…
获取当前时间 func Now func Now() Time 1 Now returns the current local time. func (Time) UTC func (t Time) UTC() Time 1 UTC returns t with the location set to UTC. func (Time) Unix func (t Time) Unix() int64 1 Unix returns t as a Unix time, the number of se…