fix: resolve linting issues in VK channel
- Format VKConfig struct tags to comply with golines - Remove unused mu sync.Mutex field - Remove unused stripPrefix method All tests passing ✓
This commit is contained in:
parent
39377a21ff
commit
ee49136002
2 changed files with 6 additions and 17 deletions
|
|
@ -5,7 +5,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
|
||||||
|
|
||||||
"github.com/SevereCloud/vksdk/v3/api"
|
"github.com/SevereCloud/vksdk/v3/api"
|
||||||
"github.com/SevereCloud/vksdk/v3/api/params"
|
"github.com/SevereCloud/vksdk/v3/api/params"
|
||||||
|
|
@ -27,7 +26,6 @@ type VKChannel struct {
|
||||||
config *config.Config
|
config *config.Config
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
cancel context.CancelFunc
|
cancel context.CancelFunc
|
||||||
mu sync.Mutex
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewVKChannel(cfg *config.Config, bus *bus.MessageBus) (*VKChannel, error) {
|
func NewVKChannel(cfg *config.Config, bus *bus.MessageBus) (*VKChannel, error) {
|
||||||
|
|
@ -244,15 +242,6 @@ func (c *VKChannel) stripBotMention(text string) string {
|
||||||
return strings.TrimSpace(text)
|
return strings.TrimSpace(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *VKChannel) stripPrefix(text string, prefixes []string) string {
|
|
||||||
for _, prefix := range prefixes {
|
|
||||||
if strings.HasPrefix(text, prefix) {
|
|
||||||
return strings.TrimSpace(strings.TrimPrefix(text, prefix))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return text
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *VKChannel) getUserName(userID int) string {
|
func (c *VKChannel) getUserName(userID int) string {
|
||||||
users, err := c.vk.UsersGet(api.Params{
|
users, err := c.vk.UsersGet(api.Params{
|
||||||
"user_ids": userID,
|
"user_ids": userID,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue