From b921ebfb3e81b367ff24305eb18c5dd073b38635 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 2 Mar 2024 18:28:58 +0700 Subject: all: comply with linter recommendations #1 Instead of annotating the lines that caught by linters, fix it to comply with the recommendations. This causes several breaking changes, especially related to naming, * api/slack: [Message.IconUrl] become [Message.IconURL] * lib/dns: DefaultSoaMinumumTtl become DefaultSoaMinimumTTL * lib/email: [Message.SetBodyHtml] become [Message.SetBodyHTML] * lib/http: [Client.GenerateHttpRequest] become [Client.GenerateHTTPRequest] * lib/http: [ClientOptions.ServerUrl] become [ClientOptions.ServerURL] * lib/http: [EndpointRequest.HttpWriter] become [EndpointRequest.HTTPWriter] * lib/http: [EndpointRequest.HttpRequest] become [EndpointRequest.HTTPRequest] * lib/http: [ServerOptions.EnableIndexHtml] become [ServerOptions.EnableIndexHTML] * lib/http: [SSEConn.HttpRequest] become [SSEConn.HTTPRequest] * lib/smtp: [ClientOptions.ServerUrl] become [ClientOptions.ServerURL] * lib/ssh/sftp: [FileAttrs.SetUid] become [FileAttrs.SetUID] * lib/ssh/sftp: [FileAttrs.Uid] become [FileAttrs.UID] --- lib/http/callback_error_handler.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/http/callback_error_handler.go') diff --git a/lib/http/callback_error_handler.go b/lib/http/callback_error_handler.go index ec0c4a8a..7a1c075d 100644 --- a/lib/http/callback_error_handler.go +++ b/lib/http/callback_error_handler.go @@ -44,14 +44,14 @@ func DefaultErrorHandler(epr *EndpointRequest) { errInternal.Code = http.StatusInternalServerError } } else { - mlog.Errf("%s: %s %s: %s", logp, epr.HttpRequest.Method, - epr.HttpRequest.URL.Path, epr.Error) + mlog.Errf(`%s: %s %s: %s`, logp, epr.HTTPRequest.Method, + epr.HTTPRequest.URL.Path, epr.Error) errInternal = liberrors.Internal(epr.Error) } - epr.HttpWriter.Header().Set(HeaderContentType, ContentTypeJSON) - epr.HttpWriter.WriteHeader(errInternal.Code) + epr.HTTPWriter.Header().Set(HeaderContentType, ContentTypeJSON) + epr.HTTPWriter.WriteHeader(errInternal.Code) jsonb, err = json.Marshal(errInternal) if err != nil { @@ -59,7 +59,7 @@ func DefaultErrorHandler(epr *EndpointRequest) { return } - _, err = epr.HttpWriter.Write(jsonb) + _, err = epr.HTTPWriter.Write(jsonb) if err != nil { mlog.Errf("%s: Write: %s", logp, err) } -- cgit v1.3-6-g1900