package main import ( "log" "os" ) func removeFile(path string) { err := os.Remove(path) if err != nil && !os.IsNotExist(err) { log.Panic(err) } }