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
4 changes: 2 additions & 2 deletions cmd/alert/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ func writeHtmlFile(content string, lg log.Logger) {
}

func addToEmailList(emailList map[string]struct{}, emailToString string) {
emails := strings.Split(emailToString, ",")
emails := strings.SplitSeq(emailToString, ",")

for _, email := range emails {
for email := range emails {
emailList[email] = struct{}{}
}
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/priv-dashboard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ func (d *dashboard) Report() {

if *emailEnableFlag && time.Now().After(d.lastNotification.Add(emailReportInterval)) {
contracts := make(map[string]struct{})
cs := strings.Split(*emailContractsFlag, ",")
for _, c := range cs {
cs := strings.SplitSeq(*emailContractsFlag, ",")
for c := range cs {
c = strings.TrimSpace(c)
if c == "" { // ignore empty records
continue
Expand Down
4 changes: 2 additions & 2 deletions ethstorage/flags/types/flags_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ func (b *bigValue) Set(s string) error {
}

func eachName(f cli.Flag, fn func(string)) {
parts := strings.Split(f.GetName(), ",")
for _, name := range parts {
parts := strings.SplitSeq(f.GetName(), ",")
for name := range parts {
name = strings.Trim(name, " ")
fn(name)
}
Expand Down
2 changes: 1 addition & 1 deletion ethstorage/p2p/cli/load_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func loadLibp2pOpts(conf *p2p.Config, ctx *cli.Context) error {
conf.StaticPeers = append(conf.StaticPeers, a)
}

for _, v := range strings.Split(ctx.GlobalString(flags.HostMux.Name), ",") {
for v := range strings.SplitSeq(ctx.GlobalString(flags.HostMux.Name), ",") {
v = strings.ToLower(strings.TrimSpace(v))
switch v {
case "yamux":
Expand Down
2 changes: 1 addition & 1 deletion ethstorage/p2p/peer_scorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewBandScorer(str string) (*BandScoreThresholds, error) {
bands: make([]scorePair, 0),
}

for _, band := range strings.Split(str, ";") {
for band := range strings.SplitSeq(str, ";") {
// Skip empty band strings.
band := strings.TrimSpace(band)
if band == "" {
Expand Down