From: Sergey Matveev Date: Wed, 12 Feb 2025 10:47:59 +0000 (+0300) Subject: Modernise the code X-Git-Tag: v0.11.0~1 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=cc8cb9a8971aad81b9e8e203a95c1ffa0fdedb64;p=meta4ra.git Modernise the code --- 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 }