chore(spanner): replace interface{} with any for statement Params#13865
chore(spanner): replace interface{} with any for statement Params#13865Zarux wants to merge 1 commit intogoogleapis:mainfrom
interface{} with any for statement Params#13865Conversation
There was a problem hiding this comment.
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.
|
@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? |
|
It shouldn't be problem to change every occurrence to I can update the PR to change every occurrence instead if you want |
This change is a minor quality of life change mixed with some modernisation.
Using
anyoverinterface{}is generally considered the preferred syntax in modern Go.When creating
ParamsonStatementgopls will suggestmap[string]interface{}{}which will then have to be changed tomap[string]any{}manually (or withgo fix).I kept the change small to minimize review time, but with the recent
go fixchanges 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.