Commit 4f299f93 authored by Taro Aoki's avatar Taro Aoki Committed by Brad Fitzpatrick

os: use Fstat instead of Stat in FileMode example

The existing example for FileMode using Stat to get FileInfo.
But, Stat cannot get symlink info, it need to use Fstat instead.

Change-Id: I5cc38cd10caaa5912946abe2a2b90995a91ee10f
Reviewed-on: https://go-review.googlesource.com/47370Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
parent 2a2a2834
......@@ -50,7 +50,7 @@ func ExampleChtimes() {
}
func ExampleFileMode() {
fi, err := os.Stat("some-filename")
fi, err := os.Lstat("some-filename")
if err != nil {
log.Fatal(err)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment