Gorm gorm通过Raw查询,然后Scan到[]map[string]interface{} 字段名转驼峰,通过NamingStrategy可以实现吗

package main

import ( "log"

"github.com/iancoleman/strcase"
"gorm.io/driver/mysql"
"gorm.io/gorm"
"gorm.io/gorm/schema"

)

type CamelCaseNamingStrategy struct { schema.NamingStrategy }

func (s CamelCaseNamingStrategy) ColumnName(tableName, fieldName string) string { return strcase.ToLowerCamel(fieldName) }

func (s CamelCaseNamingStrategy) TableName(className string) string { return strcase.ToSnake(className) }

func main() { db, err := gorm.Open( mysql.Open("dev:dev@tcp(192.168.10.1:3306)/3t_dev?charset=utf8&parseTime=True&loc=Local"), &gorm.Config{ PrepareStmt: true, }, ) if err != nil { log.Fatal(err) }

db.NamingStrategy = CamelCaseNamingStrategy{}

var m []map[string]interface{}
db.Raw("select * from user limit 1").Scan(&m)

for _, item := range m {
    for k, v := range item {
        log.Println(k, v) //  希望 field:user_name  to  UserName,但是并没有转换
    }
}

}

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking

Comment From: a631807682

It's funny, but it's lying and doesn't actually support