SQLTemplate: Swap the IFace with the concrete struct (#92008)

This commit is contained in:
Ryan McKinley
2024-08-16 15:12:37 +03:00
committed by GitHub
parent 32a5651e96
commit f432a1713b
19 changed files with 271 additions and 271 deletions
+6 -6
View File
@@ -5,12 +5,12 @@ import (
"reflect"
)
type ScanDest struct {
type scanDest struct {
values []any
colNames []string
}
func (i *ScanDest) Into(v reflect.Value, colName string) (string, error) {
func (i *scanDest) Into(v reflect.Value, colName string) (string, error) {
if !v.IsValid() || !v.CanAddr() || !v.Addr().CanInterface() {
return "", fmt.Errorf("invalid or unaddressable value: %v", colName)
}
@@ -21,19 +21,19 @@ func (i *ScanDest) Into(v reflect.Value, colName string) (string, error) {
return colName, nil
}
func (i *ScanDest) Reset() {
func (i *scanDest) Reset() {
i.values = nil
}
func (i *ScanDest) GetScanDest() []any {
func (i *scanDest) GetScanDest() []any {
return i.values
}
func (i *ScanDest) GetColNames() []string {
func (i *scanDest) GetColNames() []string {
return i.colNames
}
type ScanDestIface interface {
type ScanDest interface {
Into(v reflect.Value, colName string) (string, error)
GetScanDest() []any
GetColNames() []string