mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* 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
26 lines
425 B
Go
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
|
|
}
|