[Go] Time
·
Go
Golang Time 패키지 Time struct type Time struct { wall uint64 ext int64 loc *Location } Time 생성 방법 time.now() time.Date(year int, month Month...) time.Unix(sec int64, nsec int64) Time Test func TestTime(t *testing.T) { now := time.Now() t.Log(now) // 2022-08-02 11:14:48.8866312 +0900 KST m=+0.002534901 nowFormat := time.Now().Format("2006-01-02 15:04:05") t.Log(nowFormat) // 2022-08-02 11:17:33 (ht..
[Go] File 정보 확인
·
Go
Go File 정보 확인 package file import ( "fmt" "os" "runtime" "syscall" "time" ) const FILE_PATH = "data/big_data.txt" type myFile struct { file *os.File } func newMyFile(file *os.File) *myFile { f := myFile{ file: file, } return &f } func (f *myFile) showStat() { stat, err := f.file.Stat() if err != nil { panic(err) } /* type FileInfo interface { Name() string // base name of the file Size() int64 /..