Skip to content
Open
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
2 changes: 1 addition & 1 deletion cmd/XDC/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func loadBaseConfig(ctx *cli.Context) XDCConfig {
for _, env := range cfg.Account.Passwords {
if trimmed := strings.TrimSpace(env); trimmed != "" {
value := os.Getenv(trimmed)
for _, info := range strings.Split(value, ",") {
for info := range strings.SplitSeq(value, ",") {
if trimmed2 := strings.TrimSpace(info); trimmed2 != "" {
passwords = append(passwords, trimmed2)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,7 @@ func MakeConsolePreloads(ctx *cli.Context) []string {
preloads := []string{}

assets := ctx.String(JSpathFlag.Name)
for _, file := range strings.Split(ctx.String(PreloadJSFlag.Name), ",") {
for file := range strings.SplitSeq(ctx.String(PreloadJSFlag.Name), ",") {
preloads = append(preloads, common.AbsolutePath(assets, strings.TrimSpace(file)))
}
return preloads
Expand Down
2 changes: 1 addition & 1 deletion eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func New(stack *node.Node, config *ethconfig.Config, XDCXServ *XDCx.XDCX, lendin
common.CopyConstants(networkID)

log.Info(strings.Repeat("-", 153))
for _, line := range strings.Split(chainConfig.Description(), "\n") {
for line := range strings.SplitSeq(chainConfig.Description(), "\n") {
log.Info(line)
}
log.Info(strings.Repeat("-", 153))
Expand Down
2 changes: 1 addition & 1 deletion internal/build/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func ExpandPackages(patterns []string, quick bool) []string {
log.Fatalf("package listing failed: %v\n%s", err, string(out))
}
var packages []string
for _, line := range strings.Split(string(out), "\n") {
for line := range strings.SplitSeq(string(out), "\n") {
if strings.Contains(line, "/vendor/") {
continue
}
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
10 changes: 5 additions & 5 deletions node/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,19 @@ func (api *adminAPI) StartHTTP(host *string, port *int, cors *string, apis *stri
}
if cors != nil {
config.CorsAllowedOrigins = nil
for _, origin := range strings.Split(*cors, ",") {
for origin := range strings.SplitSeq(*cors, ",") {
config.CorsAllowedOrigins = append(config.CorsAllowedOrigins, strings.TrimSpace(origin))
}
}
if vhosts != nil {
config.Vhosts = nil
for _, vhost := range strings.Split(*host, ",") {
for vhost := range strings.SplitSeq(*host, ",") {
config.Vhosts = append(config.Vhosts, strings.TrimSpace(vhost))
}
}
if apis != nil {
config.Modules = nil
for _, m := range strings.Split(*apis, ",") {
for m := range strings.SplitSeq(*apis, ",") {
config.Modules = append(config.Modules, strings.TrimSpace(m))
}
}
Expand Down Expand Up @@ -283,13 +283,13 @@ func (api *adminAPI) StartWS(host *string, port *int, allowedOrigins *string, ap

if apis != nil {
config.Modules = nil
for _, m := range strings.Split(*apis, ",") {
for m := range strings.SplitSeq(*apis, ",") {
config.Modules = append(config.Modules, strings.TrimSpace(m))
}
}
if allowedOrigins != nil {
config.Origins = nil
for _, origin := range strings.Split(*allowedOrigins, ",") {
for origin := range strings.SplitSeq(*allowedOrigins, ",") {
config.Origins = append(config.Origins, strings.TrimSpace(origin))
}
}
Expand Down
4 changes: 2 additions & 2 deletions p2p/simulations/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,13 +480,13 @@ func (s *Server) StreamNetworkEvents(w http.ResponseWriter, req *http.Request) {
// A message code of '*' or '-1' is considered a wildcard and matches any code.
func NewMsgFilters(filterParam string) (MsgFilters, error) {
filters := make(MsgFilters)
for _, filter := range strings.Split(filterParam, "-") {
for filter := range strings.SplitSeq(filterParam, "-") {
proto, codes, found := strings.Cut(filter, ":")
if !found || proto == "" || codes == "" {
return nil, fmt.Errorf("invalid message filter: %s", filter)
}

for _, code := range strings.Split(codes, ",") {
for code := range strings.SplitSeq(codes, ",") {
if code == "*" || code == "-1" {
filters[MsgFilter{Proto: proto, Code: -1}] = struct{}{}
continue
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