SoFunction
Updated on 2025-03-04

How to determine whether a specified file exists in Go language

package main
  
import (
    "fmt"
    "os"
)
  
func main() {
    f, err := ("")
    if err != nil && (err) {
        ("file not exist!\n")
        return
    }
    ("file exist!\n")
    defer ()
}