From 29bc4768553368d9ebae64f8d57f7ef6853472e0 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Wed, 13 May 2015 23:39:13 +0200 Subject: [PATCH] Adds travis and godocs banners --- README.md | 3 +++ sse-encoder.go | 4 ++-- sse_test.go | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e19ec4e..e40026b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ #Server-Sent Events +[![GoDoc](https://godoc.org/github.com/manucorporat/sse?status.svg)](https://godoc.org/github.com/manucorporat/sse) +[![Build Status](https://travis-ci.org/manucorporat/sse.svg)](https://travis-ci.org/manucorporat/sse) + Server-sent events (SSE) is a technology where a browser receives automatic updates from a server via HTTP connection. The Server-Sent Events EventSource API is standardized as part of HTML5[1] by the W3C. [Read this great SSE introduction by the HTML5Rocks guys](http://www.html5rocks.com/en/tutorials/eventsource/basics/) diff --git a/sse-encoder.go b/sse-encoder.go index 528f6ba..4905525 100644 --- a/sse-encoder.go +++ b/sse-encoder.go @@ -8,12 +8,12 @@ import ( "strings" ) -const ContentType = "text/event-stream" - // Server-Sent Events // W3C Working Draft 29 October 2009 // http://www.w3.org/TR/2009/WD-eventsource-20091029/ +const ContentType = "text/event-stream" + type Event struct { Event string Id string diff --git a/sse_test.go b/sse_test.go index 32a5beb..4421a8f 100644 --- a/sse_test.go +++ b/sse_test.go @@ -2,7 +2,6 @@ package sse import ( "bytes" - "fmt" "testing" "github.com/stretchr/testify/assert" @@ -143,6 +142,5 @@ func TestEncodeStream(t *testing.T) { Event: "chat", Data: "hi! dude", }) - fmt.Println(w.String()) assert.Equal(t, w.String(), "event: float\ndata: 1.5\n\nid: 123\ndata: {\"bar\":\"foo\",\"foo\":\"bar\"}\n\nid: 124\nevent: chat\ndata: hi! dude\n\n") }