Skip to content

Commit 5c5bf4c

Browse files
committed
Run gofumpt -w which removes naked returns for clarity
1 parent 3d8a46e commit 5c5bf4c

File tree

13 files changed

+20
-20
lines changed

13 files changed

+20
-20
lines changed

cloudapi/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,5 +244,5 @@ func retry(s sleeper, attempts int, interval, maxDuration time.Duration, do func
244244
return nil
245245
}
246246
}
247-
return
247+
return err
248248
}

cloudapi/logs_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func TestStreamLogsToLogger(t *testing.T) {
223223
for _, e := range hook.Drain() {
224224
lines = append(lines, e.Message)
225225
}
226-
return
226+
return lines
227227
}
228228

229229
generateLogline := func(key string, ts uint64, msg string) string {
@@ -276,7 +276,7 @@ func TestStreamLogsToLogger(t *testing.T) {
276276
}
277277

278278
start = time.Unix(0, rawstart)
279-
return
279+
return start, err
280280
}
281281

282282
var requestsCount uint64
@@ -355,7 +355,7 @@ func TestStreamLogsToLogger(t *testing.T) {
355355
}
356356

357357
start = time.Unix(0, rawstart)
358-
return
358+
return start, err
359359
}
360360

361361
var requestsCount uint64

ext/ext.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ func extractModuleInfo(mod interface{}) (path, version string) {
136136
case reflect.Func:
137137
path = runtime.FuncForPC(reflect.ValueOf(mod).Pointer()).Name()
138138
default:
139-
return
139+
return path, version
140140
}
141141

142142
buildInfo, ok := debug.ReadBuildInfo()
143143
if !ok {
144-
return
144+
return path, version
145145
}
146146

147147
for _, dep := range buildInfo.Deps {
@@ -154,7 +154,7 @@ func extractModuleInfo(mod interface{}) (path, version string) {
154154
}
155155
}
156156

157-
return
157+
return path, version
158158
}
159159

160160
func init() {

internal/js/eventloop/eventloop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func (e *EventLoop) popAll() (queue []func() error, awaiting bool) {
149149
e.queue = make([]func() error, 0, len(queue))
150150
awaiting = e.registeredCallbacks != 0
151151
e.lock.Unlock()
152-
return
152+
return queue, awaiting
153153
}
154154

155155
func (e *EventLoop) putInfront(queue []func() error) {

internal/js/modules/k6/browser/common/connection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,5 +658,5 @@ func (c *Connection) isClosing() (s bool) {
658658
default:
659659
}
660660

661-
return
661+
return s
662662
}

internal/lib/summary/summary.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func ValidateMode(val string) (m Mode, err error) {
9797
if err = m.UnmarshalText([]byte(val)); err != nil {
9898
return 0, err
9999
}
100-
return
100+
return m, err
101101
}
102102

103103
// Summary is the data structure that holds all the summary data (thresholds, metrics, checks, etc)

internal/lib/testutils/minirunner/minirunner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (r *MiniRunner) Setup(ctx context.Context, out chan<- metrics.SampleContain
6464
if fn := r.SetupFn; fn != nil {
6565
r.SetupData, err = fn(ctx, out)
6666
}
67-
return
67+
return err
6868
}
6969

7070
// GetSetupData returns json representation of the setup data if setup() is

internal/output/summary/data.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ func extractPercentileThresholdSource(source string) (agg string, percentile flo
441441

442442
agg = "p(" + matches[1] + ")"
443443
isPercentile = true
444-
return
444+
return agg, percentile, isPercentile
445445
}
446446

447447
return "", 0, false

lib/executor/helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func sumStagesDuration(stages []Stage) (result time.Duration) {
2626
for _, s := range stages {
2727
result += s.Duration.TimeDuration()
2828
}
29-
return
29+
return result
3030
}
3131

3232
func getStagesUnscaledMaxTarget(unscaledStartValue int64, stages []Stage) int64 {

lib/netext/resolver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func (r *resolver) applyPolicy(ips []net.IP) (retIPs []net.IP) {
154154
retIPs = ips
155155
}
156156

157-
return
157+
return retIPs
158158
}
159159

160160
func groupByVersion(ips []net.IP) (ip4 []net.IP, ip6 []net.IP) {
@@ -166,5 +166,5 @@ func groupByVersion(ips []net.IP) (ip4 []net.IP, ip6 []net.IP) {
166166
}
167167
}
168168

169-
return
169+
return ip4, ip6
170170
}

0 commit comments

Comments
 (0)