1.windows下 同一级目录下有a.go, b.go ,a.go代码如下:
package main
import (
"fmt"
"os"
)
func main() {
fi, err := os.Stat("b.go")
if err != nil {
fmt.Println("err:",err)
return
}
fmt.Println(fi.IsDir())
}
运行,报错:
err: FindFirstFile b.go: The system cannot find the file specified.
linux下同样执行,正常。
): 这是bug嘛?
可能是你的执行目录不对,b.go你用的相对路径