fixed go vet warnings

This commit is contained in:
Brad Rydzewski 2014-07-11 22:14:14 -07:00
parent d000ca2918
commit 5b4a8ef4ea
2 changed files with 4 additions and 4 deletions

View file

@ -55,7 +55,7 @@ func TestRemoteInsert(t *testing.T) {
setup() setup()
defer teardown() defer teardown()
remote := &model.Remote{0, "bitbucket.org", "bitbucket.org", "https://bitbucket.org", "https://bitbucket.org", "abc", "123", false} remote := &model.Remote{ID: 0, Type: "bitbucket.org", Host: "bitbucket.org", URL: "https://bitbucket.org", API: "https://bitbucket.org", Client: "abc", Secret: "123", Open: false}
remotes := NewRemoteManager(db) remotes := NewRemoteManager(db)
if err := remotes.Insert(remote); err != nil { if err := remotes.Insert(remote); err != nil {
t.Errorf("Want Remote created, got %s", err) t.Errorf("Want Remote created, got %s", err)

View file

@ -158,19 +158,19 @@ func (h *WsHandler) WsConsole(w http.ResponseWriter, r *http.Request) error {
ws.SetWriteDeadline(time.Now().Add(writeWait)) ws.SetWriteDeadline(time.Now().Add(writeWait))
err := ws.WriteMessage(websocket.TextMessage, data) err := ws.WriteMessage(websocket.TextMessage, data)
if err != nil { if err != nil {
log.Println("websocket for commit %d closed. Err: %s", commitID, err) log.Printf("websocket for commit %d closed. Err: %s\n", commitID, err)
ws.Close() ws.Close()
return return
} }
case <-sub.CloseNotify(): case <-sub.CloseNotify():
log.Println("websocket for commit %d closed by client", commitID) log.Printf("websocket for commit %d closed by client\n", commitID)
ws.Close() ws.Close()
return return
case <-ticker.C: case <-ticker.C:
ws.SetWriteDeadline(time.Now().Add(writeWait)) ws.SetWriteDeadline(time.Now().Add(writeWait))
err := ws.WriteMessage(websocket.PingMessage, []byte{}) err := ws.WriteMessage(websocket.PingMessage, []byte{})
if err != nil { if err != nil {
log.Println("websocket for commit %d closed. Err: %s", commitID, err) log.Printf("websocket for commit %d closed. Err: %s\n", commitID, err)
ws.Close() ws.Close()
return return
} }