Switch Go runner to using bufio.Reader to avoid length limit

This commit is contained in:
akp 2021-11-27 18:13:17 +00:00
parent a0a651f8f6
commit de714d4ed8
No known key found for this signature in database
GPG key ID: AA5726202C8879B7

View file

@ -27,11 +27,9 @@ func sendResult(taskID string, ok bool, output string, duration float64) {
}
func run() error {
scanner := bufio.NewScanner(os.Stdin)
var tasksBytes []byte
if scanner.Scan() {
tasksBytes = scanner.Bytes()
} else if err := scanner.Err(); err != nil {
reader := bufio.NewReader(os.Stdin)
tasksBytes, err := reader.ReadBytes('\n')
if err != nil {
return err
}