Suppose in database/sql/driver/driver.go file, The interface Rows will define The functions columns which returns a string array. I want to return one more parameter to it.
Can we extend it and add a new function or override the existing function?
Just to nuance this a bit… sounds like you are writing your own driver, so you have control over how it works. Then two things:
a) you can document access to your driver that does what you want. For example, the Postgres driver’s Listener feature [here].
b) you can offer the functionality by adding it to your interface and making your driver implement both interfaces. In this example, the standard would be like “x” and yours would be like “y”