Skip to content

Instantly share code, notes, and snippets.

@bartmeuris
Last active August 29, 2015 13:56
Show Gist options
  • Save bartmeuris/9115663 to your computer and use it in GitHub Desktop.
Save bartmeuris/9115663 to your computer and use it in GitHub Desktop.
package main
import "net"
import "bufio"
func main() {
c,err := net.Dial("unix", "/tmp/echo.sock")
if err != nil {
panic(err.Error())
}
for {
reader := bufio.NewReader(c)
str, err := reader.ReadString('\n')
if err != nil {
println("ERROR: ", err.Error())
return
}
println("Got string: '"+str+"'");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment