chore: update and streamline linting configuration and error formatting

- Update `.golangci.yaml` to version 2 and streamline settings
- Remove specific linters from `.golangci.yaml` configuration
- Add exclusion and formatter settings to `.golangci.yaml`
- Change error message formatting in `plugin.go` to lowercase
- Use `strings.ReplaceAll` instead of `strings.Replace` for better readability and performance in `plugin.go` and `plugin_test.go`

Signed-off-by: appleboy <appleboy.tw@gmail.com>
This commit is contained in:
appleboy
2025-03-29 09:39:55 +08:00
parent 07c75984e5
commit 0ec46c4fd2
3 changed files with 45 additions and 33 deletions
+1 -1
View File
@@ -638,7 +638,7 @@ func TestEnvOutput(t *testing.T) {
}
func unindent(text string) string {
return strings.TrimSpace(strings.Replace(text, "\t", "", -1))
return strings.TrimSpace(strings.ReplaceAll(text, "\t", ""))
}
func TestPlugin_scriptCommands(t *testing.T) {