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

How to delete files in golang?

coldplay.xixi
Release: 2020-06-20 09:57:40
Original
6218 people have browsed it

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 {
        // 删除成功
 
}
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template