Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
name: Test Builds
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21

- name: Check out code
uses: actions/checkout@v3
go-version-file: go.mod

- name: Test
run: go test ./...
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v9
with:
version: latest
args: --timeout 5m
working-directory: .
working-directory: .
16 changes: 8 additions & 8 deletions cmd/example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ func normal(wg *sync.WaitGroup) {
if err != nil {
log.Fatal(err)
}
defer hm.Close()
defer func() { _ = hm.Close() }()
err2 := hm.Set("a", []byte("b"))
if err2 != nil {
log.Fatal(err2)
}
v, ok := hm.Get("a")
if ok {
log.Println(v)
log.Println(string(v))
}
}

Expand All @@ -53,7 +53,7 @@ func memoryExpire(wg *sync.WaitGroup) {
if err != nil {
log.Fatal(err)
}
defer hm.Close()
defer func() { _ = hm.Close() }()
err2 := hm.Set("a", []byte("b"))
if err2 != nil {
log.Fatal(err2)
Expand All @@ -73,7 +73,7 @@ func disk(wg *sync.WaitGroup) {
if err != nil {
log.Fatal(err)
}
defer hm.Close()
defer func() { _ = hm.Close() }()
err2 := hm.Set("a", []byte("b"))
if err2 != nil {
log.Fatal(err2)
Expand All @@ -99,7 +99,7 @@ func hybridz(wg *sync.WaitGroup) {
if err != nil {
log.Fatal(err)
}
defer hm.Close()
defer func() { _ = hm.Close() }()
err2 := hm.Set("a", []byte("b"))
if err2 != nil {
log.Fatal(err2)
Expand All @@ -108,7 +108,7 @@ func hybridz(wg *sync.WaitGroup) {
// this should happen from disk
v, ok := hm.Get("a")
if ok {
log.Println("Read1 (disk)", v)
log.Println("Read1 (disk)", string(v))
} else {
log.Println("Read1 (disk) Not found")
}
Expand All @@ -124,7 +124,7 @@ func hybridz(wg *sync.WaitGroup) {
// this should happen from memory again
v3, ok3 := hm.Get("a")
if ok3 {
log.Println("Read2 (memory)", v3)
log.Println("Read2 (memory)", string(v3))
} else {
log.Println("Read2 (memory) Not found")
}
Expand Down Expand Up @@ -193,7 +193,7 @@ func testhybrid(name string, opts hybrid.Options, total int) (duration time.Dura
read := 0
hm.Scan(func(k, v []byte) error {
gotValue := string(v)
if "test" != gotValue {
if gotValue != "test" {
return errors.New("unexpected item")
}
read++
Expand Down
14 changes: 7 additions & 7 deletions cmd/filekv/filekv.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@ func main() {
list1, list2, list3 := "list1.txt", "list2.txt", "list3.txt"
fList1, _ := os.Create(list1)
for i := 0; i < 100000; i++ {
_, _ = fList1.WriteString(fmt.Sprintf("%d\n", i))
_, _ = fmt.Fprintf(fList1, "%d\n", i)
}
fList1.Close()
_ = fList1.Close()

fList2, _ := os.Create(list2)
// 1000 items overlaps
for i := 90000; i < 200000; i++ {
_, _ = fList2.WriteString(fmt.Sprintf("%d\n", i))
_, _ = fmt.Fprintf(fList2, "%d\n", i)
}
fList2.Close()
_ = fList2.Close()

// third list is still on disk but will be used as io.reader
fList3, _ := os.Create(list3)
// 1000 items overlaps
for i := 190000; i < 300000; i++ {
_, _ = fList3.WriteString(fmt.Sprintf("%d\n", i))
_, _ = fmt.Fprintf(fList3, "%d\n", i)
}
fList3.Close()
_ = fList3.Close()

// 4th list will be a list of new-line separated numbers
var list4 strings.Builder
for i := 290000; i < 400000; i++ {
list4.WriteString(fmt.Sprintf("%d\n", i))
fmt.Fprintf(&list4, "%d\n", i)
}

opts := filekv.DefaultOptions
Expand Down
28 changes: 14 additions & 14 deletions filekv/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ func (fdb *FileDB) Process() error {
_ = fdb.Set(sc.Bytes(), nil)
}

fdb.tmpDb.Close()
_ = fdb.tmpDb.Close()

// flush to disk
fdb.dbWriter.Close()
fdb.db.Close()
_ = fdb.dbWriter.Close()
_ = fdb.db.Close()

// cleanup filters
switch fdb.options.Dedupe {
Expand All @@ -153,8 +153,8 @@ func (fdb *FileDB) Process() error {
case MemoryFilter:
fdb.bdb.ClearAll()
case DiskFilter:
fdb.ddb.Close()
os.RemoveAll(fdb.ddbName)
_ = fdb.ddb.Close()
_ = os.RemoveAll(fdb.ddbName)
}

return nil
Expand All @@ -172,8 +172,8 @@ func (fdb *FileDB) Reset() error {
fdb.bdb.ClearAll()
case DiskFilter:
// close - remove - reopen
fdb.ddb.Close()
os.RemoveAll(fdb.ddbName)
_ = fdb.ddb.Close()
_ = os.RemoveAll(fdb.ddbName)
var err error
fdb.ddb, err = leveldb.OpenFile(fdb.ddbName, nil)
if err != nil {
Expand All @@ -182,15 +182,15 @@ func (fdb *FileDB) Reset() error {
}

// reset the tmp file
fdb.tmpDb.Close()
_ = fdb.tmpDb.Close()
var err error
fdb.tmpDb, err = os.Create(fdb.tmpDbName)
if err != nil {
return err
}

// reset the target file
fdb.db.Close()
_ = fdb.db.Close()
fdb.db, err = os.Create(fdb.tmpDbName)
if err != nil {
return err
Expand Down Expand Up @@ -220,17 +220,17 @@ func (fdb *FileDB) Size() int64 {
func (fdb *FileDB) Close() {
tmpDBFilename := fdb.tmpDb.Name()
_ = fdb.tmpDb.Close()
os.RemoveAll(tmpDBFilename)
_ = os.RemoveAll(tmpDBFilename)

_ = fdb.db.Close()
dbFilename := fdb.db.Name()
if fdb.options.Cleanup {
os.RemoveAll(dbFilename)
_ = os.RemoveAll(dbFilename)
}

if fdb.ddbName != "" {
fdb.ddb.Close()
os.RemoveAll(fdb.ddbName)
_ = fdb.ddb.Close()
_ = os.RemoveAll(fdb.ddbName)
}
}

Expand Down Expand Up @@ -292,7 +292,7 @@ func (fdb *FileDB) Scan(handler func([]byte, []byte) error) error {
if err != nil {
return err
}
defer dbCopy.Close()
defer func() { _ = dbCopy.Close() }()

var dbReader io.ReadCloser
if fdb.options.Compress {
Expand Down
2 changes: 1 addition & 1 deletion filekv/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (f *FileDB) MergeFile(filename string) (uint, error) {
if err != nil {
return 0, err
}
defer newF.Close()
defer func() { _ = newF.Close() }()

return f.MergeReader(newF)
}
Expand Down
13 changes: 6 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module github.com/projectdiscovery/hmap

go 1.24.0
go 1.26.0

require (
github.com/akrylysov/pogreb v0.10.1
github.com/bits-and-blooms/bloom/v3 v3.5.0
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/pkg/errors v0.9.1
github.com/projectdiscovery/utils v0.11.1
github.com/projectdiscovery/utils v0.11.9
github.com/rs/xid v1.5.0
github.com/stretchr/testify v1.11.1
github.com/stretchr/testify v1.12.1
github.com/syndtr/goleveldb v1.0.0
github.com/tidwall/buntdb v1.3.0
go.etcd.io/bbolt v1.3.7
Expand All @@ -19,14 +19,12 @@ require (
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/gorilla/css v1.0.1 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/microcosm-cc/bluemonday v1.0.27 // indirect
github.com/onsi/ginkgo v1.16.4 // indirect
github.com/onsi/gomega v1.16.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/projectdiscovery/blackrock v0.0.2 // indirect
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect
github.com/tidwall/btree v1.4.3 // indirect
Expand All @@ -36,8 +34,9 @@ require (
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/rtred v0.1.2 // indirect
github.com/tidwall/tinyqueue v0.1.1 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/net v0.55.0 // indirect
golang.org/x/sys v0.45.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
26 changes: 12 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ github.com/bits-and-blooms/bloom/v3 v3.5.0 h1:AKDvi1V3xJCmSR6QhcBfHbCN4Vf8FfxeWk
github.com/bits-and-blooms/bloom/v3 v3.5.0/go.mod h1:Y8vrn7nk1tPIlmLtW2ZPV+W7StdVMor6bC1xgpjMZFs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
Expand Down Expand Up @@ -59,20 +57,18 @@ github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/projectdiscovery/blackrock v0.0.2 h1:mxXdu0uM8P2L2Qi210COlU8QiICPFW/Rxk5QUhlPO2k=
github.com/projectdiscovery/blackrock v0.0.2/go.mod h1:ANUtjDfaVrqB453bzToU+YB4cUbvBRpLvEwoWIwlTss=
github.com/projectdiscovery/utils v0.11.1 h1:PWj1KjIASxt8icxommH72C0TQqNOvGkcSODRkiq0SQw=
github.com/projectdiscovery/utils v0.11.1/go.mod h1:yktGrHGk2CTjNiccXovnvGrLHX9sV2bqz9nSnbA3V8M=
github.com/projectdiscovery/utils v0.11.9 h1:aKLje3zPcZuOGmopN51PasWxPX/CypPwzP2ke/Qa2bA=
github.com/projectdiscovery/utils v0.11.9/go.mod h1:d3BcbsHhuxW9T3jpvrgzwshvqhaL9qPSkoi+3h/DY8E=
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d h1:hrujxIzL1woJ7AwssoOcM/tq5JjjG2yYOc8odClEiXA=
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE=
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
github.com/tidwall/assert v0.1.0 h1:aWcKyRBUAdLoVebxo95N7+YZVTFF/ASTr7BN4sLP6XI=
Expand Down Expand Up @@ -104,6 +100,8 @@ go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
Expand All @@ -116,8 +114,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -133,14 +131,14 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
Expand Down
2 changes: 1 addition & 1 deletion store/disk/bboltdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (b *BBoltDB) Size() int64 {

// Close ...
func (b *BBoltDB) Close() {
b.db.Close()
_ = b.db.Close()
}

// GC - runs the garbage collector
Expand Down
2 changes: 1 addition & 1 deletion store/disk/buntdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (bdb *BuntDB) Size() int64 {

// Close
func (bdb *BuntDB) Close() {
bdb.db.Close()
_ = bdb.db.Close()
}

// GC - runs the garbage collector
Expand Down
2 changes: 1 addition & 1 deletion store/disk/kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestKV(t *testing.T) {

func TestFileKV(t *testing.T) {
dbpath, _ := fileutil.GetTempFileName()
os.RemoveAll(dbpath)
_ = os.RemoveAll(dbpath)
opts := filekv.DefaultOptions
opts.Cleanup = true
opts.Compress = true
Expand Down
2 changes: 1 addition & 1 deletion store/disk/leveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (ldb *LevelDB) Size() int64 {

// Close ...
func (ldb *LevelDB) Close() {
ldb.db.Close()
_ = ldb.db.Close()
}

// GC - runs the garbage collector
Expand Down
Loading
Loading