Closed mathiasHillmann closed 3 years ago
I have the function coolFunction(arg1 coolStruct) of which the coolStruct is composed of the following fields:
coolFunction(arg1 coolStruct)
coolStruct
type coolStruct struct { id pgtype.Int4 foo pgtype.Numeric name pgtype.Text }
How can I assign value to the pgtype.* fields for testing?
pgtype.*
All the fields are public. You can directly initialize them. e.g. s.id = pgtype.Int4{Int: 42, Status: pgtype.Present} or use the Set method.
s.id = pgtype.Int4{Int: 42, Status: pgtype.Present}
Set
I have the function
coolFunction(arg1 coolStruct)
of which thecoolStruct
is composed of the following fields:How can I assign value to the
pgtype.*
fields for testing?