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 /api | |
| 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 'api')
| -rw-r--r-- | api/slack/message.go | 2 | ||||
| -rw-r--r-- | api/slack/webhook_client.go | 2 | ||||
| -rw-r--r-- | api/telegram/bot/bot.go | 2 | ||||
| -rw-r--r-- | api/telegram/bot/passport_data.go | 4 |
4 files changed, 3 insertions, 7 deletions
diff --git a/api/slack/message.go b/api/slack/message.go index 2a62c200..1483f20d 100644 --- a/api/slack/message.go +++ b/api/slack/message.go @@ -9,6 +9,6 @@ type Message struct { Channel string `json:"channel,omitempty"` Username string `json:"username,omitempty"` IconEmoji string `json:"icon_emoji,omitempty"` - IconUrl string `json:"icon_url,omitempty"` //revive:disable-line + IconURL string `json:"icon_url,omitempty"` Text string `json:"text"` } diff --git a/api/slack/webhook_client.go b/api/slack/webhook_client.go index 753f38bc..651f8d35 100644 --- a/api/slack/webhook_client.go +++ b/api/slack/webhook_client.go @@ -32,7 +32,7 @@ func NewWebhookClient(webhookURL, user, channel string) (wcl *WebhookClient, err } clientOpts := &libhttp.ClientOptions{ - ServerUrl: fmt.Sprintf("%s://%s", wurl.Scheme, wurl.Host), + ServerURL: fmt.Sprintf("%s://%s", wurl.Scheme, wurl.Host), } wcl = &WebhookClient{ Client: libhttp.NewClient(clientOpts), diff --git a/api/telegram/bot/bot.go b/api/telegram/bot/bot.go index f0e2c009..2f237489 100644 --- a/api/telegram/bot/bot.go +++ b/api/telegram/bot/bot.go @@ -110,7 +110,7 @@ func New(opts Options) (bot *Bot, err error) { } clientOpts := &http.ClientOptions{ - ServerUrl: defURL + opts.Token + "/", + ServerURL: defURL + opts.Token + `/`, } bot = &Bot{ opts: opts, diff --git a/api/telegram/bot/passport_data.go b/api/telegram/bot/passport_data.go index e7d9d271..3c3d077b 100644 --- a/api/telegram/bot/passport_data.go +++ b/api/telegram/bot/passport_data.go @@ -9,8 +9,4 @@ package bot type PassportData struct { // Encrypted credentials required to decrypt the data. Credentials EncryptedCredentials - - // Array with information about documents and other Telegram Passport - // elements that was shared with the bot. - data []EncryptedPassportElement //nolint: structcheck,unused } |
