1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-08-04 21:42:57 +02:00

fix: some linting issues (#2563)

This commit is contained in:
David Brouwer
2022-09-30 16:27:07 +02:00
committed by GitHub
parent 47e6a8d725
commit 85c0b0b8eb
221 changed files with 1025 additions and 1283 deletions

View File

@ -13,7 +13,7 @@ import (
"go-micro.dev/v4/selector"
)
// Write sets the status and body on a http ResponseWriter
// Write sets the status and body on a http ResponseWriter.
func Write(w http.ResponseWriter, contentType string, status int, body string) {
w.Header().Set("Content-Length", fmt.Sprintf("%v", len(body)))
w.Header().Set("Content-Type", contentType)
@ -21,7 +21,7 @@ func Write(w http.ResponseWriter, contentType string, status int, body string) {
fmt.Fprintf(w, `%v`, body)
}
// WriteBadRequestError sets a 400 status code
// WriteBadRequestError sets a 400 status code.
func WriteBadRequestError(w http.ResponseWriter, err error) {
rawBody, err := json.Marshal(map[string]string{
"error": err.Error(),
@ -33,7 +33,7 @@ func WriteBadRequestError(w http.ResponseWriter, err error) {
Write(w, "application/json", 400, string(rawBody))
}
// WriteInternalServerError sets a 500 status code
// WriteInternalServerError sets a 500 status code.
func WriteInternalServerError(w http.ResponseWriter, err error) {
rawBody, err := json.Marshal(map[string]string{
"error": err.Error(),

View File

@ -77,5 +77,4 @@ func TestRoundTripper(t *testing.T) {
if string(b) != "hello world" {
t.Fatal("response is", string(b))
}
}