Svarog a7299c1b87
Add stability tests (#1587)
* Add stability-tests

* Fix requires

* Fix golint errors

* Update README.md

* Remove payloadHash from everywhere

* don't run vet on kaspad in stability-tests/install_and_test
2021-03-09 15:01:08 +02:00

26 lines
425 B
Go

package main
import (
"bufio"
"os"
)
func readCommands() (<-chan string, error) {
cfg := activeConfig()
f, err := os.Open(cfg.CommandsFilePath)
if err != nil {
return nil, err
}
scanner := bufio.NewScanner(f)
commandsChan := make(chan string)
spawn("readCommands", func() {
for scanner.Scan() {
command := scanner.Text()
commandsChan <- command
}
close(commandsChan)
})
return commandsChan, nil
}