Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add golangci yaml config #91

Merged
merged 5 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
9 changes: 9 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
run:
timeout: "3m"
issue-exit-code: 1
tests: true
skip-dirs-use-default: true
skip-files:
- pkg/dgvoice/.*.go$
- pkg/speech/win32/.*.go$
go: 1.18
6 changes: 5 additions & 1 deletion pkg/slashCmd/dict.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"log"

"github.com/azuki-bar/ceviord/pkg/ceviord"
"github.com/azuki-bar/ceviord/pkg/logging"
"github.com/azuki-bar/ceviord/pkg/replace"
"github.com/bwmarrin/discordgo"
"github.com/k0kubun/pp"
Expand Down Expand Up @@ -42,10 +43,13 @@ func (*dict) handle(c chan<- bool, s *discordgo.Session, i *discordgo.Interactio
}

func replySimpleMsg(msg string, s *discordgo.Session, i *discordgo.Interaction) {
s.InteractionRespond(i, &discordgo.InteractionResponse{
err := s.InteractionRespond(i, &discordgo.InteractionResponse{
Type: discordgo.InteractionResponseChannelMessageWithSource,
Data: &discordgo.InteractionResponseData{Content: msg},
})
if err != nil {
ceviord.Logger.Log(logging.WARN, "reply simple msg", err)
}
}

func dictSubCmdParse(opt *discordgo.ApplicationCommandInteractionDataOption) (dictSubCmd, error) {
Expand Down
5 changes: 1 addition & 4 deletions pkg/slashCmd/slashCmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ func InteractionHandler(s *discordgo.Session, i *discordgo.InteractionCreate) {
case <-finish:
return
case <-time.After(2500 * time.Millisecond):
s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
Type: discordgo.InteractionResponseChannelMessageWithSource,
Data: &discordgo.InteractionResponseData{Content: "handler connection timeout"},
})
replySimpleMsg("コネクションがタイムアウトしました。", s, i.Interaction)
}
}

Expand Down