Chore: Bump Go to 1.23.0 (#92105)
* chore: Bump Go to 1.23.0 Signed-off-by: Dave Henderson <dave.henderson@grafana.com> * update swagger files Signed-off-by: Dave Henderson <dave.henderson@grafana.com> * chore: update .bingo/README.md formatting to satisfy prettier Signed-off-by: Dave Henderson <dave.henderson@grafana.com> * chore(lint): Fix new lint errors found by golangci-lint 1.60.1 and Go 1.23 Signed-off-by: Dave Henderson <dave.henderson@grafana.com> * keep golden file * update openapi * add name to expected output * chore(lint): rearrange imports to a sensible order Signed-off-by: Dave Henderson <dave.henderson@grafana.com> --------- Signed-off-by: Dave Henderson <dave.henderson@grafana.com> Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
co-authored by
Ryan McKinley
parent
02c820382d
commit
df3d8915ba
@@ -2,6 +2,7 @@ package plugins
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"os"
|
||||
@@ -90,18 +91,16 @@ func (cr *configReaderImpl) parsePluginConfig(path string, file fs.DirEntry) (*p
|
||||
|
||||
func validateRequiredField(apps []*pluginsAsConfig) error {
|
||||
for i := range apps {
|
||||
var errStrings []string
|
||||
errs := []error{}
|
||||
for index, app := range apps[i].Apps {
|
||||
if app.PluginID == "" {
|
||||
errStrings = append(
|
||||
errStrings,
|
||||
fmt.Sprintf("app item %d in configuration doesn't contain required field type", index+1),
|
||||
)
|
||||
err := fmt.Errorf("app item %d in configuration doesn't contain required field type", index+1)
|
||||
errs = append(errs, err)
|
||||
}
|
||||
}
|
||||
|
||||
if len(errStrings) != 0 {
|
||||
return fmt.Errorf(strings.Join(errStrings, "\n"))
|
||||
if len(errs) != 0 {
|
||||
return errors.Join(errs...)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user