ldez / golangci-lint-bench

0 stars 0 forks source link

benchmark: PR (wsl) #12

Closed ldez closed 2 months ago

ldez commented 2 months ago

{ "pr": 4844, "linter": "wsl", "version": "v1.59.1" }

github-actions[bot] commented 2 months ago

The benchmark is done!

beego/beego

local ``` client/httplib/testing/client.go:40:2: return statements should not be cuddled if block has more than two lines (wsl) return port ^ client/orm/internal/logs/log.go:16:2: return statements should not be cuddled if block has more than two lines (wsl) return d ^ client/orm/internal/utils/utils.go:131:3: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ client/orm/internal/utils/utils.go:134:3: return statements should not be cuddled if block has more than two lines (wsl) return ni.Uint64(), nil ^ client/orm/internal/utils/utils.go:136:2: return statements should not be cuddled if block has more than two lines (wsl) return v, err ^ client/orm/internal/utils/utils.go:144:2: return statements should not be cuddled if block has more than two lines (wsl) return "" ^ client/orm/internal/utils/utils.go:197:2: return statements should not be cuddled if block has more than two lines (wsl) return ^ client/orm/internal/utils/utils.go:93:3: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ client/orm/internal/utils/utils.go:96:3: return statements should not be cuddled if block has more than two lines (wsl) return ni.Int64(), nil ^ client/orm/internal/utils/utils.go:98:2: return statements should not be cuddled if block has more than two lines (wsl) return v, err ^ client/orm/internal/utils/utils.go:209:2: return statements should not be cuddled if block has more than two lines (wsl) return ^ client/orm/internal/utils/utils.go:219:2: if statements should only be cuddled with assignments (wsl) if len(args) > 0 { ^ client/orm/internal/utils/utils.go:222:2: return statements should not be cuddled if block has more than two lines (wsl) return ^ client/orm/migration/ddl.go:312:4: ranges should only be cuddled with assignments used in the iteration (wsl) for index, column := range m.Columns { ^ client/orm/migration/ddl.go:286:4: if statements should only be cuddled with assignments (wsl) if len(m.Primary) > 0 { ^ client/orm/migration/ddl.go:307:4: branch statements should not be cuddled if block has more than two lines (wsl) break ^ client/orm/migration/ddl.go:285:4: block should not end with a whitespace (or comment) (wsl) } ^ client/orm/migration/ddl.go:324:4: only one cuddle assignment allowed before range statement (wsl) for index, column := range m.Renames { ^ client/orm/migration/ddl.go:344:4: block should not start with a whitespace (wsl) { ^ client/orm/migration/ddl.go:347:4: ranges should only be cuddled with assignments used in the iteration (wsl) for index, column := range m.Columns { ^ client/orm/migration/ddl.go:305:4: block should not end with a whitespace (or comment) (wsl) } ^ client/orm/migration/ddl.go:265:2: switch statements should only be cuddled with variables switched (wsl) switch m.ModifyType { ^ client/orm/migration/ddl.go:279:4: ranges should only be cuddled with assignments used in the iteration (wsl) for index, column := range m.Primary { ^ client/orm/migration/ddl.go:335:5: only one cuddle assignment allowed before if statement (wsl) if len(m.Foreigns) > index+1 { ^ client/orm/migration/ddl.go:339:4: assignments should only be cuddled with other assignments (wsl) sql += ";" ^ client/orm/migration/ddl.go:306:4: assignments should only be cuddled with other assignments (wsl) sql += fmt.Sprintf(")ENGINE=%s DEFAULT CHARSET=%s;", m.Engine, m.Charset) ^ client/orm/migration/ddl.go:315:6: assignments should only be cuddled with other assignments (wsl) sql += fmt.Sprintf("\n ADD `%s` %s %s %s %s %s", column.Name, column.DataType, column.Unsign, column.Null, column.Inc, column.Default) ^ client/orm/migration/ddl.go:353:5: if statements should only be cuddled with assignments (wsl) if len(m.Columns) > index+1 { ^ client/orm/migration/ddl.go:368:4: block should not end with a whitespace (or comment) (wsl) } ^ client/orm/migration/ddl.go:108:2: if statements should only be cuddled with assignments (wsl) if uniqueOriginal.Definition == "" { ^ client/orm/migration/ddl.go:298:5: assignments should only be cuddled with other assignments (wsl) sql += ")" ^ client/orm/migration/ddl.go:300:4: ranges should only be cuddled with assignments used in the iteration (wsl) for _, foreign := range m.Foreigns { ^ client/orm/migration/ddl.go:381:4: assignments should only be cuddled with other assignments (wsl) sql += ";" ^ client/orm/migration/ddl.go:369:4: ranges should only be cuddled with assignments used in the iteration (wsl) for index, column := range m.Renames { ^ client/orm/migration/migration.go:144:2: assignments should only be cuddled with other assignments (wsl) status = "update" ^ client/orm/migration/migration.go:238:3: assignments should only be cuddled with other assignments (wsl) i++ ^ client/orm/migration/migration.go:100:2: append only allowed to cuddle with appended value (wsl) m.sqls = append(m.sqls, m.GetSQL()) ^ client/orm/migration/migration.go:138:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ client/orm/migration/migration.go:314:2: assignments should only be cuddled with other assignments (wsl) migs := make(map[string]string) ^ client/orm/migration/migration.go:126:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ client/orm/migration/migration.go:239:3: only cuddled expressions if assigning variable or using from line above (wsl) logs.Info("end reset:", v.name) ^ client/orm/migration/migration.go:305:2: if statements should only be cuddled with assignments (wsl) if maps[0]["status"] == "rollback" { ^ client/orm/migration/migration.go:146:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ client/orm/migration/migration.go:89:2: append only allowed to cuddle with appended value (wsl) m.sqls = append(m.sqls, m.GetSQL()) ^ client/orm/migration/migration.go:222:2: only one cuddle assignment allowed before for statement (wsl) for j := len(sm) - 1; j >= 0; j-- { ^ client/orm/migration/migration.go:283:2: ranges should only be cuddled with assignments used in the iteration (wsl) for k, v := range m { ^ client/orm/migration/migration.go:290:2: expressions should not be cuddled with blocks (wsl) sort.Sort(s) ^ client/orm/migration/migration.go:233:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ client/orm/migration/migration.go:203:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ client/orm/migration/migration.go:187:4: expressions should not be cuddled with blocks (wsl) logs.Info("end upgrade:", v.name) ^ ```
v1.59.1 ``` client/httplib/testing/client.go:40:2: return statements should not be cuddled if block has more than two lines (wsl) return port ^ client/orm/internal/logs/log.go:16:2: return statements should not be cuddled if block has more than two lines (wsl) return d ^ client/orm/internal/utils/utils.go:96:3: return statements should not be cuddled if block has more than two lines (wsl) return ni.Int64(), nil ^ client/orm/internal/utils/utils.go:98:2: return statements should not be cuddled if block has more than two lines (wsl) return v, err ^ client/orm/internal/utils/utils.go:131:3: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ client/orm/internal/utils/utils.go:144:2: return statements should not be cuddled if block has more than two lines (wsl) return "" ^ client/orm/internal/utils/utils.go:183:2: return statements should not be cuddled if block has more than two lines (wsl) return s ^ client/orm/internal/utils/utils.go:209:2: return statements should not be cuddled if block has more than two lines (wsl) return ^ client/orm/internal/utils/utils.go:93:3: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ client/orm/internal/utils/utils.go:134:3: return statements should not be cuddled if block has more than two lines (wsl) return ni.Uint64(), nil ^ client/orm/internal/utils/utils.go:136:2: return statements should not be cuddled if block has more than two lines (wsl) return v, err ^ client/orm/internal/utils/utils.go:197:2: return statements should not be cuddled if block has more than two lines (wsl) return ^ client/orm/internal/utils/utils.go:219:2: if statements should only be cuddled with assignments (wsl) if len(args) > 0 { ^ client/orm/migration/ddl.go:108:2: if statements should only be cuddled with assignments (wsl) if uniqueOriginal.Definition == "" { ^ client/orm/migration/ddl.go:312:4: ranges should only be cuddled with assignments used in the iteration (wsl) for index, column := range m.Columns { ^ client/orm/migration/ddl.go:339:4: assignments should only be cuddled with other assignments (wsl) sql += ";" ^ client/orm/migration/ddl.go:279:4: ranges should only be cuddled with assignments used in the iteration (wsl) for index, column := range m.Primary { ^ client/orm/migration/ddl.go:286:4: if statements should only be cuddled with assignments (wsl) if len(m.Primary) > 0 { ^ client/orm/migration/ddl.go:285:4: block should not end with a whitespace (or comment) (wsl) } ^ client/orm/migration/ddl.go:300:4: ranges should only be cuddled with assignments used in the iteration (wsl) for _, foreign := range m.Foreigns { ^ client/orm/migration/ddl.go:315:6: assignments should only be cuddled with other assignments (wsl) sql += fmt.Sprintf("\n ADD `%s` %s %s %s %s %s", column.Name, column.DataType, column.Unsign, column.Null, column.Inc, column.Default) ^ client/orm/migration/ddl.go:381:4: assignments should only be cuddled with other assignments (wsl) sql += ";" ^ client/orm/migration/ddl.go:265:2: switch statements should only be cuddled with variables switched (wsl) switch m.ModifyType { ^ client/orm/migration/ddl.go:335:5: only one cuddle assignment allowed before if statement (wsl) if len(m.Foreigns) > index+1 { ^ client/orm/migration/ddl.go:305:4: block should not end with a whitespace (or comment) (wsl) } ^ client/orm/migration/ddl.go:307:4: branch statements should not be cuddled if block has more than two lines (wsl) break ^ client/orm/migration/ddl.go:324:4: only one cuddle assignment allowed before range statement (wsl) for index, column := range m.Renames { ^ client/orm/migration/ddl.go:353:5: if statements should only be cuddled with assignments (wsl) if len(m.Columns) > index+1 { ^ client/orm/migration/ddl.go:369:4: ranges should only be cuddled with assignments used in the iteration (wsl) for index, column := range m.Renames { ^ client/orm/migration/ddl.go:347:4: ranges should only be cuddled with assignments used in the iteration (wsl) for index, column := range m.Columns { ^ client/orm/migration/ddl.go:298:5: assignments should only be cuddled with other assignments (wsl) sql += ")" ^ client/orm/migration/ddl.go:306:4: assignments should only be cuddled with other assignments (wsl) sql += fmt.Sprintf(")ENGINE=%s DEFAULT CHARSET=%s;", m.Engine, m.Charset) ^ client/orm/migration/ddl.go:344:4: block should not start with a whitespace (wsl) { ^ client/orm/migration/ddl.go:368:4: block should not end with a whitespace (or comment) (wsl) } ^ client/orm/migration/migration.go:314:2: assignments should only be cuddled with other assignments (wsl) migs := make(map[string]string) ^ client/orm/migration/migration.go:191:2: expressions should not be cuddled with blocks (wsl) logs.Info("total success upgrade:", i, " migration") ^ client/orm/migration/migration.go:239:3: only cuddled expressions if assigning variable or using from line above (wsl) logs.Info("end reset:", v.name) ^ client/orm/migration/migration.go:302:2: if statements should only be cuddled with assignments (wsl) if num <= 0 { ^ client/orm/migration/migration.go:233:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ client/orm/migration/migration.go:138:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ client/orm/migration/migration.go:305:2: if statements should only be cuddled with assignments (wsl) if maps[0]["status"] == "rollback" { ^ client/orm/migration/migration.go:126:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ client/orm/migration/migration.go:146:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ client/orm/migration/migration.go:149:2: assignments should only be cuddled with other assignments (wsl) _, err = p.Exec(name, time.Now().Format(DBDateFormat), strings.Join(m.sqls, "; "), status) ^ client/orm/migration/migration.go:135:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if status == "down" { ^ client/orm/migration/migration.go:296:2: declarations should never be cuddled (wsl) var maps []orm.Params ^ client/orm/migration/migration.go:167:2: assignments should only be cuddled with other assignments (wsl) migrationMap[name] = m ^ client/orm/migration/migration.go:212:2: expressions should not be cuddled with blocks (wsl) logs.Error("not exist the migrationMap name:" + name) ^ client/orm/migration/migration.go:176:2: only one cuddle assignment allowed before range statement (wsl) for _, v := range sm { ^ client/orm/migration/migration.go:203:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ ```
Command Mean [ms] Min [ms] Max [ms] Relative
local 847.4 ± 13.3 829.3 869.4 1.04 ± 0.02
v1.59.1 815.2 ± 8.0 805.7 829.2 1.00

cilium/cilium

local ``` api/v1/health/server/configure_cilium_health_api.go:49:2: if statements should only be cuddled with assignments (wsl) if api.ConnectivityGetStatusHandler == nil { ^ api/v1/health/server/configure_cilium_health_api.go:54:2: if statements should only be cuddled with assignments (wsl) if api.ConnectivityPutStatusProbeHandler == nil { ^ api/v1/operator/server/configure_cilium_operator.go:50:2: if statements should only be cuddled with assignments (wsl) if api.MetricsGetMetricsHandler == nil { ^ api/v1/server/configure_cilium_api.go:90:2: if statements should only be cuddled with assignments (wsl) if api.DaemonGetConfigHandler == nil { ^ api/v1/server/configure_cilium_api.go:100:2: if statements should only be cuddled with assignments (wsl) if api.EndpointGetEndpointHandler == nil { ^ api/v1/server/configure_cilium_api.go:240:2: if statements should only be cuddled with assignments (wsl) if api.IpamPostIpamIPHandler == nil { ^ api/v1/server/configure_cilium_api.go:250:2: if statements should only be cuddled with assignments (wsl) if api.PolicyPutPolicyHandler == nil { ^ api/v1/server/configure_cilium_api.go:95:2: if statements should only be cuddled with assignments (wsl) if api.DaemonGetDebuginfoHandler == nil { ^ api/v1/server/configure_cilium_api.go:155:2: if statements should only be cuddled with assignments (wsl) if api.PolicyGetIdentityHandler == nil { ^ api/v1/server/configure_cilium_api.go:170:2: if statements should only be cuddled with assignments (wsl) if api.DaemonGetMapHandler == nil { ^ cilium-health/cmd/root.go:56:2: assignments should only be cuddled with other assignments (wsl) flags := rootCmd.PersistentFlags() ^ cilium-health/cmd/root.go:99:3: expressions should not be cuddled with blocks (wsl) os.Exit(0) ^ cilium-health/launch/endpoint.go:178:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cilium-health/launch/endpoint.go:292:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cilium-health/launch/endpoint.go:308:2: only cuddled expressions if assigning variable or using from line above (wsl) cmd.SetTarget(binaryName) ^ cilium-health/launch/endpoint.go:84:3: append only allowed to cuddle with appended value (wsl) routes = append(routes, v6Routes...) ^ cilium-health/launch/endpoint.go:101:3: only one cuddle assignment allowed before if statement (wsl) if err == nil && len(out) > 0 { ^ cilium-health/launch/endpoint.go:107:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ cilium-health/launch/endpoint.go:199:4: if statements should only be cuddled with assignments used in the if statement itself (wsl) if link, err := netlink.LinkByName(iface); err == nil { ^ cilium-health/launch/endpoint.go:233:21: block should not start with a whitespace (wsl) ) (*Client, error) { ^ cilium-health/launch/endpoint.go:360:18: block should not start with a whitespace (wsl) ); err != nil { ^ cilium-health/launch/endpoint.go:97:3: assignments should only be cuddled with other assignments (wsl) prog := cmd[0] ^ cilium-health/launch/endpoint.go:329:2: for statement without condition should never be cuddled (wsl) for { ^ cilium-health/launch/endpoint.go:377:2: only cuddled expressions if assigning variable or using from line above (wsl) metrics.SubprocessStart.WithLabelValues(ciliumHealth).Inc() ^ cilium-health/launch/endpoint.go:177:2: assignments should only be cuddled with other assignments (wsl) pid, err := pidfile.Kill(path) ^ cilium-health/launch/launcher.go:106:3: expressions should not be cuddled with blocks (wsl) scopedLog.WithError(err).Debugf("Cannot find socket") ^ cilium-health/launch/launcher.go:101:2: for statement without condition should never be cuddled (wsl) for { ^ cilium-health/launch/launcher.go:135:2: return statements should not be cuddled if block has more than two lines (wsl) return status ^ cilium-health/launch/launcher.go:86:3: expressions should not be cuddled with blocks (wsl) log.WithError(err).Debugf("Cannot establish connection to local cilium instance") ^ cilium-health/launch/launcher.go:92:2: go statements can only invoke functions assigned on line above (wsl) go func() { ^ cilium-health/responder/main.go:27:2: expressions should not be cuddled with declarations or returns (wsl) flag.StringVar(&pidfilePath, "pidfile", "", "Write pid to the specified file") ^ cilium-health/responder/main.go:36:2: only one cuddle assignment allowed before go statement (wsl) go func() { ^ clustermesh-apiserver/clustermesh/k8s/resource_ctors.go:22:2: assignments should only be cuddled with other assignments (wsl) lw := utils.ListerWatcherWithModifiers( ^ clustermesh-apiserver/clustermesh/k8s/resource_ctors.go:26:2: return statements should not be cuddled if block has more than two lines (wsl) return resource.New[*types.CiliumEndpoint](params.Lifecycle, lw, ^ clustermesh-apiserver/clustermesh/k8s/resource_ctors.go:37:2: assignments should only be cuddled with other assignments (wsl) lw := utils.ListerWatcherWithModifiers( ^ clustermesh-apiserver/clustermesh/k8s/resource_ctors.go:41:2: return statements should not be cuddled if block has more than two lines (wsl) return resource.New[*cilium_api_v2.CiliumNode](params.Lifecycle, lw, ^ clustermesh-apiserver/etcdinit/root.go:167:3: assignments should only be cuddled with other assignments (wsl) err := etcdCmd.Process.Signal(syscall.SIGTERM) ^ clustermesh-apiserver/etcdinit/root.go:232:3: return statements should not be cuddled if block has more than two lines (wsl) return err ^ clustermesh-apiserver/etcdinit/root.go:202:5: expressions should not be cuddled with blocks (wsl) log.WithError(err). ^ clustermesh-apiserver/etcdinit/root.go:207:5: return statements should not be cuddled if block has more than two lines (wsl) return ^ clustermesh-apiserver/etcdinit/root.go:214:5: return statements should not be cuddled if block has more than two lines (wsl) return ^ clustermesh-apiserver/etcdinit/root.go:247:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ clustermesh-apiserver/etcdinit/root.go:108:3: return statements should not be cuddled if block has more than two lines (wsl) return err ^ clustermesh-apiserver/etcdinit/root.go:120:4: return statements should not be cuddled if block has more than two lines (wsl) return err ^ clustermesh-apiserver/etcdinit/root.go:110:2: only one cuddle assignment allowed before range statement (wsl) for _, d := range dir { ^ clustermesh-apiserver/etcdinit/root.go:156:2: assignments should only be cuddled with other assignments (wsl) etcdPid := etcdCmd.Process.Pid ^ clustermesh-apiserver/etcdinit/root.go:179:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ clustermesh-apiserver/etcdinit/root.go:217:3: expressions should not be cuddled with blocks (wsl) log.Info("etcd process exited") ^ clustermesh-apiserver/etcdinit/root.go:240:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ clustermesh-apiserver/etcdinit/root.go:114:3: assignments should only be cuddled with other assignments (wsl) err = os.RemoveAll(path.Join(etcdDataDir, d.Name())) ^ ```
v1.59.1 ``` api/v1/health/server/configure_cilium_health_api.go:49:2: if statements should only be cuddled with assignments (wsl) if api.ConnectivityGetStatusHandler == nil { ^ api/v1/health/server/configure_cilium_health_api.go:54:2: if statements should only be cuddled with assignments (wsl) if api.ConnectivityPutStatusProbeHandler == nil { ^ api/v1/operator/server/configure_cilium_operator.go:50:2: if statements should only be cuddled with assignments (wsl) if api.MetricsGetMetricsHandler == nil { ^ api/v1/server/configure_cilium_api.go:100:2: if statements should only be cuddled with assignments (wsl) if api.EndpointGetEndpointHandler == nil { ^ api/v1/server/configure_cilium_api.go:205:2: if statements should only be cuddled with assignments (wsl) if api.ServiceGetServiceIDHandler == nil { ^ api/v1/server/configure_cilium_api.go:230:2: if statements should only be cuddled with assignments (wsl) if api.PrefilterPatchPrefilterHandler == nil { ^ api/v1/server/configure_cilium_api.go:70:2: if statements should only be cuddled with assignments (wsl) if api.PolicyDeletePolicyHandler == nil { ^ api/v1/server/configure_cilium_api.go:140:2: if statements should only be cuddled with assignments (wsl) if api.PolicyGetFqdnNamesHandler == nil { ^ api/v1/server/configure_cilium_api.go:175:2: if statements should only be cuddled with assignments (wsl) if api.DaemonGetMapNameHandler == nil { ^ api/v1/server/configure_cilium_api.go:255:2: if statements should only be cuddled with assignments (wsl) if api.ServicePutServiceIDHandler == nil { ^ cilium-health/cmd/root.go:56:2: assignments should only be cuddled with other assignments (wsl) flags := rootCmd.PersistentFlags() ^ cilium-health/cmd/root.go:99:3: expressions should not be cuddled with blocks (wsl) os.Exit(0) ^ cilium-health/launch/endpoint.go:178:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cilium-health/launch/endpoint.go:84:3: append only allowed to cuddle with appended value (wsl) routes = append(routes, v6Routes...) ^ cilium-health/launch/endpoint.go:107:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ cilium-health/launch/endpoint.go:177:2: assignments should only be cuddled with other assignments (wsl) pid, err := pidfile.Kill(path) ^ cilium-health/launch/endpoint.go:329:2: for statement without condition should never be cuddled (wsl) for { ^ cilium-health/launch/endpoint.go:360:18: block should not start with a whitespace (wsl) ); err != nil { ^ cilium-health/launch/endpoint.go:101:3: only one cuddle assignment allowed before if statement (wsl) if err == nil && len(out) > 0 { ^ cilium-health/launch/endpoint.go:308:2: only cuddled expressions if assigning variable or using from line above (wsl) cmd.SetTarget(binaryName) ^ cilium-health/launch/endpoint.go:377:2: only cuddled expressions if assigning variable or using from line above (wsl) metrics.SubprocessStart.WithLabelValues(ciliumHealth).Inc() ^ cilium-health/launch/endpoint.go:292:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cilium-health/launch/endpoint.go:97:3: assignments should only be cuddled with other assignments (wsl) prog := cmd[0] ^ cilium-health/launch/endpoint.go:199:4: if statements should only be cuddled with assignments used in the if statement itself (wsl) if link, err := netlink.LinkByName(iface); err == nil { ^ cilium-health/launch/endpoint.go:233:21: block should not start with a whitespace (wsl) ) (*Client, error) { ^ cilium-health/launch/launcher.go:135:2: return statements should not be cuddled if block has more than two lines (wsl) return status ^ cilium-health/launch/launcher.go:86:3: expressions should not be cuddled with blocks (wsl) log.WithError(err).Debugf("Cannot establish connection to local cilium instance") ^ cilium-health/launch/launcher.go:92:2: go statements can only invoke functions assigned on line above (wsl) go func() { ^ cilium-health/launch/launcher.go:106:3: expressions should not be cuddled with blocks (wsl) scopedLog.WithError(err).Debugf("Cannot find socket") ^ cilium-health/launch/launcher.go:101:2: for statement without condition should never be cuddled (wsl) for { ^ cilium-health/responder/main.go:36:2: only one cuddle assignment allowed before go statement (wsl) go func() { ^ cilium-health/responder/main.go:27:2: expressions should not be cuddled with declarations or returns (wsl) flag.StringVar(&pidfilePath, "pidfile", "", "Write pid to the specified file") ^ clustermesh-apiserver/clustermesh/k8s/resource_ctors.go:41:2: return statements should not be cuddled if block has more than two lines (wsl) return resource.New[*cilium_api_v2.CiliumNode](params.Lifecycle, lw, ^ clustermesh-apiserver/clustermesh/k8s/resource_ctors.go:22:2: assignments should only be cuddled with other assignments (wsl) lw := utils.ListerWatcherWithModifiers( ^ clustermesh-apiserver/clustermesh/k8s/resource_ctors.go:26:2: return statements should not be cuddled if block has more than two lines (wsl) return resource.New[*types.CiliumEndpoint](params.Lifecycle, lw, ^ clustermesh-apiserver/clustermesh/k8s/resource_ctors.go:37:2: assignments should only be cuddled with other assignments (wsl) lw := utils.ListerWatcherWithModifiers( ^ clustermesh-apiserver/etcdinit/root.go:154:3: return statements should not be cuddled if block has more than two lines (wsl) return err ^ clustermesh-apiserver/etcdinit/root.go:234:2: only one cuddle assignment allowed before defer statement (wsl) defer etcdClient.Close() ^ clustermesh-apiserver/etcdinit/root.go:244:3: return statements should not be cuddled if block has more than two lines (wsl) return err ^ clustermesh-apiserver/etcdinit/root.go:200:6: return statements should not be cuddled if block has more than two lines (wsl) return ^ clustermesh-apiserver/etcdinit/root.go:179:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ clustermesh-apiserver/etcdinit/root.go:228:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ clustermesh-apiserver/etcdinit/root.go:108:3: return statements should not be cuddled if block has more than two lines (wsl) return err ^ clustermesh-apiserver/etcdinit/root.go:173:4: return statements should not be cuddled if block has more than two lines (wsl) return ^ clustermesh-apiserver/etcdinit/root.go:217:3: expressions should not be cuddled with blocks (wsl) log.Info("etcd process exited") ^ clustermesh-apiserver/etcdinit/root.go:227:2: assignments should only be cuddled with other assignments (wsl) etcdClient, err := clientv3.New(config) ^ clustermesh-apiserver/etcdinit/root.go:246:2: expressions should not be cuddled with blocks (wsl) log.Info("Etcd init completed") ^ clustermesh-apiserver/etcdinit/root.go:202:5: expressions should not be cuddled with blocks (wsl) log.WithError(err). ^ clustermesh-apiserver/etcdinit/root.go:239:2: assignments should only be cuddled with other assignments (wsl) err = kvstoreEtcdInit.ClusterMeshEtcdInit(ctx, log, etcdClient, ciliumClusterName) ^ clustermesh-apiserver/etcdinit/root.go:240:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ ```
Command Mean [s] Min [s] Max [s] Relative
local 5.027 ± 0.039 4.968 5.092 1.00
v1.59.1 5.030 ± 0.042 4.991 5.142 1.00 ± 0.01

