Skip to content

Instantly share code, notes, and snippets.

@chespinoza
Created July 24, 2013 16:17
Show Gist options
  • Save chespinoza/6072086 to your computer and use it in GitHub Desktop.
Save chespinoza/6072086 to your computer and use it in GitHub Desktop.
Simulating i/o input
package main
import (
"bufio"
"fmt"
"strings"
)
func main() {
str := []byte("T=06/06/2013 23:49:06.000\r\n")
reader := bufio.NewReader(strings.NewReader(string(str)))
line, _ := reader.ReadString('\n')
fmt.Println(line)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment