Provided that http://golang.org/pkg/os/#MkdirAll works for you, this can be avoided (and it should).