You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the return value type of the custom query method in the Model Interface is set to *[]gen.T, the generated code reports an error. The document clearly states that the return value type is allowed to be set to *[]gen.T.
typeQuerierinterface {
// SELECT * FROM @@table WHERE id=@idGetByID(idint) (gen.T, error) // returns struct and error// SELECT * FROM @@table WHERE id=@idGetByID(idint) gen.T// returns data as struct// SELECT * FROM @@table WHERE id=@idGetByID(idint) (gen.M, error) // returns map and error// INSERT INTO @@table (name, age) VALUES (@name, @age)InsertValue(namestring, ageint) (gen.RowsAffected, error) // returns affected rows count and error
}
GORM Playground Link
go-gorm/playground#1
Description
When the return value type of the custom query method in the Model Interface is set to *[]gen.T, the generated code reports an error. The document clearly states that the return value type is allowed to be set to *[]gen.T.
doc
return value
version
code
error
The text was updated successfully, but these errors were encountered: