0
0
mirror of https://github.com/thegeeklab/wp-plugin-go.git synced 2024-11-23 06:40:40 +00:00

ci: fix golangci-lint deprecations

This commit is contained in:
Robert Kaussow 2024-05-12 11:08:23 +02:00
parent 5e6b213c13
commit 085ee0d15a
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
3 changed files with 5 additions and 6 deletions

View File

@ -23,7 +23,6 @@ linters:
- errchkjson - errchkjson
- errname - errname
- errorlint - errorlint
- execinquery
- exhaustive - exhaustive
- exportloopref - exportloopref
- forcetypeassert - forcetypeassert
@ -37,12 +36,12 @@ linters:
- gocyclo - gocyclo
- godot - godot
# - godox # - godox
- goerr113 - err113
- gofmt - gofmt
- gofumpt - gofumpt
- goheader - goheader
- goimports - goimports
- gomnd - mnd
- gomoddirectives - gomoddirectives
- gomodguard - gomodguard
- goprintffuncname - goprintffuncname

View File

@ -238,11 +238,11 @@ func prevFromContext(c *cli.Context) Commit {
// line as the title, and the rest as the description. If there is no newline, // line as the title, and the rest as the description. If there is no newline,
// the entire message is returned as the title, and the description is empty. // the entire message is returned as the title, and the description is empty.
func splitMessage(message string) (string, string) { func splitMessage(message string) (string, string) {
//nolint:gomnd //nolint:mnd
switch parts := strings.SplitN(message, "\n", 2); len(parts) { switch parts := strings.SplitN(message, "\n", 2); len(parts) {
case 1: case 1:
return parts[0], "" return parts[0], ""
//nolint:gomnd //nolint:mnd
case 2: case 2:
return parts[0], parts[1] return parts[0], parts[1]
} }

View File

@ -28,7 +28,7 @@ func splitWithEscaping(in, separator, escapeString string) []string {
out := strings.Split(in, separator) out := strings.Split(in, separator)
//nolint:gomnd //nolint:mnd
for i := len(out) - 2; i >= 0; i-- { for i := len(out) - 2; i >= 0; i-- {
if strings.HasSuffix(out[i], escapeString) { if strings.HasSuffix(out[i], escapeString) {
out[i] = out[i][:len(out[i])-len(escapeString)] + separator + out[i+1] out[i] = out[i][:len(out[i])-len(escapeString)] + separator + out[i+1]