Skip to content
Advertisement

Is it possible to omit FieldID in struct when using gorm?

Looking at an example from their documentation:

CompanyID field seems rather redundant. Is it possible to get rid of it using some tags on Company field instead?

Advertisement

Answer

Changing User definition like this did the trick:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement