Skip to content

Commit 492c5d6

Browse files
Danil Timerbulatovpull[bot]
Danil Timerbulatov
authored andcommitted
all: remove newline characters after return statements
This commit is aimed at improving the readability and consistency of the code base. Extraneous newline characters were present after some return statements, creating unnecessary separation in the code. Fixes #64610 Change-Id: Ic1b05bf11761c4dff22691c2f1c3755f66d341f7 Reviewed-on: https://go-review.googlesource.com/c/go/+/548316 Auto-Submit: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Pratt <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 64553e9 commit 492c5d6

File tree

32 files changed

+4
-39
lines changed

32 files changed

+4
-39
lines changed

src/cmd/compile/internal/base/hashdebug.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ func NewHashDebug(ev, s string, file io.Writer) *HashDebug {
204204
i++
205205
}
206206
return hd
207-
208207
}
209208

210209
// TODO: Delete when we switch to bisect-only.

src/cmd/compile/internal/loopvar/loopvar_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func TestLoopVarVersionEnableFlag(t *testing.T) {
251251

252252
t.Logf(m)
253253

254-
yCount := strings.Count(m, "opt.go:16:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt.go:30)")
254+
yCount := strings.Count(m, "opt.go:16:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt.go:29)")
255255
nCount := strings.Count(m, "shared")
256256

257257
if yCount != 1 {
@@ -290,7 +290,7 @@ func TestLoopVarVersionEnableGoBuild(t *testing.T) {
290290

291291
t.Logf(m)
292292

293-
yCount := strings.Count(m, "opt-122.go:18:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt-122.go:32)")
293+
yCount := strings.Count(m, "opt-122.go:18:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt-122.go:31)")
294294
nCount := strings.Count(m, "shared")
295295

296296
if yCount != 1 {
@@ -329,7 +329,7 @@ func TestLoopVarVersionDisableFlag(t *testing.T) {
329329

330330
t.Logf(m) // expect error
331331

332-
yCount := strings.Count(m, "opt.go:16:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt.go:30)")
332+
yCount := strings.Count(m, "opt.go:16:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt.go:29)")
333333
nCount := strings.Count(m, "shared")
334334

335335
if yCount != 0 {
@@ -368,7 +368,7 @@ func TestLoopVarVersionDisableGoBuild(t *testing.T) {
368368

369369
t.Logf(m) // expect error
370370

371-
yCount := strings.Count(m, "opt-121.go:18:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt-121.go:32)")
371+
yCount := strings.Count(m, "opt-121.go:18:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt-121.go:31)")
372372
nCount := strings.Count(m, "shared")
373373

374374
if yCount != 0 {

src/cmd/compile/internal/loopvar/testdata/opt-121.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ func inline(j, k int) []*int {
1919
a = append(a, &private)
2020
}
2121
return a
22-
2322
}
2423

2524
//go:noinline

src/cmd/compile/internal/loopvar/testdata/opt-122.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ func inline(j, k int) []*int {
1919
a = append(a, &private)
2020
}
2121
return a
22-
2322
}
2423

2524
//go:noinline

src/cmd/compile/internal/loopvar/testdata/opt.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ func inline(j, k int) []*int {
1717
a = append(a, &private)
1818
}
1919
return a
20-
2120
}
2221

2322
//go:noinline

src/cmd/compile/internal/ssa/func.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,6 @@ func (f *Func) ConstOffPtrSP(t *types.Type, c int64, sp *Value) *Value {
721721
v.AddArg(sp)
722722
}
723723
return v
724-
725724
}
726725

727726
func (f *Func) Frontend() Frontend { return f.fe }

src/cmd/compile/internal/test/testdata/ctl_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ func switch_ssa(a int) int {
7070
ret += 1
7171
}
7272
return ret
73-
7473
}
7574

7675
func fallthrough_ssa(a int) int {
@@ -92,7 +91,6 @@ func fallthrough_ssa(a int) int {
9291
ret++
9392
}
9493
return ret
95-
9694
}
9795

9896
func testFallthrough(t *testing.T) {

src/cmd/link/internal/loadxcoff/ldxcoff.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ func Load(l *loader.Loader, arch *sys.Arch, localSymVersion int, input *bio.Read
155155
}
156156
}
157157
return textp, nil
158-
159158
}
160159

161160
// Convert symbol xcoff type to sym.SymKind

src/cmd/link/internal/mips/obj.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,4 @@ func archinit(ctxt *ld.Link) {
103103
func adddynrel(target *ld.Target, ldr *loader.Loader, syms *ld.ArchSyms, s loader.Sym, r loader.Reloc, rIdx int) bool {
104104
ld.Exitf("adddynrel currently unimplemented for MIPS")
105105
return false
106-
107106
}

src/cmd/link/internal/ppc64/asm.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,6 @@ func xcoffreloc1(arch *sys.Arch, out *ld.OutBuf, ldr *loader.Loader, s loader.Sy
917917
emitReloc(ld.XCOFF_R_REF|0x3F<<8, 0)
918918
}
919919
return true
920-
921920
}
922921

923922
func elfreloc1(ctxt *ld.Link, out *ld.OutBuf, ldr *loader.Loader, s loader.Sym, r loader.ExtReloc, ri int, sectoff int64) bool {

src/database/sql/convert.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ func driverArgsConnLocked(ci driver.Conn, ds *driverStmt, args []any) ([]driver.
203203
}
204204

205205
return nvargs, nil
206-
207206
}
208207

209208
// convertAssign is the same as convertAssignRows, but without the optional

src/hash/fnv/fnv.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ func (s *sum64) MarshalBinary() ([]byte, error) {
241241
b = append(b, magic64...)
242242
b = appendUint64(b, uint64(*s))
243243
return b, nil
244-
245244
}
246245

247246
func (s *sum64a) MarshalBinary() ([]byte, error) {

src/internal/bisect/bisect.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ func (m *Matcher) stack(w Writer) bool {
482482
}
483483
}
484484
return m.ShouldEnable(h)
485-
486485
}
487486

488487
// Writer is the same interface as io.Writer.

src/internal/syscall/unix/at_fstatat.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ func Fstatat(dirfd int, path string, stat *syscall.Stat_t, flags int) error {
2424
}
2525

2626
return nil
27-
2827
}

