24 lines
441 B
Go
24 lines
441 B
Go
package tournament
|
|
|
|
import (
|
|
"errors"
|
|
"strings"
|
|
"io"
|
|
)
|
|
func Tally(in io.Reader, out io.Writer) error {
|
|
buf := new(strings.Builder)
|
|
_, err := io.Copy(buf, in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
s := buf.String()
|
|
lines := strings.Split(s, "\n")
|
|
|
|
for _, line := range lines {
|
|
if strings.HasPrefix(line, "#") || len(line) == 0 {
|
|
continue
|
|
}
|
|
}
|
|
return errors.New("foo")
|
|
}
|