From 2a0694d2fa577574b505c4635eb8a824eaf88ddc Mon Sep 17 00:00:00 2001 From: Shulhan Date: Thu, 23 Jan 2025 03:40:50 +0700 Subject: all: use for-range with numeric Go 1.22 now support for-range on numeric value. --- lib/git/git.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/git') diff --git a/lib/git/git.go b/lib/git/git.go index 151e077a..71240221 100644 --- a/lib/git/git.go +++ b/lib/git/git.go @@ -1,6 +1,6 @@ -// Copyright 2018, Shulhan . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// SPDX-FileCopyrightText: 2018 M. Shulhan +// +// SPDX-License-Identifier: BSD-3-Clause // Package git provide a wrapper for git command line interface. package git @@ -280,7 +280,7 @@ func ListTags(repoDir string) (tags []string, err error) { sep := []byte{'\n'} btags := bytes.Split(bout, sep) - for x := 0; x < len(btags); x++ { + for x := range len(btags) { if len(btags[x]) == 0 { continue } @@ -361,7 +361,7 @@ func RemoteBranches(repoDir string) ([]string, error) { var branches []string bHEAD := []byte("HEAD") - for x := 0; x < len(bbranches); x++ { + for x := range len(bbranches) { if len(bbranches[x]) == 0 { continue } -- cgit v1.3