Skip to content

chore(spanner): replace interface{} with any for statement Params#13865

Open
Zarux wants to merge 1 commit intogoogleapis:mainfrom
Zarux:chore/spanner/replace-interface-with-any
Open

chore(spanner): replace interface{} with any for statement Params#13865
Zarux wants to merge 1 commit intogoogleapis:mainfrom
Zarux:chore/spanner/replace-interface-with-any

Conversation

@Zarux
Copy link

@Zarux Zarux commented Feb 18, 2026

This change is a minor quality of life change mixed with some modernisation.

Using any over interface{} is generally considered the preferred syntax in modern Go.
When creating Params on Statement gopls will suggest map[string]interface{}{} which will then have to be changed to map[string]any{} manually (or with go fix).

I kept the change small to minimize review time, but with the recent go fix changes in 1.26 i would suggest running that to catch everything.

So this PR will make that part the spanner package a smidge more enjoyable to work with as well as modernise the code a bit.

@Zarux Zarux requested review from a team as code owners February 18, 2026 14:26
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Feb 18, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request correctly updates interface{} to any in the spanner package, aligning with modern Go practices. This change improves code readability and developer experience, as noted in the PR description. The changes are minimal and focused, making them easy to review and integrate.

@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 18, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 18, 2026
@rahul2393
Copy link
Contributor

@Zarux Thanks for opening the PR, changes looks good to me, but why only these variables, is there any problem if we make this change for all occurances of interface in client lib?

@Zarux
Copy link
Author

Zarux commented Feb 19, 2026

It shouldn't be problem to change every occurrence to any, however the PR would be significantly bigger. I chose to only change here as statement was where i had annoyance with it not being any so i chose to only change there to minimise the pr size.

I can update the PR to change every occurrence instead if you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants