Skip to content

Commit 0d6f17e

Browse files
committed
Do not use field internal, which is deprecated
1 parent 17c550b commit 0d6f17e

File tree

6 files changed

+5
-13
lines changed

6 files changed

+5
-13
lines changed

go/extractor/diagnostics/diagnostics.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,14 @@ type diagnostic struct {
4646
Source sourceStruct `json:"source"`
4747
MarkdownMessage string `json:"markdownMessage"`
4848
Severity string `json:"severity"`
49-
Internal bool `json:"internal"`
5049
Visibility *visibilityStruct `json:"visibility,omitempty"` // Use a pointer so that it is omitted if nil
5150
Location *locationStruct `json:"location,omitempty"` // Use a pointer so that it is omitted if nil
5251
}
5352

5453
var diagnosticsEmitted, diagnosticsLimit uint = 0, 100
5554
var noDiagnosticDirPrinted bool = false
5655

57-
func emitDiagnostic(sourceid, sourcename, markdownMessage string, severity diagnosticSeverity, internal bool, visibility *visibilityStruct, location *locationStruct) {
56+
func emitDiagnostic(sourceid, sourcename, markdownMessage string, severity diagnosticSeverity, visibility *visibilityStruct, location *locationStruct) {
5857
if diagnosticsEmitted < diagnosticsLimit {
5958
diagnosticsEmitted += 1
6059

@@ -77,7 +76,6 @@ func emitDiagnostic(sourceid, sourcename, markdownMessage string, severity diagn
7776
sourceStruct{sourceid, sourcename, "go"},
7877
markdownMessage,
7978
string(severity),
80-
internal,
8179
visibility,
8280
location,
8381
}
@@ -87,7 +85,6 @@ func emitDiagnostic(sourceid, sourcename, markdownMessage string, severity diagn
8785
sourceStruct{"go/autobuilder/diagnostic-limit-reached", "Diagnostics limit exceeded", "go"},
8886
fmt.Sprintf("CodeQL has produced more than the maximum number of diagnostics. Only the first %d have been reported.", diagnosticsLimit),
8987
string(severityWarning),
90-
false,
9188
visibility,
9289
location,
9390
}
@@ -123,7 +120,7 @@ func EmitPackageDifferentOSArchitecture(pkgPath string) {
123120
"go/autobuilder/package-different-os-architecture",
124121
"Package "+pkgPath+" is intended for a different OS or architecture",
125122
"Make sure the `GOOS` and `GOARCH` [environment variables are correctly set](https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow). Alternatively, [change your OS and architecture](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#using-a-github-hosted-runner).",
126-
severityWarning, false,
123+
severityWarning,
127124
fullVisibility,
128125
noLocation,
129126
)
@@ -155,7 +152,7 @@ func EmitCannotFindPackages(pkgPaths []string) {
155152
"go/autobuilder/package-not-found",
156153
fmt.Sprintf("%d package%s could not be found", numPkgPaths, ending),
157154
"The following packages could not be found. Check that the paths are correct and make sure any private packages can be accessed. If any of the packages are present in the repository then you may need a [custom build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).\n\n"+secondLine,
158-
severityError, false,
155+
severityError,
159156
fullVisibility,
160157
noLocation,
161158
)
@@ -166,7 +163,7 @@ func EmitNewerGoVersionNeeded() {
166163
"go/autobuilder/newer-go-version-needed",
167164
"Newer Go version needed",
168165
"The detected version of Go is lower than the version specified in `go.mod`. [Install a newer version](https://github.com/actions/setup-go#basic).",
169-
severityError, false,
166+
severityError,
170167
fullVisibility,
171168
noLocation,
172169
)
@@ -177,7 +174,7 @@ func EmitGoFilesFoundButNotProcessed() {
177174
"go/autobuilder/go-files-found-but-not-processed",
178175
"Go files were found but not processed",
179176
"[Specify a custom build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages) that includes one or more `go build` commands to build the `.go` files to be analyzed.",
180-
severityError, false,
177+
severityError,
181178
fullVisibility,
182179
noLocation,
183180
)

go/ql/integration-tests/all-platforms/go/diagnostics/build-constraints-exclude-all-go-files/diagnostics.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"internal": false,
32
"markdownMessage": "Make sure the `GOOS` and `GOARCH` [environment variables are correctly set](https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow). Alternatively, [change your OS and architecture](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#using-a-github-hosted-runner).",
43
"severity": "warning",
54
"source": {

go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/diagnostics.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"internal": false,
32
"markdownMessage": "[Specify a custom build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages) that includes one or more `go build` commands to build the `.go` files to be analyzed.",
43
"severity": "error",
54
"source": {

go/ql/integration-tests/all-platforms/go/diagnostics/newer-go-version-needed/diagnostics.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"internal": false,
32
"markdownMessage": "The detected version of Go is lower than the version specified in `go.mod`. [Install a newer version](https://github.com/actions/setup-go#basic).",
43
"severity": "error",
54
"source": {

go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-with-go-mod/diagnostics.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"internal": false,
32
"markdownMessage": "The following packages could not be found. Check that the paths are correct and make sure any private packages can be accessed. If any of the packages are present in the repository then you may need a [custom build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).\n\n`github.com/nosuchorg/nosuchrepo000`, `github.com/nosuchorg/nosuchrepo001`, `github.com/nosuchorg/nosuchrepo002`, `github.com/nosuchorg/nosuchrepo003`, `github.com/nosuchorg/nosuchrepo004` and 105 more",
43
"severity": "error",
54
"source": {

go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-without-go-mod/diagnostics.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"internal": false,
32
"markdownMessage": "The following packages could not be found. Check that the paths are correct and make sure any private packages can be accessed. If any of the packages are present in the repository then you may need a [custom build command](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).\n\n`github.com/linode/linode-docs-theme`",
43
"severity": "error",
54
"source": {

0 commit comments

Comments
 (0)