src/log/slog/logger.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ func (l *Logger) WithGroup(name string) *Logger {
145145
c := l.clone()
146146
c.handler = l.handler.WithGroup(name)
147147
return c
148-
149148
}
150149

151150
// New creates a new Logger with the given non-nil Handler.

src/math/big/float_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,11 @@ func alike(x, y *Float) bool {
194194
func alike32(x, y float32) bool {
195195
// we can ignore NaNs
196196
return x == y && math.Signbit(float64(x)) == math.Signbit(float64(y))
197-
198197
}
199198

200199
func alike64(x, y float64) bool {
201200
// we can ignore NaNs
202201
return x == y && math.Signbit(x) == math.Signbit(y)
203-
204202
}
205203

206204
func TestFloatMantExp(t *testing.T) {

src/net/http/server.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3812,7 +3812,6 @@ func numLeadingCRorLF(v []byte) (n int) {
38123812
break
38133813
}
38143814
return
3815-
38163815
}
38173816

38183817
func strSliceContains(ss []string, s string) bool {

src/os/file_plan9.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,6 @@ func tempDir() string {
542542
dir = "/tmp"
543543
}
544544
return dir
545-
546545
}
547546

548547
// Chdir changes the current working directory to the file,

src/runtime/os2_aix.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@ func write1(fd uintptr, p unsafe.Pointer, n int32) int32 {
428428
}
429429
// Note that in this case we can't return a valid errno value.
430430
return write2(fd, uintptr(p), n)
431-
432431
}
433432

434433
//go:nosplit
@@ -641,7 +640,6 @@ func sysconf(name int32) uintptr {
641640
throw("syscall sysconf")
642641
}
643642
return r
644-
645643
}
646644

647645
// pthread functions returns its error code in the main return value

