Migrate to Go 1.18 (#45)

* Migrate to Go 1.18 and add linters
This commit is contained in:
Jonas Plum
2022-03-20 03:17:18 +01:00
committed by GitHub
parent 03a4806d45
commit 2bad1f5f28
88 changed files with 1430 additions and 868 deletions

View File

@@ -3,6 +3,7 @@ package busdb
import (
"context"
"errors"
"log"
"strings"
"github.com/arangodb/go-driver"
@@ -45,7 +46,12 @@ func (db *BusDatabase) LogBatchCreate(ctx context.Context, logentries []*model.L
}
}
if ids != nil {
go db.bus.PublishDatabaseUpdate(ids, bus.DatabaseEntryCreated)
go func() {
err := db.bus.PublishDatabaseUpdate(ids, bus.DatabaseEntryCreated)
if err != nil {
log.Println(err)
}
}()
}
_, errs, err := db.logCollection.CreateDocuments(ctx, logentries)
@@ -62,7 +68,7 @@ func (db *BusDatabase) LogBatchCreate(ctx context.Context, logentries []*model.L
func (db *BusDatabase) LogList(ctx context.Context, reference string) ([]*model.LogEntry, error) {
query := "FOR d IN @@collection FILTER d.reference == @reference SORT d.created DESC RETURN d"
cursor, err := db.internal.Query(ctx, query, map[string]interface{}{
cursor, err := db.internal.Query(ctx, query, map[string]any{
"@collection": LogCollectionName,
"reference": reference,
})