From cc8cb9a8971aad81b9e8e203a95c1ffa0fdedb64 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 12 Feb 2025 13:47:59 +0300 Subject: [PATCH] Modernise the code --- internal/hasher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/hasher.go b/internal/hasher.go index 168d63c..1f6b3f5 100644 --- a/internal/hasher.go +++ b/internal/hasher.go @@ -32,7 +32,7 @@ type Hasher struct { func NewHasher(hashes string) (*Hasher, error) { h := Hasher{} - for _, hc := range strings.Split(hashes, ",") { + for hc := range strings.SplitSeq(hashes, ",") { cols := strings.SplitN(hc, ":", 2) name, cmdline := cols[0], cols[1] if cmdline == BuiltinCmd { @@ -95,7 +95,7 @@ func (h *Hasher) Write(p []byte) (n int, rerr error) { errs <- err }(in) } - for i := 0; i < len(h.Names); i++ { + for range len(h.Names) { if err := <-errs; err != nil { rerr = err } -- 2.48.1