From: Scott Worley Date: Sat, 28 Jul 2012 17:34:50 +0000 (-0700) Subject: Fetch returns a list of messages X-Git-Url: http://git.scottworley.com/reliable-chat/commitdiff_plain/9b33d8539f2c58d46adfc676bf2a1769af221dfd?ds=sidebyside;hp=842eacb46d084f3b694c42afe22db6d7a3afc3b7 Fetch returns a list of messages Not a thing that contains a list of messages. --- diff --git a/server/server.go b/server/server.go index f9c4857..8d4e897 100644 --- a/server/server.go +++ b/server/server.go @@ -11,11 +11,6 @@ type Message struct { Text string } -type FetchResponse struct { - Messages []Message - Time time.Time -} - type StoreRequest struct { StartTime time.Time Messages chan<- []Message @@ -94,7 +89,7 @@ func start_server(store Store) { messages_from_store := make(chan []Message, 1) store.Get <- StoreRequest{since, messages_from_store} - json_encoded, err := json.Marshal(FetchResponse{<-messages_from_store, time.Now()}) + json_encoded, err := json.Marshal(<-messages_from_store) if err != nil { log.Print("json encode: ", err) w.WriteHeader(http.StatusInternalServerError)