]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: simplify return in Futimesat and Mount
authorTobias Klauser <tklauser@distanz.ch>
Thu, 26 Oct 2017 08:10:25 +0000 (10:10 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Fri, 27 Oct 2017 07:17:34 +0000 (07:17 +0000)
Directly return error instead of assigning to err and then returning.

Change-Id: Ie5c466cac70cc6d52ee72ebba3e497e0da8a5797
Reviewed-on: https://go-review.googlesource.com/73531
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/syscall/syscall_linux.go

index 83bfee46a0da40c907940a5260c0a0bef428ef70..3fb9b1aa3f30b1f3e41212234625fb534cff48b8 100644 (file)
@@ -126,8 +126,7 @@ func Futimesat(dirfd int, path string, tv []Timeval) (err error) {
        if err != nil {
                return err
        }
-       err = futimesat(dirfd, pathp, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
-       return err
+       return futimesat(dirfd, pathp, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
 }
 
 func Futimes(fd int, tv []Timeval) (err error) {
@@ -801,8 +800,7 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
        if err != nil {
                return err
        }
-       err = mount(source, target, fstype, flags, datap)
-       return err
+       return mount(source, target, fstype, flags, datap)
 }
 
 // Sendto