spf13/cobra

local ``` active_help.go:52:2: return statements should not be cuddled if block has more than two lines (wsl) return activeHelpCfg ^ args.go:59:3: only one cuddle assignment allowed before range statement (wsl) for _, v := range args { ^ args.go:65:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:89:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:99:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:46:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:79:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:109:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:121:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:38:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ bash_completions.go:456:2: expressions should not be cuddled with blocks (wsl) WriteStringAndCheck(buf, "\n") ^ bash_completions.go:490:4: expressions should not be cuddled with blocks (wsl) WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", ext)) ^ bash_completions.go:503:2: assignments should only be cuddled with other assignments (wsl) format += "flags+=(\"-%s" + cbn ^ bash_completions.go:516:2: if statements should only be cuddled with assignments (wsl) if len(flag.NoOptDefVal) == 0 { ^ bash_completions.go:520:2: expressions should not be cuddled with blocks (wsl) writeFlagHandler(buf, "--"+name, flag.Annotations, cmd) ^ bash_completions.go:624:2: if statements should only be cuddled with assignments (wsl) if cmd.ValidArgsFunction != nil { ^ bash_completions.go:647:2: only one cuddle assignment allowed before range statement (wsl) for _, value := range cmd.ArgAliases { ^ bash_completions.go:449:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, c := range cmd.Commands() { ^ bash_completions.go:539:2: only one cuddle assignment allowed before range statement (wsl) for flag := range flagCompletionFunctions { ^ bash_completions.go:571:3: if statements should only be cuddled with assignments (wsl) if len(flag.Shorthand) > 0 { ^ bash_completions.go:605:4: assignments should only be cuddled with other assignments (wsl) format += cbn ^ bash_completions.go:600:3: if statements should only be cuddled with assignments (wsl) if _, ok := flag.Annotations[BashCompOneRequiredFlag]; ok { ^ bash_completions.go:693:2: return statements should not be cuddled if block has more than two lines (wsl) return err ^ bash_completions.go:514:2: assignments should only be cuddled with other assignments (wsl) format += cbn ^ bash_completions.go:530:2: if statements should only be cuddled with assignments (wsl) if len(flag.Shorthand) > 0 { ^ bash_completions.go:570:3: expressions should not be cuddled with blocks (wsl) writeFlag(buf, flag, cmd) ^ bash_completions.go:584:3: expressions should not be cuddled with blocks (wsl) writeFlag(buf, flag, cmd) ^ bash_completions.go:585:3: if statements should only be cuddled with assignments (wsl) if len(flag.Shorthand) > 0 { ^ bash_completions.go:595:2: assignments should only be cuddled with other assignments (wsl) flags := cmd.NonInheritedFlags() ^ bash_completions.go:500:2: only one cuddle assignment allowed before if statement (wsl) if len(flag.NoOptDefVal) == 0 { ^ bash_completions.go:526:2: only one cuddle assignment allowed before if statement (wsl) if len(flag.NoOptDefVal) == 0 { ^ bash_completions.go:641:2: expressions should not be cuddled with blocks (wsl) WriteStringAndCheck(buf, ` fi`) ^ bash_completions.go:657:3: expressions should not be cuddled with blocks (wsl) gen(buf, c) ^ bash_completions.go:689:2: expressions should not be cuddled with blocks (wsl) gen(buf, c) ^ bash_completions.go:618:2: only one cuddle assignment allowed before range statement (wsl) for _, value := range cmd.ValidArgs { ^ bash_completions.go:659:2: assignments should only be cuddled with other assignments (wsl) commandName := cmd.CommandPath() ^ bash_completions.go:686:2: if statements should only be cuddled with assignments (wsl) if len(c.BashCompletionFunction) > 0 { ^ bash_completions.go:529:2: expressions should not be cuddled with blocks (wsl) WriteStringAndCheck(buf, fmt.Sprintf(format, name)) ^ bash_completions.go:637:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, value := range cmd.Aliases { ^ bash_completions.go:453:3: expressions should not be cuddled with blocks (wsl) WriteStringAndCheck(buf, fmt.Sprintf(" commands+=(%q)\n", c.Name())) ^ bash_completions.go:511:2: only one cuddle assignment allowed before if statement (wsl) if len(flag.NoOptDefVal) == 0 { ^ bash_completions.go:547:3: assignments should only be cuddled with other assignments (wsl) flag.Annotations[BashCompCustom] = []string{fmt.Sprintf("__%[1]s_handle_go_custom_completion", cmd.Root().Name())} ^ cobra.go:210:5: if statements should only be cuddled with assignments (wsl) if d[i-1][j-1] < min { ^ cobra.go:213:5: assignments should only be cuddled with other assignments (wsl) d[i][j] = min + 1 ^ cobra.go:201:2: only one cuddle assignment allowed before for statement (wsl) for j := 1; j <= len(t); j++ { ^ cobra.go:193:2: assignments should only be cuddled with other assignments (wsl) d := make([][]int, len(s)+1) ^ cobra.go:194:2: only one cuddle assignment allowed before range statement (wsl) for i := range d { ^ cobra.go:198:2: only one cuddle assignment allowed before range statement (wsl) for j := range d[0] { ^ cobra.go:217:2: block should not end with a whitespace (or comment) (wsl) } ^ cobra.go:116:2: assignments should only be cuddled with other assignments (wsl) av := reflect.ValueOf(a) ^ ```
v1.59.1 ``` active_help.go:52:2: return statements should not be cuddled if block has more than two lines (wsl) return activeHelpCfg ^ args.go:99:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:109:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:38:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:46:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:59:3: only one cuddle assignment allowed before range statement (wsl) for _, v := range args { ^ args.go:65:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:79:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:89:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ args.go:121:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ bash_completions.go:637:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, value := range cmd.Aliases { ^ bash_completions.go:453:3: expressions should not be cuddled with blocks (wsl) WriteStringAndCheck(buf, fmt.Sprintf(" commands+=(%q)\n", c.Name())) ^ bash_completions.go:490:4: expressions should not be cuddled with blocks (wsl) WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", ext)) ^ bash_completions.go:514:2: assignments should only be cuddled with other assignments (wsl) format += cbn ^ bash_completions.go:516:2: if statements should only be cuddled with assignments (wsl) if len(flag.NoOptDefVal) == 0 { ^ bash_completions.go:585:3: if statements should only be cuddled with assignments (wsl) if len(flag.Shorthand) > 0 { ^ bash_completions.go:595:2: assignments should only be cuddled with other assignments (wsl) flags := cmd.NonInheritedFlags() ^ bash_completions.go:526:2: only one cuddle assignment allowed before if statement (wsl) if len(flag.NoOptDefVal) == 0 { ^ bash_completions.go:529:2: expressions should not be cuddled with blocks (wsl) WriteStringAndCheck(buf, fmt.Sprintf(format, name)) ^ bash_completions.go:530:2: if statements should only be cuddled with assignments (wsl) if len(flag.Shorthand) > 0 { ^ bash_completions.go:539:2: only one cuddle assignment allowed before range statement (wsl) for flag := range flagCompletionFunctions { ^ bash_completions.go:500:2: only one cuddle assignment allowed before if statement (wsl) if len(flag.NoOptDefVal) == 0 { ^ bash_completions.go:520:2: expressions should not be cuddled with blocks (wsl) writeFlagHandler(buf, "--"+name, flag.Annotations, cmd) ^ bash_completions.go:547:3: assignments should only be cuddled with other assignments (wsl) flag.Annotations[BashCompCustom] = []string{fmt.Sprintf("__%[1]s_handle_go_custom_completion", cmd.Root().Name())} ^ bash_completions.go:647:2: only one cuddle assignment allowed before range statement (wsl) for _, value := range cmd.ArgAliases { ^ bash_completions.go:571:3: if statements should only be cuddled with assignments (wsl) if len(flag.Shorthand) > 0 { ^ bash_completions.go:605:4: assignments should only be cuddled with other assignments (wsl) format += cbn ^ bash_completions.go:600:3: if statements should only be cuddled with assignments (wsl) if _, ok := flag.Annotations[BashCompOneRequiredFlag]; ok { ^ bash_completions.go:641:2: expressions should not be cuddled with blocks (wsl) WriteStringAndCheck(buf, ` fi`) ^ bash_completions.go:511:2: only one cuddle assignment allowed before if statement (wsl) if len(flag.NoOptDefVal) == 0 { ^ bash_completions.go:570:3: expressions should not be cuddled with blocks (wsl) writeFlag(buf, flag, cmd) ^ bash_completions.go:618:2: only one cuddle assignment allowed before range statement (wsl) for _, value := range cmd.ValidArgs { ^ bash_completions.go:624:2: if statements should only be cuddled with assignments (wsl) if cmd.ValidArgsFunction != nil { ^ bash_completions.go:689:2: expressions should not be cuddled with blocks (wsl) gen(buf, c) ^ bash_completions.go:456:2: expressions should not be cuddled with blocks (wsl) WriteStringAndCheck(buf, "\n") ^ bash_completions.go:471:4: expressions should not be cuddled with blocks (wsl) WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", ext)) ^ bash_completions.go:659:2: assignments should only be cuddled with other assignments (wsl) commandName := cmd.CommandPath() ^ bash_completions.go:693:2: return statements should not be cuddled if block has more than two lines (wsl) return err ^ bash_completions.go:449:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, c := range cmd.Commands() { ^ bash_completions.go:503:2: assignments should only be cuddled with other assignments (wsl) format += "flags+=(\"-%s" + cbn ^ bash_completions.go:584:3: expressions should not be cuddled with blocks (wsl) writeFlag(buf, flag, cmd) ^ bash_completions.go:686:2: if statements should only be cuddled with assignments (wsl) if len(c.BashCompletionFunction) > 0 { ^ cobra.go:193:2: assignments should only be cuddled with other assignments (wsl) d := make([][]int, len(s)+1) ^ cobra.go:194:2: only one cuddle assignment allowed before range statement (wsl) for i := range d { ^ cobra.go:213:5: assignments should only be cuddled with other assignments (wsl) d[i][j] = min + 1 ^ cobra.go:201:2: only one cuddle assignment allowed before for statement (wsl) for j := 1; j <= len(t); j++ { ^ cobra.go:116:2: assignments should only be cuddled with other assignments (wsl) av := reflect.ValueOf(a) ^ cobra.go:198:2: only one cuddle assignment allowed before range statement (wsl) for j := range d[0] { ^ cobra.go:217:2: block should not end with a whitespace (or comment) (wsl) } ^ cobra.go:210:5: if statements should only be cuddled with assignments (wsl) if d[i-1][j-1] < min { ^ ```
Command Mean [ms] Min [ms] Max [ms] Relative
local 315.5 ± 4.6 306.8 322.2 1.09 ± 0.06
v1.59.1 289.9 ± 16.7 281.0 336.8 1.00

hashicorp/consul

local ``` main.go:31:2: declarations should never be cuddled (wsl) var names []string ^ main.go:32:2: only one cuddle assignment allowed before range statement (wsl) for c := range cmds { ^ acl/resolver/result.go:21:2: return statements should not be cuddled if block has more than two lines (wsl) return a.ACLIdentity.ID() ^ agent/consul/authmethod/authmethods.go:93:2: if statements should only be cuddled with assignments (wsl) if factory == nil { ^ agent/consul/authmethod/authmethods.go:151:2: return statements should not be cuddled if block has more than two lines (wsl) return validator ^ agent/consul/authmethod/authmethods.go:158:2: assignments should only be cuddled with other assignments (wsl) c.entries = make(map[string]*authMethodValidatorEntry) ^ agent/consul/authmethod/authmethods.go:183:2: only one cuddle assignment allowed before range statement (wsl) for name := range types { ^ agent/consul/authmethod/authmethods.go:144:3: expressions should not be cuddled with blocks (wsl) prev.Validator.Stop() ^ agent/consul/authmethod/authmethods.go:182:2: declarations should never be cuddled (wsl) var list []string ^ agent/consul/authmethod/authmethods.go:186:2: expressions should not be cuddled with blocks (wsl) sort.Strings(list) ^ agent/consul/authmethod/authmethods.go:79:2: return statements should not be cuddled if block has more than two lines (wsl) return v ^ agent/consul/authmethod/authmethods.go:96:2: if statements should only be cuddled with assignments (wsl) if _, dup := types[name]; dup { ^ agent/consul/authmethod/authmethods.go:99:2: assignments should only be cuddled with other assignments (wsl) types[name] = factory ^ agent/consul/authmethod/authmethods.go:106:2: return statements should not be cuddled if block has more than two lines (wsl) return ok ^ agent/consul/authmethod/authmethods.go:122:2: return statements should not be cuddled if block has more than two lines (wsl) return c ^ agent/consul/authmethod/authmethods.go:187:2: return statements should not be cuddled if block has more than two lines (wsl) return list ^ agent/consul/authmethod/authmethods_ce.go:22:2: return statements should not be cuddled if block has more than two lines (wsl) return c ^ agent/consul/authmethod/authmethods_ce.go:28:2: return statements should not be cuddled if block has more than two lines (wsl) return c.cache.GetValidator(method) ^ agent/consul/authmethod/authmethods_ce.go:34:2: return statements should not be cuddled if block has more than two lines (wsl) return c.cache.PutValidatorIfNewer(method, validator, idx) ^ agent/consul/authmethod/testing.go:27:2: expressions should not be cuddled with blocks (wsl) sort.Strings(expectNames) ^ agent/consul/authmethod/testauth/testing.go:70:2: assignments should only be cuddled with other assignments (wsl) sdb, ok := tokenDatabase[sessionID] ^ agent/consul/authmethod/testauth/testing.go:71:2: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ agent/consul/authmethod/testauth/testing.go:148:2: only one cuddle assignment allowed before range statement (wsl) for k, val := range fields { ^ agent/consul/authmethod/testauth/testing.go:33:2: return statements should not be cuddled if block has more than two lines (wsl) return sessionID ^ agent/consul/authmethod/testauth/testing.go:39:2: if statements should only be cuddled with assignments (wsl) if tokenDatabase != nil { ^ agent/consul/authmethod/testauth/testing.go:57:2: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ agent/consul/authmethod/testauth/testing.go:61:2: assignments should only be cuddled with other assignments (wsl) sdb[token] = fields ^ agent/consul/authmethod/testauth/testing.go:75:2: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ agent/consul/authmethod/testauth/testing.go:151:2: assignments should only be cuddled with other assignments (wsl) id.EnterpriseMeta = v.testAuthEntMetaFromFields(fields) ^ agent/consul/authmethod/testauth/testing.go:53:2: if statements should only be cuddled with assignments (wsl) if tokenDatabase == nil { ^ agent/consul/authmethod/testauth/testing.go:56:2: assignments should only be cuddled with other assignments (wsl) sdb, ok := tokenDatabase[sessionID] ^ agent/consul/authmethod/testauth/testing.go:67:2: if statements should only be cuddled with assignments (wsl) if tokenDatabase == nil { ^ agent/consul/authmethod/testauth/testing.go:74:2: assignments should only be cuddled with other assignments (wsl) fields, ok := sdb[token] ^ agent/consul/reporting/reporting.go:50:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ agent/grpc-external/services/resource/delete.go:57:3: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/delete.go:76:3: only one cuddle assignment allowed before if statement (wsl) if deleteVersion == "" || deleteId.Uid == "" { ^ agent/grpc-external/services/resource/delete.go:40:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ agent/grpc-external/services/resource/delete.go:67:3: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/delete.go:123:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ agent/grpc-external/services/resource/list.go:86:2: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/list.go:28:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ agent/grpc-external/services/resource/list.go:34:2: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/list.go:67:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ agent/grpc-external/services/resource/list.go:73:3: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/list.go:79:3: append only allowed to cuddle with appended value (wsl) result = append(result, resource) ^ agent/grpc-external/services/resource/list.go:56:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, resource := range resources { ^ agent/grpc-external/services/resource/list_by_owner.go:38:2: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/list_by_owner.go:66:4: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ agent/grpc-external/services/resource/list_by_owner.go:73:3: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/list_by_owner.go:52:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, child := range children { ^ ```
v1.59.1 ``` main.go:31:2: declarations should never be cuddled (wsl) var names []string ^ main.go:32:2: only one cuddle assignment allowed before range statement (wsl) for c := range cmds { ^ acl/resolver/result.go:21:2: return statements should not be cuddled if block has more than two lines (wsl) return a.ACLIdentity.ID() ^ agent/consul/authmethod/authmethods.go:158:2: assignments should only be cuddled with other assignments (wsl) c.entries = make(map[string]*authMethodValidatorEntry) ^ agent/consul/authmethod/authmethods.go:182:2: declarations should never be cuddled (wsl) var list []string ^ agent/consul/authmethod/authmethods.go:183:2: only one cuddle assignment allowed before range statement (wsl) for name := range types { ^ agent/consul/authmethod/authmethods.go:79:2: return statements should not be cuddled if block has more than two lines (wsl) return v ^ agent/consul/authmethod/authmethods.go:93:2: if statements should only be cuddled with assignments (wsl) if factory == nil { ^ agent/consul/authmethod/authmethods.go:96:2: if statements should only be cuddled with assignments (wsl) if _, dup := types[name]; dup { ^ agent/consul/authmethod/authmethods.go:106:2: return statements should not be cuddled if block has more than two lines (wsl) return ok ^ agent/consul/authmethod/authmethods.go:122:2: return statements should not be cuddled if block has more than two lines (wsl) return c ^ agent/consul/authmethod/authmethods.go:99:2: assignments should only be cuddled with other assignments (wsl) types[name] = factory ^ agent/consul/authmethod/authmethods.go:144:3: expressions should not be cuddled with blocks (wsl) prev.Validator.Stop() ^ agent/consul/authmethod/authmethods.go:151:2: return statements should not be cuddled if block has more than two lines (wsl) return validator ^ agent/consul/authmethod/authmethods.go:186:2: expressions should not be cuddled with blocks (wsl) sort.Strings(list) ^ agent/consul/authmethod/authmethods.go:187:2: return statements should not be cuddled if block has more than two lines (wsl) return list ^ agent/consul/authmethod/authmethods_ce.go:34:2: return statements should not be cuddled if block has more than two lines (wsl) return c.cache.PutValidatorIfNewer(method, validator, idx) ^ agent/consul/authmethod/authmethods_ce.go:22:2: return statements should not be cuddled if block has more than two lines (wsl) return c ^ agent/consul/authmethod/authmethods_ce.go:28:2: return statements should not be cuddled if block has more than two lines (wsl) return c.cache.GetValidator(method) ^ agent/consul/authmethod/testing.go:27:2: expressions should not be cuddled with blocks (wsl) sort.Strings(expectNames) ^ agent/consul/authmethod/testauth/testing.go:75:2: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ agent/consul/authmethod/testauth/testing.go:148:2: only one cuddle assignment allowed before range statement (wsl) for k, val := range fields { ^ agent/consul/authmethod/testauth/testing.go:53:2: if statements should only be cuddled with assignments (wsl) if tokenDatabase == nil { ^ agent/consul/authmethod/testauth/testing.go:56:2: assignments should only be cuddled with other assignments (wsl) sdb, ok := tokenDatabase[sessionID] ^ agent/consul/authmethod/testauth/testing.go:57:2: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ agent/consul/authmethod/testauth/testing.go:61:2: assignments should only be cuddled with other assignments (wsl) sdb[token] = fields ^ agent/consul/authmethod/testauth/testing.go:70:2: assignments should only be cuddled with other assignments (wsl) sdb, ok := tokenDatabase[sessionID] ^ agent/consul/authmethod/testauth/testing.go:71:2: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ agent/consul/authmethod/testauth/testing.go:33:2: return statements should not be cuddled if block has more than two lines (wsl) return sessionID ^ agent/consul/authmethod/testauth/testing.go:39:2: if statements should only be cuddled with assignments (wsl) if tokenDatabase != nil { ^ agent/consul/authmethod/testauth/testing.go:67:2: if statements should only be cuddled with assignments (wsl) if tokenDatabase == nil { ^ agent/consul/authmethod/testauth/testing.go:74:2: assignments should only be cuddled with other assignments (wsl) fields, ok := sdb[token] ^ agent/consul/authmethod/testauth/testing.go:151:2: assignments should only be cuddled with other assignments (wsl) id.EnterpriseMeta = v.testAuthEntMetaFromFields(fields) ^ agent/consul/reporting/reporting.go:50:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ agent/grpc-external/services/resource/delete.go:123:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ agent/grpc-external/services/resource/delete.go:40:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ agent/grpc-external/services/resource/delete.go:57:3: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/delete.go:67:3: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/delete.go:76:3: only one cuddle assignment allowed before if statement (wsl) if deleteVersion == "" || deleteId.Uid == "" { ^ agent/grpc-external/services/resource/list.go:34:2: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/list.go:67:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ agent/grpc-external/services/resource/list.go:73:3: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/list.go:79:3: append only allowed to cuddle with appended value (wsl) result = append(result, resource) ^ agent/grpc-external/services/resource/list.go:56:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, resource := range resources { ^ agent/grpc-external/services/resource/list.go:86:2: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/list.go:28:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ agent/grpc-external/services/resource/list_by_owner.go:38:2: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/list_by_owner.go:66:4: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ agent/grpc-external/services/resource/list_by_owner.go:73:3: anonymous switch statements should never be cuddled (wsl) switch { ^ agent/grpc-external/services/resource/list_by_owner.go:52:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, child := range children { ^ ```
Command Mean [s] Min [s] Max [s] Relative
local 5.632 ± 0.070 5.566 5.814 1.01 ± 0.01
v1.59.1 5.601 ± 0.039 5.545 5.674 1.00

go-delve/delve

