mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-30 08:06:52 +02:00
fixed go vet warnings
This commit is contained in:
parent
d000ca2918
commit
5b4a8ef4ea
@ -55,7 +55,7 @@ func TestRemoteInsert(t *testing.T) {
|
||||
setup()
|
||||
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)
|
||||
if err := remotes.Insert(remote); err != nil {
|
||||
t.Errorf("Want Remote created, got %s", err)
|
||||
|
@ -158,19 +158,19 @@ func (h *WsHandler) WsConsole(w http.ResponseWriter, r *http.Request) error {
|
||||
ws.SetWriteDeadline(time.Now().Add(writeWait))
|
||||
err := ws.WriteMessage(websocket.TextMessage, data)
|
||||
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()
|
||||
return
|
||||
}
|
||||
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()
|
||||
return
|
||||
case <-ticker.C:
|
||||
ws.SetWriteDeadline(time.Now().Add(writeWait))
|
||||
err := ws.WriteMessage(websocket.PingMessage, []byte{})
|
||||
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()
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user