os.Stat
Syntax
os.Stat PATH
If your current project working directory has a single file named README.txt
(30 bytes):
{{ $stat := os.Stat "README.txt" }}
{{ $stat.Name }} → "README.txt"
{{ $stat.Size }} → 30
Function os.Stat
returns os.FileInfo
.
For further information of os.FileInfo
, see golang page.