updated dependencies and go
This commit is contained in:
@@ -97,10 +97,7 @@ func (d *DelayedCombiningInvoker) run() {
|
||||
|
||||
for {
|
||||
d.syncLock.Lock()
|
||||
timeOut := min(d.maxDelay-time.Since(d.initialRequestTime), d.delay-time.Since(d.lastRequestTime))
|
||||
if timeOut < 0 {
|
||||
timeOut = 0
|
||||
}
|
||||
timeOut := max(min(d.maxDelay-time.Since(d.initialRequestTime), d.delay-time.Since(d.lastRequestTime)), 0)
|
||||
d.syncLock.Unlock()
|
||||
|
||||
immediately := false
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ func ObjectMerge[T1 any, T2 any](base T1, override T2) T1 {
|
||||
fieldBase := reflBase.Field(i)
|
||||
fieldOvrd := reflOvrd.Field(i)
|
||||
|
||||
if fieldBase.Kind() != reflect.Ptr || fieldOvrd.Kind() != reflect.Ptr {
|
||||
if fieldBase.Kind() != reflect.Pointer || fieldOvrd.Kind() != reflect.Pointer {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package dataext
|
||||
|
||||
import (
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
|
||||
"testing"
|
||||
)
|
||||
@@ -26,17 +25,17 @@ func TestObjectMerge(t *testing.T) {
|
||||
|
||||
valueA := A{
|
||||
Field1: nil,
|
||||
Field2: langext.Ptr("99"),
|
||||
Field3: langext.Ptr(12.2),
|
||||
Field2: new("99"),
|
||||
Field3: new(12.2),
|
||||
Field4: nil,
|
||||
OnlyA: 1,
|
||||
DiffType: 2,
|
||||
}
|
||||
|
||||
valueB := B{
|
||||
Field1: langext.Ptr(12),
|
||||
Field1: new(12),
|
||||
Field2: nil,
|
||||
Field3: langext.Ptr(13.2),
|
||||
Field3: new(13.2),
|
||||
Field4: nil,
|
||||
OnlyB: 1,
|
||||
DiffType: "X",
|
||||
|
||||
+2
-3
@@ -2,7 +2,6 @@ package dataext
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||
"sync"
|
||||
)
|
||||
|
||||
@@ -64,7 +63,7 @@ func (s *Stack[T]) OptPop() *T {
|
||||
result := s.data[l-1]
|
||||
s.data = s.data[:l-1]
|
||||
|
||||
return langext.Ptr(result)
|
||||
return new(result)
|
||||
}
|
||||
|
||||
func (s *Stack[T]) Peek() (T, error) {
|
||||
@@ -94,7 +93,7 @@ func (s *Stack[T]) OptPeek() *T {
|
||||
return nil
|
||||
}
|
||||
|
||||
return langext.Ptr(s.data[l-1])
|
||||
return new(s.data[l-1])
|
||||
}
|
||||
|
||||
func (s *Stack[T]) Length() int {
|
||||
|
||||
@@ -82,7 +82,7 @@ func binarize(writer io.Writer, dat reflect.Value, opt StructHashOptions) error
|
||||
|
||||
err = binary.Write(writer, binary.LittleEndian, uint8(dat.Kind()))
|
||||
switch dat.Kind() {
|
||||
case reflect.Ptr, reflect.Map, reflect.Array, reflect.Chan, reflect.Slice, reflect.Interface:
|
||||
case reflect.Pointer, reflect.Map, reflect.Array, reflect.Chan, reflect.Slice, reflect.Interface:
|
||||
if dat.IsNil() {
|
||||
err = binary.Write(writer, binary.LittleEndian, uint64(0))
|
||||
if err != nil {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package dataext
|
||||
|
||||
import (
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
|
||||
"testing"
|
||||
)
|
||||
@@ -46,7 +45,7 @@ func TestStructHashSimpleStruct(t *testing.T) {
|
||||
tst.AssertHexEqual(t, "5d09090dc34ac59dd645f197a255f653387723de3afa1b614721ea5a081c675f", noErrStructHash(t, t0{
|
||||
F1: 10,
|
||||
F2: []string{"1", "2", "3"},
|
||||
F3: langext.Ptr(99),
|
||||
F3: new(99),
|
||||
}))
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user