February 7, 2015

Golang delete file

Deleting a file from Google Go (Golang) is simple with the "os" package. See the example below.

Golang delete file example

path := "/path/to/file/to/delete"
err := os.Remove(path)

if err != nil {
  fmt.Println(err)
  return
}

Leave a Reply

Your email address will not be published. Required fields are marked *

XFerion Europe LLP
We build an maintain your software. From web to mobile. From MVP to extended product. Contact us if you wish to discuss a project.
CONTACT US