Stat()IsNotExist()
package main
import (
"os"
"fmt"
)
func main(){
filepath := "C:\\Users\\Administrator\\Desktop\\user_agent.py"
_,err := os.Stat(filepath)
if os.IsNotExist(err){
fmt.Println("file not exist")
return
}
fmt.Println("file exist")
}