Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/cmdtest/test_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ type testlogger struct {
}

func (tl *testlogger) Write(b []byte) (n int, err error) {
lines := bytes.Split(b, []byte("\n"))
for _, line := range lines {
lines := bytes.SplitSeq(b, []byte("\n"))
for line := range lines {
if len(line) > 0 {
tl.t.Logf("(stderr) %s", line)
}
Expand Down
4 changes: 2 additions & 2 deletions log/handler_glog.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (h *GlogHandler) Verbosity(level slog.Level) {
// sets V to 3 in all files of any packages whose import path contains "foo"
func (h *GlogHandler) Vmodule(ruleset string) error {
var filter []pattern
for _, rule := range strings.Split(ruleset, ",") {
for rule := range strings.SplitSeq(ruleset, ",") {
// Empty strings such as from a trailing comma can be ignored
if len(rule) == 0 {
continue
Expand All @@ -113,7 +113,7 @@ func (h *GlogHandler) Vmodule(ruleset string) error {
}
// Compile the rule pattern into a regular expression
matcher := ".*"
for _, comp := range strings.Split(parts[0], "/") {
for comp := range strings.SplitSeq(parts[0], "/") {
if comp == "*" {
matcher += "(/.*)?"
} else if comp != "" {
Expand Down
2 changes: 1 addition & 1 deletion p2p/dnsdisc/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func parseBranch(e string) (entry, error) {
return &branchEntry{}, nil // empty entry is OK
}
hashes := make([]string, 0, strings.Count(e, ","))
for _, c := range strings.Split(e, ",") {
for c := range strings.SplitSeq(e, ",") {
if !isValidHash(c) {
return nil, entryError{"branch", errInvalidChild}
}
Expand Down
2 changes: 1 addition & 1 deletion rlp/internal/rlpstruct/rlpstruct.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func parseTag(field Field, lastPublic int) (Tags, error) {
name := field.Name
tag := reflect.StructTag(field.Tag)
var ts Tags
for _, t := range strings.Split(tag.Get("rlp"), ",") {
for t := range strings.SplitSeq(tag.Get("rlp"), ",") {
switch t = strings.TrimSpace(t); t {
case "":
// empty tag is allowed for some reason
Expand Down
2 changes: 1 addition & 1 deletion rpc/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func runTestScript(t *testing.T, file string) {
defer clientConn.Close()
go server.ServeCodec(NewCodec(serverConn), 0)
readbuf := bufio.NewReader(clientConn)
for _, line := range strings.Split(string(content), "\n") {
for line := range strings.SplitSeq(string(content), "\n") {
line = strings.TrimSpace(line)
switch {
case len(line) == 0 || strings.HasPrefix(line, "//"):
Expand Down
Loading