local ``` cmd/dlv/cmds/helphelpers/help.go:95:2: expressions should not be cuddled with blocks (wsl) hideFlag(cmd.Parent(), name) ^ cmd/dlv/cmds/helphelpers/help.go:90:2: assignments should only be cuddled with other assignments (wsl) flag := cmd.Flags().Lookup(name) ^ cmd/dlv/cmds/helphelpers/help.go:91:2: only one cuddle assignment allowed before if statement (wsl) if flag != nil { ^ pkg/astutil/astutil.go:36:2: return statements should not be cuddled if block has more than two lines (wsl) return &ast.BinaryExpr{Op: token.LAND, X: x, Y: y} ^ pkg/astutil/astutil.go:44:2: return statements should not be cuddled if block has more than two lines (wsl) return &ast.BinaryExpr{Op: token.LOR, X: x, Y: y} ^ pkg/dwarf/parseutil.go:35:3: return statements should not be cuddled if block has more than two lines (wsl) return uint64(n), nil ^ pkg/dwarf/parseutil.go:76:2: only one cuddle assignment allowed before switch statement (wsl) switch { ^ pkg/dwarf/parseutil.go:118:3: only one cuddle assignment allowed before if statement (wsl) if dwarf64 { ^ pkg/dwarf/parseutil.go:29:3: return statements should not be cuddled if block has more than two lines (wsl) return uint64(n), nil ^ pkg/dwarf/parseutil.go:41:3: return statements should not be cuddled if block has more than two lines (wsl) return n, nil ^ pkg/dwarf/parseutil.go:43:2: return statements should not be cuddled if block has more than two lines (wsl) return 0, fmt.Errorf("pointer size %d not supported", ptrSize) ^ pkg/dwarf/parseutil.go:54:2: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Errorf("pointer size %d not supported", ptrSize) ^ pkg/dwarf/parseutil.go:65:2: only one cuddle assignment allowed before if statement (wsl) if lengthfield == ^uint32(0) { ^ pkg/dwarf/parseutil.go:112:2: only one cuddle assignment allowed before for statement (wsl) for len(data) > 0 { ^ pkg/dwarf/parseutil.go:149:2: return statements should not be cuddled if block has more than two lines (wsl) return r ^ pkg/dwarf/dwarfbuilder/builder.go:49:2: assignments should only be cuddled with other assignments (wsl) loc = b.loc.Bytes() ^ pkg/dwarf/dwarfbuilder/info.go:316:2: return statements should not be cuddled if block has more than two lines (wsl) return r ^ pkg/dwarf/dwarfbuilder/info.go:150:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, x) ^ pkg/dwarf/dwarfbuilder/info.go:239:3: only one cuddle assignment allowed before range statement (wsl) for j := range b.abbrevs[i].attr { ^ pkg/dwarf/dwarfbuilder/info.go:144:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, x) ^ pkg/dwarf/dwarfbuilder/info.go:153:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, x) ^ pkg/dwarf/dwarfbuilder/info.go:225:2: return statements should not be cuddled if block has more than two lines (wsl) return byte(len(b.abbrevs)) ^ pkg/dwarf/dwarfbuilder/info.go:115:2: assignments should only be cuddled with other assignments (wsl) tag := b.tagStack[len(b.tagStack)-1] ^ pkg/dwarf/dwarfbuilder/info.go:140:3: only cuddled expressions if assigning variable or using from line above (wsl) b.info.Write([]byte(x)) ^ pkg/dwarf/dwarfbuilder/info.go:107:2: assignments should only be cuddled with other assignments (wsl) b.tagStack[len(b.tagStack)-1].children = true ^ pkg/dwarf/dwarfbuilder/info.go:91:2: assignments should only be cuddled with other assignments (wsl) ts := &tagState{off: dwarf.Offset(b.info.Len())} ^ pkg/dwarf/dwarfbuilder/info.go:93:2: only cuddled expressions if assigning variable or using from line above (wsl) b.info.WriteByte(0) ^ pkg/dwarf/dwarfbuilder/info.go:198:2: if statements should only be cuddled with assignments (wsl) if len(a.attr) != len(b.attr) { ^ pkg/dwarf/dwarfbuilder/info.go:201:2: if statements should only be cuddled with assignments (wsl) if a.children != b.children { ^ pkg/dwarf/dwarfbuilder/info.go:129:2: assignments should only be cuddled with other assignments (wsl) off := dwarf.Offset(b.info.Len()) ^ pkg/dwarf/dwarfbuilder/info.go:163:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, uint32(b.loc.Len())) ^ pkg/dwarf/dwarfbuilder/info.go:208:3: if statements should only be cuddled with assignments (wsl) if a.form[i] != b.form[i] { ^ pkg/dwarf/dwarfbuilder/info.go:156:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, x) ^ pkg/dwarf/dwarfbuilder/info.go:243:3: expressions should not be cuddled with blocks (wsl) leb128.EncodeUnsigned(&abbrev, 0) ^ pkg/dwarf/dwarfbuilder/info.go:118:2: if statements should only be cuddled with assignments (wsl) if tag.children { ^ pkg/dwarf/dwarfbuilder/info.go:147:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, x) ^ pkg/dwarf/dwarfbuilder/info.go:131:2: only one cuddle assignment allowed before if statement (wsl) if tag.children { ^ pkg/dwarf/dwarfbuilder/info.go:159:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, uint32(len(x))) ^ pkg/dwarf/dwarfbuilder/info.go:204:2: only one cuddle assignment allowed before range statement (wsl) for i := range a.attr { ^ pkg/dwarf/dwarfbuilder/info.go:234:3: if statements should only be cuddled with assignments (wsl) if b.abbrevs[i].children { ^ pkg/dwarf/dwarfbuilder/info.go:95:2: only one cuddle assignment allowed before if statement (wsl) if name != "" { ^ pkg/dwarf/dwarfbuilder/info.go:121:2: assignments should only be cuddled with other assignments (wsl) b.tagStack = b.tagStack[:len(b.tagStack)-1] ^ pkg/dwarf/dwarfbuilder/loc.go:21:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, arg := range args { ^ pkg/dwarf/reader/reader.go:174:2: only one cuddle assignment allowed before if statement (wsl) if member { ^ pkg/dwarf/reader/reader.go:179:2: assignments should only be cuddled with other assignments (wsl) instr, ok := entry.Val(attr).([]byte) ^ pkg/dwarf/reader/reader.go:43:2: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ pkg/dwarf/reader/reader.go:133:2: for statements should only be cuddled with assignments used in the iteration (wsl) for entry, err := reader.Next(); entry != nil; entry, err = reader.Next() { ^ pkg/dwarf/reader/reader.go:180:2: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ pkg/dwarf/reader/reader.go:47:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ pkg/dwarf/reader/reader.go:42:2: assignments should only be cuddled with other assignments (wsl) instructions, ok := entry.Val(dwarf.AttrLocation).([]byte) ^ ```
v1.59.1 ``` cmd/dlv/cmds/helphelpers/help.go:90:2: assignments should only be cuddled with other assignments (wsl) flag := cmd.Flags().Lookup(name) ^ cmd/dlv/cmds/helphelpers/help.go:91:2: only one cuddle assignment allowed before if statement (wsl) if flag != nil { ^ cmd/dlv/cmds/helphelpers/help.go:95:2: expressions should not be cuddled with blocks (wsl) hideFlag(cmd.Parent(), name) ^ pkg/astutil/astutil.go:36:2: return statements should not be cuddled if block has more than two lines (wsl) return &ast.BinaryExpr{Op: token.LAND, X: x, Y: y} ^ pkg/astutil/astutil.go:44:2: return statements should not be cuddled if block has more than two lines (wsl) return &ast.BinaryExpr{Op: token.LOR, X: x, Y: y} ^ pkg/dwarf/parseutil.go:35:3: return statements should not be cuddled if block has more than two lines (wsl) return uint64(n), nil ^ pkg/dwarf/parseutil.go:43:2: return statements should not be cuddled if block has more than two lines (wsl) return 0, fmt.Errorf("pointer size %d not supported", ptrSize) ^ pkg/dwarf/parseutil.go:54:2: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Errorf("pointer size %d not supported", ptrSize) ^ pkg/dwarf/parseutil.go:65:2: only one cuddle assignment allowed before if statement (wsl) if lengthfield == ^uint32(0) { ^ pkg/dwarf/parseutil.go:76:2: only one cuddle assignment allowed before switch statement (wsl) switch { ^ pkg/dwarf/parseutil.go:118:3: only one cuddle assignment allowed before if statement (wsl) if dwarf64 { ^ pkg/dwarf/parseutil.go:149:2: return statements should not be cuddled if block has more than two lines (wsl) return r ^ pkg/dwarf/parseutil.go:29:3: return statements should not be cuddled if block has more than two lines (wsl) return uint64(n), nil ^ pkg/dwarf/parseutil.go:41:3: return statements should not be cuddled if block has more than two lines (wsl) return n, nil ^ pkg/dwarf/parseutil.go:112:2: only one cuddle assignment allowed before for statement (wsl) for len(data) > 0 { ^ pkg/dwarf/dwarfbuilder/builder.go:49:2: assignments should only be cuddled with other assignments (wsl) loc = b.loc.Bytes() ^ pkg/dwarf/dwarfbuilder/info.go:91:2: assignments should only be cuddled with other assignments (wsl) ts := &tagState{off: dwarf.Offset(b.info.Len())} ^ pkg/dwarf/dwarfbuilder/info.go:107:2: assignments should only be cuddled with other assignments (wsl) b.tagStack[len(b.tagStack)-1].children = true ^ pkg/dwarf/dwarfbuilder/info.go:129:2: assignments should only be cuddled with other assignments (wsl) off := dwarf.Offset(b.info.Len()) ^ pkg/dwarf/dwarfbuilder/info.go:144:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, x) ^ pkg/dwarf/dwarfbuilder/info.go:255:2: return statements should not be cuddled if block has more than two lines (wsl) return r ^ pkg/dwarf/dwarfbuilder/info.go:118:2: if statements should only be cuddled with assignments (wsl) if tag.children { ^ pkg/dwarf/dwarfbuilder/info.go:147:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, x) ^ pkg/dwarf/dwarfbuilder/info.go:239:3: only one cuddle assignment allowed before range statement (wsl) for j := range b.abbrevs[i].attr { ^ pkg/dwarf/dwarfbuilder/info.go:243:3: expressions should not be cuddled with blocks (wsl) leb128.EncodeUnsigned(&abbrev, 0) ^ pkg/dwarf/dwarfbuilder/info.go:288:2: return statements should not be cuddled if block has more than two lines (wsl) return r ^ pkg/dwarf/dwarfbuilder/info.go:115:2: assignments should only be cuddled with other assignments (wsl) tag := b.tagStack[len(b.tagStack)-1] ^ pkg/dwarf/dwarfbuilder/info.go:140:3: only cuddled expressions if assigning variable or using from line above (wsl) b.info.Write([]byte(x)) ^ pkg/dwarf/dwarfbuilder/info.go:156:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, x) ^ pkg/dwarf/dwarfbuilder/info.go:93:2: only cuddled expressions if assigning variable or using from line above (wsl) b.info.WriteByte(0) ^ pkg/dwarf/dwarfbuilder/info.go:121:2: assignments should only be cuddled with other assignments (wsl) b.tagStack = b.tagStack[:len(b.tagStack)-1] ^ pkg/dwarf/dwarfbuilder/info.go:201:2: if statements should only be cuddled with assignments (wsl) if a.children != b.children { ^ pkg/dwarf/dwarfbuilder/info.go:208:3: if statements should only be cuddled with assignments (wsl) if a.form[i] != b.form[i] { ^ pkg/dwarf/dwarfbuilder/info.go:131:2: only one cuddle assignment allowed before if statement (wsl) if tag.children { ^ pkg/dwarf/dwarfbuilder/info.go:234:3: if statements should only be cuddled with assignments (wsl) if b.abbrevs[i].children { ^ pkg/dwarf/dwarfbuilder/info.go:150:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, x) ^ pkg/dwarf/dwarfbuilder/info.go:153:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, x) ^ pkg/dwarf/dwarfbuilder/info.go:159:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, uint32(len(x))) ^ pkg/dwarf/dwarfbuilder/info.go:163:3: only cuddled expressions if assigning variable or using from line above (wsl) binary.Write(&b.info, binary.LittleEndian, uint32(b.loc.Len())) ^ pkg/dwarf/dwarfbuilder/info.go:204:2: only one cuddle assignment allowed before range statement (wsl) for i := range a.attr { ^ pkg/dwarf/dwarfbuilder/info.go:95:2: only one cuddle assignment allowed before if statement (wsl) if name != "" { ^ pkg/dwarf/dwarfbuilder/info.go:198:2: if statements should only be cuddled with assignments (wsl) if len(a.attr) != len(b.attr) { ^ pkg/dwarf/dwarfbuilder/loc.go:21:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, arg := range args { ^ pkg/dwarf/reader/reader.go:43:2: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ pkg/dwarf/reader/reader.go:174:2: only one cuddle assignment allowed before if statement (wsl) if member { ^ pkg/dwarf/reader/reader.go:300:4: if statements should only be cuddled with assignments (wsl) if n.Tag == dwarf.TagInlinedSubroutine { ^ pkg/dwarf/reader/reader.go:42:2: assignments should only be cuddled with other assignments (wsl) instructions, ok := entry.Val(dwarf.AttrLocation).([]byte) ^ pkg/dwarf/reader/reader.go:47:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ pkg/dwarf/reader/reader.go:180:2: only one cuddle assignment allowed before if statement (wsl) if !ok { ^ pkg/dwarf/reader/reader.go:179:2: assignments should only be cuddled with other assignments (wsl) instr, ok := entry.Val(attr).([]byte) ^ ```
Command Mean [s] Min [s] Max [s] Relative
local 1.413 ± 0.017 1.377 1.431 1.02 ± 0.03
v1.59.1 1.383 ± 0.043 1.332 1.473 1.00

etcd-io/etcd

local ``` contrib/lock/client/client.go:109:2: assignments should only be cuddled with other assignments (wsl) _, err = client.MemberList(ctx) ^ contrib/lock/client/client.go:110:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/lock/client/client.go:124:2: assignments should only be cuddled with other assignments (wsl) version := session.Lease() ^ contrib/lock/client/client.go:129:3: assignments should only be cuddled with other assignments (wsl) reader := bufio.NewReader(os.Stdin) ^ contrib/lock/client/client.go:131:3: only cuddled expressions if assigning variable or using from line above (wsl) log.Print("resuming client 1") ^ contrib/lock/client/client.go:72:2: expressions should not be cuddled with blocks (wsl) httpResp.Body.Close() ^ contrib/lock/client/client.go:76:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/lock/storage/storage.go:107:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/lock/storage/storage.go:52:2: assignments should only be cuddled with other assignments (wsl) _, err = w.Write(wBytes) ^ contrib/lock/storage/storage.go:53:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/lock/storage/storage.go:68:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/lock/storage/storage.go:101:2: return statements should not be cuddled if block has more than two lines (wsl) return escaped ^ tools/benchmark/cmd/lease.go:57:4: assignments should only be cuddled with other assignments (wsl) resp, err := c.Grant(context.Background(), 100) ^ tools/benchmark/cmd/lease.go:55:3: go statements can only invoke functions assigned on line above (wsl) go func(c v3.Lease) { ^ tools/benchmark/cmd/lease.go:73:3: for statements should only be cuddled with assignments used in the iteration (wsl) for i := 0; i < leaseKeepaliveTotal; i++ { ^ tools/benchmark/cmd/lease.go:76:3: expressions should not be cuddled with blocks (wsl) close(requests) ^ tools/benchmark/cmd/lease.go:80:2: only cuddled expressions if assigning variable or using from line above (wsl) wg.Wait() ^ tools/benchmark/cmd/lease.go:58:4: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ tools/benchmark/cmd/lease.go:61:4: only one cuddle assignment allowed before range statement (wsl) for range requests { ^ tools/benchmark/cmd/lease.go:53:2: ranges should only be cuddled with assignments used in the iteration (wsl) for i := range clients { ^ tools/benchmark/cmd/lease.go:71:2: go statements can only invoke functions assigned on line above (wsl) go func() { ^ tools/benchmark/cmd/mvcc-put.go:60:1: block should not end with a whitespace (or comment) (wsl) } ^ tools/benchmark/cmd/mvcc-put.go:70:2: return statements should not be cuddled if block has more than two lines (wsl) return rs ^ tools/benchmark/cmd/mvcc-put.go:80:3: only one cuddle assignment allowed before defer statement (wsl) defer f.Close() ^ tools/benchmark/cmd/mvcc-put.go:95:3: only one cuddle assignment allowed before defer statement (wsl) defer f.Close() ^ tools/benchmark/cmd/mvcc-put.go:129:4: only cuddled expressions if assigning variable or using from line above (wsl) s.Put(keys[i], vals[i], lease.NoLease) ^ tools/benchmark/cmd/mvcc-put.go:82:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ tools/benchmark/cmd/mvcc-put.go:86:3: only one cuddle assignment allowed before defer statement (wsl) defer pprof.StopCPUProfile() ^ tools/benchmark/cmd/mvcc-put.go:101:4: block should not end with a whitespace (or comment) (wsl) } ^ tools/benchmark/cmd/mvcc-put.go:122:4: expressions should not be cuddled with blocks (wsl) tw.End() ^ tools/benchmark/cmd/mvcc.go:42:2: only cuddled expressions if assigning variable or using from line above (wsl) os.Remove("mvcc-bench") // boltDB has an opened fd, so removing the file is ok ^ tools/benchmark/cmd/put.go:116:3: expressions should not be cuddled with blocks (wsl) close(requests) ^ tools/benchmark/cmd/put.go:150:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ tools/benchmark/cmd/put.go:163:2: assignments should only be cuddled with other assignments (wsl) host := eps[0] ^ tools/benchmark/cmd/put.go:94:3: go statements can only invoke functions assigned on line above (wsl) go func(c *v3.Client) { ^ tools/benchmark/cmd/put.go:92:2: ranges should only be cuddled with assignments used in the iteration (wsl) for i := range clients { ^ tools/benchmark/cmd/put.go:149:2: only cuddled expressions if assigning variable or using from line above (wsl) cancel() ^ tools/benchmark/cmd/put.go:129:2: only cuddled expressions if assigning variable or using from line above (wsl) wg.Wait() ^ tools/benchmark/cmd/put.go:143:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ tools/benchmark/cmd/put.go:167:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ tools/benchmark/cmd/put.go:172:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ tools/benchmark/cmd/put.go:81:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if putRate == 0 { ^ tools/benchmark/cmd/put.go:96:4: ranges should only be cuddled with assignments used in the iteration (wsl) for op := range requests { ^ tools/benchmark/cmd/put.go:146:2: assignments should only be cuddled with other assignments (wsl) revToCompact := max(0, resp.Header.Revision-compactIndexDelta) ^ tools/benchmark/cmd/put.go:160:2: only one cuddle assignment allowed before range statement (wsl) for i, ip := range eps { ^ tools/benchmark/cmd/put.go:171:2: assignments should only be cuddled with other assignments (wsl) rt, err := clients[0].Status(context.Background(), host) ^ tools/benchmark/cmd/put.go:84:2: assignments should only be cuddled with other assignments (wsl) limit := rate.NewLimiter(rate.Limit(putRate), 1) ^ tools/benchmark/cmd/put.go:142:2: only cuddled expressions if assigning variable or using from line above (wsl) cancel() ^ tools/benchmark/cmd/range.go:65:2: only one cuddle assignment allowed before if statement (wsl) if len(args) == 2 { ^ tools/benchmark/cmd/range.go:81:2: assignments should only be cuddled with other assignments (wsl) limit := rate.NewLimiter(rate.Limit(rangeRate), 1) ^ ```
v1.59.1 ``` contrib/lock/client/client.go:110:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/lock/client/client.go:124:2: assignments should only be cuddled with other assignments (wsl) version := session.Lease() ^ contrib/lock/client/client.go:129:3: assignments should only be cuddled with other assignments (wsl) reader := bufio.NewReader(os.Stdin) ^ contrib/lock/client/client.go:131:3: only cuddled expressions if assigning variable or using from line above (wsl) log.Print("resuming client 1") ^ contrib/lock/client/client.go:72:2: expressions should not be cuddled with blocks (wsl) httpResp.Body.Close() ^ contrib/lock/client/client.go:76:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/lock/client/client.go:109:2: assignments should only be cuddled with other assignments (wsl) _, err = client.MemberList(ctx) ^ contrib/lock/storage/storage.go:52:2: assignments should only be cuddled with other assignments (wsl) _, err = w.Write(wBytes) ^ contrib/lock/storage/storage.go:53:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/lock/storage/storage.go:68:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/lock/storage/storage.go:101:2: return statements should not be cuddled if block has more than two lines (wsl) return escaped ^ contrib/lock/storage/storage.go:107:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ tools/benchmark/cmd/lease.go:61:4: only one cuddle assignment allowed before range statement (wsl) for range requests { ^ tools/benchmark/cmd/lease.go:55:3: go statements can only invoke functions assigned on line above (wsl) go func(c v3.Lease) { ^ tools/benchmark/cmd/lease.go:53:2: ranges should only be cuddled with assignments used in the iteration (wsl) for i := range clients { ^ tools/benchmark/cmd/lease.go:73:3: for statements should only be cuddled with assignments used in the iteration (wsl) for i := 0; i < leaseKeepaliveTotal; i++ { ^ tools/benchmark/cmd/lease.go:71:2: go statements can only invoke functions assigned on line above (wsl) go func() { ^ tools/benchmark/cmd/lease.go:80:2: only cuddled expressions if assigning variable or using from line above (wsl) wg.Wait() ^ tools/benchmark/cmd/lease.go:57:4: assignments should only be cuddled with other assignments (wsl) resp, err := c.Grant(context.Background(), 100) ^ tools/benchmark/cmd/lease.go:58:4: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ tools/benchmark/cmd/mvcc-put.go:70:2: return statements should not be cuddled if block has more than two lines (wsl) return rs ^ tools/benchmark/cmd/mvcc-put.go:80:3: only one cuddle assignment allowed before defer statement (wsl) defer f.Close() ^ tools/benchmark/cmd/mvcc-put.go:82:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ tools/benchmark/cmd/mvcc-put.go:86:3: only one cuddle assignment allowed before defer statement (wsl) defer pprof.StopCPUProfile() ^ tools/benchmark/cmd/mvcc-put.go:95:3: only one cuddle assignment allowed before defer statement (wsl) defer f.Close() ^ tools/benchmark/cmd/mvcc-put.go:101:4: block should not end with a whitespace (or comment) (wsl) } ^ tools/benchmark/cmd/mvcc-put.go:129:4: only cuddled expressions if assigning variable or using from line above (wsl) s.Put(keys[i], vals[i], lease.NoLease) ^ tools/benchmark/cmd/mvcc-put.go:60:1: block should not end with a whitespace (or comment) (wsl) } ^ tools/benchmark/cmd/mvcc.go:42:2: only cuddled expressions if assigning variable or using from line above (wsl) os.Remove("mvcc-bench") // boltDB has an opened fd, so removing the file is ok ^ tools/benchmark/cmd/put.go:129:2: only cuddled expressions if assigning variable or using from line above (wsl) wg.Wait() ^ tools/benchmark/cmd/put.go:143:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ tools/benchmark/cmd/put.go:171:2: assignments should only be cuddled with other assignments (wsl) rt, err := clients[0].Status(context.Background(), host) ^ tools/benchmark/cmd/put.go:96:4: ranges should only be cuddled with assignments used in the iteration (wsl) for op := range requests { ^ tools/benchmark/cmd/put.go:92:2: ranges should only be cuddled with assignments used in the iteration (wsl) for i := range clients { ^ tools/benchmark/cmd/put.go:149:2: only cuddled expressions if assigning variable or using from line above (wsl) cancel() ^ tools/benchmark/cmd/put.go:167:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ tools/benchmark/cmd/put.go:81:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if putRate == 0 { ^ tools/benchmark/cmd/put.go:94:3: go statements can only invoke functions assigned on line above (wsl) go func(c *v3.Client) { ^ tools/benchmark/cmd/put.go:142:2: only cuddled expressions if assigning variable or using from line above (wsl) cancel() ^ tools/benchmark/cmd/put.go:146:2: assignments should only be cuddled with other assignments (wsl) revToCompact := max(0, resp.Header.Revision-compactIndexDelta) ^ tools/benchmark/cmd/put.go:150:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ tools/benchmark/cmd/put.go:163:2: assignments should only be cuddled with other assignments (wsl) host := eps[0] ^ tools/benchmark/cmd/put.go:172:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ tools/benchmark/cmd/put.go:84:2: assignments should only be cuddled with other assignments (wsl) limit := rate.NewLimiter(rate.Limit(putRate), 1) ^ tools/benchmark/cmd/put.go:160:2: only one cuddle assignment allowed before range statement (wsl) for i, ip := range eps { ^ tools/benchmark/cmd/range.go:111:4: if statements should only be cuddled with assignments (wsl) if rangeConsistency == "s" { ^ tools/benchmark/cmd/range.go:114:4: assignments should only be cuddled with other assignments (wsl) op := v3.OpGet(k, opts...) ^ tools/benchmark/cmd/range.go:121:2: only cuddled expressions if assigning variable or using from line above (wsl) wg.Wait() ^ tools/benchmark/cmd/range.go:65:2: only one cuddle assignment allowed before if statement (wsl) if len(args) == 2 { ^ tools/benchmark/cmd/range.go:94:4: ranges should only be cuddled with assignments used in the iteration (wsl) for op := range requests { ^ ```
Command Mean [ms] Min [ms] Max [ms] Relative
local 334.0 ± 17.0 320.2 380.7 1.00
v1.59.1 337.1 ± 76.1 294.0 531.8 1.01 ± 0.23

go-gitea/gitea

