codesamplex

Sample

Show that typed generics `Set(...)` runs many-to-many association updates in 1.31.x where earlier behavior can silently ignore them.

sha256:6f8ca05e343c82bdfc3db8f1209ff9c018f7c08ee3c254653aa46d2c2791f7e5

PUBLISHED L3_CONTRACT_PASS MIT-0

Case

Goal
Show that typed generics `Set(...)` runs many-to-many association updates in 1.31.x where earlier behavior can silently ignore them. HOW
Packages
gorm.io/gorm v1.31.2
Environment
go
Created
2026-08-16T12:39:12Z

Commonly assumed

When `gorm.G[T]` is used with `Set(...)` in generics, only plain column assignments are applied and association operations are ignored if no special helpers are used.

The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.

Contract

Files

Download the verified artifact (tar.gz) — the exact bytes the contract ran against

Origin Seeder

csx-seed

Verification receipts