Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkwork committed Dec 1, 2024
1 parent 8cc2de3 commit df964c8
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion mylog/safeStream_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"unicode/utf8"

"github.com/dc0d/caseconv"

"github.com/rivo/uniseg"
"mvdan.cc/gofumpt/format"
)
Expand Down
6 changes: 3 additions & 3 deletions safemap/safemap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func TestSafeMap_StoreAndLoad_Ordered(t *testing.T) {
sm := New[int, string](Ordered)
sm.Update(1, "one")

value, ok := sm.GetMust(1)
value, ok := sm.Get(1)
if !ok || value != "one" {
t.Errorf("expected 'one', got '%v'", value)
}
Expand Down Expand Up @@ -233,7 +233,7 @@ func BenchmarkSafeMap_Load(b *testing.B) {
sm.Update(1, "value")
b.ResetTimer()
for i := 0; i < b.N; i++ {
sm.GetMust(1)
sm.Get(1)
}
}

Expand All @@ -257,7 +257,7 @@ func BenchmarkSafeMap_Ordered_Load(b *testing.B) {
sm.Update(1, "value")
b.ResetTimer()
for i := 0; i < b.N; i++ {
sm.GetMust(1)
sm.Get(1)
}
}

Expand Down
3 changes: 2 additions & 1 deletion stream/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package stream
import (
_ "embed"
"fmt"
"github.com/ddkwork/golibrary/safemap"
"go/format"
"path/filepath"
"reflect"
"strconv"
"strings"

"github.com/ddkwork/golibrary/safemap"

"github.com/ddkwork/golibrary/mylog"
)

Expand Down
9 changes: 5 additions & 4 deletions stream/net/httpClient/Schemer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package httpClient
import (
"testing"

"github.com/ddkwork/golibrary/mylog"
"mvdan.cc/gofumpt/format"
"github.com/ddkwork/golibrary/safemap"

"github.com/ddkwork/golibrary/assert"

"github.com/ddkwork/golibrary/mylog"
"github.com/ddkwork/golibrary/stream"
"mvdan.cc/gofumpt/format"
)

func TestLayer_AssertKind(t *testing.T) {
Expand All @@ -17,7 +17,8 @@ func TestLayer_AssertKind(t *testing.T) {
}

func TestGeneratedFile_Iota(t *testing.T) {
m := safemap.NewOrdered[string, string]()
m := safemap.NewOrdered[string, string](func(yield func(string, string) bool) {
})
m.Set("Http", "Http")
m.Set("Https", "Https")
m.Set("Socket4", "Socket4")
Expand Down
4 changes: 2 additions & 2 deletions stream/other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package stream

import (
"embed"
"github.com/ddkwork/golibrary/safemap"

"path/filepath"

"github.com/ddkwork/golibrary/safemap"

"github.com/ddkwork/golibrary/mylog"
)

Expand Down
1 change: 1 addition & 0 deletions stream/topo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package stream

import (
"fmt"

"github.com/ddkwork/golibrary/mylog"
"github.com/ddkwork/golibrary/safemap"
)
Expand Down
2 changes: 2 additions & 0 deletions stream/topo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package stream

import (
"testing"

"github.com/ddkwork/golibrary/safemap"
)

func TestTopologicalSort(t *testing.T) {
Expand Down

0 comments on commit df964c8

Please sign in to comment.