local ``` contrib/backport/backport.go:121:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:125:2: if statements should only be cuddled with assignments (wsl) if version == "" { ^ contrib/backport/backport.go:128:2: if statements should only be cuddled with assignments (wsl) if version == "" { ^ contrib/backport/backport.go:139:2: only one cuddle assignment allowed before if statement (wsl) if remote == "" && !c.Bool("--no-push") { ^ contrib/backport/backport.go:160:2: if statements should only be cuddled with assignments (wsl) if pr == "" { ^ contrib/backport/backport.go:175:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:179:2: if statements should only be cuddled with assignments (wsl) if sha == "" { ^ contrib/backport/backport.go:220:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ contrib/backport/backport.go:230:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ contrib/backport/backport.go:236:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:240:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ contrib/backport/backport.go:245:2: assignments should only be cuddled with other assignments (wsl) out, err := exec.CommandContext(ctx, "git", "log", "-1", "--pretty=format:%B").Output() ^ contrib/backport/backport.go:246:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:256:2: assignments should only be cuddled with other assignments (wsl) subject, body := parts[0], parts[1] ^ contrib/backport/backport.go:266:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ contrib/backport/backport.go:274:3: assignments should only be cuddled with other assignments (wsl) out, err := exec.CommandContext(ctx, "git", "cherry-pick", "--continue").Output() ^ contrib/backport/backport.go:275:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:279:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ contrib/backport/backport.go:284:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:288:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ contrib/backport/backport.go:299:2: if statements should only be cuddled with assignments (wsl) if currentBranch == backportBranch { ^ contrib/backport/backport.go:310:2: return statements should not be cuddled if block has more than two lines (wsl) return exec.CommandContext(ctx, "git", "checkout", "-b", backportBranch, releaseBranch).Run() ^ contrib/backport/backport.go:320:2: expressions should not be cuddled with blocks (wsl) fmt.Println(string(out)) ^ contrib/backport/backport.go:324:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:328:2: expressions should not be cuddled with blocks (wsl) fmt.Println(string(out)) ^ contrib/backport/backport.go:339:2: assignments should only be cuddled with other assignments (wsl) lines := strings.Split(string(out), "\n") ^ contrib/backport/backport.go:340:2: only one cuddle assignment allowed before range statement (wsl) for _, line := range lines { ^ contrib/backport/backport.go:355:3: if statements should only be cuddled with assignments (wsl) if !strings.Contains(remote, forkUser) { ^ contrib/backport/backport.go:358:3: if statements should only be cuddled with assignments (wsl) if strings.HasPrefix(remote, "git@github.com:") { ^ contrib/backport/backport.go:367:3: assignments should only be cuddled with other assignments (wsl) idx := strings.Index(forkUser, "/") ^ contrib/backport/backport.go:368:3: only one cuddle assignment allowed before if statement (wsl) if idx >= 0 { ^ contrib/backport/backport.go:371:3: return statements should not be cuddled if block has more than two lines (wsl) return name, forkUser, nil ^ contrib/backport/backport.go:373:2: return statements should not be cuddled if block has more than two lines (wsl) return "", "", fmt.Errorf("unable to find appropriate remote in:\n%s", string(out)) ^ contrib/backport/backport.go:382:2: assignments should only be cuddled with other assignments (wsl) parts := strings.Split(strings.TrimSpace(string(out)), "-") ^ contrib/backport/backport.go:399:3: expressions should not be cuddled with blocks (wsl) fmt.Fprintf(os.Stderr, "Unable to read `docs/config.yaml`: %v\n", err) ^ contrib/backport/backport.go:400:3: return statements should not be cuddled if block has more than two lines (wsl) return "" ^ contrib/backport/backport.go:406:2: declarations should never be cuddled (wsl) type docConfig struct { ^ contrib/backport/backport.go:409:2: assignments should only be cuddled with other assignments (wsl) dc := &docConfig{} ^ contrib/backport/backport.go:410:2: only one cuddle assignment allowed before if statement (wsl) if err := yaml.Unmarshal(bs, dc); err != nil { ^ contrib/environment-to-ini/environment-to-ini.go:102:2: if statements should only be cuddled with assignments (wsl) if destination != setting.CustomConf || changed { ^ contrib/fixtures/fixture_generation.go:41:2: if statements should only be cuddled with assignments (wsl) if err := unittest.PrepareTestDatabase(); err != nil { ^ contrib/fixtures/fixture_generation.go:45:2: assignments should only be cuddled with other assignments (wsl) ctx := context.Background() ^ contrib/fixtures/fixture_generation.go:70:4: assignments should only be cuddled with other assignments (wsl) path := filepath.Join(fixturesDir, name+".yml") ^ contrib/fixtures/fixture_generation.go:74:4: expressions should not be cuddled with blocks (wsl) fmt.Printf("%s created.\n", path) ^ main.go:47:2: only cuddled expressions if assigning variable or using from line above (wsl) log.GetManager().Close() ^ main.go:55:2: if statements should only be cuddled with assignments (wsl) if len(Tags) == 0 { ^ models/activities/action.go:204:2: declarations should never be cuddled (wsl) var err error ^ models/activities/action.go:594:2: declarations should never be cuddled (wsl) var permIssue []bool ^ models/activities/action.go:699:2: only one cuddle assignment allowed before defer statement (wsl) defer committer.Close() ^ models/activities/action.go:717:2: for statement without condition should never be cuddled (wsl) for { ^ ```
v1.59.1 ``` contrib/backport/backport.go:121:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:125:2: if statements should only be cuddled with assignments (wsl) if version == "" { ^ contrib/backport/backport.go:128:2: if statements should only be cuddled with assignments (wsl) if version == "" { ^ contrib/backport/backport.go:160:2: if statements should only be cuddled with assignments (wsl) if pr == "" { ^ contrib/backport/backport.go:179:2: if statements should only be cuddled with assignments (wsl) if sha == "" { ^ contrib/backport/backport.go:220:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ contrib/backport/backport.go:226:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:230:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ contrib/backport/backport.go:236:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:240:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ contrib/backport/backport.go:245:2: assignments should only be cuddled with other assignments (wsl) out, err := exec.CommandContext(ctx, "git", "log", "-1", "--pretty=format:%B").Output() ^ contrib/backport/backport.go:246:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:256:2: assignments should only be cuddled with other assignments (wsl) subject, body := parts[0], parts[1] ^ contrib/backport/backport.go:257:2: only one cuddle assignment allowed before if statement (wsl) if !strings.HasSuffix(subject, " (#"+pr+")") { ^ contrib/backport/backport.go:266:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ contrib/backport/backport.go:274:3: assignments should only be cuddled with other assignments (wsl) out, err := exec.CommandContext(ctx, "git", "cherry-pick", "--continue").Output() ^ contrib/backport/backport.go:275:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:279:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ contrib/backport/backport.go:284:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:288:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ contrib/backport/backport.go:299:2: if statements should only be cuddled with assignments (wsl) if currentBranch == backportBranch { ^ contrib/backport/backport.go:310:2: return statements should not be cuddled if block has more than two lines (wsl) return exec.CommandContext(ctx, "git", "checkout", "-b", backportBranch, releaseBranch).Run() ^ contrib/backport/backport.go:316:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:320:2: expressions should not be cuddled with blocks (wsl) fmt.Println(string(out)) ^ contrib/backport/backport.go:324:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ contrib/backport/backport.go:328:2: expressions should not be cuddled with blocks (wsl) fmt.Println(string(out)) ^ contrib/backport/backport.go:339:2: assignments should only be cuddled with other assignments (wsl) lines := strings.Split(string(out), "\n") ^ contrib/backport/backport.go:340:2: only one cuddle assignment allowed before range statement (wsl) for _, line := range lines { ^ contrib/backport/backport.go:355:3: if statements should only be cuddled with assignments (wsl) if !strings.Contains(remote, forkUser) { ^ contrib/backport/backport.go:358:3: if statements should only be cuddled with assignments (wsl) if strings.HasPrefix(remote, "git@github.com:") { ^ contrib/backport/backport.go:367:3: assignments should only be cuddled with other assignments (wsl) idx := strings.Index(forkUser, "/") ^ contrib/backport/backport.go:368:3: only one cuddle assignment allowed before if statement (wsl) if idx >= 0 { ^ contrib/backport/backport.go:371:3: return statements should not be cuddled if block has more than two lines (wsl) return name, forkUser, nil ^ contrib/backport/backport.go:373:2: return statements should not be cuddled if block has more than two lines (wsl) return "", "", fmt.Errorf("unable to find appropriate remote in:\n%s", string(out)) ^ contrib/backport/backport.go:382:2: assignments should only be cuddled with other assignments (wsl) parts := strings.Split(strings.TrimSpace(string(out)), "-") ^ contrib/backport/backport.go:399:3: expressions should not be cuddled with blocks (wsl) fmt.Fprintf(os.Stderr, "Unable to read `docs/config.yaml`: %v\n", err) ^ contrib/backport/backport.go:400:3: return statements should not be cuddled if block has more than two lines (wsl) return "" ^ contrib/backport/backport.go:406:2: declarations should never be cuddled (wsl) type docConfig struct { ^ contrib/backport/backport.go:409:2: assignments should only be cuddled with other assignments (wsl) dc := &docConfig{} ^ contrib/environment-to-ini/environment-to-ini.go:102:2: if statements should only be cuddled with assignments (wsl) if destination != setting.CustomConf || changed { ^ contrib/fixtures/fixture_generation.go:41:2: if statements should only be cuddled with assignments (wsl) if err := unittest.PrepareTestDatabase(); err != nil { ^ contrib/fixtures/fixture_generation.go:45:2: assignments should only be cuddled with other assignments (wsl) ctx := context.Background() ^ contrib/fixtures/fixture_generation.go:70:4: assignments should only be cuddled with other assignments (wsl) path := filepath.Join(fixturesDir, name+".yml") ^ contrib/fixtures/fixture_generation.go:74:4: expressions should not be cuddled with blocks (wsl) fmt.Printf("%s created.\n", path) ^ main.go:47:2: only cuddled expressions if assigning variable or using from line above (wsl) log.GetManager().Close() ^ main.go:55:2: if statements should only be cuddled with assignments (wsl) if len(Tags) == 0 { ^ models/activities/action.go:204:2: declarations should never be cuddled (wsl) var err error ^ models/activities/action.go:307:2: assignments should only be cuddled with other assignments (wsl) _ = a.loadComment(ctx) ^ models/activities/action.go:647:6: branch statements should not be cuddled if block has more than two lines (wsl) continue ^ models/activities/action.go:654:6: branch statements should not be cuddled if block has more than two lines (wsl) continue ^ ```
Command Mean [s] Min [s] Max [s] Relative
local 3.219 ± 0.063 3.183 3.389 1.00 ± 0.02
v1.59.1 3.210 ± 0.035 3.164 3.263 1.00

google/go-github

local ``` test/fields/fields.go:124:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ test/fields/fields.go:133:3: if statements should only be cuddled with assignments (wsl) if _, ok := m2[k]; !ok { ^ test/fields/fields.go:43:3: assignments should only be cuddled with other assignments (wsl) client = github.NewClient(nil) ^ test/fields/fields.go:90:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ test/fields/fields.go:93:3: assignments should only be cuddled with other assignments (wsl) m1 = s[0] ^ test/fields/fields.go:87:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if slice { ^ test/fields/fields.go:108:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if slice { ^ test/fields/fields.go:81:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ test/fields/fields.go:112:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ github/actions_artifacts.go:87:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ github/actions_artifacts.go:98:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ github/actions_artifacts.go:120:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ github/actions_artifacts.go:61:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ github/actions_artifacts.go:72:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ github/actions_cache.go:165:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ github/actions_required_workflows.go:169:2: return statements should not be cuddled if block has more than two lines (wsl) return s.client.Do(ctx, req, nil) ^ github/actions_required_workflows.go:226:2: return statements should not be cuddled if block has more than two lines (wsl) return s.client.Do(ctx, req, nil) ^ github/actions_required_workflows.go:240:2: return statements should not be cuddled if block has more than two lines (wsl) return s.client.Do(ctx, req, nil) ^ github/actions_required_workflows.go:206:2: assignments should only be cuddled with other assignments (wsl) url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) ^ github/actions_required_workflows.go:183:2: assignments should only be cuddled with other assignments (wsl) req, err := s.client.NewRequest("GET", u, nil) ^ github/actions_variables.go:142:2: return statements should not be cuddled if block has more than two lines (wsl) return s.client.Do(ctx, req, nil) ^ github/actions_variables.go:180:2: return statements should not be cuddled if block has more than two lines (wsl) return s.client.Do(ctx, req, nil) ^ github/actions_workflow_jobs.go:164:2: return statements should not be cuddled if block has more than two lines (wsl) return parsedURL, newResponse(resp), err ^ github/actions_workflow_runs.go:248:2: return statements should not be cuddled if block has more than two lines (wsl) return parsedURL, newResponse(resp), err ^ github/actions_workflow_runs.go:334:2: return statements should not be cuddled if block has more than two lines (wsl) return parsedURL, newResponse(resp), err ^ github/activity_events.go:157:2: assignments should only be cuddled with other assignments (wsl) u, err := addOptions(u, opts) ^ github/activity_events.go:191:2: assignments should only be cuddled with other assignments (wsl) u, err := addOptions(u, opts) ^ github/activity_star.go:121:2: return statements should not be cuddled if block has more than two lines (wsl) return starred, resp, err ^ github/activity_star.go:84:2: assignments should only be cuddled with other assignments (wsl) u, err := addOptions(u, opts) ^ github/activity_watching.go:69:2: assignments should only be cuddled with other assignments (wsl) u, err := addOptions(u, opts) ^ github/apps.go:285:2: assignments should only be cuddled with other assignments (wsl) resp, err := s.client.Do(ctx, req, &i) ^ github/apps_marketplace.go:198:2: return statements should not be cuddled if block has more than two lines (wsl) return purchases, resp, nil ^ github/authorizations.go:226:2: expressions should not be cuddled with blocks (wsl) req.Header.Set("Accept", mediaTypeOAuthAppPreview) ^ github/authorizations.go:249:2: expressions should not be cuddled with blocks (wsl) req.Header.Set("Accept", mediaTypeOAuthAppPreview) ^ github/authorizations.go:160:2: expressions should not be cuddled with blocks (wsl) req.Header.Set("Accept", mediaTypeOAuthAppPreview) ^ github/authorizations.go:195:2: expressions should not be cuddled with blocks (wsl) req.Header.Set("Accept", mediaTypeOAuthAppPreview) ^ github/code-scanning.go:404:2: assignments should only be cuddled with other assignments (wsl) sarifID := new(SarifID) ^ github/copilot.go:69:2: declarations should never be cuddled (wsl) var seatDetail alias ^ github/dependabot_secrets.go:249:2: declarations should never be cuddled (wsl) type repoIDs struct { ^ github/git_commits.go:134:2: if statements should only be cuddled with assignments (wsl) if opts == nil { ^ github/git_commits.go:154:2: only one cuddle assignment allowed before switch statement (wsl) switch { ^ github/git_trees.go:147:3: append only allowed to cuddle with appended value (wsl) newEntries = append(newEntries, entry) ^ github/git_trees.go:136:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, entry := range entries { ^ github/git_trees.go:145:4: branch statements should not be cuddled if block has more than two lines (wsl) continue ^ github/github.go:401:2: if statements should only be cuddled with assignments (wsl) if c.UploadURL == nil { ^ github/github.go:572:2: if statements should only be cuddled with assignments (wsl) if c.UserAgent != "" { ^ github/github.go:1284:2: anonymous switch statements should never be cuddled (wsl) switch { ^ github/github.go:575:2: expressions should not be cuddled with blocks (wsl) req.Header.Set(headerAPIVersion, defaultAPIVersion) ^ github/github.go:542:2: expressions should not be cuddled with blocks (wsl) req.Header.Set(headerAPIVersion, defaultAPIVersion) ^ github/github.go:939:3: if statements should only be cuddled with assignments (wsl) if decErr != nil { ^ ```
v1.59.1 ``` test/fields/fields.go:43:3: assignments should only be cuddled with other assignments (wsl) client = github.NewClient(nil) ^ test/fields/fields.go:81:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ test/fields/fields.go:90:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ test/fields/fields.go:112:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ test/fields/fields.go:108:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if slice { ^ test/fields/fields.go:124:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ test/fields/fields.go:133:3: if statements should only be cuddled with assignments (wsl) if _, ok := m2[k]; !ok { ^ test/fields/fields.go:93:3: assignments should only be cuddled with other assignments (wsl) m1 = s[0] ^ test/fields/fields.go:87:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if slice { ^ github/actions_artifacts.go:87:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ github/actions_artifacts.go:98:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ github/actions_artifacts.go:120:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ github/actions_artifacts.go:61:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ github/actions_artifacts.go:72:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ github/actions_cache.go:140:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ github/actions_required_workflows.go:226:2: return statements should not be cuddled if block has more than two lines (wsl) return s.client.Do(ctx, req, nil) ^ github/actions_required_workflows.go:169:2: return statements should not be cuddled if block has more than two lines (wsl) return s.client.Do(ctx, req, nil) ^ github/actions_required_workflows.go:183:2: assignments should only be cuddled with other assignments (wsl) req, err := s.client.NewRequest("GET", u, nil) ^ github/actions_required_workflows.go:240:2: return statements should not be cuddled if block has more than two lines (wsl) return s.client.Do(ctx, req, nil) ^ github/actions_required_workflows.go:206:2: assignments should only be cuddled with other assignments (wsl) url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) ^ github/actions_variables.go:142:2: return statements should not be cuddled if block has more than two lines (wsl) return s.client.Do(ctx, req, nil) ^ github/actions_variables.go:180:2: return statements should not be cuddled if block has more than two lines (wsl) return s.client.Do(ctx, req, nil) ^ github/actions_workflow_jobs.go:164:2: return statements should not be cuddled if block has more than two lines (wsl) return parsedURL, newResponse(resp), err ^ github/actions_workflow_runs.go:334:2: return statements should not be cuddled if block has more than two lines (wsl) return parsedURL, newResponse(resp), err ^ github/actions_workflow_runs.go:248:2: return statements should not be cuddled if block has more than two lines (wsl) return parsedURL, newResponse(resp), err ^ github/activity_events.go:191:2: assignments should only be cuddled with other assignments (wsl) u, err := addOptions(u, opts) ^ github/activity_events.go:157:2: assignments should only be cuddled with other assignments (wsl) u, err := addOptions(u, opts) ^ github/activity_star.go:121:2: return statements should not be cuddled if block has more than two lines (wsl) return starred, resp, err ^ github/activity_star.go:84:2: assignments should only be cuddled with other assignments (wsl) u, err := addOptions(u, opts) ^ github/activity_watching.go:69:2: assignments should only be cuddled with other assignments (wsl) u, err := addOptions(u, opts) ^ github/apps.go:285:2: assignments should only be cuddled with other assignments (wsl) resp, err := s.client.Do(ctx, req, &i) ^ github/apps_marketplace.go:198:2: return statements should not be cuddled if block has more than two lines (wsl) return purchases, resp, nil ^ github/authorizations.go:160:2: expressions should not be cuddled with blocks (wsl) req.Header.Set("Accept", mediaTypeOAuthAppPreview) ^ github/authorizations.go:195:2: expressions should not be cuddled with blocks (wsl) req.Header.Set("Accept", mediaTypeOAuthAppPreview) ^ github/authorizations.go:226:2: expressions should not be cuddled with blocks (wsl) req.Header.Set("Accept", mediaTypeOAuthAppPreview) ^ github/authorizations.go:249:2: expressions should not be cuddled with blocks (wsl) req.Header.Set("Accept", mediaTypeOAuthAppPreview) ^ github/code-scanning.go:404:2: assignments should only be cuddled with other assignments (wsl) sarifID := new(SarifID) ^ github/copilot.go:69:2: declarations should never be cuddled (wsl) var seatDetail alias ^ github/dependabot_secrets.go:249:2: declarations should never be cuddled (wsl) type repoIDs struct { ^ github/git_commits.go:154:2: only one cuddle assignment allowed before switch statement (wsl) switch { ^ github/git_commits.go:134:2: if statements should only be cuddled with assignments (wsl) if opts == nil { ^ github/git_trees.go:145:4: branch statements should not be cuddled if block has more than two lines (wsl) continue ^ github/git_trees.go:147:3: append only allowed to cuddle with appended value (wsl) newEntries = append(newEntries, entry) ^ github/git_trees.go:136:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, entry := range entries { ^ github/github.go:575:2: expressions should not be cuddled with blocks (wsl) req.Header.Set(headerAPIVersion, defaultAPIVersion) ^ github/github.go:1456:2: if statements should only be cuddled with assignments (wsl) if t.ClientSecret == "" { ^ github/github.go:755:2: if statements should only be cuddled with assignments (wsl) if reset := r.Header.Get(headerRateReset); reset != "" { ^ github/github.go:993:2: if statements should only be cuddled with assignments (wsl) if !secondary.IsZero() && time.Now().Before(secondary) { ^ github/github.go:606:2: expressions should not be cuddled with blocks (wsl) req.Header.Set("Content-Type", mediaType) ^ github/github.go:572:2: if statements should only be cuddled with assignments (wsl) if c.UserAgent != "" { ^ ```
Command Mean [s] Min [s] Max [s] Relative
local 5.088 ± 0.055 5.014 5.195 1.02 ± 0.01
v1.59.1 4.996 ± 0.046 4.941 5.078 1.00

golangci/golangci-lint

local ``` cmd/golangci-lint/main.go:52:2: declarations should never be cuddled (wsl) var modified string ^ cmd/golangci-lint/main.go:53:2: only one cuddle assignment allowed before range statement (wsl) for _, setting := range buildInfo.Settings { ^ internal/pkgcache/pkgcache.go:129:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/pkgcache/pkgcache.go:146:2: expressions should not be cuddled with blocks (wsl) fmt.Fprintf(key, "pkgpath %s\n", pkg.PkgPath) ^ internal/pkgcache/pkgcache.go:163:3: return statements should not be cuddled if block has more than two lines (wsl) return hashRes[mode], nil ^ internal/pkgcache/pkgcache.go:59:2: assignments should only be cuddled with other assignments (wsl) buf := &bytes.Buffer{} ^ internal/pkgcache/pkgcache.go:63:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/pkgcache/pkgcache.go:79:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/pkgcache/pkgcache.go:106:4: assignments should only be cuddled with other assignments (wsl) aID = subkey ^ internal/pkgcache/pkgcache.go:123:3: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Errorf("failed to get data from low-level cache by key %s for package %s: %w", key, pkg.Name, err) ^ internal/pkgcache/pkgcache.go:190:2: expressions should not be cuddled with blocks (wsl) sort.Slice(imps, func(i, j int) bool { ^ internal/pkgcache/pkgcache.go:183:2: assignments should only be cuddled with other assignments (wsl) curSum := key.Sum() ^ internal/pkgcache/pkgcache.go:176:3: assignments should only be cuddled with other assignments (wsl) h, fErr := cache.FileHash(f) ^ internal/pkgcache/pkgcache.go:207:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ internal/pkgcache/pkgcache.go:220:2: assignments should only be cuddled with other assignments (wsl) curSum = key.Sum() ^ internal/pkgcache/pkgcache.go:60:2: only cuddled expressions if assigning variable or using from line above (wsl) c.sw.TrackStage("gob", func() { ^ internal/pkgcache/pkgcache.go:76:4: assignments should only be cuddled with other assignments (wsl) aID = subkey ^ internal/pkgcache/pkgcache.go:177:3: only cuddled expressions if assigning variable or using from line above (wsl) <-c.ioSem ^ internal/pkgcache/pkgcache.go:43:2: return statements should not be cuddled if block has more than two lines (wsl) return &Cache{ ^ internal/pkgcache/pkgcache.go:228:2: return statements should not be cuddled if block has more than two lines (wsl) return hashRes[mode], nil ^ internal/pkgcache/pkgcache.go:87:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/pkgcache/pkgcache.go:109:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/pkgcache/pkgcache.go:119:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/pkgcache/pkgcache.go:178:3: if statements should only be cuddled with assignments (wsl) if fErr != nil { ^ internal/pkgcache/pkgcache.go:99:2: expressions should not be cuddled with declarations or returns (wsl) c.sw.TrackStage("key build", func() { ^ internal/pkgcache/pkgcache.go:158:2: only one cuddle assignment allowed before if statement (wsl) if ok { ^ internal/pkgcache/pkgcache.go:181:3: expressions should not be cuddled with blocks (wsl) fmt.Fprintf(key, "file %s %x\n", f, h) ^ internal/pkgcache/pkgcache.go:174:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, f := range pkg.CompiledGoFiles { ^ internal/pkgcache/pkgcache.go:98:2: declarations should never be cuddled (wsl) var err error ^ internal/pkgcache/pkgcache.go:157:2: assignments should only be cuddled with other assignments (wsl) hashResI, ok := c.pkgHashes.Load(pkg) ^ pkg/fsutils/filecache.go:45:2: if statements should only be cuddled with assignments (wsl) if n >= MiB { ^ pkg/fsutils/filecache.go:48:2: if statements should only be cuddled with assignments (wsl) if n >= KiB { ^ pkg/fsutils/filecache.go:51:2: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Sprintf("%dB", n) ^ pkg/fsutils/filecache.go:56:2: declarations should never be cuddled (wsl) var mapLen int ^ pkg/fsutils/filecache.go:57:2: expressions should not be cuddled with declarations or returns (wsl) fc.files.Range(func(_, fileBytes any) bool { ^ pkg/fsutils/filecache.go:31:2: return statements should not be cuddled if block has more than two lines (wsl) return fileBytes, nil ^ pkg/fsutils/files.go:32:2: return statements should not be cuddled if block has more than two lines (wsl) return filepath.Join(pathPrefix, relativePath) ^ pkg/fsutils/fsutils.go:74:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ pkg/fsutils/fsutils.go:83:2: assignments should only be cuddled with other assignments (wsl) path = evaledPath ^ pkg/fsutils/linecache.go:30:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ pkg/fsutils/linecache.go:67:2: return statements should not be cuddled if block has more than two lines (wsl) return fc, nil ^ pkg/goanalysis/linter.go:34:2: expressions should not be cuddled with blocks (wsl) panic(fmt.Sprintf("unknown load mode %d", loadMode)) ^ pkg/goanalysis/linter.go:102:2: return statements should not be cuddled if block has more than two lines (wsl) return ret ^ pkg/goanalysis/linter.go:192:2: expressions should not be cuddled with declarations or returns (wsl) fs.VisitAll(func(f *flag.Flag) { ^ pkg/goanalysis/metalinter.go:84:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, l := range ml.linters { ^ pkg/goanalysis/metalinter.go:70:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, lnt := range ml.linters { ^ pkg/goanalysis/runner.go:269:2: only one cuddle assignment allowed before range statement (wsl) for _, lp := range loadingPackages { ^ pkg/goanalysis/runner.go:338:2: only cuddled expressions if assigning variable or using from line above (wsl) visitAll(roots) ^ pkg/goanalysis/runner.go:234:2: declarations should never be cuddled (wsl) var dfs func(pkg *packages.Package) ^ pkg/goanalysis/runner.go:317:42: block should not start with a whitespace (wsl) for _, diag := range act.diagnostics { ^ ```
v1.59.1 ``` cmd/golangci-lint/main.go:53:2: only one cuddle assignment allowed before range statement (wsl) for _, setting := range buildInfo.Settings { ^ cmd/golangci-lint/main.go:52:2: declarations should never be cuddled (wsl) var modified string ^ internal/pkgcache/pkgcache.go:176:3: assignments should only be cuddled with other assignments (wsl) h, fErr := cache.FileHash(f) ^ internal/pkgcache/pkgcache.go:178:3: if statements should only be cuddled with assignments (wsl) if fErr != nil { ^ internal/pkgcache/pkgcache.go:207:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ internal/pkgcache/pkgcache.go:129:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/pkgcache/pkgcache.go:177:3: only cuddled expressions if assigning variable or using from line above (wsl) <-c.ioSem ^ internal/pkgcache/pkgcache.go:183:2: assignments should only be cuddled with other assignments (wsl) curSum := key.Sum() ^ internal/pkgcache/pkgcache.go:106:4: assignments should only be cuddled with other assignments (wsl) aID = subkey ^ internal/pkgcache/pkgcache.go:109:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/pkgcache/pkgcache.go:181:3: expressions should not be cuddled with blocks (wsl) fmt.Fprintf(key, "file %s %x\n", f, h) ^ internal/pkgcache/pkgcache.go:79:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/pkgcache/pkgcache.go:87:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/pkgcache/pkgcache.go:98:2: declarations should never be cuddled (wsl) var err error ^ internal/pkgcache/pkgcache.go:146:2: expressions should not be cuddled with blocks (wsl) fmt.Fprintf(key, "pkgpath %s\n", pkg.PkgPath) ^ internal/pkgcache/pkgcache.go:174:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, f := range pkg.CompiledGoFiles { ^ internal/pkgcache/pkgcache.go:59:2: assignments should only be cuddled with other assignments (wsl) buf := &bytes.Buffer{} ^ internal/pkgcache/pkgcache.go:60:2: only cuddled expressions if assigning variable or using from line above (wsl) c.sw.TrackStage("gob", func() { ^ internal/pkgcache/pkgcache.go:76:4: assignments should only be cuddled with other assignments (wsl) aID = subkey ^ internal/pkgcache/pkgcache.go:220:2: assignments should only be cuddled with other assignments (wsl) curSum = key.Sum() ^ internal/pkgcache/pkgcache.go:157:2: assignments should only be cuddled with other assignments (wsl) hashResI, ok := c.pkgHashes.Load(pkg) ^ internal/pkgcache/pkgcache.go:228:2: return statements should not be cuddled if block has more than two lines (wsl) return hashRes[mode], nil ^ internal/pkgcache/pkgcache.go:99:2: expressions should not be cuddled with declarations or returns (wsl) c.sw.TrackStage("key build", func() { ^ internal/pkgcache/pkgcache.go:123:3: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Errorf("failed to get data from low-level cache by key %s for package %s: %w", key, pkg.Name, err) ^ internal/pkgcache/pkgcache.go:119:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/pkgcache/pkgcache.go:158:2: only one cuddle assignment allowed before if statement (wsl) if ok { ^ internal/pkgcache/pkgcache.go:190:2: expressions should not be cuddled with blocks (wsl) sort.Slice(imps, func(i, j int) bool { ^ internal/pkgcache/pkgcache.go:43:2: return statements should not be cuddled if block has more than two lines (wsl) return &Cache{ ^ internal/pkgcache/pkgcache.go:63:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/pkgcache/pkgcache.go:163:3: return statements should not be cuddled if block has more than two lines (wsl) return hashRes[mode], nil ^ pkg/fsutils/filecache.go:56:2: declarations should never be cuddled (wsl) var mapLen int ^ pkg/fsutils/filecache.go:57:2: expressions should not be cuddled with declarations or returns (wsl) fc.files.Range(func(_, fileBytes any) bool { ^ pkg/fsutils/filecache.go:31:2: return statements should not be cuddled if block has more than two lines (wsl) return fileBytes, nil ^ pkg/fsutils/filecache.go:45:2: if statements should only be cuddled with assignments (wsl) if n >= MiB { ^ pkg/fsutils/filecache.go:48:2: if statements should only be cuddled with assignments (wsl) if n >= KiB { ^ pkg/fsutils/filecache.go:51:2: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Sprintf("%dB", n) ^ pkg/fsutils/files.go:32:2: return statements should not be cuddled if block has more than two lines (wsl) return filepath.Join(pathPrefix, relativePath) ^ pkg/fsutils/fsutils.go:74:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ pkg/fsutils/fsutils.go:83:2: assignments should only be cuddled with other assignments (wsl) path = evaledPath ^ pkg/fsutils/linecache.go:30:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ pkg/fsutils/linecache.go:67:2: return statements should not be cuddled if block has more than two lines (wsl) return fc, nil ^ pkg/goanalysis/linter.go:34:2: expressions should not be cuddled with blocks (wsl) panic(fmt.Sprintf("unknown load mode %d", loadMode)) ^ pkg/goanalysis/linter.go:102:2: return statements should not be cuddled if block has more than two lines (wsl) return ret ^ pkg/goanalysis/linter.go:192:2: expressions should not be cuddled with declarations or returns (wsl) fs.VisitAll(func(f *flag.Flag) { ^ pkg/goanalysis/metalinter.go:70:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, lnt := range ml.linters { ^ pkg/goanalysis/metalinter.go:84:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, l := range ml.linters { ^ pkg/goanalysis/runner.go:285:2: declarations should never be cuddled (wsl) var extract func(*action) ^ pkg/goanalysis/runner.go:323:5: only one cuddle assignment allowed before if statement (wsl) if seen[k] { ^ pkg/goanalysis/runner.go:125:2: only one cuddle assignment allowed before if statement (wsl) if ok { ^ pkg/goanalysis/runner.go:197:2: assignments should only be cuddled with other assignments (wsl) totalActionsCount := len(markedActions) ^ ```
Command Mean [ms] Min [ms] Max [ms] Relative
local 622.1 ± 25.4 590.1 684.7 1.03 ± 0.08
v1.59.1 602.5 ± 42.7 558.1 700.8 1.00

