package model import ( "log" "os" ) type Storage struct { Path string } func NewStorage(path string) Storage { return Storage{Path: path} } func (s Storage) Exists() bool { _, err := os.Stat(s.Path) return !os.IsNotExist(err) } func (s Storage) Create() { err := os.Mkdir(s.Path, 0750) if err != nil { log.Fatal(err) } }