func MustExtractDBAsset(defaultDB string) string { path, err := cachedir.Get("rtfblog") if err != nil { panic("Failed to cachedir.Get()") } dbPath := filepath.Join(path, defaultDB) // Extract it only in case there isn't one already from the last time if !fileExistsNoErr(dbPath) { err = rtfblog_resources.RestoreAsset(path, defaultDB) if err != nil { panic(fmt.Sprintf("Failed to RestoreAsset(%q, %q)", path, defaultDB)) } } return dbPath }
func init() { cachedir.Get("") // no-op to fix unused import }