From 08622c142f43a402e8a9fd565a4a7d5acb09cebb Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Wed, 8 Nov 2017 17:16:28 -0700 Subject: [PATCH] fixed code format --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d4661a5..4393380 100644 --- a/README.md +++ b/README.md @@ -165,23 +165,21 @@ var mu sync.Mutex var execs = make(map[int]int) events.Serving = func(srvin evio.Server) (action evio.Action) { - srv = srvin // hang on to the server control, which has the Dial function - return + srv = srvin // hang on to the server control, which has the Dial function + return } events.Data = func(id int, in []byte) (out []byte, action evio.Action) { if string(in) == "dial\r\n" { id := srv.Dial("tcp://google.com:80") // We now established an outbound connection to google. // Treat it like you would incoming connection. - } else { - out = in - } - return + } else { + out = in + } + return } ``` - - ### Data translations The `Translate` function wraps events and provides a `ReadWriter` that can be used to translate data off the wire from one format to another. This can be useful for transparently adding compression or encryption.