8000 Go: Make type param test independent of standard library version by owen-mc · Pull Request #19532 · github/codeql · GitHub
[go: up one dir, main page]

Skip to content

Go: Make type param test independent of standard library version #19532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025

Conversation

owen-mc
Copy link
Contributor
@owen-mc owen-mc commented May 20, 2025

This will make the test results not depend on the version of the standard library being used, which means we don't have to update it with each new release.

@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 01:19
@owen-mc owen-mc added the no-change-note-required This PR does not need a change note label May 20, 2025
@owen-mc owen-mc requested a review from a team as a code owner May 20, 2025 01:19
@github-actions github-actions bot added the Go label May 20, 2025
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adjusts the type parameter test so it only counts entities with source locations, preventing standard library additions from affecting results.

  • Adds an exists(ty.getLocation()) check to the query predicate to filter out stdlib types without location metadata.
  • Cleans up the expected output by removing entries for standard library functions.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
go/ql/test/library-tests/semmle/go/Function/TypeParamType.ql Added location-existence filter and comment explaining it
go/ql/test/library-tests/semmle/go/Function/TypeParamType.expected Removed unsupported standard library entries

This will make the test results not depend on the version of the
standard library being used, which means we don't have to update it with
each new release.
@owen-mc owen-mc force-pushed the go/make-test-version-independent branch from 80999d9 to f6f6a5c Compare May 20, 2025 01:25
Copy link
Member
@mbg mbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finding a neat solution for this! Makes sense to me and should make our lives easier going forward 🚀

@owen-mc owen-mc merged commit 164cfaf into github:main May 28, 2025
11 checks passed
@owen-mc owen-mc deleted the go/make-test-version-independent branch May 28, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Go no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0