Skip to content

Commit

Permalink
make format check
Browse files Browse the repository at this point in the history
  • Loading branch information
0pcom committed Jan 27, 2024
1 parent f8f995c commit dc5e773
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cmd/skywire-cli/commands/reward/calc.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ var (
h0 bool
h1 bool
h2 bool
grr bool
pubkey string
grr bool
pubkey string
)

type nodeinfo struct {
Expand Down Expand Up @@ -101,13 +101,13 @@ Fetch uptimes: skywire-cli ut > ut.txt`,
if pubkey == "" {
res, _ = script.File(utfile).Match(strings.TrimRight(wdate, "\n")).Column(1).Slice() //nolint
if len(res) == 0 {
log.Fatal("No keys achieved minimum uptime on "+wdate+" !")
log.Fatal("No keys achieved minimum uptime on " + wdate + " !")
}
} else {
res, _ = script.File(utfile).Match(strings.TrimRight(wdate, "\n")).Column(1).Match(pubkey).Slice() //nolint
script.Echo("len(res)"+string(len(res))).Stdout()
script.Echo("len(res)" + string(len(res))).Stdout()

Check failure on line 108 in cmd/skywire-cli/commands/reward/calc.go

View workflow job for this annotation

GitHub Actions / linux

Error return value of `(*github.com/bitfield/script.Pipe).Stdout` is not checked (errcheck)

Check failure on line 108 in cmd/skywire-cli/commands/reward/calc.go

View workflow job for this annotation

GitHub Actions / windows

conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

Check failure on line 108 in cmd/skywire-cli/commands/reward/calc.go

View workflow job for this annotation

GitHub Actions / darwin

Error return value of `(*github.com/bitfield/script.Pipe).Stdout` is not checked (errcheck)
if len(res) == 0 {
log.Fatal("Specified key "+pubkey+"\n did not achieve minimum uptime on "+wdate+" !")
log.Fatal("Specified key " + pubkey + "\n did not achieve minimum uptime on " + wdate + " !")
}
}
var nodesInfos []nodeinfo
Expand All @@ -127,15 +127,15 @@ Fetch uptimes: skywire-cli ut > ut.txt`,
ifc1, _ := script.File(nodeInfo).JQ(`[.zcalusic_sysinfo.network[] | {address: .macaddress, ifname: .name}]`).Replace(" ", "").Replace(`"`, "").String() //nolint
ifc1 = strings.TrimRight(ifc1, "\n")
macs, _ := script.File(nodeInfo).JQ(`.ip_addr[]? | select(.ifname != "lo") | .address`).Replace(" ", "").Replace(`"`, "").Slice() //nolint
macs1, _ := script.File(nodeInfo).JQ(`.zcalusic_sysinfo.network[] | .macaddress`).Replace(" ", "").Replace(`"`, "").Slice() //nolint
macs1, _ := script.File(nodeInfo).JQ(`.zcalusic_sysinfo.network[] | .macaddress`).Replace(" ", "").Replace(`"`, "").Slice() //nolint
if ifc == "[]" && ifc1 != "[]" {
ifc = ifc1
}
if len(macs) == 0 && len(macs1) > 0 {
macs = macs1
} else {
} else {
macs = append(macs, "")
}
}
ni := nodeinfo{
IPAddr: ip,
SkyAddr: sky,
Expand Down

0 comments on commit dc5e773

Please sign in to comment.