MakeLabeledTuple constructs a new instance of a TupleFamily type with the given field types and labels.
(contents []*T, labels []string)
| 1057 | // MakeLabeledTuple constructs a new instance of a TupleFamily type with the |
| 1058 | // given field types and labels. |
| 1059 | func MakeLabeledTuple(contents []*T, labels []string) *T { |
| 1060 | if len(contents) != len(labels) && labels != nil { |
| 1061 | panic(errors.AssertionFailedf( |
| 1062 | "tuple contents and labels must be of same length: %v, %v", contents, labels)) |
| 1063 | } |
| 1064 | return &T{InternalType: InternalType{ |
| 1065 | Family: TupleFamily, |
| 1066 | Oid: oid.T_record, |
| 1067 | TupleContents: contents, |
| 1068 | TupleLabels: labels, |
| 1069 | Locale: &emptyLocale, |
| 1070 | }} |
| 1071 | } |
| 1072 | |
| 1073 | // Family specifies a group of types that are compatible with one another. Types |
| 1074 | // in the same family can be compared, assigned, etc., but may differ from one |