Home >Backend Development >Golang >How to delete files in golang?

How to delete files in golang?

coldplay.xixi
coldplay.xixiOriginal
2020-06-20 09:57:406232browse

How to delete files in golang?

#How to delete files in golang?

How to delete files in golang:

package main
 
import "os"
 
func main () {
 
    err := os.Remove(logFile)
 
if err != nil {
// 删除失败
 
} else {
        // 删除成功
 
}
}

Recommended tutorial: "Go Language Tutorial"

The above is the detailed content of How to delete files in golang?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn