From a2307523d4713ef76c87468d921f065026c8a4d8 Mon Sep 17 00:00:00 2001 From: H1rono Date: Sun, 1 Sep 2024 14:04:19 +0900 Subject: [PATCH 1/2] :adhesive_bandage: Fix golangci-lint errors --- service/webhook.go | 4 ++-- testutil/random/ramdom.go | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/service/webhook.go b/service/webhook.go index 6bd431cb..d1f8664f 100644 --- a/service/webhook.go +++ b/service/webhook.go @@ -127,7 +127,7 @@ func WebhookEventHandler(c echo.Context, reqBody, resBody []byte) { message += fmt.Sprintf("- 請求先グループ: %s\n", resApp.Group.Name) } - if resApp.Tags != nil && len(resApp.Tags) != 0 { + if len(resApp.Tags) != 0 { tags := lo.Map(resApp.Tags, func(tag *Tag, index int) string { return tag.Name }) @@ -188,7 +188,7 @@ func WebhookEventHandler(c echo.Context, reqBody, resBody []byte) { if resApp.Group != nil { message += fmt.Sprintf("- 関連するグループ: %s\n", resApp.Group.Name) } - if resApp.Tags != nil && len(resApp.Tags) != 0 { + if len(resApp.Tags) != 0 { tags := lo.Map(resApp.Tags, func(tag *Tag, index int) string { return tag.Name }) diff --git a/testutil/random/ramdom.go b/testutil/random/ramdom.go index f4c7de62..1b3645fc 100644 --- a/testutil/random/ramdom.go +++ b/testutil/random/ramdom.go @@ -20,39 +20,39 @@ func AlphaNumeric(t *testing.T, n int) string { return string(b) } -func Numeric(t *testing.T, max int) int { +func Numeric(t *testing.T, n int) int { t.Helper() - return rand.IntN(max) + return rand.IntN(n) } -func Numeric64(t *testing.T, max int64) int64 { +func Numeric64(t *testing.T, n int64) int64 { t.Helper() - return rand.Int64N(max) + return rand.Int64N(n) } -func AlphaNumericSlice(t *testing.T, length int, max int64) []string { +func AlphaNumericSlice(t *testing.T, length int, n int64) []string { t.Helper() slice := []string{} for range length { - slice = append(slice, AlphaNumeric(t, int(max))) + slice = append(slice, AlphaNumeric(t, int(n))) } return slice } -func NumericSlice(t *testing.T, length int, max int) []int { +func NumericSlice(t *testing.T, length int, n int) []int { t.Helper() slice := []int{} for range length { - slice = append(slice, Numeric(t, max)) + slice = append(slice, Numeric(t, n)) } return slice } -func Numeric64Slice(t *testing.T, length int, max int64) []int64 { +func Numeric64Slice(t *testing.T, length int, n int64) []int64 { t.Helper() slice := []int64{} for range length { - slice = append(slice, Numeric64(t, max)) + slice = append(slice, Numeric64(t, n)) } return slice } From e947aef5f7d7a143aeac41c59ea0e99d82a97402 Mon Sep 17 00:00:00 2001 From: H1rono Date: Sun, 1 Sep 2024 14:39:01 +0900 Subject: [PATCH 2/2] :wrench: Configure monthly check, workflow_dispatch --- .github/workflows/go.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 4207de22..cfdc62ec 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,5 +1,15 @@ name: Go -on: push + +on: + push: + branches: + - v2 + pull_request: + branches: + - v2 + workflow_dispatch: + schedule: + - cron: "0 0 1 * *" jobs: