diff options
| author | Shulhan <ms@kilabit.info> | 2024-03-02 18:28:58 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-03-05 14:53:03 +0700 |
| commit | b921ebfb3e81b367ff24305eb18c5dd073b38635 (patch) | |
| tree | 89c88e32ad92af2ade65dec6552ddd06ddc0cd90 /lib/http/callback_error_handler.go | |
| parent | 901c9803e6f93e0d5ee282f4061309022c46f490 (diff) | |
| download | pakakeh.go-b921ebfb3e81b367ff24305eb18c5dd073b38635.tar.xz | |
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]
Diffstat (limited to 'lib/http/callback_error_handler.go')
| -rw-r--r-- | lib/http/callback_error_handler.go | 10 |
1 files changed, 5 insertions, 5 deletions
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) } |
