diff options
| author | Shulhan <ms@kilabit.info> | 2025-01-23 03:40:50 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2025-01-23 03:41:10 +0700 |
| commit | 2a0694d2fa577574b505c4635eb8a824eaf88ddc (patch) | |
| tree | cce840739c7f59893c3a6a65a1600f9f857c484e /lib/strings/to.go | |
| parent | 605d847b236dde031a2e387e74298d66a27b5e0a (diff) | |
| download | pakakeh.go-2a0694d2fa577574b505c4635eb8a824eaf88ddc.tar.xz | |
all: use for-range with numeric
Go 1.22 now support for-range on numeric value.
Diffstat (limited to 'lib/strings/to.go')
| -rw-r--r-- | lib/strings/to.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/strings/to.go b/lib/strings/to.go index 6b46a724..0c00005b 100644 --- a/lib/strings/to.go +++ b/lib/strings/to.go @@ -12,7 +12,7 @@ import ( // ToBytes convert slice of string into slice of slice of bytes. func ToBytes(ss []string) (sv [][]byte) { - for x := 0; x < len(ss); x++ { + for x := range len(ss) { sv = append(sv, []byte(ss[x])) } return sv @@ -64,7 +64,7 @@ func ToInt64(ss []string) (sv []int64) { // ToStrings convert slice of interface to slice of string. func ToStrings(is []any) (vs []string) { - for x := 0; x < len(is); x++ { + for x := range len(is) { v := fmt.Sprintf("%v", is[x]) vs = append(vs, v) } |
