Skip to content

Commit 3adc871

Browse files
author
tok-kkk
committed
use more meaningful variable name
1 parent 0f84130 commit 3adc871

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

cmd/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func listAllNodes(ctx *cli.Context) error {
5757
})
5858

5959
// Check if we can find any valid nodes.
60-
if atomic.LoadInt64(&errs) == int64(len(nodesNames)){
60+
if atomic.LoadInt64(&errs) == int64(len(nodesNames)) {
6161
return fmt.Errorf("cannot find any node")
6262
}
6363

util/node.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ func GetNodesByTags(tags string) ([]string, error) {
120120
}
121121
nodes := make([]string, 0)
122122
for _, f := range files {
123-
fileName := filepath.Join(Directory, "darknodes", f.Name(), "tags.out")
124-
tagFile, err := ioutil.ReadFile(fileName)
123+
path := filepath.Join(Directory, "darknodes", f.Name(), "tags.out")
124+
tagFile, err := ioutil.ReadFile(path)
125125
if err != nil {
126126
continue
127127
}
128-
if !ValidateTags(string(tagFile), tags){
128+
if !ValidateTags(string(tagFile), tags) {
129129
continue
130130
}
131131

@@ -140,8 +140,8 @@ func GetNodesByTags(tags string) ([]string, error) {
140140

141141
func ValidateTags(have, required string) bool {
142142
tagsStr := strings.Split(strings.TrimSpace(required), ",")
143-
for _, tag := range tagsStr{
144-
if !strings.Contains(have, tag){
143+
for _, tag := range tagsStr {
144+
if !strings.Contains(have, tag) {
145145
return false
146146
}
147147
}

0 commit comments

Comments
 (0)