|
@@ -1,9 +1,11 @@
|
|
package util
|
|
package util
|
|
|
|
|
|
import (
|
|
import (
|
|
- "github.com/klauspost/compress/zstd"
|
|
|
|
"os/exec"
|
|
"os/exec"
|
|
"strings"
|
|
"strings"
|
|
|
|
+ "time"
|
|
|
|
+
|
|
|
|
+ "github.com/klauspost/compress/zstd"
|
|
)
|
|
)
|
|
|
|
|
|
func ExpandShellString(s string) (string, error) {
|
|
func ExpandShellString(s string) (string, error) {
|
|
@@ -35,3 +37,15 @@ func DecompressZstdBuffer(input []byte) ([]byte, error) {
|
|
defer decoder.Close()
|
|
defer decoder.Close()
|
|
return decoder.DecodeAll(input, nil)
|
|
return decoder.DecodeAll(input, nil)
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func FmtMyTime(t time.Time) string {
|
|
|
|
+ return t.Format("2006-01-02 15:04:05.000")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func FmtMyDate(t time.Time) string {
|
|
|
|
+ return t.Format("2006-01-02")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func LastElem[T any](s []T) T {
|
|
|
|
+ return s[len(s)-1]
|
|
|
|
+}
|