goreleaser/goreleaser

local ``` internal/git/config.go:20:2: assignments should only be cuddled with other assignments (wsl) out, err := Clean(Run(ctx, "ls-remote", "--get-url")) ^ internal/git/config.go:21:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/git/config.go:28:2: expressions should not be cuddled with blocks (wsl) log.WithField("rawurl", out).Debugf("got git url") ^ internal/git/config.go:37:2: assignments should only be cuddled with other assignments (wsl) out, err = Clean(Run(ctx, "config", "--get", fmt.Sprintf("branch.%s.remote", out))) ^ internal/git/config.go:38:2: only one cuddle assignment allowed before if statement (wsl) if err != nil || out == "" { ^ internal/git/config.go:42:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/git/config.go:45:2: return statements should not be cuddled if block has more than two lines (wsl) return ExtractRepoFromURL(out) ^ internal/git/config.go:90:2: assignments should only be cuddled with other assignments (wsl) repo := config.Repo{ ^ internal/git/config.go:96:2: return statements should not be cuddled if block has more than two lines (wsl) return repo, nil ^ internal/git/config.go:29:2: return statements should not be cuddled if block has more than two lines (wsl) return ExtractRepoFromURL(out) ^ internal/git/config.go:41:2: assignments should only be cuddled with other assignments (wsl) out, err = Clean(Run(ctx, "ls-remote", "--get-url", out)) ^ internal/git/git.go:57:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if err != nil { ^ internal/git/git.go:60:2: return statements should not be cuddled if block has more than two lines (wsl) return output, err ^ internal/git/git.go:71:3: append only allowed to cuddle with appended value (wsl) result = append(result, l) ^ internal/git/git.go:66:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, line := range strings.Split(output, "\n") { ^ internal/git/git.go:77:2: return statements should not be cuddled if block has more than two lines (wsl) return result, err ^ internal/golden/golden.go:66:2: if statements should only be cuddled with assignments (wsl) if *update { ^ internal/golden/golden.go:54:2: assignments should only be cuddled with other assignments (wsl) bts, err := os.ReadFile(path) ^ internal/golden/golden.go:56:2: return statements should not be cuddled if block has more than two lines (wsl) return bts ^ internal/shell/shell.go:38:2: if statements should only be cuddled with assignments (wsl) if err := cmd.Run(); err != nil { ^ internal/skips/skips.go:76:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ internal/skips/skips.go:45:2: return statements should not be cuddled if block has more than two lines (wsl) return str ^ internal/skips/skips.go:74:4: assignments should only be cuddled with other assignments (wsl) ctx.Skips[key] = true ^ internal/skips/skips.go:87:2: expressions should not be cuddled with blocks (wsl) slices.Sort(ss) ^ internal/skips/skips.go:88:2: return statements should not be cuddled if block has more than two lines (wsl) return strings.Join(ss, ", ") ^ internal/skips/skips.go:93:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, k := range keys { ^ internal/skips/skips.go:98:2: expressions should not be cuddled with blocks (wsl) sort.Strings(result) ^ internal/skips/skips.go:99:2: return statements should not be cuddled if block has more than two lines (wsl) return result ^ internal/skips/skips.go:42:2: only one cuddle assignment allowed before if statement (wsl) if idx := strings.LastIndex(str, ","); idx > -1 { ^ main.go:58:4: if statements should only be cuddled with assignments (wsl) if treeState != "" { ^ main.go:61:4: if statements should only be cuddled with assignments (wsl) if date != "" { ^ main.go:64:4: if statements should only be cuddled with assignments (wsl) if version != "" { ^ main.go:67:4: if statements should only be cuddled with assignments (wsl) if builtBy != "" { ^ main_test.go:12:2: declarations should never be cuddled (wsl) const compiler = "gc" ^ main_test.go:13:2: declarations should never be cuddled (wsl) const platform = "linux/amd64" ^ cmd/build.go:97:2: only cuddled expressions if assigning variable or using from line above (wsl) cmd.Flags().BoolVar(&root.opts.deprecated, "deprecated", false, "Force print the deprecation message - tests only") ^ cmd/build.go:161:3: assignments should only be cuddled with other assignments (wsl) ctx.Snapshot = true ^ cmd/build.go:202:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, build := range ctx.Config.Builds { ^ cmd/build.go:121:2: assignments should only be cuddled with other assignments (wsl) ctx, cancel := context.NewWithTimeout(cfg, options.timeout) ^ cmd/build.go:123:2: if statements should only be cuddled with assignments (wsl) if err := setupBuildContext(ctx, options); err != nil { ^ cmd/build.go:153:2: only one cuddle assignment allowed before if statement (wsl) if options.parallelism > 0 { ^ cmd/build.go:233:2: assignments should only be cuddled with other assignments (wsl) path := bins[0].Path ^ cmd/build.go:91:3: assignments should only be cuddled with other assignments (wsl) ids := make([]string, 0, len(cfg.Builds)) ^ cmd/build.go:92:3: only one cuddle assignment allowed before range statement (wsl) for _, build := range cfg.Builds { ^ cmd/build.go:156:2: expressions should not be cuddled with blocks (wsl) log.Debugf("parallelism: %v", ctx.Parallelism) ^ cmd/build.go:235:2: only one cuddle assignment allowed before if statement (wsl) if out == "." { ^ cmd/build.go:122:2: only one cuddle assignment allowed before defer statement (wsl) defer cancel() ^ cmd/config.go:26:2: if statements should only be cuddled with assignments (wsl) if path != "" { ^ cmd/config.go:30:2: only one cuddle assignment allowed before range statement (wsl) for _, f := range [6]string{ ^ cmd/healthcheck.go:99:2: if statements should only be cuddled with assignments (wsl) if _, err := exec.LookPath(tool); err != nil { ^ ```
v1.59.1 ``` internal/git/config.go:20:2: assignments should only be cuddled with other assignments (wsl) out, err := Clean(Run(ctx, "ls-remote", "--get-url")) ^ internal/git/config.go:21:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/git/config.go:38:2: only one cuddle assignment allowed before if statement (wsl) if err != nil || out == "" { ^ internal/git/config.go:42:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/git/config.go:96:2: return statements should not be cuddled if block has more than two lines (wsl) return repo, nil ^ internal/git/config.go:90:2: assignments should only be cuddled with other assignments (wsl) repo := config.Repo{ ^ internal/git/config.go:28:2: expressions should not be cuddled with blocks (wsl) log.WithField("rawurl", out).Debugf("got git url") ^ internal/git/config.go:29:2: return statements should not be cuddled if block has more than two lines (wsl) return ExtractRepoFromURL(out) ^ internal/git/config.go:37:2: assignments should only be cuddled with other assignments (wsl) out, err = Clean(Run(ctx, "config", "--get", fmt.Sprintf("branch.%s.remote", out))) ^ internal/git/config.go:41:2: assignments should only be cuddled with other assignments (wsl) out, err = Clean(Run(ctx, "ls-remote", "--get-url", out)) ^ internal/git/config.go:45:2: return statements should not be cuddled if block has more than two lines (wsl) return ExtractRepoFromURL(out) ^ internal/git/git.go:71:3: append only allowed to cuddle with appended value (wsl) result = append(result, l) ^ internal/git/git.go:66:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, line := range strings.Split(output, "\n") { ^ internal/git/git.go:77:2: return statements should not be cuddled if block has more than two lines (wsl) return result, err ^ internal/git/git.go:57:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if err != nil { ^ internal/git/git.go:60:2: return statements should not be cuddled if block has more than two lines (wsl) return output, err ^ internal/golden/golden.go:54:2: assignments should only be cuddled with other assignments (wsl) bts, err := os.ReadFile(path) ^ internal/golden/golden.go:56:2: return statements should not be cuddled if block has more than two lines (wsl) return bts ^ internal/golden/golden.go:66:2: if statements should only be cuddled with assignments (wsl) if *update { ^ internal/shell/shell.go:38:2: if statements should only be cuddled with assignments (wsl) if err := cmd.Run(); err != nil { ^ internal/skips/skips.go:45:2: return statements should not be cuddled if block has more than two lines (wsl) return str ^ internal/skips/skips.go:74:4: assignments should only be cuddled with other assignments (wsl) ctx.Skips[key] = true ^ internal/skips/skips.go:76:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ internal/skips/skips.go:87:2: expressions should not be cuddled with blocks (wsl) slices.Sort(ss) ^ internal/skips/skips.go:88:2: return statements should not be cuddled if block has more than two lines (wsl) return strings.Join(ss, ", ") ^ internal/skips/skips.go:93:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, k := range keys { ^ internal/skips/skips.go:98:2: expressions should not be cuddled with blocks (wsl) sort.Strings(result) ^ internal/skips/skips.go:42:2: only one cuddle assignment allowed before if statement (wsl) if idx := strings.LastIndex(str, ","); idx > -1 { ^ internal/skips/skips.go:99:2: return statements should not be cuddled if block has more than two lines (wsl) return result ^ main.go:58:4: if statements should only be cuddled with assignments (wsl) if treeState != "" { ^ main.go:61:4: if statements should only be cuddled with assignments (wsl) if date != "" { ^ main.go:64:4: if statements should only be cuddled with assignments (wsl) if version != "" { ^ main.go:67:4: if statements should only be cuddled with assignments (wsl) if builtBy != "" { ^ main_test.go:13:2: declarations should never be cuddled (wsl) const platform = "linux/amd64" ^ main_test.go:12:2: declarations should never be cuddled (wsl) const compiler = "gc" ^ cmd/build.go:153:2: only one cuddle assignment allowed before if statement (wsl) if options.parallelism > 0 { ^ cmd/build.go:161:3: assignments should only be cuddled with other assignments (wsl) ctx.Snapshot = true ^ cmd/build.go:233:2: assignments should only be cuddled with other assignments (wsl) path := bins[0].Path ^ cmd/build.go:97:2: only cuddled expressions if assigning variable or using from line above (wsl) cmd.Flags().BoolVar(&root.opts.deprecated, "deprecated", false, "Force print the deprecation message - tests only") ^ cmd/build.go:108:2: assignments should only be cuddled with other assignments (wsl) _ = cmd.RegisterFlagCompletionFunc("skip", func(_ *cobra.Command, _ []string, toComplete string) ([]string, cobra.ShellCompDirective) { ^ cmd/build.go:235:2: only one cuddle assignment allowed before if statement (wsl) if out == "." { ^ cmd/build.go:92:3: only one cuddle assignment allowed before range statement (wsl) for _, build := range cfg.Builds { ^ cmd/build.go:121:2: assignments should only be cuddled with other assignments (wsl) ctx, cancel := context.NewWithTimeout(cfg, options.timeout) ^ cmd/build.go:122:2: only one cuddle assignment allowed before defer statement (wsl) defer cancel() ^ cmd/build.go:202:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, build := range ctx.Config.Builds { ^ cmd/build.go:123:2: if statements should only be cuddled with assignments (wsl) if err := setupBuildContext(ctx, options); err != nil { ^ cmd/build.go:156:2: expressions should not be cuddled with blocks (wsl) log.Debugf("parallelism: %v", ctx.Parallelism) ^ cmd/config.go:30:2: only one cuddle assignment allowed before range statement (wsl) for _, f := range [6]string{ ^ cmd/config.go:26:2: if statements should only be cuddled with assignments (wsl) if path != "" { ^ cmd/healthcheck.go:99:2: if statements should only be cuddled with assignments (wsl) if _, err := exec.LookPath(tool); err != nil { ^ ```
Command Mean [ms] Min [ms] Max [ms] Relative
local 914.3 ± 62.6 884.1 1091.6 1.04 ± 0.09
v1.59.1 881.2 ± 41.8 855.3 995.1 1.00

grpc/grpc-go

local ``` admin/test/utils.go:101:2: only one cuddle assignment allowed before defer statement (wsl) defer cancel() ^ admin/test/utils.go:103:2: return statements should not be cuddled if block has more than two lines (wsl) return err ^ admin/test/utils.go:93:2: assignments should only be cuddled with other assignments (wsl) _, err := c.GetTopChannels(ctx, &channelzpb.GetTopChannelsRequest{}, grpc.WaitForReady(true)) ^ admin/test/utils.go:94:2: return statements should not be cuddled if block has more than two lines (wsl) return err ^ admin/test/utils.go:67:2: only one cuddle assignment allowed before go statement (wsl) go func() { ^ admin/test/utils.go:92:2: only one cuddle assignment allowed before defer statement (wsl) defer cancel() ^ admin/test/utils.go:102:2: assignments should only be cuddled with other assignments (wsl) _, err := c.FetchClientStatus(ctx, &v3statuspb.ClientStatusRequest{}, grpc.WaitForReady(true)) ^ admin/test/utils.go:63:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ admin/test/utils.go:66:2: only one cuddle assignment allowed before defer statement (wsl) defer cleanup() ^ attributes/attributes.go:56:2: assignments should only be cuddled with other assignments (wsl) n := &Attributes{m: make(map[any]any, len(a.m)+1)} ^ attributes/attributes.go:70:2: return statements should not be cuddled if block has more than two lines (wsl) return a.m[key] ^ attributes/attributes.go:104:2: return statements should not be cuddled if block has more than two lines (wsl) return true ^ attributes/attributes.go:111:2: expressions should not be cuddled with declarations or returns (wsl) sb.WriteString("{") ^ attributes/attributes.go:117:3: expressions should not be cuddled with blocks (wsl) sb.WriteString(fmt.Sprintf("%q: %q ", str(k), str(v))) ^ attributes/attributes.go:130:2: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Sprintf("<%p>", x) ^ attributes/attributes.go:120:2: expressions should not be cuddled with blocks (wsl) sb.WriteString("}") ^ attributes/attributes.go:113:2: only one cuddle assignment allowed before range statement (wsl) for k, v := range a.m { ^ attributes/attributes.go:57:2: only one cuddle assignment allowed before range statement (wsl) for k, v := range a.m { ^ attributes/attributes.go:61:2: return statements should not be cuddled if block has more than two lines (wsl) return n ^ attributes/attributes.go:86:2: if statements should only be cuddled with assignments (wsl) if len(a.m) != len(o.m) { ^ attributes/attributes.go:89:2: only one cuddle assignment allowed before range statement (wsl) for k, v := range a.m { ^ attributes/attributes.go:112:2: assignments should only be cuddled with other assignments (wsl) first := true ^ attributes/attributes.go:118:3: assignments should only be cuddled with other assignments (wsl) first = false ^ attributes/attributes.go:60:2: assignments should only be cuddled with other assignments (wsl) n.m[key] = value ^ attributes/attributes.go:83:2: if statements should only be cuddled with assignments (wsl) if a == nil || o == nil { ^ attributes/attributes.go:95:3: if statements should only be cuddled with assignments (wsl) if eq, ok := v.(interface{ Equal(o any) bool }); ok { ^ attributes/attributes.go:121:2: return statements should not be cuddled if block has more than two lines (wsl) return sb.String() ^ authz/audit/audit_logger.go:57:2: return statements should not be cuddled if block has more than two lines (wsl) return registry.builders[name] ^ balancer/pickfirst/pickfirst.go:77:2: return statements should not be cuddled if block has more than two lines (wsl) return cfg, nil ^ balancer/pickfirst/pickfirst.go:91:2: if statements should only be cuddled with assignments (wsl) if b.subConn == nil { ^ balancer/pickfirst/pickfirst.go:183:3: assignments should only be cuddled with other assignments (wsl) b.state = connectivity.TransientFailure ^ balancer/pickfirst/pickfirst.go:214:3: return statements should not be cuddled if block has more than two lines (wsl) return ^ balancer/pickfirst/pickfirst.go:216:2: if statements should only be cuddled with assignments (wsl) if state.ConnectivityState == connectivity.Shutdown { ^ balancer/pickfirst/pickfirst.go:253:2: assignments should only be cuddled with other assignments (wsl) b.state = state.ConnectivityState ^ balancer/pickfirst/pickfirst.go:100:2: expressions should not be cuddled with blocks (wsl) b.cc.UpdateState(balancer.State{ ^ balancer/pickfirst/pickfirst.go:190:2: assignments should only be cuddled with other assignments (wsl) b.subConn = subConn ^ balancer/pickfirst/pickfirst.go:243:3: expressions should not be cuddled with blocks (wsl) b.cc.UpdateState(balancer.State{ ^ balancer/pickfirst/pickfirst.go:40:2: assignments should only be cuddled with other assignments (wsl) internal.ShuffleAddressListForTesting = func(n int, swap func(i, j int)) { rand.Shuffle(n, swap) } ^ balancer/pickfirst/pickfirst.go:210:2: if statements should only be cuddled with assignments (wsl) if b.subConn != subConn { ^ balancer/pickfirst/pickfirst.go:122:3: expressions should not be cuddled with blocks (wsl) b.ResolverError(errors.New("produced zero addresses")) ^ balancer/pickfirst/pickfirst.go:137:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if endpoints := state.ResolverState.Endpoints; len(endpoints) != 0 { ^ balancer/pickfirst/pickfirst.go:179:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ balancer/pickfirst/pickfirst.go:232:3: expressions should not be cuddled with blocks (wsl) b.cc.UpdateState(balancer.State{ ^ balancer/rls/internal/test/e2e/rls_child_policy.go:77:2: only one cuddle assignment allowed before go statement (wsl) go b.run() ^ balancer/rls/internal/test/e2e/rls_child_policy.go:86:2: if statements should only be cuddled with assignments (wsl) if cfg.Backend == RLSChildPolicyBadTarget { ^ balancer/rls/internal/test/e2e/rls_child_policy.go:110:2: if statements should only be cuddled with assignments (wsl) if b.bf != nil && b.bf.UpdateClientConnState != nil { ^ balancer/rls/internal/test/e2e/rls_child_policy.go:120:2: if statements should only be cuddled with assignments (wsl) if b.bf != nil && b.bf.Close != nil { ^ balancer/rls/internal/test/e2e/rls_child_policy.go:123:2: expressions should not be cuddled with blocks (wsl) b.done.Fire() ^ balancer/rls/internal/test/e2e/rls_lb_config.go:50:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ balancer/rls/internal/test/e2e/rls_lb_config.go:54:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ ```
v1.59.1 ``` admin/test/utils.go:67:2: only one cuddle assignment allowed before go statement (wsl) go func() { ^ admin/test/utils.go:93:2: assignments should only be cuddled with other assignments (wsl) _, err := c.GetTopChannels(ctx, &channelzpb.GetTopChannelsRequest{}, grpc.WaitForReady(true)) ^ admin/test/utils.go:94:2: return statements should not be cuddled if block has more than two lines (wsl) return err ^ admin/test/utils.go:102:2: assignments should only be cuddled with other assignments (wsl) _, err := c.FetchClientStatus(ctx, &v3statuspb.ClientStatusRequest{}, grpc.WaitForReady(true)) ^ admin/test/utils.go:103:2: return statements should not be cuddled if block has more than two lines (wsl) return err ^ admin/test/utils.go:63:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ admin/test/utils.go:66:2: only one cuddle assignment allowed before defer statement (wsl) defer cleanup() ^ admin/test/utils.go:92:2: only one cuddle assignment allowed before defer statement (wsl) defer cancel() ^ admin/test/utils.go:101:2: only one cuddle assignment allowed before defer statement (wsl) defer cancel() ^ attributes/attributes.go:95:3: if statements should only be cuddled with assignments (wsl) if eq, ok := v.(interface{ Equal(o any) bool }); ok { ^ attributes/attributes.go:104:2: return statements should not be cuddled if block has more than two lines (wsl) return true ^ attributes/attributes.go:121:2: return statements should not be cuddled if block has more than two lines (wsl) return sb.String() ^ attributes/attributes.go:56:2: assignments should only be cuddled with other assignments (wsl) n := &Attributes{m: make(map[any]any, len(a.m)+1)} ^ attributes/attributes.go:57:2: only one cuddle assignment allowed before range statement (wsl) for k, v := range a.m { ^ attributes/attributes.go:60:2: assignments should only be cuddled with other assignments (wsl) n.m[key] = value ^ attributes/attributes.go:86:2: if statements should only be cuddled with assignments (wsl) if len(a.m) != len(o.m) { ^ attributes/attributes.go:112:2: assignments should only be cuddled with other assignments (wsl) first := true ^ attributes/attributes.go:130:2: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Sprintf("<%p>", x) ^ attributes/attributes.go:89:2: only one cuddle assignment allowed before range statement (wsl) for k, v := range a.m { ^ attributes/attributes.go:111:2: expressions should not be cuddled with declarations or returns (wsl) sb.WriteString("{") ^ attributes/attributes.go:117:3: expressions should not be cuddled with blocks (wsl) sb.WriteString(fmt.Sprintf("%q: %q ", str(k), str(v))) ^ attributes/attributes.go:113:2: only one cuddle assignment allowed before range statement (wsl) for k, v := range a.m { ^ attributes/attributes.go:120:2: expressions should not be cuddled with blocks (wsl) sb.WriteString("}") ^ attributes/attributes.go:61:2: return statements should not be cuddled if block has more than two lines (wsl) return n ^ attributes/attributes.go:70:2: return statements should not be cuddled if block has more than two lines (wsl) return a.m[key] ^ attributes/attributes.go:83:2: if statements should only be cuddled with assignments (wsl) if a == nil || o == nil { ^ attributes/attributes.go:118:3: assignments should only be cuddled with other assignments (wsl) first = false ^ authz/audit/audit_logger.go:57:2: return statements should not be cuddled if block has more than two lines (wsl) return registry.builders[name] ^ balancer/pickfirst/pickfirst.go:123:3: return statements should not be cuddled if block has more than two lines (wsl) return balancer.ErrBadResolverState ^ balancer/pickfirst/pickfirst.go:214:3: return statements should not be cuddled if block has more than two lines (wsl) return ^ balancer/pickfirst/pickfirst.go:216:2: if statements should only be cuddled with assignments (wsl) if state.ConnectivityState == connectivity.Shutdown { ^ balancer/pickfirst/pickfirst.go:232:3: expressions should not be cuddled with blocks (wsl) b.cc.UpdateState(balancer.State{ ^ balancer/pickfirst/pickfirst.go:243:3: expressions should not be cuddled with blocks (wsl) b.cc.UpdateState(balancer.State{ ^ balancer/pickfirst/pickfirst.go:253:2: assignments should only be cuddled with other assignments (wsl) b.state = state.ConnectivityState ^ balancer/pickfirst/pickfirst.go:40:2: assignments should only be cuddled with other assignments (wsl) internal.ShuffleAddressListForTesting = func(n int, swap func(i, j int)) { rand.Shuffle(n, swap) } ^ balancer/pickfirst/pickfirst.go:183:3: assignments should only be cuddled with other assignments (wsl) b.state = connectivity.TransientFailure ^ balancer/pickfirst/pickfirst.go:190:2: assignments should only be cuddled with other assignments (wsl) b.subConn = subConn ^ balancer/pickfirst/pickfirst.go:122:3: expressions should not be cuddled with blocks (wsl) b.ResolverError(errors.New("produced zero addresses")) ^ balancer/pickfirst/pickfirst.go:137:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if endpoints := state.ResolverState.Endpoints; len(endpoints) != 0 { ^ balancer/pickfirst/pickfirst.go:179:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ balancer/pickfirst/pickfirst.go:210:2: if statements should only be cuddled with assignments (wsl) if b.subConn != subConn { ^ balancer/pickfirst/pickfirst.go:100:2: expressions should not be cuddled with blocks (wsl) b.cc.UpdateState(balancer.State{ ^ balancer/pickfirst/pickfirst.go:91:2: if statements should only be cuddled with assignments (wsl) if b.subConn == nil { ^ balancer/rls/internal/test/e2e/rls_child_policy.go:110:2: if statements should only be cuddled with assignments (wsl) if b.bf != nil && b.bf.UpdateClientConnState != nil { ^ balancer/rls/internal/test/e2e/rls_child_policy.go:120:2: if statements should only be cuddled with assignments (wsl) if b.bf != nil && b.bf.Close != nil { ^ balancer/rls/internal/test/e2e/rls_child_policy.go:123:2: expressions should not be cuddled with blocks (wsl) b.done.Fire() ^ balancer/rls/internal/test/e2e/rls_child_policy.go:77:2: only one cuddle assignment allowed before go statement (wsl) go b.run() ^ balancer/rls/internal/test/e2e/rls_child_policy.go:86:2: if statements should only be cuddled with assignments (wsl) if cfg.Backend == RLSChildPolicyBadTarget { ^ balancer/rls/internal/test/e2e/rls_lb_config.go:54:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ balancer/rls/internal/test/e2e/rls_lb_config.go:82:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ ```
Command Mean [s] Min [s] Max [s] Relative
local 2.044 ± 0.049 1.992 2.150 1.01 ± 0.05
v1.59.1 2.028 ± 0.090 1.958 2.263 1.00

