From a508a15f3b92701894b350ae57db73bf10cb65b9 Mon Sep 17 00:00:00 2001 From: Seebs Date: Wed, 26 Oct 2022 14:52:32 -0500 Subject: [PATCH] drop unused CreateDirIfNotExist function I was wondering why this is exported, and the answer is, if it weren't exported, staticcheck would have reported that it was unused, which it is. We don't need a wrapper on os.MkdirAll that we never use. (cherry picked from commit e9a40cdc3543f814a979cb86137711f1043d30a5) --- rbf/db.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/rbf/db.go b/rbf/db.go index bd4b633d3..4204d2720 100644 --- a/rbf/db.go +++ b/rbf/db.go @@ -106,16 +106,6 @@ func (db *DB) WALPath() string { return filepath.Join(db.Path, "wal") } -func CreateDirIfNotExist(path string) { - dir := filepath.Dir(path) - if _, err := os.Stat(dir); os.IsNotExist(err) { - err = os.MkdirAll(dir, 0755) - if err != nil { - panic(err) - } - } -} - // TxN returns the number of active transactions. func (db *DB) TxN() int { db.mu.RLock()