mirror of https://github.com/ehang-io/nps
20 lines
240 B
Go
20 lines
240 B
Go
![]() |
package file
|
||
|
|
||
|
import (
|
||
|
"github.com/cnlh/nps/lib/common"
|
||
|
"sync"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
CsvDb *Csv
|
||
|
once sync.Once
|
||
|
)
|
||
|
//init csv from file
|
||
|
func GetCsvDb() *Csv {
|
||
|
once.Do(func() {
|
||
|
CsvDb = NewCsv(common.GetRunPath())
|
||
|
CsvDb.Init()
|
||
|
})
|
||
|
return CsvDb
|
||
|
}
|