Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt";
- "bufio";
- "strings";
- "os";
- )
- func readline() (bool, string) {
- in := bufio.NewReader(os.Stdin);
- input, err := in.ReadString('\n');
- if err != nil {
- // handle error
- fmt.Printf("error: %#v\n", err);
- return false, ""
- }
- return true, strings.TrimSpace(input)
- }
- func main() {
- if ok, line := readline(); ok {
- fmt.Println(line)
- }
- }
Add Comment
Please, Sign In to add comment