1.关联1.1.属于//`User`属于`Profile`,`ProfileID`为外键typeUserstruct{gorm.ModelProfileProfileProfileIDint}typeProfilestruct{gorm.ModelNamestring}db.Model(&user).Related(&profile)////SELECT*FROMprof
golang gorm的关系关联实现示例
