Golang compilation problem: gorm.io/plugin/[email protected]/dbresolver.go:139:18: cannot use map[string]gorm.Stmt{}...

When golang executed sh buildto compile the project, an error was foundpkg/mod/gorm.io/plugin/[email protected]/dbresolver.go:139:18: cannot use map[string]gorm.Stmt{} (value of type map[string]gorm.Stmt) as type map[string]*gorm.Stmt in struct literal

The solution is: execute go get gorm.io/plugin/dbresolver@latestto gorm.io/plugin/dbresolverupgrade to the latest version, and then execute to go mod tidyupdate go.mod

Execute again sh build, there should be no error

Reference: [Question] cannot use map[string]gorm.Stmt{}

Guess you like

Origin blog.csdn.net/qq_41767116/article/details/130235099