Skip to content

Commit d308777

Browse files
committed
refactor: a run's card and a file's attributes are read without a slice
Signed-off-by: karo <karolin.kostial@gmail.com>
1 parent 084c63d commit d308777

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎internal/runnet/settings.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func readSettings(network *protocol.Network) (settings, error) {
4141
}
4242

4343
var card []byte
44-
for _, part := range strings.Split(network.Card, ":") {
44+
for part := range strings.SplitSeq(network.Card, ":") {
4545
octet, err := strconv.ParseUint(part, 16, 8)
4646
if err != nil {
4747
return settings{}, fmt.Errorf("card of the run %s: %w", network.Card, err)

‎internal/tree/xattr.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func list(path string) ([]string, error) {
7575

7676
var attributes []string
7777

78-
for _, attribute := range bytes.Split(names[:size], []byte{0}) {
78+
for attribute := range bytes.SplitSeq(names[:size], []byte{0}) {
7979
if len(attribute) > 0 {
8080
attributes = append(attributes, string(attribute))
8181
}

0 commit comments

Comments
 (0)