Created
June 30, 2018 23:37
-
-
Save miguelmota/08bca5febf2ce460a289ef14c7e9af4f to your computer and use it in GitHub Desktop.
Golang file size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func fileSize(path string) int64 { | |
fi, err := os.Stat(path) | |
if err != nil { | |
log.Fatal(err) | |
} | |
return fi.Size() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment