mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Merge pull request #1094 from Icinga/go-fix-20260312
Some checks failed
Compliance / compliance (push) Has been cancelled
Build and Publish Container Image / build-and-publish-container-image (push) Has been cancelled
Go / build-test (macos-latest) (push) Has been cancelled
Go / build-test (ubuntu-latest) (push) Has been cancelled
Go / lint (push) Has been cancelled
Go / vet (push) Has been cancelled
Go / fmt (push) Has been cancelled
Go / modtidy (push) Has been cancelled
Go / vendor-diff (push) Has been cancelled
Integration Tests / MySQL (push) Has been cancelled
Integration Tests / PostgreSQL (push) Has been cancelled
SQL / MySQL 5.5 (push) Has been cancelled
SQL / MySQL 5.6 (push) Has been cancelled
SQL / MariaDB 10.1 (push) Has been cancelled
SQL / MariaDB 10.2 (push) Has been cancelled
SQL / MariaDB 10.3 (push) Has been cancelled
SQL / MariaDB 10.4 (push) Has been cancelled
SQL / MariaDB 10.5 (push) Has been cancelled
SQL / MariaDB 10.6 (push) Has been cancelled
SQL / MariaDB 10.7 (push) Has been cancelled
SQL / MariaDB latest (push) Has been cancelled
SQL / MySQL 5.7 (push) Has been cancelled
SQL / MySQL 8 (push) Has been cancelled
SQL / MySQL latest (push) Has been cancelled
SQL / PostgreSQL 10 (push) Has been cancelled
SQL / PostgreSQL 11 (push) Has been cancelled
SQL / PostgreSQL 12 (push) Has been cancelled
SQL / PostgreSQL 13 (push) Has been cancelled
SQL / PostgreSQL 9.6 (push) Has been cancelled
SQL / PostgreSQL latest (push) Has been cancelled
Sync For-Container.md to Docker Hub / sync (push) Has been cancelled
Some checks failed
Compliance / compliance (push) Has been cancelled
Build and Publish Container Image / build-and-publish-container-image (push) Has been cancelled
Go / build-test (macos-latest) (push) Has been cancelled
Go / build-test (ubuntu-latest) (push) Has been cancelled
Go / lint (push) Has been cancelled
Go / vet (push) Has been cancelled
Go / fmt (push) Has been cancelled
Go / modtidy (push) Has been cancelled
Go / vendor-diff (push) Has been cancelled
Integration Tests / MySQL (push) Has been cancelled
Integration Tests / PostgreSQL (push) Has been cancelled
SQL / MySQL 5.5 (push) Has been cancelled
SQL / MySQL 5.6 (push) Has been cancelled
SQL / MariaDB 10.1 (push) Has been cancelled
SQL / MariaDB 10.2 (push) Has been cancelled
SQL / MariaDB 10.3 (push) Has been cancelled
SQL / MariaDB 10.4 (push) Has been cancelled
SQL / MariaDB 10.5 (push) Has been cancelled
SQL / MariaDB 10.6 (push) Has been cancelled
SQL / MariaDB 10.7 (push) Has been cancelled
SQL / MariaDB latest (push) Has been cancelled
SQL / MySQL 5.7 (push) Has been cancelled
SQL / MySQL 8 (push) Has been cancelled
SQL / MySQL latest (push) Has been cancelled
SQL / PostgreSQL 10 (push) Has been cancelled
SQL / PostgreSQL 11 (push) Has been cancelled
SQL / PostgreSQL 12 (push) Has been cancelled
SQL / PostgreSQL 13 (push) Has been cancelled
SQL / PostgreSQL 9.6 (push) Has been cancelled
SQL / PostgreSQL latest (push) Has been cancelled
Sync For-Container.md to Docker Hub / sync (push) Has been cancelled
tree-wide: Apply go fix
This commit is contained in:
commit
9d990f9d1b
5 changed files with 8 additions and 12 deletions
|
|
@ -135,11 +135,9 @@ func TestDelta(t *testing.T) {
|
|||
// Log ID mapping to allow easier debugging in case of failures.
|
||||
t.Logf("ID=%d(%s) Test=%s SendOrder=%s",
|
||||
id, testDeltaMakeIdOrChecksum(id).String(), test.Name, sendOrder.Name)
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
sendOrder.Send(id, test, chActual, chDesired)
|
||||
}()
|
||||
})
|
||||
|
||||
if test.Create != 0 {
|
||||
expectedCreate[id] = test.Create
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import (
|
|||
)
|
||||
|
||||
var slaStateStructify = structify.MakeMapStructifier(
|
||||
reflect.TypeOf((*history.SlaHistoryState)(nil)).Elem(),
|
||||
reflect.TypeFor[history.SlaHistoryState](),
|
||||
"json",
|
||||
contracts.SafeInit)
|
||||
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ func userNotificationStage(ctx context.Context, s Sync, key string, in <-chan re
|
|||
}
|
||||
|
||||
structifier := structify.MakeMapStructifier(
|
||||
reflect.TypeOf((*NotificationHistory)(nil)).Elem(),
|
||||
reflect.TypeFor[NotificationHistory](),
|
||||
"structify",
|
||||
contracts.SafeInit)
|
||||
|
||||
|
|
|
|||
|
|
@ -240,8 +240,7 @@ func TestSetChecksums(t *testing.T) {
|
|||
t.Run(fmt.Sprint(concurrency), func(t *testing.T) {
|
||||
for _, l := range latencies {
|
||||
t.Run(l.name, func(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
ctx := t.Context()
|
||||
|
||||
input := make(chan database.Entity, 1)
|
||||
go func() {
|
||||
|
|
@ -311,8 +310,7 @@ func TestSetChecksums(t *testing.T) {
|
|||
|
||||
for _, concurrency := range []int{0, -1, -2, -30} {
|
||||
t.Run(fmt.Sprint(concurrency), func(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
ctx := t.Context()
|
||||
|
||||
input := make(chan database.Entity, 1)
|
||||
input <- nil
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ func (client *Client) Submit(entity database.Entity) bool {
|
|||
// This loop allows resubmitting an event if the rules have changed. The first try would be the rule update, the
|
||||
// second try would be the resubmit, and the third try would be for bad luck, e.g., when a second rule update just
|
||||
// crept in between. If there are three subsequent rule updates, something is wrong.
|
||||
for try := 0; try < 3; try++ {
|
||||
for range 3 {
|
||||
eventRuleIds, err := client.evaluateRulesForObject(
|
||||
client.ctx,
|
||||
metaHistory.HostId,
|
||||
|
|
@ -484,7 +484,7 @@ func (client *Client) SyncExtraStages() map[string]history.StageFunc {
|
|||
}
|
||||
|
||||
sorterCallbackFn := func(msg redis.XMessage, key string) bool {
|
||||
makeEntity := func(key string, values map[string]interface{}) (database.Entity, error) {
|
||||
makeEntity := func(key string, values map[string]any) (database.Entity, error) {
|
||||
structPtr, ok := syncKeyStructPtrs[key]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("key is not part of keyStructPtrs")
|
||||
|
|
|
|||
Loading…
Reference in a new issue