File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed
Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments