Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(220)

Unified Diff: 2014/go4java/loopback.go

Issue 111050043: code review 111050043: go.talks: add "Go for Javaneros" (Closed)
Patch Set: diff -r f10c43fe60f9 https://code.google.com/p/go.talks Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: 2014/go4java/loopback.go
===================================================================
new file mode 100644
--- /dev/null
+++ b/2014/go4java/loopback.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+ "bytes"
+ "net"
+)
+
+func handleConn(conn net.Conn) {
+ // does something that should be tested.
+}
+
+type loopBack struct {
+ net.Conn
+ buf bytes.Buffer
+}
+
+func (c *loopBack) Read(b []byte) (int, error) {
+ return c.buf.Read(b)
+}
+
+func (c *loopBack) Write(b []byte) (int, error) {
+ return c.buf.Write(b)
+}

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b