diff --git a/build.assets/tooling/cmd/resource-ref-generator/main.go b/build.assets/tooling/cmd/resource-ref-generator/main.go index a09e0235b6b49..8f7a050a5724f 100644 --- a/build.assets/tooling/cmd/resource-ref-generator/main.go +++ b/build.assets/tooling/cmd/resource-ref-generator/main.go @@ -1,5 +1,5 @@ // Teleport -// Copyright (C) 2023 Gravitational, Inc. +// Copyright (C) 2025 Gravitational, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/build.assets/tooling/cmd/resource-ref-generator/reference/reference.go b/build.assets/tooling/cmd/resource-ref-generator/reference/reference.go index 93e8ff6daaf05..10fac58bad68f 100644 --- a/build.assets/tooling/cmd/resource-ref-generator/reference/reference.go +++ b/build.assets/tooling/cmd/resource-ref-generator/reference/reference.go @@ -1,5 +1,5 @@ // Teleport -// Copyright (C) 2023 Gravitational, Inc. +// Copyright (C) 2025 Gravitational, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -89,7 +89,7 @@ type GeneratorConfig struct { // not, returns the first error it encounters. func (c GeneratorConfig) UnmarshalYAML(value *yaml.Node) error { if err := value.Decode(&c); err != nil { - return fmt.Errorf("could not parse the configuration file as YAML: %v\n", err) + return fmt.Errorf("parsing the configuration file as YAML: %w\n", err) } switch { @@ -234,7 +234,7 @@ func (g GenerationError) Error() string { func Generate(srcFS, destFS afero.Fs, conf GeneratorConfig) error { sourceData, err := resource.NewSourceData(srcFS, conf.SourcePath) if err != nil { - return fmt.Errorf("can't load Go source files: %v", err) + return fmt.Errorf("loading Go source files: %w", err) } versionKindAssignments, err := resource.VersionKindAssignments(sourceData.PossibleFuncDecls, conf.FieldAssignmentMethodName) @@ -259,7 +259,7 @@ func Generate(srcFS, destFS afero.Fs, conf GeneratorConfig) error { continue } if err != nil { - errs.messages = append(errs.messages, fmt.Errorf("issue creating a reference entry for declaration %v.%v in file %v: %v", k.PackageName, k.DeclName, decl.FilePath, err)) + errs.messages = append(errs.messages, fmt.Errorf("creating a reference entry for declaration %v.%v in file %v: %w", k.PackageName, k.DeclName, decl.FilePath, err)) } pc.Resource.ReferenceEntry = entries[k] diff --git a/build.assets/tooling/cmd/resource-ref-generator/reference/reference_test.go b/build.assets/tooling/cmd/resource-ref-generator/reference/reference_test.go index 4faa23390299f..69cff26cc5d25 100644 --- a/build.assets/tooling/cmd/resource-ref-generator/reference/reference_test.go +++ b/build.assets/tooling/cmd/resource-ref-generator/reference/reference_test.go @@ -1,5 +1,5 @@ // Teleport -// Copyright (C) 2023 Gravitational, Inc. +// Copyright (C) 2025 Gravitational, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/build.assets/tooling/cmd/resource-ref-generator/reference/testdata/src/app.go b/build.assets/tooling/cmd/resource-ref-generator/reference/testdata/src/app.go index 131b8cc9b56fe..c5bc505eab2d2 100644 --- a/build.assets/tooling/cmd/resource-ref-generator/reference/testdata/src/app.go +++ b/build.assets/tooling/cmd/resource-ref-generator/reference/testdata/src/app.go @@ -1,5 +1,5 @@ // Teleport -// Copyright (C) 2023 Gravitational, Inc. +// Copyright (C) 2025 Gravitational, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/build.assets/tooling/cmd/resource-ref-generator/reference/testdata/src/database.go b/build.assets/tooling/cmd/resource-ref-generator/reference/testdata/src/database.go index 3b2fae759585d..34d168319d6b8 100644 --- a/build.assets/tooling/cmd/resource-ref-generator/reference/testdata/src/database.go +++ b/build.assets/tooling/cmd/resource-ref-generator/reference/testdata/src/database.go @@ -1,5 +1,5 @@ // Teleport -// Copyright (C) 2023 Gravitational, Inc. +// Copyright (C) 2025 Gravitational, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by diff --git a/build.assets/tooling/cmd/resource-ref-generator/resource/resource.go b/build.assets/tooling/cmd/resource-ref-generator/resource/resource.go index 1043f5b9afbb1..05fa6986cce28 100644 --- a/build.assets/tooling/cmd/resource-ref-generator/resource/resource.go +++ b/build.assets/tooling/cmd/resource-ref-generator/resource/resource.go @@ -1,5 +1,5 @@ // Teleport -// Copyright (C) 2023 Gravitational, Inc. +// Copyright (C) 2025 Gravitational, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -110,7 +110,7 @@ func NewSourceData(fs afero.Fs, rootPath string) (SourceData, error) { // the resulting docs page know which files to modify. err := afero.Walk(fs, rootPath, func(currentPath string, info gofs.FileInfo, err error) error { if err != nil { - return fmt.Errorf("unable to load Go source due to path error: %v", err) + return fmt.Errorf("loading Go source: %w", err) } if info.IsDir() { @@ -182,7 +182,7 @@ func NewSourceData(fs afero.Fs, rootPath string) (SourceData, error) { return nil }) if err != nil { - return SourceData{}, fmt.Errorf("can't load Go source files: %v", err) + return SourceData{}, fmt.Errorf("loading Go source files: %w", err) } return SourceData{ TypeDecls: typeDecls, diff --git a/build.assets/tooling/cmd/resource-ref-generator/resource/resource_test.go b/build.assets/tooling/cmd/resource-ref-generator/resource/resource_test.go index e9b1bad7338fa..ef7a9696e8035 100644 --- a/build.assets/tooling/cmd/resource-ref-generator/resource/resource_test.go +++ b/build.assets/tooling/cmd/resource-ref-generator/resource/resource_test.go @@ -1,5 +1,5 @@ // Teleport -// Copyright (C) 2023 Gravitational, Inc. +// Copyright (C) 2025 Gravitational, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by