Skip to content

Commit 8245dfe

Browse files
authored
Merge pull request #7 from PDOK/PDOK-17406-upgrade-github-actions
Bump actions/cache from v2 to v4
2 parents 45b8a1a + 72ad233 commit 8245dfe

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

.github/workflows/build-and-publish-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Set up Docker Buildx
4040
uses: docker/setup-buildx-action@v1
4141
- name: Cache Docker layers
42-
uses: actions/cache@v2
42+
uses: actions/cache@v4
4343
with:
4444
path: /tmp/.buildx-cache
4545
key: ${{ runner.os }}-buildx-${{ github.sha }}

.golangci.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ issues:
1616
linters:
1717
- bodyclose
1818
- dupl
19+
- dogsled
1920
- funlen
2021

2122
output:
22-
format: colored-line-number
23+
formats: colored-line-number
2324
print-issued-lines: true
2425
print-linter-name: true
2526

@@ -37,11 +38,15 @@ linters-settings:
3738
skip-tests: true
3839
funlen:
3940
lines: 100
40-
gomoddirectives:
41-
replace-allow-list:
42-
- github.com/abbot/go-http-auth # https://github.com/traefik/traefik/issues/6873#issuecomment-637654361
4341
nestif:
4442
min-complexity: 6
43+
forbidigo:
44+
forbid:
45+
- http\.NotFound.* # return RFC 7807 problem details instead
46+
- http\.Error.* # return RFC 7807 problem details instead
47+
gomoddirectives:
48+
replace-allow-list:
49+
- github.com/abbot/go-http-auth
4550

4651
linters:
4752
disable-all: true
@@ -62,23 +67,28 @@ linters:
6267
- cyclop # checks function and package cyclomatic complexity
6368
- dupl # tool for code clone detection
6469
- durationcheck # checks for two durations multiplied together
70+
- dogsled # find assignments/declarations with too many blank identifiers
6571
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
6672
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
67-
- execinquery # checks query string in Query function which reads your Go src files and warning it finds
6873
- exhaustive # checks exhaustiveness of enum switch statements
69-
- exportloopref # checks for pointers to enclosing loop variables
74+
- exptostd # detects functions from golang.org/x/exp/ that can be replaced by std functions
75+
- copyloopvar # checks for pointers to enclosing loop variables
76+
- fatcontext # detects nested contexts in loops and function literals
7077
- forbidigo # forbids identifiers
7178
- funlen # tool for detection of long functions
7279
- gocheckcompilerdirectives # validates go compiler directive comments (//go:)
7380
- goconst # finds repeated strings that could be replaced by a constant
7481
- gocritic # provides diagnostics that check for bugs, performance and style issues
82+
- gofmt # checks if the code is formatted according to 'gofmt' command
7583
- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
7684
- gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
7785
- gomodguard # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations
7886
- goprintffuncname # checks that printf-like functions are named with f at the end
7987
- gosec # inspects source code for security problems
8088
- loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap)
8189
- makezero # finds slice declarations with non-zero initial length
90+
- mirror # reports wrong mirror patterns of bytes/strings usage
91+
- misspell # finds commonly misspelled English words
8292
- nakedret # finds naked returns in functions greater than a specified function length
8393
- nestif # reports deeply nested if statements
8494
- nilerr # finds the code that returns nil even if it checks that the error is not nil
@@ -92,7 +102,8 @@ linters:
92102
- rowserrcheck # checks whether Err of rows is checked successfully
93103
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
94104
- sloglint # A Go linter that ensures consistent code style when using log/slog
95-
- tenv # detects using os.Setenv instead of t.Setenv since Go1.17
105+
- tagliatelle # checks the struct tags.
106+
- usetesting # detects using os.Setenv instead of t.Setenv since Go1.17
96107
- testableexamples # checks if examples are testable (have an expected output)
97108
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
98109
- unconvert # removes unnecessary type conversions

internal/model/check.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ type UptimeCheck struct {
2929
Name string `json:"name"`
3030
URL string `json:"url"`
3131
Tags []string `json:"tags"`
32-
RequestHeaders map[string]string `json:"request_headers"`
33-
StringContains string `json:"string_contains"`
34-
StringNotContains string `json:"string_not_contains"`
32+
RequestHeaders map[string]string `json:"request_headers"` //nolint:tagliatelle // grandfathered in
33+
StringContains string `json:"string_contains"` //nolint:tagliatelle // grandfathered in
34+
StringNotContains string `json:"string_not_contains"` //nolint:tagliatelle // grandfathered in
3535
}
3636

3737
func NewUptimeCheck(ingressName string, annotations map[string]string) (*UptimeCheck, error) {

internal/service/providers/pingdom.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ func (m *PingdomUptimeProvider) checkToJSON(check model.UptimeCheck, includeType
220220
// update messages shouldn't include 'type', since the type of check can't be modified in Pingdom.
221221
message["type"] = "http"
222222
}
223-
if m.settings.UserIDs != nil && len(m.settings.UserIDs) > 0 {
223+
if len(m.settings.UserIDs) > 0 {
224224
message["userids"] = m.settings.UserIDs
225225
}
226-
if m.settings.IntegrationIDs != nil && len(m.settings.IntegrationIDs) > 0 {
226+
if len(m.settings.IntegrationIDs) > 0 {
227227
message["integrationids"] = m.settings.IntegrationIDs
228228
}
229229

0 commit comments

Comments
 (0)