Cleanup read_stdin()

This commit is contained in:
2026-07-11 12:18:13 +02:00
parent 6ccf7c4c71
commit 95376d5cc8
+6 -8
View File
@@ -3,20 +3,18 @@ module main
import os
fn read_stdin() []string {
mut line := ''
mut inputstr := []string{}
mut lines := []string{}
for {
line = os.get_line()
line := os.get_line()
if line.len == 0 && os.stdin().eof() {
break
}
line = line.trim_space()
inputstr << line
lines << line
}
return inputstr
return lines
}
fn main() {
var := read_stdin()
println(var)
lines := read_stdin()
println(lines)
}