gohugoio/hugo

local ``` cache/filecache/filecache.go:304:3: return statements should not be cuddled if block has more than two lines (wsl) return info, b, err ^ cache/filecache/filecache.go:229:2: return statements should not be cuddled if block has more than two lines (wsl) return info, ^ cache/filecache/filecache.go:294:2: assignments should only be cuddled with other assignments (wsl) id = cleanID(id) ^ cache/filecache/filecache.go:243:2: only one cuddle assignment allowed before defer statement (wsl) defer f.Close() ^ cache/filecache/filecache.go:255:2: assignments should only be cuddled with other assignments (wsl) id = cleanID(id) ^ cache/filecache/filecache.go:414:2: return statements should not be cuddled if block has more than two lines (wsl) return string(b) ^ cache/filecache/filecache.go:118:2: return statements should not be cuddled if block has more than two lines (wsl) return c.initErr ^ cache/filecache/filecache.go:167:3: if statements should only be cuddled with assignments (wsl) if err == nil || err == ErrFatal { ^ cache/filecache/filecache.go:265:3: return statements should not be cuddled if block has more than two lines (wsl) return info, b, err ^ cache/filecache/filecache.go:315:2: assignments should only be cuddled with other assignments (wsl) id = cleanID(id) ^ cache/filecache/filecache.go:202:2: assignments should only be cuddled with other assignments (wsl) id = cleanID(id) ^ cache/filecache/filecache.go:239:2: assignments should only be cuddled with other assignments (wsl) f, err := c.Fs.Create(id) ^ cache/filecache/filecache.go:240:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cache/filecache/filecache.go:432:2: ranges should only be cuddled with assignments used in the iteration (wsl) for k, v := range dcfg { ^ cache/filecache/filecache_config.go:194:3: assignments should only be cuddled with other assignments (wsl) v.DirCompiled = filepath.Clean(filepath.FromSlash(dir)) ^ cache/filecache/filecache_config.go:143:3: assignments should only be cuddled with other assignments (wsl) cc := defaultCacheConfig ^ cache/filecache/filecache_config.go:183:5: if statements should only be cuddled with assignments (wsl) if isResource { ^ cache/filecache/filecache_config.go:186:5: assignments should only be cuddled with other assignments (wsl) parts[i] = resolved ^ cache/filecache/filecache_pruner.go:125:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cache/filecache/filecache_pruner.go:45:2: block should not end with a whitespace (or comment) (wsl) } ^ cache/filecache/filecache_pruner.go:33:2: ranges should only be cuddled with assignments used in the iteration (wsl) for k, cache := range c { ^ cache/filecache/filecache_pruner.go:56:2: if statements should only be cuddled with assignments (wsl) if err := c.init(); err != nil { ^ cache/filecache/filecache_pruner.go:124:2: assignments should only be cuddled with other assignments (wsl) info, err := c.Fs.Stat(c.pruneAllRootDir) ^ cache/filecache/filecache_pruner.go:129:3: return statements should not be cuddled if block has more than two lines (wsl) return 0, err ^ cache/filecache/filecache_pruner.go:42:4: return statements should not be cuddled if block has more than two lines (wsl) return counter, fmt.Errorf("failed to prune cache %q: %w", k, err) ^ cache/filecache/filecache_pruner.go:75:4: assignments should only be cuddled with other assignments (wsl) _, err = f.Readdirnames(1) ^ cache/filecache/filecache_pruner.go:77:4: if statements should only be cuddled with assignments (wsl) if err == io.EOF { ^ cache/filecache/filecache_pruner.go:112:3: block should not end with a whitespace (or comment) (wsl) } ^ commands/commandeer.go:353:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ commands/commandeer.go:413:2: declarations should never be cuddled (wsl) var err error ^ commands/commandeer.go:314:2: return statements should not be cuddled if block has more than two lines (wsl) return h, err ^ commands/commandeer.go:324:3: return statements should not be cuddled if block has more than two lines (wsl) return hugolib.NewHugoSites(depsCfg) ^ commands/commandeer.go:326:2: return statements should not be cuddled if block has more than two lines (wsl) return h, err ^ commands/commandeer.go:415:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ commands/commandeer.go:378:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ commands/commandeer.go:64:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ commands/commandeer.go:629:2: if statements should only be cuddled with assignments (wsl) if c.withc != nil { ^ commands/commandeer.go:176:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ commands/commandeer.go:244:3: declarations should never be cuddled (wsl) var destinationFs afero.Fs ^ commands/commandeer.go:283:3: block should not end with a whitespace (or comment) (wsl) } ^ commands/commandeer.go:626:2: only one cuddle assignment allowed before if statement (wsl) if c.use != "" { ^ commands/commandeer.go:152:2: if statements should only be cuddled with assignments (wsl) if err := h.Build(bcfg); err != nil { ^ commands/commandeer.go:247:4: if statements should only be cuddled with assignments used in the if statement itself (wsl) if renderStaticToDisk { ^ commands/commandeer.go:245:3: only one cuddle assignment allowed before if statement (wsl) if cfg.GetBool("renderToMemory") { ^ commands/commandeer.go:75:3: if statements should only be cuddled with assignments (wsl) if simplecobra.IsCommandError(err) { ^ commands/commandeer.go:69:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ commands/config.go:65:2: declarations should never be cuddled (wsl) var config *allconfig.Config ^ commands/config.go:96:3: expressions should not be cuddled with blocks (wsl) maps.ConvertFloat64WithNoDecimalsToInt(m) ^ commands/config.go:97:3: only one cuddle assignment allowed before switch statement (wsl) switch format { ^ commands/convert.go:223:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, p := range site.AllPages() { ^ ```
v1.59.1 ``` cache/filecache/filecache.go:167:3: if statements should only be cuddled with assignments (wsl) if err == nil || err == ErrFatal { ^ cache/filecache/filecache.go:229:2: return statements should not be cuddled if block has more than two lines (wsl) return info, ^ cache/filecache/filecache.go:240:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cache/filecache/filecache.go:243:2: only one cuddle assignment allowed before defer statement (wsl) defer f.Close() ^ cache/filecache/filecache.go:294:2: assignments should only be cuddled with other assignments (wsl) id = cleanID(id) ^ cache/filecache/filecache.go:118:2: return statements should not be cuddled if block has more than two lines (wsl) return c.initErr ^ cache/filecache/filecache.go:239:2: assignments should only be cuddled with other assignments (wsl) f, err := c.Fs.Create(id) ^ cache/filecache/filecache.go:255:2: assignments should only be cuddled with other assignments (wsl) id = cleanID(id) ^ cache/filecache/filecache.go:432:2: ranges should only be cuddled with assignments used in the iteration (wsl) for k, v := range dcfg { ^ cache/filecache/filecache.go:202:2: assignments should only be cuddled with other assignments (wsl) id = cleanID(id) ^ cache/filecache/filecache.go:265:3: return statements should not be cuddled if block has more than two lines (wsl) return info, b, err ^ cache/filecache/filecache.go:304:3: return statements should not be cuddled if block has more than two lines (wsl) return info, b, err ^ cache/filecache/filecache.go:315:2: assignments should only be cuddled with other assignments (wsl) id = cleanID(id) ^ cache/filecache/filecache.go:414:2: return statements should not be cuddled if block has more than two lines (wsl) return string(b) ^ cache/filecache/filecache_config.go:143:3: assignments should only be cuddled with other assignments (wsl) cc := defaultCacheConfig ^ cache/filecache/filecache_config.go:183:5: if statements should only be cuddled with assignments (wsl) if isResource { ^ cache/filecache/filecache_config.go:186:5: assignments should only be cuddled with other assignments (wsl) parts[i] = resolved ^ cache/filecache/filecache_config.go:194:3: assignments should only be cuddled with other assignments (wsl) v.DirCompiled = filepath.Clean(filepath.FromSlash(dir)) ^ cache/filecache/filecache_pruner.go:56:2: if statements should only be cuddled with assignments (wsl) if err := c.init(); err != nil { ^ cache/filecache/filecache_pruner.go:77:4: if statements should only be cuddled with assignments (wsl) if err == io.EOF { ^ cache/filecache/filecache_pruner.go:112:3: block should not end with a whitespace (or comment) (wsl) } ^ cache/filecache/filecache_pruner.go:129:3: return statements should not be cuddled if block has more than two lines (wsl) return 0, err ^ cache/filecache/filecache_pruner.go:125:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cache/filecache/filecache_pruner.go:45:2: block should not end with a whitespace (or comment) (wsl) } ^ cache/filecache/filecache_pruner.go:42:4: return statements should not be cuddled if block has more than two lines (wsl) return counter, fmt.Errorf("failed to prune cache %q: %w", k, err) ^ cache/filecache/filecache_pruner.go:33:2: ranges should only be cuddled with assignments used in the iteration (wsl) for k, cache := range c { ^ cache/filecache/filecache_pruner.go:75:4: assignments should only be cuddled with other assignments (wsl) _, err = f.Readdirnames(1) ^ cache/filecache/filecache_pruner.go:124:2: assignments should only be cuddled with other assignments (wsl) info, err := c.Fs.Stat(c.pruneAllRootDir) ^ commands/commandeer.go:244:3: declarations should never be cuddled (wsl) var destinationFs afero.Fs ^ commands/commandeer.go:245:3: only one cuddle assignment allowed before if statement (wsl) if cfg.GetBool("renderToMemory") { ^ commands/commandeer.go:283:3: block should not end with a whitespace (or comment) (wsl) } ^ commands/commandeer.go:69:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ commands/commandeer.go:152:2: if statements should only be cuddled with assignments (wsl) if err := h.Build(bcfg); err != nil { ^ commands/commandeer.go:247:4: if statements should only be cuddled with assignments used in the if statement itself (wsl) if renderStaticToDisk { ^ commands/commandeer.go:324:3: return statements should not be cuddled if block has more than two lines (wsl) return hugolib.NewHugoSites(depsCfg) ^ commands/commandeer.go:618:2: return statements should not be cuddled if block has more than two lines (wsl) return c.run(ctx, cd, c.rootCmd, args) ^ commands/commandeer.go:353:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ commands/commandeer.go:356:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ commands/commandeer.go:415:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ commands/commandeer.go:64:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ commands/commandeer.go:75:3: if statements should only be cuddled with assignments (wsl) if simplecobra.IsCommandError(err) { ^ commands/commandeer.go:176:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ commands/commandeer.go:626:2: only one cuddle assignment allowed before if statement (wsl) if c.use != "" { ^ commands/commandeer.go:413:2: declarations should never be cuddled (wsl) var err error ^ commands/commandeer.go:378:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ commands/commandeer.go:629:2: if statements should only be cuddled with assignments (wsl) if c.withc != nil { ^ commands/config.go:65:2: declarations should never be cuddled (wsl) var config *allconfig.Config ^ commands/config.go:96:3: expressions should not be cuddled with blocks (wsl) maps.ConvertFloat64WithNoDecimalsToInt(m) ^ commands/config.go:97:3: only one cuddle assignment allowed before switch statement (wsl) switch format { ^ commands/convert.go:219:3: append only allowed to cuddle with appended value (wsl) pagesBackedByFile = append(pagesBackedByFile, p) ^ ```
Command Mean [s] Min [s] Max [s] Relative
local 1.605 ± 0.043 1.563 1.681 1.04 ± 0.03
v1.59.1 1.546 ± 0.011 1.532 1.562 1.00

kubernetes/kubernetes

local ``` build/pause/windows/wincat/wincat.go:34:2: assignments should only be cuddled with other assignments (wsl) host := os.Args[1] ^ build/pause/windows/wincat/wincat.go:49:2: expressions should not be cuddled with declarations or returns (wsl) wg.Add(2) ^ cluster/gce/gci/mounter/mounter.go:60:2: block should not end with a whitespace (or comment) (wsl) } ^ cluster/gce/gci/mounter/mounter.go:49:2: only one cuddle assignment allowed before switch statement (wsl) switch command { ^ cluster/gce/gci/mounter/mounter.go:68:2: append only allowed to cuddle with appended value (wsl) args = append([]string{rootfsPath, mountCmd}, args...) ^ cluster/gce/gci/mounter/mounter.go:70:2: only one cuddle assignment allowed before if statement (wsl) if err == nil { ^ cluster/gce/gci/mounter/mounter.go:37:14: block should not start with a whitespace (wsl) func main() { ^ cluster/gce/gci/mounter/mounter.go:43:2: assignments should only be cuddled with other assignments (wsl) path, _ := filepath.Split(os.Args[0]) ^ cluster/gce/gci/mounter/mounter.go:45:2: only one cuddle assignment allowed before if statement (wsl) if _, err := os.Stat(rootfsPath); os.IsNotExist(err) { ^ cluster/gce/gci/mounter/mounter.go:48:2: assignments should only be cuddled with other assignments (wsl) command := os.Args[1] ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:338:3: ranges should only be cuddled with assignments used in the iteration (wsl) for _, lbl := range m.Label { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:376:2: return statements should not be cuddled if block has more than two lines (wsl) return r ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:158:2: assignments should only be cuddled with other assignments (wsl) exported, err := m.rewriteExportedMetrics(etcdMetrics) ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:162:2: assignments should only be cuddled with other assignments (wsl) custom, err := customMetricRegistry.Gather() ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:313:2: only one cuddle assignment allowed before range statement (wsl) for _, m := range mf.Metric { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:306:2: assignments should only be cuddled with other assignments (wsl) mf.Metric = buf ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:344:3: assignments should only be cuddled with other assignments (wsl) m.Label = buf ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:358:2: only one cuddle assignment allowed before range statement (wsl) for i, m := range mf.Metric { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:383:2: return statements should not be cuddled if block has more than two lines (wsl) return r ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:216:2: only one cuddle assignment allowed before defer statement (wsl) defer resp.Body.Close() ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:273:2: only one cuddle assignment allowed before defer statement (wsl) defer resp.Body.Close() ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:302:3: if statements should only be cuddled with assignments (wsl) if !shouldRemove { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:312:2: assignments should only be cuddled with other assignments (wsl) byLabels := map[string]*dto.Metric{} ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:321:2: assignments should only be cuddled with other assignments (wsl) mf.Metric = buf ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:328:3: if statements should only be cuddled with assignments (wsl) if i < len(lbls)-1 { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:332:2: return statements should not be cuddled if block has more than two lines (wsl) return buf.String() ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:166:2: assignments should only be cuddled with other assignments (wsl) result := make([]*dto.MetricFamily, 0, len(exported)+len(custom)) ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:193:2: return statements should not be cuddled if block has more than two lines (wsl) return results, nil ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:163:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:248:2: for statement without condition should never be cuddled (wsl) for { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:270:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:361:2: return statements should not be cuddled if block has more than two lines (wsl) return r ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:367:2: only one cuddle assignment allowed before range statement (wsl) for i, lp := range m.Label { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:169:2: return statements should not be cuddled if block has more than two lines (wsl) return result, nil ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:213:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:242:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:174:2: ranges should only be cuddled with assignments used in the iteration (wsl) for n, mf := range metrics { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:296:3: ranges should only be cuddled with assignments used in the iteration (wsl) for _, lbl := range m.Label { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:398:2: only one cuddle assignment allowed before go statement (wsl) go getVersionPeriodically(stopCh) ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:159:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:185:6: append only allowed to cuddle with appended value (wsl) results = append(results, new) ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:294:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, m := range mf.Metric { ^ cmd/clicheck/check_cli_conventions.go:34:2: only one cuddle assignment allowed before range statement (wsl) for _, err := range errors { ^ cmd/cloud-controller-manager/main.go:89:2: if statements should only be cuddled with assignments (wsl) if cloud == nil { ^ cmd/cloud-controller-manager/nodeipamcontroller.go:59:2: expressions should not be cuddled with blocks (wsl) nodeIpamController.nodeIPAMControllerOptions.ApplyTo(&nodeIpamController.nodeIPAMControllerConfiguration) ^ cmd/cloud-controller-manager/nodeipamcontroller.go:118:3: if statements should only be cuddled with assignments (wsl) if !dualstackServiceCIDR { ^ cmd/cloud-controller-manager/nodeipamcontroller.go:142:2: only one cuddle assignment allowed before go statement (wsl) go nodeIpamController.Run(ctx) ^ cmd/cloud-controller-manager/nodeipamcontroller.go:168:122: block should not start with a whitespace (wsl) func setNodeCIDRMaskSizes(cfg nodeipamconfig.NodeIPAMControllerConfiguration, clusterCIDRs []*net.IPNet) ([]int, error) { ^ cmd/cloud-controller-manager/nodeipamcontroller.go:216:3: return statements should not be cuddled if block has more than two lines (wsl) return sortedSizes(mask, mask), nil ^ cmd/cloud-controller-manager/nodeipamcontroller.go:235:2: return statements should not be cuddled if block has more than two lines (wsl) return sortedSizes(ipv4Mask, ipv6Mask), nil ^ ```
v1.59.1 ``` build/pause/windows/wincat/wincat.go:34:2: assignments should only be cuddled with other assignments (wsl) host := os.Args[1] ^ build/pause/windows/wincat/wincat.go:49:2: expressions should not be cuddled with declarations or returns (wsl) wg.Add(2) ^ cluster/gce/gci/mounter/mounter.go:49:2: only one cuddle assignment allowed before switch statement (wsl) switch command { ^ cluster/gce/gci/mounter/mounter.go:68:2: append only allowed to cuddle with appended value (wsl) args = append([]string{rootfsPath, mountCmd}, args...) ^ cluster/gce/gci/mounter/mounter.go:70:2: only one cuddle assignment allowed before if statement (wsl) if err == nil { ^ cluster/gce/gci/mounter/mounter.go:37:14: block should not start with a whitespace (wsl) func main() { ^ cluster/gce/gci/mounter/mounter.go:43:2: assignments should only be cuddled with other assignments (wsl) path, _ := filepath.Split(os.Args[0]) ^ cluster/gce/gci/mounter/mounter.go:45:2: only one cuddle assignment allowed before if statement (wsl) if _, err := os.Stat(rootfsPath); os.IsNotExist(err) { ^ cluster/gce/gci/mounter/mounter.go:48:2: assignments should only be cuddled with other assignments (wsl) command := os.Args[1] ^ cluster/gce/gci/mounter/mounter.go:60:2: block should not end with a whitespace (or comment) (wsl) } ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:162:2: assignments should only be cuddled with other assignments (wsl) custom, err := customMetricRegistry.Gather() ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:169:2: return statements should not be cuddled if block has more than two lines (wsl) return result, nil ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:174:2: ranges should only be cuddled with assignments used in the iteration (wsl) for n, mf := range metrics { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:338:3: ranges should only be cuddled with assignments used in the iteration (wsl) for _, lbl := range m.Label { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:216:2: only one cuddle assignment allowed before defer statement (wsl) defer resp.Body.Close() ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:296:3: ranges should only be cuddled with assignments used in the iteration (wsl) for _, lbl := range m.Label { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:367:2: only one cuddle assignment allowed before range statement (wsl) for i, lp := range m.Label { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:398:2: only one cuddle assignment allowed before go statement (wsl) go getVersionPeriodically(stopCh) ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:166:2: assignments should only be cuddled with other assignments (wsl) result := make([]*dto.MetricFamily, 0, len(exported)+len(custom)) ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:213:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:273:2: only one cuddle assignment allowed before defer statement (wsl) defer resp.Body.Close() ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:306:2: assignments should only be cuddled with other assignments (wsl) mf.Metric = buf ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:344:3: assignments should only be cuddled with other assignments (wsl) m.Label = buf ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:159:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:193:2: return statements should not be cuddled if block has more than two lines (wsl) return results, nil ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:294:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, m := range mf.Metric { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:332:2: return statements should not be cuddled if block has more than two lines (wsl) return buf.String() ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:241:2: assignments should only be cuddled with other assignments (wsl) *lastSeenBinaryVersion = version.BinaryVersion ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:270:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:312:2: assignments should only be cuddled with other assignments (wsl) byLabels := map[string]*dto.Metric{} ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:313:2: only one cuddle assignment allowed before range statement (wsl) for _, m := range mf.Metric { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:370:2: assignments should only be cuddled with other assignments (wsl) r.Gauge = m.Gauge ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:185:6: append only allowed to cuddle with appended value (wsl) results = append(results, new) ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:302:3: if statements should only be cuddled with assignments (wsl) if !shouldRemove { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:328:3: if statements should only be cuddled with assignments (wsl) if i < len(lbls)-1 { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:376:2: return statements should not be cuddled if block has more than two lines (wsl) return r ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:383:2: return statements should not be cuddled if block has more than two lines (wsl) return r ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:163:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:242:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:248:2: for statement without condition should never be cuddled (wsl) for { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:358:2: only one cuddle assignment allowed before range statement (wsl) for i, m := range mf.Metric { ^ cluster/images/etcd-version-monitor/etcd-version-monitor.go:361:2: return statements should not be cuddled if block has more than two lines (wsl) return r ^ cmd/clicheck/check_cli_conventions.go:34:2: only one cuddle assignment allowed before range statement (wsl) for _, err := range errors { ^ cmd/cloud-controller-manager/main.go:89:2: if statements should only be cuddled with assignments (wsl) if cloud == nil { ^ cmd/cloud-controller-manager/nodeipamcontroller.go:59:2: expressions should not be cuddled with blocks (wsl) nodeIpamController.nodeIPAMControllerOptions.ApplyTo(&nodeIpamController.nodeIPAMControllerConfiguration) ^ cmd/cloud-controller-manager/nodeipamcontroller.go:142:2: only one cuddle assignment allowed before go statement (wsl) go nodeIpamController.Run(ctx) ^ cmd/cloud-controller-manager/nodeipamcontroller.go:143:2: return statements should not be cuddled if block has more than two lines (wsl) return nil, true, nil ^ cmd/cloud-controller-manager/nodeipamcontroller.go:197:3: if statements should only be cuddled with assignments (wsl) if cfg.NodeCIDRMaskSizeIPv6 != 0 { ^ cmd/cloud-controller-manager/nodeipamcontroller.go:200:3: return statements should not be cuddled if block has more than two lines (wsl) return sortedSizes(ipv4Mask, ipv6Mask), nil ^ cmd/cloud-controller-manager/nodeipamcontroller.go:216:3: return statements should not be cuddled if block has more than two lines (wsl) return sortedSizes(mask, mask), nil ^ ```
Command Mean [s] Min [s] Max [s] Relative
local 11.045 ± 0.051 10.936 11.107 1.00
v1.59.1 11.084 ± 0.064 10.991 11.184 1.00 ± 0.01

go-acme/lego

