Original post

I’m currently learning Golang with TDD. I have this function:

func FileExists(filepath string) bool {
        if _, err := os.Stat(filepath); os.IsNotExist(err) {
                return false
        }
        return true
}

I’m at a loss on how to test this. Any thoughts? Thanks!