src/runtime/runtime1.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,6 @@ func reflect_resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer {
623623
//go:linkname reflect_resolveTextOff reflect.resolveTextOff
624624
func reflect_resolveTextOff(rtype unsafe.Pointer, off int32) unsafe.Pointer {
625625
return toRType((*_type)(rtype)).textOff(textOff(off))
626-
627626
}
628627

629628
// reflectlite_resolveNameOff resolves a name offset from a base pointer.

src/runtime/syscall_aix.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ func syscall_exit(code uintptr) {
164164
func syscall_fcntl1(fd, cmd, arg uintptr) (val, err uintptr) {
165165
val, err = syscall3(&libc_fcntl, fd, cmd, arg)
166166
return
167-
168167
}
169168

170169
//go:linkname syscall_forkx syscall.forkx

src/runtime/traceback_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,6 @@ func testTracebackArgs2(a bool, b struct {
461461
return b.a + b.b + b.c + b.x[0] + b.x[1] + int(d[0]) + int(d[1]) + int(d[2])
462462
}
463463
return n
464-
465464
}
466465

467466
//go:noinline

src/text/template/parse/node.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ func (a *ActionNode) tree() *Tree {
284284

285285
func (a *ActionNode) Copy() Node {
286286
return a.tr.newAction(a.Pos, a.Line, a.Pipe.CopyPipe())
287-
288287
}
289288

290289
// CommandNode holds a command (a pipeline inside an evaluating action).

test/codegen/bits.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ func signextendAndMask8to64(a int8) (s, z uint64) {
382382
// ppc64x: -"MOVB", "ANDCC\t[$]247,"
383383
z = uint64(uint8(a)) & 0x3F7
384384
return
385-
386385
}
387386

388387
// Verify zero-extended values are not sign-extended under a bit mask (#61297)
@@ -392,7 +391,6 @@ func zeroextendAndMask8to64(a int8, b int16) (x, y uint64) {
392391
// ppc64x: -"MOVH\t", -"ANDCC", "MOVHZ"
393392
y = uint64(b) & 0xFFFF
394393
return
395-
396394
}
397395

398396
// Verify rotate and mask instructions, and further simplified instructions for small types

test/codegen/memcombine.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ func reassoc_load_uint32(b []byte) uint32 {
348348
func extrashift_load_uint32(b []byte) uint32 {
349349
// amd64:`MOVL\s\([A-Z]+\)`,`SHLL\s[$]2`,-`MOV[BW]`,-`OR`
350350
return uint32(b[0])<<2 | uint32(b[1])<<10 | uint32(b[2])<<18 | uint32(b[3])<<26
351-
352351
}
353352

354353
func outoforder_load_uint32(b []byte) uint32 {

test/codegen/noextend.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ func shouldSignEXT(x int) int64 {
277277
ret += int64(int8(x & 0x1100000000000011))
278278

279279
return ret
280-
281280
}
282281

283282
func noIntermediateExtension(a, b, c uint32) uint32 {

test/escape2.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,6 @@ func exprsw(i *int) *int { // ERROR "leaking param: i to result ~r0 level=0$"
397397
return nil
398398
}
399399
return nil
400-
401400
}
402401

403402
// assigning to an array element is like assigning to the array

test/escape2n.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,6 @@ func exprsw(i *int) *int { // ERROR "leaking param: i to result ~r0 level=0$"
397397
return nil
398398
}
399399
return nil
400-
401400
}
402401

403402
// assigning to an array element is like assigning to the array

test/fixedbugs/issue32680b.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ func hashBytesRaw(b0, b1, b2, b3, b7 byte) uint64 {
1212

1313
func doStuff(data []byte) uint64 {
1414
return hashBytesRaw(data[0], data[1], data[2], data[3], data[7])
15-
1615
}

test/fixedbugs/issue56923.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func (r EqFunc[T]) Eqv(a, b T) bool {
1818

1919
func New[T any](f func(a, b T) bool) Eq[T] {
2020
return EqFunc[T](f)
21-
2221
}
2322

2423
func Equal(a, b []byte) bool {

test/typeparam/issue50485.dir/a.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ func (r ApplicativeFunctor2[H, HT, A1, A2, R]) ApOption(a Option[A1]) Applicativ
219219
func (r ApplicativeFunctor2[H, HT, A1, A2, R]) Ap(a A1) ApplicativeFunctor1[Cons[A1, H], A1, A2, R] {
220220

221221
return r.ApOption(Some(a))
222-
223222
}
224223

225224
func Applicative2[A1, A2, R any](fn Func2[A1, A2, R]) ApplicativeFunctor2[Nil, Nil, A1, A2, R] {

test/typeparam/issue51925.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ func min[T IntLike](x, y T) T {
2525
return x
2626
}
2727
return y
28-
2928
}
3029

3130
// Min returns the minimum element of `nums`.

0 commit comments

Comments
 (0)