cheatsheet
Edited: Wednesday 2 February 2022

Command

撤销Git本地提交: git reset --soft HEAD^

Tar打包: tar -zcvf /tmp/etc.tar.gz /etc

Tar解包: tar -zxvf /tmp/etc.tar.gz

Go

Const

1const (
2    DATE_FORMAT="2006-01-02"
3    TIME_FORMAT="2006-01-02 15:04:05"
4)

Utils

取time的0点时刻

1func Bod(t time.Time) time.Time {
2    year, month, day := t.Date()
3    return time.Date(year, month, day, 0, 0, 0, 0, t.Location())
4}