Answers for "how to check if file is present of not in 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

Code answers related to "how to check if file is present of not in golang"

Browse Popular Code Answers by Language