Go: Make diagnostic names static

This commit is contained in:
Michael B. Gale
2024-03-27 13:49:40 +00:00
parent c74d6348f9
commit 86bf4fbbc0
3 changed files with 6 additions and 6 deletions

View File

@@ -497,7 +497,7 @@ func EmitNewerSystemGoRequired(requiredVersion string) {
func EmitExtractionFailedForProjects(path []string) {
emitDiagnostic(
"go/autobuilder/extraction-failed-for-project",
fmt.Sprintf("Unable to extract %d Go projects", len(path)),
"Unable to extract some Go projects",
fmt.Sprintf(
"The following %d Go project%s could not be extracted successfully:\n\n`%s`\n",
len(path),
@@ -512,9 +512,9 @@ func EmitExtractionFailedForProjects(path []string) {
func EmitInvalidToolchainVersion(goModPath string, version string) {
emitDiagnostic(
"go/autobuilder/invalid-go-toolchain-version",
fmt.Sprintf("`%s` is not a valid Go toolchain version", version),
"Invalid Go toolchain version",
strings.Join([]string{
"As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://tip.golang.org/doc/toolchain#version).",
"As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://go.dev/doc/toolchain#version).",
fmt.Sprintf("`%s` in `%s` does not match this syntax and there is no additional `toolchain` directive, which may cause some `go` commands to fail.", version, goModPath),
},
"\n\n"),

View File

@@ -2,12 +2,12 @@
"location": {
"file": "go.mod"
},
"markdownMessage": "As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://tip.golang.org/doc/toolchain#version).\n\n`1.21` in `go.mod` does not match this syntax and there is no additional `toolchain` directive, which may cause some `go` commands to fail.",
"markdownMessage": "As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://go.dev/doc/toolchain#version).\n\n`1.21` in `go.mod` does not match this syntax and there is no additional `toolchain` directive, which may cause some `go` commands to fail.",
"severity": "warning",
"source": {
"extractorName": "go",
"id": "go/autobuilder/invalid-go-toolchain-version",
"name": "`1.21` is not a valid Go toolchain version"
"name": "Invalid Go toolchain version"
},
"visibility": {
"cliSummaryTable": true,

View File

@@ -18,7 +18,7 @@
"source": {
"extractorName": "go",
"id": "go/autobuilder/extraction-failed-for-project",
"name": "Unable to extract 1 Go projects"
"name": "Unable to extract some Go projects"
},
"visibility": {
"cliSummaryTable": true,