February 7, 2015

Golang create directory

Creating a directory from Google Go is simple with the "os" package. See the example below.

Golang create directory example

path := "/folder/to/create"
err := os.MkdirAll(path,0711)

if err != nil {
 log.Println("Error creating directory")
 log.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