From 4f5b4fd4dfc775c0f4e9a54d974e34e32e4a284f Mon Sep 17 00:00:00 2001 From: Noboru Saito Date: Fri, 13 Dec 2024 10:31:00 +0900 Subject: [PATCH] Delete Loopvar, which is no longer needed This change removes the Loopvar variable from the codebase, as it is no longer necessary with the improvements introduced in Go1.22. Update modules. --- go.mod | 14 +++++++------- go.sum | 28 ++++++++++++++-------------- oviewer/action_test.go | 2 -- oviewer/content_test.go | 10 ---------- oviewer/control_test.go | 8 -------- oviewer/convert_es_test.go | 1 - oviewer/document_test.go | 5 ----- oviewer/input_test.go | 1 - oviewer/keybind_test.go | 1 - oviewer/logdoc_test.go | 1 - oviewer/mouse_test.go | 4 ---- oviewer/oviewer_test.go | 1 - oviewer/reader_test.go | 4 ---- oviewer/search_test.go | 9 --------- oviewer/store_test.go | 8 -------- oviewer/utils_test.go | 11 ----------- 16 files changed, 21 insertions(+), 87 deletions(-) diff --git a/go.mod b/go.mod index 521aacb3..b5e36bcd 100644 --- a/go.mod +++ b/go.mod @@ -15,15 +15,15 @@ require ( github.com/klauspost/compress v1.17.11 github.com/mattn/go-runewidth v0.0.16 github.com/noborus/guesswidth v0.4.0 - github.com/pierrec/lz4/v4 v4.1.21 + github.com/pierrec/lz4/v4 v4.1.22 github.com/rivo/uniseg v0.4.7 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 github.com/ulikunitz/xz v0.5.12 - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f - golang.org/x/sync v0.9.0 - golang.org/x/term v0.26.0 + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 + golang.org/x/sync v0.10.0 + golang.org/x/term v0.27.0 ) require ( @@ -32,7 +32,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jwalton/go-supportscolor v1.2.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect + github.com/magiconair/properties v1.8.9 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/sagikazarmark/locafero v0.6.0 // indirect @@ -42,8 +42,8 @@ require ( github.com/spf13/cast v1.7.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index da0f0f44..d14f718e 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= +github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= @@ -52,8 +52,8 @@ github.com/noborus/guesswidth v0.4.0 h1:+PPh+Z+GM4mKmVrhYR4lpjeyBuLMSVo2arM+VErd github.com/noborus/guesswidth v0.4.0/go.mod h1:ghA6uh9RcK+uSmaDDmBMj/tRZ3BSpspDP6DMF5Xk3bc= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= -github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= -github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= +github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -91,8 +91,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -102,8 +102,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -114,24 +114,24 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= diff --git a/oviewer/action_test.go b/oviewer/action_test.go index cf0e0c63..3bb4ca44 100644 --- a/oviewer/action_test.go +++ b/oviewer/action_test.go @@ -203,7 +203,6 @@ func Test_position(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := calculatePosition(tt.args.str, tt.args.height); got != tt.want { @@ -374,7 +373,6 @@ func Test_jumpPosition(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() got, got1 := jumpPosition(tt.args.str, tt.args.height) diff --git a/oviewer/content_test.go b/oviewer/content_test.go index e0e72292..9ecd5164 100644 --- a/oviewer/content_test.go +++ b/oviewer/content_test.go @@ -108,7 +108,6 @@ func Test_StrToContentsNormal(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() got := StrToContents(tt.args.line, tt.args.tabWidth) @@ -186,7 +185,6 @@ func Test_StrToContentsOverlapping(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() got := StrToContents(tt.args.line, tt.args.tabWidth) @@ -335,7 +333,6 @@ func Test_StrToContentsStyle1(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() got := StrToContents(tt.args.line, tt.args.tabWidth) @@ -431,7 +428,6 @@ func Test_StrToContentUnStyle(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() got := StrToContents(tt.args.line, tt.args.tabWidth) @@ -492,7 +488,6 @@ func Test_StrToContentsCombining(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() got := StrToContents(tt.args.line, tt.args.tabWidth) @@ -546,7 +541,6 @@ func Test_StrToContentsHyperlink(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() got := StrToContents(tt.args.line, tt.args.tabWidth) @@ -602,7 +596,6 @@ func Test_lastContent(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := tt.args.lc.last(); !reflect.DeepEqual(got, tt.want) { @@ -658,7 +651,6 @@ func Test_ContentsToStr(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() lc := StrToContents(tt.str, 8) @@ -704,7 +696,6 @@ func Test_widthPos_x(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := tt.pos.x(tt.args.x); got != tt.want { @@ -751,7 +742,6 @@ func Test_widthPos_n(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := tt.pos.n(tt.args.w); got != tt.want { diff --git a/oviewer/control_test.go b/oviewer/control_test.go index 4b509c65..04edade1 100644 --- a/oviewer/control_test.go +++ b/oviewer/control_test.go @@ -63,7 +63,6 @@ func TestDocument_ControlFile(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m, err := NewDocument() @@ -148,7 +147,6 @@ func TestDocument_requestLoad(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m, err := NewDocument() @@ -223,7 +221,6 @@ func TestDocument_requestSearch(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m, err := NewDocument() @@ -291,7 +288,6 @@ func TestDocument_requestFollow(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() fname := CopyToTempFile(t, tt.fields.FileName) @@ -362,7 +358,6 @@ func TestDocument_requestClose(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m, err := NewDocument() @@ -414,7 +409,6 @@ func TestDocument_ControlReader(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m, err := NewDocument() @@ -485,7 +479,6 @@ func TestDocument_ControlReaderCtl(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m, err := NewDocument() @@ -523,7 +516,6 @@ func TestDocument_ControlLog(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m, err := NewDocument() diff --git a/oviewer/convert_es_test.go b/oviewer/convert_es_test.go index 4d4a1a2a..2b012359 100644 --- a/oviewer/convert_es_test.go +++ b/oviewer/convert_es_test.go @@ -246,7 +246,6 @@ func Test_sgrStyle(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() got := sgrStyle(tt.args.style, tt.args.csiParameter) diff --git a/oviewer/document_test.go b/oviewer/document_test.go index 65fa8d6b..bc441579 100644 --- a/oviewer/document_test.go +++ b/oviewer/document_test.go @@ -57,7 +57,6 @@ func TestOpenDocument(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() _, err := OpenDocument(tt.args.fileName) @@ -111,7 +110,6 @@ func TestDocument_lineToContents(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m := docHelper(t, tt.str) @@ -160,7 +158,6 @@ func TestDocument_Export(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m := docHelper(t, tt.str) @@ -223,7 +220,6 @@ func TestDocument_searchLine(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m := docFileReadHelper(t, tt.fields.FileName) @@ -284,7 +280,6 @@ func TestDocument_backSearchLine(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m := docFileReadHelper(t, tt.fields.FileName) diff --git a/oviewer/input_test.go b/oviewer/input_test.go index 1bc19193..2023590a 100644 --- a/oviewer/input_test.go +++ b/oviewer/input_test.go @@ -127,7 +127,6 @@ func TestInput_keyEvent(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() input := &Input{ diff --git a/oviewer/keybind_test.go b/oviewer/keybind_test.go index 0f09a49e..cd793a03 100644 --- a/oviewer/keybind_test.go +++ b/oviewer/keybind_test.go @@ -47,7 +47,6 @@ func TestKeyBind_String(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() kb := defaultKeyBinds() diff --git a/oviewer/logdoc_test.go b/oviewer/logdoc_test.go index 56a31f0c..8beea537 100644 --- a/oviewer/logdoc_test.go +++ b/oviewer/logdoc_test.go @@ -36,7 +36,6 @@ func TestDocument_Write(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() l, err := NewLogDoc() diff --git a/oviewer/mouse_test.go b/oviewer/mouse_test.go index 1c18f81f..818d167b 100644 --- a/oviewer/mouse_test.go +++ b/oviewer/mouse_test.go @@ -98,7 +98,6 @@ func TestRoot_mouseEvent(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { root := rootFileReadHelper(t, filepath.Join(testdata, "normal.txt")) root.prepareScreen() @@ -224,7 +223,6 @@ func TestSCR_lineRangeToString(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m := docFileReadHelper(t, filepath.Join(testdata, "normal.txt")) @@ -275,7 +273,6 @@ func TestSCR_rectangleToString(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m := docFileReadHelper(t, filepath.Join(testdata, "normal.txt")) @@ -362,7 +359,6 @@ func TestSCR_selectLine(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() scr := SCR{ diff --git a/oviewer/oviewer_test.go b/oviewer/oviewer_test.go index 59e6e140..b447f222 100644 --- a/oviewer/oviewer_test.go +++ b/oviewer/oviewer_test.go @@ -264,7 +264,6 @@ func Test_applyStyle(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := applyStyle(tt.args.style, tt.args.s); !reflect.DeepEqual(got, tt.want) { diff --git a/oviewer/reader_test.go b/oviewer/reader_test.go index 65b0de41..e18fe063 100644 --- a/oviewer/reader_test.go +++ b/oviewer/reader_test.go @@ -36,7 +36,6 @@ func TestDocument_ReadFile(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m, err := NewDocument() @@ -83,7 +82,6 @@ func TestDocument_ReadAll(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m, err := NewDocument() @@ -116,7 +114,6 @@ func TestDocument_reset(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m := docFileReadHelper(t, tt.fields.FileName) @@ -160,7 +157,6 @@ func TestDocument_reload(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m, err := NewDocument() diff --git a/oviewer/search_test.go b/oviewer/search_test.go index 99f80103..9cfa38cb 100644 --- a/oviewer/search_test.go +++ b/oviewer/search_test.go @@ -208,7 +208,6 @@ func Test_sensitiveWord_Match(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() substr := sensitiveWord{ @@ -267,7 +266,6 @@ func Test_regexpWord_Match(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() substr := regexpWord{ @@ -340,7 +338,6 @@ func Test_getSearchMatch(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() searcher := NewSearcher(tt.args.searchWord, tt.args.searchReg, tt.args.caseSensitive, tt.args.regexpSearch) @@ -372,7 +369,6 @@ func Test_regexpCompile(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := regexpCompile(tt.args.r, tt.args.caseSensitive); !reflect.DeepEqual(got, tt.want) { @@ -469,7 +465,6 @@ func Test_searchPositionReg(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := searchPositionReg(tt.args.s, tt.args.re); !reflect.DeepEqual(got, tt.want) { @@ -537,7 +532,6 @@ func TestRoot_setSearch(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() root := &Root{ @@ -583,7 +577,6 @@ func Test_multiRegexpCompile(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := multiRegexpCompile(tt.args.words); !reflect.DeepEqual(got, tt.want) { @@ -654,7 +647,6 @@ func Test_condRegexpCompile(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := condRegexpCompile(tt.args.in); !reflect.DeepEqual(got, tt.want) { @@ -729,7 +721,6 @@ func TestDocument_searchChunk(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() m := docFileReadHelper(t, tt.fileName) diff --git a/oviewer/store_test.go b/oviewer/store_test.go index cd2b5840..6f3fea7a 100644 --- a/oviewer/store_test.go +++ b/oviewer/store_test.go @@ -68,7 +68,6 @@ func Test_store_chunkRange(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() s := &store{ @@ -163,7 +162,6 @@ func Test_store_swapChunksFile(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() s := testNewStore(t, tt.fields.maxChunks, tt.capacity) @@ -211,7 +209,6 @@ func Test_store_isContinueRead(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() s := testNewStore(t, 10, tt.args.limit) @@ -281,7 +278,6 @@ func Test_store_loadChunksMem(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() s := testNewStore(t, tt.fields.maxChunks, tt.limit) @@ -366,7 +362,6 @@ func Test_store_evictChunksMem(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() s := testNewStore(t, tt.fields.maxChunks, tt.limit) @@ -462,7 +457,6 @@ func Test_store_appendLine(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() s, chunk := testChunkStore(t) @@ -527,7 +521,6 @@ func Test_store_chunkForAdd(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() s := NewStore() @@ -605,7 +598,6 @@ func Test_store_isLoadedChunk(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() s := testNewStore(t, tt.fields.chunks, tt.limit) diff --git a/oviewer/utils_test.go b/oviewer/utils_test.go index b9533d1a..733e2840 100644 --- a/oviewer/utils_test.go +++ b/oviewer/utils_test.go @@ -29,7 +29,6 @@ func Test_max(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := max(tt.args.a, tt.args.b); got != tt.want { @@ -62,7 +61,6 @@ func Test_min(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := min(tt.args.a, tt.args.b); got != tt.want { @@ -109,7 +107,6 @@ func Test_removeStr(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := remove(tt.args.list, tt.args.s); !reflect.DeepEqual(got, tt.want) { @@ -156,7 +153,6 @@ func Test_removeInt(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := remove(tt.args.list, tt.args.c); !reflect.DeepEqual(got, tt.want) { @@ -195,7 +191,6 @@ func Test_containsInt(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := contains(tt.args.list, tt.args.e); got != tt.want { @@ -242,7 +237,6 @@ func Test_toAddTop(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := toAddTop(tt.args.list, tt.args.s); !reflect.DeepEqual(got, tt.want) { @@ -306,7 +300,6 @@ func Test_toAddLast(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := toAddLast(tt.args.list, tt.args.s); !reflect.DeepEqual(got, tt.want) { @@ -353,7 +346,6 @@ func Test_toLast(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := toLast(tt.args.list, tt.args.s); !reflect.DeepEqual(got, tt.want) { @@ -388,7 +380,6 @@ func Test_remove(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := remove(tt.args.list, tt.args.s); !reflect.DeepEqual(got, tt.want) { @@ -472,7 +463,6 @@ func Test_allIndex(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := allIndex(tt.args.s, tt.args.substr, tt.args.reg); !reflect.DeepEqual(got, tt.want) { @@ -544,7 +534,6 @@ func Test_allStringIndex(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := allStringIndex(tt.args.s, tt.args.substr); !reflect.DeepEqual(got, tt.want) {