When golang executed sh build
to 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@latest
to gorm.io/plugin/dbresolver
upgrade to the latest version, and then execute to go mod tidy
update go.mod
Execute again sh build
, there should be no error
Reference: [Question] cannot use map[string]gorm.Stmt{}