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
{{ message }}
This repository was archived by the owner on Jul 12, 2025. It is now read-only.
This repository was archived by the owner on Jul 12, 2025. It is now read-only.
invalid field found for struct github.com/jackc/pgtype.Inet's field IPNet: define a valid foreign key for relations or implement the Valuer/Scanner interface #190
CREATE TABLE IF NOT EXISTS merchant (
id SERIAL NOT NULL UNIQUE,
bms_whitelist INET[] NOT NULL,
api_whitelist INET[] NOT NULL,
);
code
type Merchant struct{
Id uint64 `json:"id" gorm:"id"`
BmsWhitelist *pgtype.InetArray `json:"bms_whitelist" gorm:"bms_whitelist"`
ApiWhitelist *pgtype.InetArray `json:"api_whitelist" gorm:"api_whitelist"`
}
when I execute the query statement using gorm
[error] invalid field found for struct github.com/jackc/pgtype.Inet's field IPNet: define a valid foreign key for relations or implement the Valuer/Scanner interface