pkger/examples/stat/std/main.go

28 lines
366 B
Go
Raw Normal View History

2019-11-01 22:53:54 +03:00
package main
import (
"fmt"
"log"
"os"
)
func main() {
if err := run(); err != nil {
log.Fatal(err)
}
}
func run() error {
info, err := os.Stat("./go.mod")
if err != nil {
return err
}
fmt.Println("Name: ", info.Name())
fmt.Println("Size: ", info.Size())
fmt.Println("Mode: ", info.Mode())
fmt.Println("ModTime: ", info.ModTime())
return nil
}