Skip to content

Commit

Permalink
fix golang lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-s committed Jan 31, 2024
1 parent 962c74f commit 1ab94d6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions server/api/queue.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package api

import (
"encoding/json"
"log"
"net/http"

"go.woodpecker-ci.org/woodpecker/v2/server/queue" // replace with the actual import path
)

func GetQueueStats() {
http.HandleFunc("/api/queue/stats", func(w http.ResponseWriter, r *http.Request) {
var stats queue.InfoT
err := json.NewEncoder(w).Encode(stats)
if err != nil {
// handle the error
log.Printf("Error encoding JSON: %v", err)
return
}

Check warning on line 19 in server/api/queue.go

View check run for this annotation

Codecov / codecov/patch

server/api/queue.go#L11-L19

Added lines #L11 - L19 were not covered by tests
})
}

0 comments on commit 1ab94d6

Please sign in to comment.