aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-31 05:40:41 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-31 05:40:41 +0200
commit08afcb6c1cd7f7edb220e128488ed706553b0831 (patch)
tree7e3e84c838b484a0ade54ee976a0004fcb82e973
parent5747d262fd4eebd89ebfbb33f1571da859feeef1 (diff)
Expose Send and Recv
-rw-r--r--easteregg.go4
-rw-r--r--robo.go10
2 files changed, 9 insertions, 5 deletions
diff --git a/easteregg.go b/easteregg.go
index 64800b7..b9f738e 100644
--- a/easteregg.go
+++ b/easteregg.go
@@ -324,5 +324,7 @@ var easteregg = []string{
}
func EasterEgg(c *bufio.Writer) {
- Raw(c, easteregg)
+ for _, cmd := range easteregg {
+ Send(c, cmd)
+ }
}
diff --git a/robo.go b/robo.go
index 8d7825b..2181bc5 100644
--- a/robo.go
+++ b/robo.go
@@ -128,15 +128,17 @@ func recv(c *bufio.Reader) string {
return ans[:len(ans)-1]
}
+func Recv(c *bufio.Reader) string {
+ return recv(c)
+}
+
func send(c *bufio.Writer, a ...interface{}) {
fmt.Fprint(c, a...)
etx(c)
}
-func Raw(c *bufio.Writer, a ...interface{}) {
- for _, cmd := range a {
- send(c, cmd)
- }
+func Send(c *bufio.Writer, a interface{}) {
+ send(c, a)
}
func GoHome(c *bufio.Writer) { send(c, "TT") }