github.com/lovishpuri/go-40569/src@v0.0.0-20230519171745-f8623e7c56cf/os/stat.go (about) 1 // Copyright 2017 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package os 6 7 import "internal/testlog" 8 9 // Stat returns a FileInfo describing the named file. 10 // If there is an error, it will be of type *PathError. 11 func Stat(name string) (FileInfo, error) { 12 testlog.Stat(name) 13 return statNolog(name) 14 } 15 16 // Lstat returns a FileInfo describing the named file. 17 // If the file is a symbolic link, the returned FileInfo 18 // describes the symbolic link. Lstat makes no attempt to follow the link. 19 // If there is an error, it will be of type *PathError. 20 func Lstat(name string) (FileInfo, error) { 21 testlog.Stat(name) 22 return lstatNolog(name) 23 }