Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
26
Task/Input-loop/Go/input-loop-1.go
Normal file
26
Task/Input-loop/Go/input-loop-1.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
in := bufio.NewReader(os.Stdin)
|
||||
for {
|
||||
s, err := in.ReadString('\n')
|
||||
if err != nil {
|
||||
// io.EOF is expected, anything else
|
||||
// should be handled/reported
|
||||
if err != io.EOF {
|
||||
log.Fatal(err)
|
||||
}
|
||||
break
|
||||
}
|
||||
// Do something with the line of text
|
||||
// in string variable s.
|
||||
_ = s
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue