Skip to content

Commit ae70df9

Browse files
authored
Merge pull request #841 from devlights/fix-warnings
2 parents 172577c + c415e63 commit ae70df9

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

examples/advanced/zeromemorycopy/byteslice2string.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func ByteSliceToString() error {
4343
// 普通に変換
4444
// -------------------------------------
4545
elapsed := times.Stopwatch(func(start time.Time) {
46+
//lint:ignore SA6006 It's ok because this is just a example.
4647
io.WriteString(io.Discard, string(b))
4748
})
4849
fmt.Printf("[normal] %v\n", elapsed)

examples/basic/runtimes/memorystats.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func RuntimeMemoryStats() error {
3131
wg.Add(1)
3232
go func(ctx context.Context, wg *sync.WaitGroup) {
3333
var (
34-
tick = time.Tick(500 * time.Millisecond) //lint:ignore SA1015 time.Tickはリークの危険があることは認識済み
34+
tick = time.Tick(500 * time.Millisecond) // Go 1.22まではtime.Tickはリークの危険がある。Go 1.23 から改善されて気にしなくて良くなった。
3535
count = 0
3636
items = make([][]byte, 0, 5)
3737
)
@@ -59,7 +59,7 @@ func RuntimeMemoryStats() error {
5959
wg.Add(1)
6060
go func(ctx context.Context, wg *sync.WaitGroup) {
6161
var (
62-
tick = time.Tick(2000 * time.Millisecond) //lint:ignore SA1015 time.Tickはリークの危険があることは認識済み
62+
tick = time.Tick(2000 * time.Millisecond) // Go 1.22まではtime.Tickはリークの危険がある。Go 1.23 から改善されて気にしなくて良くなった。
6363
count = 0
6464
)
6565

examples/basic/times/time_tick_and_ticker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ LOOP:
7676
case <-done:
7777
// 非同期処理が終わったのでメインの出力に切り替え
7878
// 再びこのチャネルが select で選択されないように nil を設定しておく
79-
//lint:ignore SA1015 サンプルなのでOK
79+
// Go 1.22まではtime.Tickはリークの危険がある。Go 1.23 から改善されて気にしなくて良くなった。
8080
tick = time.Tick(500 * time.Millisecond)
8181
done = nil
8282

0 commit comments

Comments
 (0)