local ``` acme/api/api.go:86:2: assignments should only be cuddled with other assignments (wsl) operation := func() error { ^ acme/api/api.go:160:2: if statements should only be cuddled with assignments (wsl) if dir.NewOrderURL == "" { ^ acme/api/internal/nonces/nonce_manager_test.go:31:2: only one cuddle assignment allowed before go statement (wsl) go func() { ^ acme/api/order.go:32:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, domain := range domains { ^ acme/api/service.go:26:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, link := range header["Link"] { ^ acme/api/service.go:31:4: if statements should only be cuddled with assignments (wsl) if m[2] == rel { ^ acme/errors.go:41:2: assignments should only be cuddled with other assignments (wsl) msg += fmt.Sprintf(" :: %s :: %s", p.Type, p.Detail) ^ challenge/challenges.go:43:2: return statements should not be cuddled if block has more than two lines (wsl) return authz.Identifier.Value ^ cmd/lego/main.go:31:2: assignments should only be cuddled with other assignments (wsl) cwd, err := os.Getwd() ^ cmd/lego/main.go:32:2: only one cuddle assignment allowed before if statement (wsl) if err == nil { ^ e2e/loader/loader.go:43:3: return statements should not be cuddled if block has more than two lines (wsl) return 0 ^ e2e/loader/loader.go:49:3: return statements should not be cuddled if block has more than two lines (wsl) return 0 ^ e2e/loader/loader.go:56:4: return statements should not be cuddled if block has more than two lines (wsl) return 0 ^ e2e/loader/loader.go:64:4: return statements should not be cuddled if block has more than two lines (wsl) return 0 ^ e2e/loader/loader.go:76:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ e2e/loader/loader.go:117:3: expressions should not be cuddled with blocks (wsl) fmt.Println(outPebble.String()) ^ e2e/loader/loader.go:129:2: assignments should only be cuddled with other assignments (wsl) cmd.Dir = dir ^ e2e/loader/loader.go:154:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ e2e/loader/loader.go:177:3: expressions should not be cuddled with blocks (wsl) fmt.Println(outChalSrv.String()) ^ e2e/loader/loader.go:198:2: only one cuddle assignment allowed before defer statement (wsl) defer func() { _ = os.Chdir(here) }() ^ e2e/loader/loader.go:231:3: only cuddled expressions if assigning variable or using from line above (wsl) CleanLegoFiles() ^ e2e/loader/loader.go:252:2: assignments should only be cuddled with other assignments (wsl) cmd := exec.Command(toolPath, "build", "-o", binary) ^ e2e/loader/loader.go:299:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/dnsdocs/cli_help/generator.go:53:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, args := range [][]string{ ^ internal/dnsdocs/cli_help/generator.go:75:2: defer statements should only be cuddled with expressions on same variable (wsl) defer func() { _ = f.Close() }() ^ internal/dnsdocs/cli_help/generator.go:76:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/dnsdocs/generator.go:143:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/dnsdocs/generator.go:178:4: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/dnsdocs/generator.go:181:4: assignments should only be cuddled with other assignments (wsl) skip = true ^ internal/dnsdocs/generator.go:229:2: declarations should never be cuddled (wsl) var line []string ^ internal/dnsdocs/generator.go:242:4: append only allowed to cuddle with appended value (wsl) lines = append(lines, line) ^ internal/dnsdocs/generator.go:253:3: append only allowed to cuddle with appended value (wsl) lines = append(lines, line) ^ internal/release.go:97:2: return statements should not be cuddled if block has more than two lines (wsl) return writeUserAgentFile(sourceFile, newVersion, comment) ^ internal/release.go:110:2: return statements should not be cuddled if block has more than two lines (wsl) return writeUserAgentFile(sourceFile, version, comment) ^ internal/release.go:130:5: if statements should only be cuddled with assignments (wsl) if len(valueSpec.Names) != 1 || len(valueSpec.Values) != 1 { ^ internal/release.go:138:5: if statements should only be cuddled with assignments (wsl) if va.Kind != token.STRING { ^ internal/release.go:152:2: block should not end with a whitespace (or comment) (wsl) } ^ internal/release.go:159:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/release.go:180:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/release.go:207:3: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Sprintf("%s.%s.%d", allString[1], allString[2], patch+1), nil ^ internal/release.go:213:3: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Sprintf("%s.%d.0", allString[1], minor+1), nil ^ internal/release.go:219:3: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Sprintf("%d.0.0", major+1), nil ^ platform/tester/api.go:62:2: if statements should only be cuddled with assignments (wsl) if _, err := w.Write(bs); err != nil { ^ platform/tester/env.go:24:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, key := range keys { ^ providers/dns/gandi/internal/client.go:53:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, member := range resp.StructMembers { ^ providers/dns/gandi/internal/client.go:91:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, member := range resp.StructMembers { ^ providers/dns/gandi/internal/client.go:198:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, member := range resp.StructMembers { ^ providers/dns/gandiv5/internal/client.go:82:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ providers/dns/gandiv5/internal/client.go:99:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ providers/dns/gandiv5/internal/client.go:120:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ ```
v1.59.1 ``` acme/api/api.go:86:2: assignments should only be cuddled with other assignments (wsl) operation := func() error { ^ acme/api/api.go:160:2: if statements should only be cuddled with assignments (wsl) if dir.NewOrderURL == "" { ^ acme/api/internal/nonces/nonce_manager_test.go:31:2: only one cuddle assignment allowed before go statement (wsl) go func() { ^ acme/api/order.go:32:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, domain := range domains { ^ acme/api/service.go:26:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, link := range header["Link"] { ^ acme/api/service.go:31:4: if statements should only be cuddled with assignments (wsl) if m[2] == rel { ^ acme/errors.go:41:2: assignments should only be cuddled with other assignments (wsl) msg += fmt.Sprintf(" :: %s :: %s", p.Type, p.Detail) ^ challenge/challenges.go:43:2: return statements should not be cuddled if block has more than two lines (wsl) return authz.Identifier.Value ^ cmd/lego/main.go:31:2: assignments should only be cuddled with other assignments (wsl) cwd, err := os.Getwd() ^ cmd/lego/main.go:32:2: only one cuddle assignment allowed before if statement (wsl) if err == nil { ^ e2e/loader/loader.go:43:3: return statements should not be cuddled if block has more than two lines (wsl) return 0 ^ e2e/loader/loader.go:49:3: return statements should not be cuddled if block has more than two lines (wsl) return 0 ^ e2e/loader/loader.go:56:4: return statements should not be cuddled if block has more than two lines (wsl) return 0 ^ e2e/loader/loader.go:64:4: return statements should not be cuddled if block has more than two lines (wsl) return 0 ^ e2e/loader/loader.go:76:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ e2e/loader/loader.go:117:3: expressions should not be cuddled with blocks (wsl) fmt.Println(outPebble.String()) ^ e2e/loader/loader.go:129:2: assignments should only be cuddled with other assignments (wsl) cmd.Dir = dir ^ e2e/loader/loader.go:154:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ e2e/loader/loader.go:177:3: expressions should not be cuddled with blocks (wsl) fmt.Println(outChalSrv.String()) ^ e2e/loader/loader.go:198:2: only one cuddle assignment allowed before defer statement (wsl) defer func() { _ = os.Chdir(here) }() ^ e2e/loader/loader.go:231:3: only cuddled expressions if assigning variable or using from line above (wsl) CleanLegoFiles() ^ e2e/loader/loader.go:252:2: assignments should only be cuddled with other assignments (wsl) cmd := exec.Command(toolPath, "build", "-o", binary) ^ e2e/loader/loader.go:299:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/dnsdocs/cli_help/generator.go:53:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, args := range [][]string{ ^ internal/dnsdocs/cli_help/generator.go:75:2: defer statements should only be cuddled with expressions on same variable (wsl) defer func() { _ = f.Close() }() ^ internal/dnsdocs/cli_help/generator.go:76:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ internal/dnsdocs/generator.go:143:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/dnsdocs/generator.go:178:4: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/dnsdocs/generator.go:181:4: assignments should only be cuddled with other assignments (wsl) skip = true ^ internal/dnsdocs/generator.go:229:2: declarations should never be cuddled (wsl) var line []string ^ internal/dnsdocs/generator.go:242:4: append only allowed to cuddle with appended value (wsl) lines = append(lines, line) ^ internal/dnsdocs/generator.go:253:3: append only allowed to cuddle with appended value (wsl) lines = append(lines, line) ^ internal/release.go:97:2: return statements should not be cuddled if block has more than two lines (wsl) return writeUserAgentFile(sourceFile, newVersion, comment) ^ internal/release.go:110:2: return statements should not be cuddled if block has more than two lines (wsl) return writeUserAgentFile(sourceFile, version, comment) ^ internal/release.go:130:5: if statements should only be cuddled with assignments (wsl) if len(valueSpec.Names) != 1 || len(valueSpec.Values) != 1 { ^ internal/release.go:138:5: if statements should only be cuddled with assignments (wsl) if va.Kind != token.STRING { ^ internal/release.go:152:2: block should not end with a whitespace (or comment) (wsl) } ^ internal/release.go:153:2: return statements should not be cuddled if block has more than two lines (wsl) return v ^ internal/release.go:159:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/release.go:180:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/release.go:207:3: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Sprintf("%s.%s.%d", allString[1], allString[2], patch+1), nil ^ internal/release.go:213:3: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Sprintf("%s.%d.0", allString[1], minor+1), nil ^ platform/tester/api.go:62:2: if statements should only be cuddled with assignments (wsl) if _, err := w.Write(bs); err != nil { ^ platform/tester/env.go:24:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, key := range keys { ^ providers/dns/gandi/internal/client.go:53:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, member := range resp.StructMembers { ^ providers/dns/gandi/internal/client.go:91:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, member := range resp.StructMembers { ^ providers/dns/gandi/internal/client.go:198:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, member := range resp.StructMembers { ^ providers/dns/gandiv5/internal/client.go:82:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ providers/dns/gandiv5/internal/client.go:99:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ providers/dns/gandiv5/internal/client.go:120:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ ```
Command Mean [s] Min [s] Max [s] Relative
local 1.031 ± 0.005 1.024 1.040 1.02 ± 0.01
v1.59.1 1.007 ± 0.013 0.993 1.038 1.00

pact-foundation/pact-go

local ``` message/verifier.go:26:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ message/verifier.go:102:6: assignments should only be cuddled with other assignments (wsl) body = bytes ^ message/verifier.go:121:4: expressions should not be cuddled with blocks (wsl) log.Println("[TRACE] skipping message handler for request", r.RequestURI) ^ message/verifier.go:106:6: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ message/verifier.go:29:3: expressions should not be cuddled with blocks (wsl) log.Println("[TRACE] encoded metadata to JSON:", string(json)) ^ message/verifier.go:61:5: assignments should only be cuddled with other assignments (wsl) body, err := io.ReadAll(r.Body) ^ message/verifier.go:109:7: return statements should not be cuddled if block has more than two lines (wsl) return ^ message/verifier.go:94:6: return statements should not be cuddled if block has more than two lines (wsl) return ^ message/verifier.go:105:6: assignments should only be cuddled with other assignments (wsl) body, err = json.Marshal(res) ^ message/verifier.go:53:47: block should not start with a whitespace (wsl) return func(next http.Handler) http.Handler { ^ message/verifier.go:76:6: return statements should not be cuddled if block has more than two lines (wsl) return ^ message/verifier.go:85:6: return statements should not be cuddled if block has more than two lines (wsl) return ^ message/verifier.go:126:3: block should not end with a whitespace (or comment) (wsl) }) ^ message/verifier.go:68:6: return statements should not be cuddled if block has more than two lines (wsl) return ^ message/verifier.go:115:5: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ message/v3/asynchronous_message.go:160:2: assignments should only be cuddled with other assignments (wsl) dir, _ := os.Getwd() ^ message/v3/asynchronous_message.go:205:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ command/root_test.go:14:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ command/root_test.go:58:2: assignments should only be cuddled with other assignments (wsl) out, _ := io.ReadAll(r) ^ command/version_test.go:11:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ command/version_test.go:14:2: expressions should not be cuddled with blocks (wsl) versionCmd.Run(nil, os.Args) ^ consumer/http.go:279:3: only one cuddle assignment allowed before if statement (wsl) if isTest(name, "Test") || ^ consumer/http.go:147:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ consumer/http.go:191:26: block should not start with a whitespace (wsl) if len(mismatches) > 0 { ^ consumer/http.go:202:4: switch statements should only be cuddled with variables switched (wsl) switch m.Type { ^ consumer/http.go:256:3: assignments should only be cuddled with other assignments (wsl) name = f.Name() ^ consumer/http.go:123:2: expressions should not be cuddled with blocks (wsl) native.Init(string(logging.LogLevel())) ^ consumer/http.go:183:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ consumer/http.go:224:3: expressions should not be cuddled with blocks (wsl) fmt.Println() ^ consumer/http.go:297:2: if statements should only be cuddled with assignments (wsl) if len(name) == len(prefix) { // "Test" is ok ^ consumer/http.go:230:29: block should not start with a whitespace (wsl) func callerInfo() []string { ^ consumer/http.go:233:2: declarations should never be cuddled (wsl) var ok bool ^ consumer/http.go:235:2: declarations should never be cuddled (wsl) var line int ^ consumer/http.go:236:2: declarations should never be cuddled (wsl) var name string ^ consumer/http.go:96:2: assignments should only be cuddled with other assignments (wsl) dir, _ := os.Getwd() ^ consumer/http.go:196:3: expressions should not be cuddled with blocks (wsl) fmt.Println("\tPact Verification Failed for:", t.Name()) ^ consumer/http.go:209:4: block should not end with a whitespace (or comment) (wsl) } ^ consumer/http.go:200:3: only one cuddle assignment allowed before range statement (wsl) for _, m := range mismatches { ^ consumer/http.go:269:3: only one cuddle assignment allowed before if statement (wsl) if len(parts) > 1 { ^ consumer/http.go:239:2: for statement without condition should never be cuddled (wsl) for i := 0; ; i++ { ^ consumer/http.go:300:2: assignments should only be cuddled with other assignments (wsl) r, _ := utf8.DecodeRuneInString(name[len(prefix):]) ^ consumer/http.go:234:2: declarations should never be cuddled (wsl) var file string ^ consumer/http.go:301:2: return statements should not be cuddled if block has more than two lines (wsl) return !unicode.IsLower(r) ^ consumer/http.go:309:2: if statements should only be cuddled with assignments (wsl) if p.config.Port != 0 { ^ consumer/http.go:312:2: return statements should not be cuddled if block has more than two lines (wsl) return errors.New("pact server not yet started") ^ consumer/http_v2.go:38:2: assignments should only be cuddled with other assignments (wsl) interaction := p.httpMockProvider.mockserver.NewInteraction("") ^ consumer/http_v2.go:215:36: block should not start with a whitespace (wsl) for _, builder := range builders { ^ consumer/http_v2.go:272:2: expressions should not be cuddled with blocks (wsl) i.interaction.interaction.WithJSONResponseBody(body) ^ consumer/http_v3.go:38:2: assignments should only be cuddled with other assignments (wsl) interaction := p.httpMockProvider.mockserver.NewInteraction("") ^ consumer/http_v3.go:226:36: block should not start with a whitespace (wsl) for _, builder := range builders { ^ ```
v1.59.1 ``` message/verifier.go:94:6: return statements should not be cuddled if block has more than two lines (wsl) return ^ message/verifier.go:106:6: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ message/verifier.go:109:7: return statements should not be cuddled if block has more than two lines (wsl) return ^ message/verifier.go:26:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ message/verifier.go:126:3: block should not end with a whitespace (or comment) (wsl) }) ^ message/verifier.go:102:6: assignments should only be cuddled with other assignments (wsl) body = bytes ^ message/verifier.go:29:3: expressions should not be cuddled with blocks (wsl) log.Println("[TRACE] encoded metadata to JSON:", string(json)) ^ message/verifier.go:68:6: return statements should not be cuddled if block has more than two lines (wsl) return ^ message/verifier.go:85:6: return statements should not be cuddled if block has more than two lines (wsl) return ^ message/verifier.go:105:6: assignments should only be cuddled with other assignments (wsl) body, err = json.Marshal(res) ^ message/verifier.go:115:5: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ message/verifier.go:121:4: expressions should not be cuddled with blocks (wsl) log.Println("[TRACE] skipping message handler for request", r.RequestURI) ^ message/verifier.go:53:47: block should not start with a whitespace (wsl) return func(next http.Handler) http.Handler { ^ message/verifier.go:61:5: assignments should only be cuddled with other assignments (wsl) body, err := io.ReadAll(r.Body) ^ message/verifier.go:76:6: return statements should not be cuddled if block has more than two lines (wsl) return ^ message/v3/asynchronous_message.go:160:2: assignments should only be cuddled with other assignments (wsl) dir, _ := os.Getwd() ^ message/v3/asynchronous_message.go:205:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ command/root_test.go:58:2: assignments should only be cuddled with other assignments (wsl) out, _ := io.ReadAll(r) ^ command/root_test.go:14:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ command/version_test.go:14:2: expressions should not be cuddled with blocks (wsl) versionCmd.Run(nil, os.Args) ^ command/version_test.go:11:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ consumer/http.go:147:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ consumer/http.go:224:3: expressions should not be cuddled with blocks (wsl) fmt.Println() ^ consumer/http.go:239:2: for statement without condition should never be cuddled (wsl) for i := 0; ; i++ { ^ consumer/http.go:96:2: assignments should only be cuddled with other assignments (wsl) dir, _ := os.Getwd() ^ consumer/http.go:123:2: expressions should not be cuddled with blocks (wsl) native.Init(string(logging.LogLevel())) ^ consumer/http.go:196:3: expressions should not be cuddled with blocks (wsl) fmt.Println("\tPact Verification Failed for:", t.Name()) ^ consumer/http.go:297:2: if statements should only be cuddled with assignments (wsl) if len(name) == len(prefix) { // "Test" is ok ^ consumer/http.go:300:2: assignments should only be cuddled with other assignments (wsl) r, _ := utf8.DecodeRuneInString(name[len(prefix):]) ^ consumer/http.go:230:29: block should not start with a whitespace (wsl) func callerInfo() []string { ^ consumer/http.go:233:2: declarations should never be cuddled (wsl) var ok bool ^ consumer/http.go:234:2: declarations should never be cuddled (wsl) var file string ^ consumer/http.go:236:2: declarations should never be cuddled (wsl) var name string ^ consumer/http.go:256:3: assignments should only be cuddled with other assignments (wsl) name = f.Name() ^ consumer/http.go:269:3: only one cuddle assignment allowed before if statement (wsl) if len(parts) > 1 { ^ consumer/http.go:301:2: return statements should not be cuddled if block has more than two lines (wsl) return !unicode.IsLower(r) ^ consumer/http.go:309:2: if statements should only be cuddled with assignments (wsl) if p.config.Port != 0 { ^ consumer/http.go:312:2: return statements should not be cuddled if block has more than two lines (wsl) return errors.New("pact server not yet started") ^ consumer/http.go:279:3: only one cuddle assignment allowed before if statement (wsl) if isTest(name, "Test") || ^ consumer/http.go:183:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ consumer/http.go:191:26: block should not start with a whitespace (wsl) if len(mismatches) > 0 { ^ consumer/http.go:209:4: block should not end with a whitespace (or comment) (wsl) } ^ consumer/http.go:202:4: switch statements should only be cuddled with variables switched (wsl) switch m.Type { ^ consumer/http.go:200:3: only one cuddle assignment allowed before range statement (wsl) for _, m := range mismatches { ^ consumer/http.go:235:2: declarations should never be cuddled (wsl) var line int ^ consumer/http_v2.go:38:2: assignments should only be cuddled with other assignments (wsl) interaction := p.httpMockProvider.mockserver.NewInteraction("") ^ consumer/http_v2.go:215:36: block should not start with a whitespace (wsl) for _, builder := range builders { ^ consumer/http_v2.go:272:2: expressions should not be cuddled with blocks (wsl) i.interaction.interaction.WithJSONResponseBody(body) ^ consumer/http_v3.go:38:2: assignments should only be cuddled with other assignments (wsl) interaction := p.httpMockProvider.mockserver.NewInteraction("") ^ consumer/http_v3.go:226:36: block should not start with a whitespace (wsl) for _, builder := range builders { ^ ```
Command Mean [ms] Min [ms] Max [ms] Relative
local 324.0 ± 9.5 314.3 343.7 1.10 ± 0.05
v1.59.1 295.8 ± 9.1 286.9 319.8 1.00

rclone/rclone

local ``` backend/b2/api/types.go:70:2: assignments should only be cuddled with other assignments (wsl) *t = Timestamp(time.Unix(timestamp/1e3, (timestamp%1e3)*1e6).UTC()) ^ backend/b2/api/types.go:71:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ backend/b2/api/types.go:94:2: return statements should not be cuddled if block has more than two lines (wsl) return ^ backend/b2/api/types.go:109:2: if statements should only be cuddled with assignments (wsl) if time.Time(s).IsZero() { ^ backend/b2/api/types.go:112:2: return statements should not be cuddled if block has more than two lines (wsl) return time.Time(t).Equal(time.Time(s)) ^ backend/box/box.go:785:2: assignments should only be cuddled with other assignments (wsl) opts := rest.Opts{ ^ backend/box/box.go:922:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ backend/box/box.go:991:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:1474:4: assignments should only be cuddled with other assignments (wsl) notifiedPaths[p.path] = true ^ backend/box/box.go:1555:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:429:2: if statements should only be cuddled with assignments (wsl) if errResponse.Status == 0 { ^ backend/box/box.go:1152:2: assignments should only be cuddled with other assignments (wsl) err = f.pacer.Call(func() (bool, error) { ^ backend/box/box.go:1627:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:415:2: return statements should not be cuddled if block has more than two lines (wsl) return &item, nil ^ backend/box/box.go:527:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:990:2: assignments should only be cuddled with other assignments (wsl) err = dstObj.setMetaData(info) ^ backend/box/box.go:1115:2: expressions should not be cuddled with blocks (wsl) srcFs.dirCache.FlushDir(srcRemote) ^ backend/box/box.go:1367:3: assignments should only be cuddled with other assignments (wsl) newEventIDs := 0 ^ backend/box/box.go:1576:2: return statements should not be cuddled if block has more than two lines (wsl) return o.modTime ^ backend/box/box.go:791:2: assignments should only be cuddled with other assignments (wsl) err = f.pacer.Call(func() (bool, error) { ^ backend/box/box.go:918:2: expressions should not be cuddled with blocks (wsl) f.dirCache.FlushDir(dir) ^ backend/box/box.go:959:2: only one cuddle assignment allowed before if statement (wsl) if strings.EqualFold(srcPath, dstPath) { ^ backend/box/box.go:1116:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ backend/box/box.go:1477:3: expressions should not be cuddled with blocks (wsl) fs.Debugf(f, "Received %v events, resulting in %v paths and %v notifications", len(result.Entries), len(pathsToClear), len(notifiedPaths)) ^ backend/box/box.go:1535:2: if statements should only be cuddled with assignments (wsl) if info.Type != api.ItemTypeFile { ^ backend/box/box.go:408:2: assignments should only be cuddled with other assignments (wsl) err = f.pacer.Call(func() (bool, error) { ^ backend/box/box.go:1589:2: declarations should never be cuddled (wsl) var info *api.Item ^ backend/box/box.go:1618:2: assignments should only be cuddled with other assignments (wsl) opts := rest.Opts{ ^ backend/box/box.go:727:4: append only allowed to cuddle with appended value (wsl) entries = append(entries, o) ^ backend/box/box.go:748:2: return statements should not be cuddled if block has more than two lines (wsl) return entries, nil ^ backend/box/box.go:982:2: declarations should never be cuddled (wsl) var info *api.Item ^ backend/box/box.go:1020:2: declarations should never be cuddled (wsl) var resp *http.Response ^ backend/box/box.go:1187:4: only one cuddle assignment allowed before go statement (wsl) go func() { ^ backend/box/box.go:1517:2: return statements should not be cuddled if block has more than two lines (wsl) return o.sha1, nil ^ backend/box/box.go:1554:2: assignments should only be cuddled with other assignments (wsl) info, err := o.fs.readMetaDataForPath(ctx, o.remote) ^ backend/box/box.go:1043:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:1052:2: return statements should not be cuddled if block has more than two lines (wsl) return usage, nil ^ backend/box/box.go:1134:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:1343:3: declarations should never be cuddled (wsl) var resp *http.Response ^ backend/box/box.go:1667:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:569:2: if statements should only be cuddled with assignments (wsl) if err != nil { ^ backend/box/box.go:621:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:1123:2: only one cuddle assignment allowed before if statement (wsl) if err == nil { ^ backend/box/box.go:745:2: if statements should only be cuddled with assignments (wsl) if iErr != nil { ^ backend/box/box.go:562:2: declarations should never be cuddled (wsl) var err error ^ backend/box/box.go:1616:2: expressions should not be cuddled with blocks (wsl) fs.FixRangeOption(options, o.size) ^ backend/box/box.go:981:2: declarations should never be cuddled (wsl) var resp *http.Response ^ backend/box/box.go:407:2: declarations should never be cuddled (wsl) var item api.Item ^ backend/box/box.go:369:3: only cuddled expressions if assigning variable or using from line above (wsl) fs.Debugf(nil, "Should retry: %v", err) ^ backend/box/box.go:605:2: declarations should never be cuddled (wsl) var info *api.Item ^ ```
v1.59.1 ``` backend/b2/api/types.go:70:2: assignments should only be cuddled with other assignments (wsl) *t = Timestamp(time.Unix(timestamp/1e3, (timestamp%1e3)*1e6).UTC()) ^ backend/b2/api/types.go:71:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ backend/b2/api/types.go:94:2: return statements should not be cuddled if block has more than two lines (wsl) return ^ backend/b2/api/types.go:109:2: if statements should only be cuddled with assignments (wsl) if time.Time(s).IsZero() { ^ backend/b2/api/types.go:112:2: return statements should not be cuddled if block has more than two lines (wsl) return time.Time(t).Equal(time.Time(s)) ^ backend/box/box.go:1590:2: assignments should only be cuddled with other assignments (wsl) err := o.fs.pacer.Call(func() (bool, error) { ^ backend/box/box.go:1603:2: return statements should not be cuddled if block has more than two lines (wsl) return o.setMetaData(info) ^ backend/box/box.go:1037:2: declarations should never be cuddled (wsl) var user api.User ^ backend/box/box.go:1122:2: declarations should never be cuddled (wsl) var opts rest.Opts ^ backend/box/box.go:1504:2: return statements should not be cuddled if block has more than two lines (wsl) return o.remote ^ backend/box/box.go:1150:2: declarations should never be cuddled (wsl) var info api.Item ^ backend/box/box.go:1563:2: return statements should not be cuddled if block has more than two lines (wsl) return o.setMetaData(info) ^ backend/box/box.go:1627:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:440:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:451:2: declarations should never be cuddled (wsl) var ts *oauthutil.TokenSource ^ backend/box/box.go:911:2: assignments should only be cuddled with other assignments (wsl) err = f.pacer.Call(func() (bool, error) { ^ backend/box/box.go:825:3: return statements should not be cuddled if block has more than two lines (wsl) return nil, err ^ backend/box/box.go:1020:2: declarations should never be cuddled (wsl) var resp *http.Response ^ backend/box/box.go:1187:4: only one cuddle assignment allowed before go statement (wsl) go func() { ^ backend/box/box.go:1249:5: if statements should only be cuddled with assignments (wsl) if pollInterval != 0 { ^ backend/box/box.go:195:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:432:2: return statements should not be cuddled if block has more than two lines (wsl) return errResponse ^ backend/box/box.go:727:4: append only allowed to cuddle with appended value (wsl) entries = append(entries, o) ^ backend/box/box.go:1028:2: return statements should not be cuddled if block has more than two lines (wsl) return info, nil ^ backend/box/box.go:1667:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:194:2: assignments should only be cuddled with other assignments (wsl) privateKey, err := getDecryptedPrivateKey(boxConfig) ^ backend/box/box.go:369:3: only cuddled expressions if assigning variable or using from line above (wsl) fs.Debugf(nil, "Should retry: %v", err) ^ backend/box/box.go:606:2: assignments should only be cuddled with other assignments (wsl) opts := rest.Opts{ ^ backend/box/box.go:1087:2: return statements should not be cuddled if block has more than two lines (wsl) return dstObj, nil ^ backend/box/box.go:1235:3: declarations should never be cuddled (wsl) var tickerC <-chan time.Time ^ backend/box/box.go:1400:4: only one cuddle assignment allowed before if statement (wsl) if cachedItemMetaFound { ^ backend/box/box.go:407:2: declarations should never be cuddled (wsl) var item api.Item ^ backend/box/box.go:412:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:215:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:429:2: if statements should only be cuddled with assignments (wsl) if errResponse.Status == 0 { ^ backend/box/box.go:790:2: declarations should never be cuddled (wsl) var resp *http.Response ^ backend/box/box.go:1554:2: assignments should only be cuddled with other assignments (wsl) info, err := o.fs.readMetaDataForPath(ctx, o.remote) ^ backend/box/box.go:563:2: only one cuddle assignment allowed before if statement (wsl) if info != nil { ^ backend/box/box.go:1025:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:1349:3: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ backend/box/box.go:981:2: declarations should never be cuddled (wsl) var resp *http.Response ^ backend/box/box.go:1021:2: assignments should only be cuddled with other assignments (wsl) err = f.pacer.Call(func() (bool, error) { ^ backend/box/box.go:983:2: assignments should only be cuddled with other assignments (wsl) err = f.pacer.Call(func() (bool, error) { ^ backend/box/box.go:990:2: assignments should only be cuddled with other assignments (wsl) err = dstObj.setMetaData(info) ^ backend/box/box.go:534:3: expressions should not be cuddled with blocks (wsl) f.features.Fill(ctx, &tempF) ^ backend/box/box.go:1192:5: assignments should only be cuddled with other assignments (wsl) err := f.deletePermanently(ctx, item.Type, item.ID) ^ backend/box/box.go:1204:2: if statements should only be cuddled with assignments (wsl) if deleteErrors.Load() != 0 { ^ backend/box/box.go:1535:2: if statements should only be cuddled with assignments (wsl) if info.Type != api.ItemTypeFile { ^ backend/box/box.go:1368:3: only one cuddle assignment allowed before range statement (wsl) for _, entry := range result.Entries { ^ backend/box/box.go:1616:2: expressions should not be cuddled with blocks (wsl) fs.FixRangeOption(options, o.size) ^ ```
Command Mean [s] Min [s] Max [s] Relative
local 2.555 ± 0.058 2.513 2.710 1.02 ± 0.03
v1.59.1 2.504 ± 0.028 2.467 2.549 1.00

