1
0
mirror of https://github.com/golang/go synced 2024-07-01 07:56:09 +00:00

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 <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
Danil Timerbulatov 2023-12-08 00:17:19 +03:00 committed by Gopher Robot
parent 5f48662c5a
commit 527829a7cb
32 changed files with 4 additions and 39 deletions

View File

@ -204,7 +204,6 @@ func NewHashDebug(ev, s string, file io.Writer) *HashDebug {
i++
}
return hd
}
// TODO: Delete when we switch to bisect-only.

View File

@ -251,7 +251,7 @@ func TestLoopVarVersionEnableFlag(t *testing.T) {
t.Logf(m)
yCount := strings.Count(m, "opt.go:16:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt.go:30)")
yCount := strings.Count(m, "opt.go:16:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt.go:29)")
nCount := strings.Count(m, "shared")
if yCount != 1 {
@ -290,7 +290,7 @@ func TestLoopVarVersionEnableGoBuild(t *testing.T) {
t.Logf(m)
yCount := strings.Count(m, "opt-122.go:18:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt-122.go:32)")
yCount := strings.Count(m, "opt-122.go:18:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt-122.go:31)")
nCount := strings.Count(m, "shared")
if yCount != 1 {
@ -329,7 +329,7 @@ func TestLoopVarVersionDisableFlag(t *testing.T) {
t.Logf(m) // expect error
yCount := strings.Count(m, "opt.go:16:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt.go:30)")
yCount := strings.Count(m, "opt.go:16:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt.go:29)")
nCount := strings.Count(m, "shared")
if yCount != 0 {
@ -368,7 +368,7 @@ func TestLoopVarVersionDisableGoBuild(t *testing.T) {
t.Logf(m) // expect error
yCount := strings.Count(m, "opt-121.go:18:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt-121.go:32)")
yCount := strings.Count(m, "opt-121.go:18:6: loop variable private now per-iteration, heap-allocated (loop inlined into ./opt-121.go:31)")
nCount := strings.Count(m, "shared")
if yCount != 0 {

View File

@ -19,7 +19,6 @@ func inline(j, k int) []*int {
a = append(a, &private)
}
return a
}
//go:noinline

View File

@ -19,7 +19,6 @@ func inline(j, k int) []*int {
a = append(a, &private)
}
return a
}
//go:noinline

View File

@ -17,7 +17,6 @@ func inline(j, k int) []*int {
a = append(a, &private)
}
return a
}
//go:noinline

View File

@ -721,7 +721,6 @@ func (f *Func) ConstOffPtrSP(t *types.Type, c int64, sp *Value) *Value {
v.AddArg(sp)
}
return v
}
func (f *Func) Frontend() Frontend { return f.fe }

View File

@ -70,7 +70,6 @@ func switch_ssa(a int) int {
ret += 1
}
return ret
}
func fallthrough_ssa(a int) int {
@ -92,7 +91,6 @@ func fallthrough_ssa(a int) int {
ret++
}
return ret
}
func testFallthrough(t *testing.T) {

View File

@ -155,7 +155,6 @@ func Load(l *loader.Loader, arch *sys.Arch, localSymVersion int, input *bio.Read
}
}
return textp, nil
}
// Convert symbol xcoff type to sym.SymKind

View File

@ -103,5 +103,4 @@ func archinit(ctxt *ld.Link) {
func adddynrel(target *ld.Target, ldr *loader.Loader, syms *ld.ArchSyms, s loader.Sym, r loader.Reloc, rIdx int) bool {
ld.Exitf("adddynrel currently unimplemented for MIPS")
return false
}

View File

@ -917,7 +917,6 @@ func xcoffreloc1(arch *sys.Arch, out *ld.OutBuf, ldr *loader.Loader, s loader.Sy
emitReloc(ld.XCOFF_R_REF|0x3F<<8, 0)
}
return true
}
func elfreloc1(ctxt *ld.Link, out *ld.OutBuf, ldr *loader.Loader, s loader.Sym, r loader.ExtReloc, ri int, sectoff int64) bool {

View File

@ -203,7 +203,6 @@ func driverArgsConnLocked(ci driver.Conn, ds *driverStmt, args []any) ([]driver.
}
return nvargs, nil
}
// convertAssign is the same as convertAssignRows, but without the optional

View File

@ -241,7 +241,6 @@ func (s *sum64) MarshalBinary() ([]byte, error) {
b = append(b, magic64...)
b = appendUint64(b, uint64(*s))
return b, nil
}
func (s *sum64a) MarshalBinary() ([]byte, error) {

View File

@ -482,7 +482,6 @@ func (m *Matcher) stack(w Writer) bool {
}
}
return m.ShouldEnable(h)
}
// Writer is the same interface as io.Writer.

View File

@ -24,5 +24,4 @@ func Fstatat(dirfd int, path string, stat *syscall.Stat_t, flags int) error {
}
return nil
}

View File

@ -145,7 +145,6 @@ func (l *Logger) WithGroup(name string) *Logger {
c := l.clone()
c.handler = l.handler.WithGroup(name)
return c
}
// New creates a new Logger with the given non-nil Handler.

View File

