Vim-args-系列指令 当用 vim 打开多个文件时, file name list 会存储在 argument list 中, 可以通过这个 list 在多个文件中跳转. 注意区分 buffer list (其可以用 :buffers 查看) 所有 argument list 中存在的文件都会存在于 buffer list 中. (反之不一定) 所有 window 有一个共有的 global argument lis 2024-02-26 Vim
Go-bytes-库 Godoc bytes 文档 type Buffer一个标记类型的结构体: 123type Buffer struct { // contains filtered or unexported fields} NewBuffer 创建并用 []byte 初始化一个 buffer1func NewBuffer(buf []byte) *Buffer buf 为提供的初始值. 之 2024-02-25 Go
Go-time-库 两个时间概念: Wall clock, 指真实时间, 就像墙上的挂钟上看到的时间一样 Monotonic clock, 指一个递增的计时器, 可以用于测量时间 type Duration1type Duration int64 指两个 instants 之间的 elapsed time. 常见的有: time.Microsecond time.Millisecond time.Second 2024-02-18 Go
Go-harmonica-库使用 Harmonica 是一个 physics-based animation tools for 2D and 3D application, 也就是通过设置速度, 位置之类的物理单位来实现动画. FPS 设置帧数返回值是两帧之间的间隔时间 delta: 1func FPS(n int) float64 这里可用于初始化一个 spring: 1spring := NewSpring(FPS(60) 2024-02-17 Go
Go-os-exec-库 重要类型Type Cmd12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989 2024-02-13 Go
Go-io-库 Godoc io 库文档 io 库提供了基本的 I/O 操作接口和函数, 用于处理数据流, 读写操作等. 其定义了 Reader 和 Writer 接口, 以及一些实现这些接口的类型, 用于读取和写入数据. 预定义的变量, 和读取位置相关12345const ( SeekStart = 0 // seek relative to the origin of the file Seek 2024-02-11 Go
Go-bufio-库 Godoc bufio 文档 重要类型type Scanner123type Scanner struct { // contains filtered or unexported fields} type SplitFunc1type SplitFunc func(data []byte, atEOF bool) (advance int, token []byte, er 2024-02-11 Go
Go-语言-os-库 Godoc os 文档 Create 创建文件如果文件存在则清空其内容, 不存在则以 0666 的权限创建: 1func Create(name string) (*File, error) Remove 删除文件或空目录1func Remove(name string) error RemoveAll 递归删除目录及其下内容1func RemoveAll(path string) error 2024-02-11 Go