hashicorp/terraform

local ``` internal/backend/testing.go:215:3: assignments should only be cuddled with other assignments (wsl) expected := []string{"bar", "default", "foo"} ^ internal/backend/testing.go:241:2: if statements should only be cuddled with assignments (wsl) if err := foo.RefreshState(); err != nil { ^ internal/backend/testing.go:260:3: assignments should only be cuddled with other assignments (wsl) expected := []string{"bar", "default"} ^ internal/backend/testing.go:330:2: if statements should only be cuddled with assignments (wsl) if err := b2StateMgr.RefreshState(); err != nil { ^ internal/backend/testing.go:175:3: only one cuddle assignment allowed before if statement (wsl) if fooState.HasManagedResourceInstanceObjects() { ^ internal/backend/testing.go:261:3: only one cuddle assignment allowed before if statement (wsl) if noDefault { ^ internal/backend/testing.go:314:2: if statements should only be cuddled with assignments (wsl) if err := b1StateMgr.RefreshState(); err != nil { ^ internal/backend/testing.go:197:3: if statements should only be cuddled with assignments (wsl) if err := bar.RefreshState(); err != nil { ^ internal/backend/testing.go:201:3: only one cuddle assignment allowed before if statement (wsl) if !barState.HasManagedResourceInstanceObjects() { ^ internal/backend/testing.go:404:2: assignments should only be cuddled with other assignments (wsl) unlock := func() { ^ internal/backend/testing.go:96:3: expressions should not be cuddled with blocks (wsl) t.Fatalf("error: %v", err) ^ internal/backend/testing.go:188:3: only one cuddle assignment allowed before if statement (wsl) if fooState.HasManagedResourceInstanceObjects() { ^ internal/backend/testing.go:166:3: if statements should only be cuddled with assignments (wsl) if err := bar.PersistState(nil); err != nil { ^ internal/backend/testing.go:244:2: if statements should only be cuddled with assignments (wsl) if v := foo.State(); v.HasManagedResourceInstanceObjects() { ^ internal/backend/testing.go:216:3: only one cuddle assignment allowed before if statement (wsl) if noDefault { ^ internal/backend/testing.go:112:2: if statements should only be cuddled with assignments (wsl) if v := foo.State(); v.HasManagedResourceInstanceObjects() { ^ internal/backend/testing.go:200:3: assignments should only be cuddled with other assignments (wsl) barState = bar.State() ^ internal/backend/testing.go:219:3: if statements should only be cuddled with assignments (wsl) if !reflect.DeepEqual(workspaces, expected) { ^ internal/backend/testing.go:123:2: if statements should only be cuddled with assignments (wsl) if v := bar.State(); v.HasManagedResourceInstanceObjects() { ^ internal/backend/testing.go:174:3: assignments should only be cuddled with other assignments (wsl) fooState = foo.State() ^ internal/backend/testing.go:120:2: if statements should only be cuddled with assignments (wsl) if err := bar.RefreshState(); err != nil { ^ internal/backend/testing.go:187:3: assignments should only be cuddled with other assignments (wsl) fooState = foo.State() ^ internal/backend/testing.go:82:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if _, err := b.StateMgr(DefaultStateName); err != nil { ^ internal/command/jsonformat/collections/action.go:18:2: return statements should not be cuddled if block has more than two lines (wsl) return current ^ internal/command/jsonformat/collections/slice.go:34:2: return statements should not be cuddled if block has more than two lines (wsl) return elements, current ^ internal/command/jsonformat/collections/slice.go:60:5: assignments should only be cuddled with other assignments (wsl) beforeIx++ ^ internal/command/jsonformat/collections/slice.go:66:4: assignments should only be cuddled with other assignments (wsl) beforeIx++ ^ internal/command/jsonformat/collections/slice.go:29:2: expressions should not be cuddled with declarations or returns (wsl) ProcessSlice(before, after, func(before, after int) { ^ internal/command/jsonformat/collections/slice.go:44:3: return statements should not be cuddled if block has more than two lines (wsl) return ^ internal/command/jsonformat/collections/slice.go:62:5: branch statements should not be cuddled if block has more than two lines (wsl) continue ^ internal/command/jsonformat/collections/slice.go:73:4: assignments should only be cuddled with other assignments (wsl) afterIx++ ^ internal/command/jsonformat/collections/slice.go:79:4: assignments should only be cuddled with other assignments (wsl) beforeIx++ ^ internal/command/jsonformat/collections/slice.go:95:3: ranges should only be cuddled with assignments used in the iteration (wsl) for _, a := range after { ^ internal/command/jsonformat/jsondiff/diff.go:90:2: anonymous switch statements should never be cuddled (wsl) switch { ^ internal/command/jsonformat/jsondiff/diff.go:58:3: return statements should not be cuddled if block has more than two lines (wsl) return opts.processUpdate(change, targetType) ^ internal/command/jsonformat/jsondiff/diff.go:63:2: return statements should not be cuddled if block has more than two lines (wsl) return opts.TypeChange(b, a, plans.Update) ^ internal/command/jsonformat/structured/change.go:228:2: return statements should not be cuddled if block has more than two lines (wsl) return plans.NoOp ^ internal/command/jsonformat/structured/change.go:291:2: return statements should not be cuddled if block has more than two lines (wsl) return out ^ internal/command/jsonformat/structured/change.go:299:2: return statements should not be cuddled if block has more than two lines (wsl) return out ^ internal/command/jsonformat/structured/map.go:168:2: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ internal/command/jsonformat/structured/map.go:139:2: only one cuddle assignment allowed before range statement (wsl) for sensitive := range m.BeforeSensitive { ^ internal/command/jsonformat/structured/map.go:121:2: only one cuddle assignment allowed before range statement (wsl) for after := range m.After { ^ internal/command/jsonformat/structured/map.go:150:2: return statements should not be cuddled if block has more than two lines (wsl) return dedupedKeys ^ internal/command/jsonformat/structured/map.go:127:2: only one cuddle assignment allowed before range statement (wsl) for unknown := range m.Unknown { ^ internal/command/jsonformat/structured/map.go:133:2: only one cuddle assignment allowed before range statement (wsl) for sensitive := range m.AfterSensitive { ^ internal/command/jsonformat/structured/map.go:96:2: only one cuddle assignment allowed before range statement (wsl) for after := range m.After { ^ internal/command/testing/test_provider.go:305:2: only one cuddle assignment allowed before if statement (wsl) if resource == cty.NilVal { ^ internal/command/testing/test_provider.go:320:2: only one cuddle assignment allowed before if statement (wsl) if resource == cty.NilVal { ^ internal/command/testing/test_provider.go:258:2: only one cuddle assignment allowed before if statement (wsl) if !id.IsKnown() { ^ internal/command/testing/test_provider.go:193:2: ranges should only be cuddled with assignments used in the iteration (wsl) for key := range provider.Store.Data { ^ ```
v1.59.1 ``` internal/backend/testing.go:96:3: expressions should not be cuddled with blocks (wsl) t.Fatalf("error: %v", err) ^ internal/backend/testing.go:215:3: assignments should only be cuddled with other assignments (wsl) expected := []string{"bar", "default", "foo"} ^ internal/backend/testing.go:330:2: if statements should only be cuddled with assignments (wsl) if err := b2StateMgr.RefreshState(); err != nil { ^ internal/backend/testing.go:404:2: assignments should only be cuddled with other assignments (wsl) unlock := func() { ^ internal/backend/testing.go:166:3: if statements should only be cuddled with assignments (wsl) if err := bar.PersistState(nil); err != nil { ^ internal/backend/testing.go:174:3: assignments should only be cuddled with other assignments (wsl) fooState = foo.State() ^ internal/backend/testing.go:260:3: assignments should only be cuddled with other assignments (wsl) expected := []string{"bar", "default"} ^ internal/backend/testing.go:261:3: only one cuddle assignment allowed before if statement (wsl) if noDefault { ^ internal/backend/testing.go:264:3: if statements should only be cuddled with assignments (wsl) if !reflect.DeepEqual(workspaces, expected) { ^ internal/backend/testing.go:314:2: if statements should only be cuddled with assignments (wsl) if err := b1StateMgr.RefreshState(); err != nil { ^ internal/backend/testing.go:184:3: if statements should only be cuddled with assignments (wsl) if err := foo.RefreshState(); err != nil { ^ internal/backend/testing.go:187:3: assignments should only be cuddled with other assignments (wsl) fooState = foo.State() ^ internal/backend/testing.go:188:3: only one cuddle assignment allowed before if statement (wsl) if fooState.HasManagedResourceInstanceObjects() { ^ internal/backend/testing.go:200:3: assignments should only be cuddled with other assignments (wsl) barState = bar.State() ^ internal/backend/testing.go:197:3: if statements should only be cuddled with assignments (wsl) if err := bar.RefreshState(); err != nil { ^ internal/backend/testing.go:219:3: if statements should only be cuddled with assignments (wsl) if !reflect.DeepEqual(workspaces, expected) { ^ internal/backend/testing.go:241:2: if statements should only be cuddled with assignments (wsl) if err := foo.RefreshState(); err != nil { ^ internal/backend/testing.go:244:2: if statements should only be cuddled with assignments (wsl) if v := foo.State(); v.HasManagedResourceInstanceObjects() { ^ internal/backend/testing.go:109:2: if statements should only be cuddled with assignments (wsl) if err := foo.RefreshState(); err != nil { ^ internal/backend/testing.go:201:3: only one cuddle assignment allowed before if statement (wsl) if !barState.HasManagedResourceInstanceObjects() { ^ internal/backend/testing.go:82:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if _, err := b.StateMgr(DefaultStateName); err != nil { ^ internal/backend/testing.go:175:3: only one cuddle assignment allowed before if statement (wsl) if fooState.HasManagedResourceInstanceObjects() { ^ internal/backend/testing.go:216:3: only one cuddle assignment allowed before if statement (wsl) if noDefault { ^ internal/command/jsonformat/collections/action.go:18:2: return statements should not be cuddled if block has more than two lines (wsl) return current ^ internal/command/jsonformat/collections/slice.go:29:2: expressions should not be cuddled with declarations or returns (wsl) ProcessSlice(before, after, func(before, after int) { ^ internal/command/jsonformat/collections/slice.go:34:2: return statements should not be cuddled if block has more than two lines (wsl) return elements, current ^ internal/command/jsonformat/collections/slice.go:60:5: assignments should only be cuddled with other assignments (wsl) beforeIx++ ^ internal/command/jsonformat/collections/slice.go:95:3: ranges should only be cuddled with assignments used in the iteration (wsl) for _, a := range after { ^ internal/command/jsonformat/collections/slice.go:44:3: return statements should not be cuddled if block has more than two lines (wsl) return ^ internal/command/jsonformat/collections/slice.go:62:5: branch statements should not be cuddled if block has more than two lines (wsl) continue ^ internal/command/jsonformat/collections/slice.go:66:4: assignments should only be cuddled with other assignments (wsl) beforeIx++ ^ internal/command/jsonformat/collections/slice.go:73:4: assignments should only be cuddled with other assignments (wsl) afterIx++ ^ internal/command/jsonformat/collections/slice.go:79:4: assignments should only be cuddled with other assignments (wsl) beforeIx++ ^ internal/command/jsonformat/jsondiff/diff.go:58:3: return statements should not be cuddled if block has more than two lines (wsl) return opts.processUpdate(change, targetType) ^ internal/command/jsonformat/jsondiff/diff.go:63:2: return statements should not be cuddled if block has more than two lines (wsl) return opts.TypeChange(b, a, plans.Update) ^ internal/command/jsonformat/jsondiff/diff.go:90:2: anonymous switch statements should never be cuddled (wsl) switch { ^ internal/command/jsonformat/structured/change.go:228:2: return statements should not be cuddled if block has more than two lines (wsl) return plans.NoOp ^ internal/command/jsonformat/structured/change.go:291:2: return statements should not be cuddled if block has more than two lines (wsl) return out ^ internal/command/jsonformat/structured/change.go:299:2: return statements should not be cuddled if block has more than two lines (wsl) return out ^ internal/command/jsonformat/structured/map.go:121:2: only one cuddle assignment allowed before range statement (wsl) for after := range m.After { ^ internal/command/jsonformat/structured/map.go:107:2: return statements should not be cuddled if block has more than two lines (wsl) return dedupedKeys ^ internal/command/jsonformat/structured/map.go:133:2: only one cuddle assignment allowed before range statement (wsl) for sensitive := range m.AfterSensitive { ^ internal/command/jsonformat/structured/map.go:127:2: only one cuddle assignment allowed before range statement (wsl) for unknown := range m.Unknown { ^ internal/command/jsonformat/structured/map.go:96:2: only one cuddle assignment allowed before range statement (wsl) for after := range m.After { ^ internal/command/jsonformat/structured/map.go:139:2: only one cuddle assignment allowed before range statement (wsl) for sensitive := range m.BeforeSensitive { ^ internal/command/jsonformat/structured/map.go:150:2: return statements should not be cuddled if block has more than two lines (wsl) return dedupedKeys ^ internal/command/testing/test_provider.go:193:2: ranges should only be cuddled with assignments used in the iteration (wsl) for key := range provider.Store.Data { ^ internal/command/testing/test_provider.go:258:2: only one cuddle assignment allowed before if statement (wsl) if !id.IsKnown() { ^ internal/command/testing/test_provider.go:180:2: ranges should only be cuddled with assignments used in the iteration (wsl) for key := range provider.Store.Data { ^ internal/command/testing/test_provider.go:305:2: only one cuddle assignment allowed before if statement (wsl) if resource == cty.NilVal { ^ ```
Command Mean [s] Min [s] Max [s] Relative
local 3.646 ± 0.067 3.539 3.760 1.01 ± 0.02
v1.59.1 3.613 ± 0.059 3.541 3.754 1.00

traefik/traefik

local ``` cmd/healthcheck/healthcheck.go:42:3: expressions should not be cuddled with blocks (wsl) fmt.Printf("OK: %s\n", resp.Request.URL) ^ cmd/healthcheck/healthcheck.go:44:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ cmd/healthcheck/healthcheck.go:33:3: if statements should only be cuddled with assignments (wsl) if errPing != nil { ^ cmd/internal/gen/centrifuge.go:231:3: return statements should not be cuddled if block has more than two lines (wsl) return "" ^ cmd/internal/gen/centrifuge.go:321:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, s := range imports { ^ cmd/internal/gen/centrifuge.go:126:24: block should not start with a whitespace (wsl) case *types.TypeName: ^ cmd/internal/gen/centrifuge.go:225:3: return statements should not be cuddled if block has more than two lines (wsl) return "" ^ integration/try/condition.go:33:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ integration/try/condition.go:51:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ integration/try/condition.go:133:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ integration/try/condition.go:151:4: if statements should only be cuddled with assignments (wsl) if value == hdr { ^ integration/try/condition.go:147:3: ranges should only be cuddled with assignments used in the iteration (wsl) for _, hdr := range res.Header[header] { ^ integration/try/condition.go:159:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ integration/try/condition.go:69:3: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Errorf("could not find '%v' in body '%s'", values, string(body)) ^ integration/try/condition.go:85:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ integration/try/condition.go:122:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ integration/try/try.go:112:2: only one cuddle assignment allowed before defer statement (wsl) defer retryTick.Stop() ^ integration/try/try.go:121:4: if statements should only be cuddled with assignments (wsl) if err = operation(); err == nil { ^ integration/try/try.go:146:3: assignments should only be cuddled with other assignments (wsl) client := http.DefaultClient ^ integration/try/try.go:147:3: only one cuddle assignment allowed before if statement (wsl) if transport != nil { ^ integration/try/try.go:107:2: expressions should not be cuddled with blocks (wsl) fmt.Print("*") ^ integration/try/try.go:111:2: assignments should only be cuddled with other assignments (wsl) retryTick := time.NewTicker(interval) ^ internal/gendoc.go:313:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/gendoc.go:53:2: assignments should only be cuddled with other assignments (wsl) err = yamlWrite("./docs/content/reference/dynamic-configuration/file.yaml", dynConf) ^ internal/gendoc.go:54:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/gendoc.go:130:4: expressions should not be cuddled with blocks (wsl) fmt.Fprintln(dockerLabels, `- "`+strings.ToLower(k)+`=`+v+`"`) ^ internal/gendoc.go:179:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/gendoc.go:209:2: ranges should only be cuddled with assignments used in the iteration (wsl) for i := range valueSvcRoot.NumField() { ^ internal/gendoc.go:326:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/gendoc.go:76:2: assignments should only be cuddled with other assignments (wsl) err = yamlWrite("./docs/content/reference/static-configuration/file.yaml", staticConf) ^ internal/gendoc.go:77:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/gendoc.go:93:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/gendoc.go:99:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ pkg/collector/hydratation/hydration.go:103:3: only one cuddle assignment allowed before if statement (wsl) if err := fill(ptrValue); err != nil { ^ pkg/collector/hydratation/hydration.go:106:3: assignments should only be cuddled with other assignments (wsl) value := ptrValue.Elem().Elem() ^ pkg/collector/hydratation/hydration.go:145:2: ranges should only be cuddled with assignments used in the iteration (wsl) for j := range field.Len() { ^ pkg/collector/hydratation/hydration.go:156:3: if statements should only be cuddled with assignments (wsl) if err := fill(field.Elem()); err != nil { ^ pkg/middlewares/extractor.go:39:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if sourceMatcher.IPStrategy != nil { ^ pkg/middlewares/extractor.go:22:3: if statements should only be cuddled with assignments (wsl) if sourceMatcher.IPStrategy != nil && sourceMatcher.RequestHost { ^ pkg/middlewares/extractor.go:25:3: if statements should only be cuddled with assignments (wsl) if sourceMatcher.RequestHeaderName != "" && sourceMatcher.RequestHost { ^ pkg/middlewares/response_modifier.go:84:2: if statements should only be cuddled with assignments (wsl) if r.modifierErr != nil { ^ pkg/ping/ping.go:36:2: expressions should not be cuddled with blocks (wsl) response.WriteHeader(statusCode) ^ pkg/ping/ping.go:27:3: assignments should only be cuddled with other assignments (wsl) h.terminating = true ^ pkg/plugins/client.go:122:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ pkg/plugins/client.go:134:2: assignments should only be cuddled with other assignments (wsl) _, err := os.Stat(filename) ^ pkg/plugins/plugins.go:70:2: ranges should only be cuddled with assignments used in the iteration (wsl) for pAlias, descriptor := range plugins { ^ pkg/plugins/plugins.go:108:2: ranges should only be cuddled with assignments used in the iteration (wsl) for pAlias, descriptor := range plugins { ^ pkg/provider/configuration.go:102:4: if statements should only be cuddled with assignments used in the if statement itself (wsl) if !AddTransport(configuration.HTTP, transportName, transport) { ^ pkg/provider/configuration.go:109:4: if statements should only be cuddled with assignments used in the if statement itself (wsl) if !AddServiceTCP(configuration.TCP, serviceName, service) { ^ pkg/provider/configuration.go:144:4: if statements should only be cuddled with assignments used in the if statement itself (wsl) if !AddMiddleware(configuration.HTTP, middlewareName, middleware) { ^ ```
v1.59.1 ``` cmd/healthcheck/healthcheck.go:44:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ cmd/healthcheck/healthcheck.go:33:3: if statements should only be cuddled with assignments (wsl) if errPing != nil { ^ cmd/healthcheck/healthcheck.go:42:3: expressions should not be cuddled with blocks (wsl) fmt.Printf("OK: %s\n", resp.Request.URL) ^ cmd/internal/gen/centrifuge.go:321:2: ranges should only be cuddled with assignments used in the iteration (wsl) for _, s := range imports { ^ cmd/internal/gen/centrifuge.go:126:24: block should not start with a whitespace (wsl) case *types.TypeName: ^ cmd/internal/gen/centrifuge.go:225:3: return statements should not be cuddled if block has more than two lines (wsl) return "" ^ cmd/internal/gen/centrifuge.go:231:3: return statements should not be cuddled if block has more than two lines (wsl) return "" ^ integration/try/condition.go:69:3: return statements should not be cuddled if block has more than two lines (wsl) return fmt.Errorf("could not find '%v' in body '%s'", values, string(body)) ^ integration/try/condition.go:122:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ integration/try/condition.go:147:3: ranges should only be cuddled with assignments used in the iteration (wsl) for _, hdr := range res.Header[header] { ^ integration/try/condition.go:33:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ integration/try/condition.go:51:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ integration/try/condition.go:85:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ integration/try/condition.go:133:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ integration/try/condition.go:151:4: if statements should only be cuddled with assignments (wsl) if value == hdr { ^ integration/try/condition.go:159:3: return statements should not be cuddled if block has more than two lines (wsl) return nil ^ integration/try/try.go:147:3: only one cuddle assignment allowed before if statement (wsl) if transport != nil { ^ integration/try/try.go:107:2: expressions should not be cuddled with blocks (wsl) fmt.Print("*") ^ integration/try/try.go:111:2: assignments should only be cuddled with other assignments (wsl) retryTick := time.NewTicker(interval) ^ integration/try/try.go:112:2: only one cuddle assignment allowed before defer statement (wsl) defer retryTick.Stop() ^ integration/try/try.go:121:4: if statements should only be cuddled with assignments (wsl) if err = operation(); err == nil { ^ integration/try/try.go:146:3: assignments should only be cuddled with other assignments (wsl) client := http.DefaultClient ^ internal/gendoc.go:179:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/gendoc.go:326:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/gendoc.go:54:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/gendoc.go:76:2: assignments should only be cuddled with other assignments (wsl) err = yamlWrite("./docs/content/reference/static-configuration/file.yaml", staticConf) ^ internal/gendoc.go:93:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/gendoc.go:130:4: expressions should not be cuddled with blocks (wsl) fmt.Fprintln(dockerLabels, `- "`+strings.ToLower(k)+`=`+v+`"`) ^ internal/gendoc.go:313:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/gendoc.go:53:2: assignments should only be cuddled with other assignments (wsl) err = yamlWrite("./docs/content/reference/dynamic-configuration/file.yaml", dynConf) ^ internal/gendoc.go:77:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/gendoc.go:99:2: only one cuddle assignment allowed before if statement (wsl) if err != nil { ^ internal/gendoc.go:209:2: ranges should only be cuddled with assignments used in the iteration (wsl) for i := range valueSvcRoot.NumField() { ^ pkg/collector/hydratation/hydration.go:103:3: only one cuddle assignment allowed before if statement (wsl) if err := fill(ptrValue); err != nil { ^ pkg/collector/hydratation/hydration.go:106:3: assignments should only be cuddled with other assignments (wsl) value := ptrValue.Elem().Elem() ^ pkg/collector/hydratation/hydration.go:145:2: ranges should only be cuddled with assignments used in the iteration (wsl) for j := range field.Len() { ^ pkg/collector/hydratation/hydration.go:156:3: if statements should only be cuddled with assignments (wsl) if err := fill(field.Elem()); err != nil { ^ pkg/middlewares/extractor.go:25:3: if statements should only be cuddled with assignments (wsl) if sourceMatcher.RequestHeaderName != "" && sourceMatcher.RequestHost { ^ pkg/middlewares/extractor.go:39:2: if statements should only be cuddled with assignments used in the if statement itself (wsl) if sourceMatcher.IPStrategy != nil { ^ pkg/middlewares/extractor.go:22:3: if statements should only be cuddled with assignments (wsl) if sourceMatcher.IPStrategy != nil && sourceMatcher.RequestHost { ^ pkg/middlewares/response_modifier.go:84:2: if statements should only be cuddled with assignments (wsl) if r.modifierErr != nil { ^ pkg/ping/ping.go:27:3: assignments should only be cuddled with other assignments (wsl) h.terminating = true ^ pkg/ping/ping.go:36:2: expressions should not be cuddled with blocks (wsl) response.WriteHeader(statusCode) ^ pkg/plugins/client.go:134:2: assignments should only be cuddled with other assignments (wsl) _, err := os.Stat(filename) ^ pkg/plugins/client.go:135:2: only one cuddle assignment allowed before if statement (wsl) if err != nil && !os.IsNotExist(err) { ^ pkg/plugins/plugins.go:70:2: ranges should only be cuddled with assignments used in the iteration (wsl) for pAlias, descriptor := range plugins { ^ pkg/plugins/plugins.go:108:2: ranges should only be cuddled with assignments used in the iteration (wsl) for pAlias, descriptor := range plugins { ^ pkg/provider/configuration.go:144:4: if statements should only be cuddled with assignments used in the if statement itself (wsl) if !AddMiddleware(configuration.HTTP, middlewareName, middleware) { ^ pkg/provider/configuration.go:478:5: branch statements should not be cuddled if block has more than two lines (wsl) continue ^ pkg/provider/configuration.go:130:4: if statements should only be cuddled with assignments used in the if statement itself (wsl) if !AddServiceUDP(configuration.UDP, serviceName, service) { ^ ```
Command Mean [s] Min [s] Max [s] Relative
local 1.449 ± 0.040 1.414 1.541 1.04 ± 0.03
v1.59.1 1.399 ± 0.016 1.379 1.425 1.00

You can find the workflow here: https://github.com/ldez/golangci-lint-bench/actions/runs/9652588633