Answers for "check if a file exist golang"

Go
0

golang check if file exists

file, err := os.OpenFile(...)
if errors.Is(err, os.ErrNotExist) {
    // handle the case where the file doesn't exist
}
Posted by: Guest on October-10-2021

Browse Popular Code Answers by Language