partage

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.z3bra.org/partage.git
Log | Files | Refs

commit db7c8a75c2da5d006f6160b3e911b503445849d9
parent 19eac4e3851f659762ab3ac53cc6e7d36cce1a0c
Author: Willy Goiffon <dev@z3bra.org>
Date:   Mon, 11 Oct 2021 18:18:43 +0200

Make ifs one-line when appropriate

Diffstat:
Mpartage.go | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/partage.go b/partage.go @@ -77,8 +77,7 @@ func servefile(f *os.File, w http.ResponseWriter) { if err != nil { if err == io.EOF { - _, err := w.Write(buffer[:n]) - if err != nil { + if _, err := w.Write(buffer[:n]); err != nil { fmt.Println(err) } break @@ -87,8 +86,7 @@ func servefile(f *os.File, w http.ResponseWriter) { return } - _, err = w.Write(buffer[:n]) - if err != nil { + if _, err = w.Write(buffer[:n]); err != nil { fmt.Println(err) } }