partage

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

commit 5f15801b0cc3b91c61e0829be1f691d155f93e61
parent 598b884e65c18c8a239b87bb3c931c570027124a
Author: Willy Goiffon <dev@z3bra.org>
Date:   Mon, 11 Oct 2021 15:09:06 +0200

Remove useless if imbrication

Diffstat:
Mpartage.go | 17++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/partage.go b/partage.go @@ -39,15 +39,15 @@ func writefile(f *os.File, s io.ReadCloser) int { for { n, err := s.Read(buffer) - if err != nil { - if err == io.EOF { - n, err := f.Write(buffer[:n]) - if err != nil { - fmt.Println(err) - } - sz += n - break + if err == io.EOF { + n, err := f.Write(buffer[:n]) + if err != nil { + fmt.Println(err) } + sz += n + break + } + if err != nil { fmt.Println(err) return -1 } @@ -145,7 +145,6 @@ func parse(w http.ResponseWriter, r *http.Request) { } func main() { - conf.bind = "0.0.0.0:8080" conf.maxsize = 28 * 1024 * 1024 conf.filepath = "/tmp"