Some fixes suggested by golangci-lint

This commit is contained in:
Roberto Abdelkader Martínez Pérez
2019-10-07 08:53:48 +02:00
parent 7e54c26cb8
commit 47bd2be882
11 changed files with 86 additions and 49 deletions
+18 -3
View File
@@ -5,10 +5,25 @@ import (
"sync"
)
// Handler represents an open HTTP connection in the User Server.
//
// This struct contains the connection Writer and Request to be managed
// by endpoints of the Data Server.
type Handler struct {
Id string
Route *Route
// ID is unique identifier of the request.
ID string
// Route is a reference to the original route that matched this
// request.
Route *Route
// Writing is a mutex that prevents two goroutines from writing at
// the same time in the response.
Writing sync.Mutex
Writer http.ResponseWriter
// Request is a pointer to the in-progress request.
Request *http.Request
// Writer is the original http.ResponseWriter of the request.
Writer http.ResponseWriter
}