@ -194,13 +194,11 @@ func alike(x, y *Float) bool {
func alike32(x, y float32) bool {
// we can ignore NaNs
return x == y && math.Signbit(float64(x)) == math.Signbit(float64(y))
}
func alike64(x, y float64) bool {
// we can ignore NaNs
return x == y && math.Signbit(x) == math.Signbit(y)
}
func TestFloatMantExp(t *testing.T) {

View File

@ -3812,7 +3812,6 @@ func numLeadingCRorLF(v []byte) (n int) {
break
}
return
}
func strSliceContains(ss []string, s string) bool {

View File

@ -542,7 +542,6 @@ func tempDir() string {
dir = "/tmp"
}
return dir
}
// Chdir changes the current working directory to the file,

View File

@ -428,7 +428,6 @@ func write1(fd uintptr, p unsafe.Pointer, n int32) int32 {
}
// Note that in this case we can't return a valid errno value.
return write2(fd, uintptr(p), n)
}
//go:nosplit
@ -641,7 +640,6 @@ func sysconf(name int32) uintptr {
throw("syscall sysconf")
}
return r
}
// pthread functions returns its error code in the main return value

View File

@ -623,7 +623,6 @@ func reflect_resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer {
//go:linkname reflect_resolveTextOff reflect.resolveTextOff
func reflect_resolveTextOff(rtype unsafe.Pointer, off int32) unsafe.Pointer {
return toRType((*_type)(rtype)).textOff(textOff(off))
}
// reflectlite_resolveNameOff resolves a name offset from a base pointer.

View File

@ -164,7 +164,6 @@ func syscall_exit(code uintptr) {
func syscall_fcntl1(fd, cmd, arg uintptr) (val, err uintptr) {
val, err = syscall3(&libc_fcntl, fd, cmd, arg)
return
}
//go:linkname syscall_forkx syscall.forkx

View File

@ -461,7 +461,6 @@ func testTracebackArgs2(a bool, b struct {
return b.a + b.b + b.c + b.x[0] + b.x[1] + int(d[0]) + int(d[1]) + int(d[2])
}
return n
}
//go:noinline

View File

@ -284,7 +284,6 @@ func (a *ActionNode) tree() *Tree {
func (a *ActionNode) Copy() Node {
return a.tr.newAction(a.Pos, a.Line, a.Pipe.CopyPipe())
}
// CommandNode holds a command (a pipeline inside an evaluating action).

View File

@ -382,7 +382,6 @@ func signextendAndMask8to64(a int8) (s, z uint64) {
// ppc64x: -"MOVB", "ANDCC\t[$]247,"
z = uint64(uint8(a)) & 0x3F7
return
}
// 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) {
// ppc64x: -"MOVH\t", -"ANDCC", "MOVHZ"
y = uint64(b) & 0xFFFF
return
}
// Verify rotate and mask instructions, and further simplified instructions for small types

View File

@ -348,7 +348,6 @@ func reassoc_load_uint32(b []byte) uint32 {
func extrashift_load_uint32(b []byte) uint32 {
// amd64:`MOVL\s\([A-Z]+\)`,`SHLL\s[$]2`,-`MOV[BW]`,-`OR`
return uint32(b[0])<<2 | uint32(b[1])<<10 | uint32(b[2])<<18 | uint32(b[3])<<26
}
func outoforder_load_uint32(b []byte) uint32 {

View File

@ -277,7 +277,6 @@ func shouldSignEXT(x int) int64 {
ret += int64(int8(x & 0x1100000000000011))
return ret
}
func noIntermediateExtension(a, b, c uint32) uint32 {

View File

@ -397,7 +397,6 @@ func exprsw(i *int) *int { // ERROR "leaking param: i to result ~r0 level=0$"
return nil
}
return nil
}
// assigning to an array element is like assigning to the array

View File

@ -397,7 +397,6 @@ func exprsw(i *int) *int { // ERROR "leaking param: i to result ~r0 level=0$"
return nil
}
return nil
}
// assigning to an array element is like assigning to the array

View File

@ -12,5 +12,4 @@ func hashBytesRaw(b0, b1, b2, b3, b7 byte) uint64 {
func doStuff(data []byte) uint64 {
return hashBytesRaw(data[0], data[1], data[2], data[3], data[7])
}

View File

@ -18,7 +18,6 @@ func (r EqFunc[T]) Eqv(a, b T) bool {
func New[T any](f func(a, b T) bool) Eq[T] {
return EqFunc[T](f)
}
func Equal(a, b []byte) bool {

View File

@ -219,7 +219,6 @@ func (r ApplicativeFunctor2[H, HT, A1, A2, R]) ApOption(a Option[A1]) Applicativ
func (r ApplicativeFunctor2[H, HT, A1, A2, R]) Ap(a A1) ApplicativeFunctor1[Cons[A1, H], A1, A2, R] {
return r.ApOption(Some(a))
}
func Applicative2[A1, A2, R any](fn Func2[A1, A2, R]) ApplicativeFunctor2[Nil, Nil, A1, A2, R] {

View File

@ -25,7 +25,6 @@ func min[T IntLike](x, y T) T {
return x
}
return y
}
// Min returns the minimum element of `nums`.