You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
442 B

package setft
import (
"testing"
"time"
)
func TestSetFileTime(t *testing.T) {
layout := "2006-01-02 15:04:05"
atime, _ := time.ParseInLocation(layout, "2021-01-01 00:00:00", time.Local)
ctime, _ := time.ParseInLocation(layout, "2021-01-01 00:00:00", time.Local)
mtime, _ := time.ParseInLocation(layout, "2021-01-01 00:00:00", time.Local)
if err := SetFileTime("setft_test.go", atime, ctime, mtime); err != nil {
t.Fatal(err)
}
}