(fldDescs []pgconn.FieldDescription)
| 750 | } |
| 751 | |
| 752 | func joinFieldNames(fldDescs []pgconn.FieldDescription) string { |
| 753 | switch len(fldDescs) { |
| 754 | case 0: |
| 755 | return "" |
| 756 | case 1: |
| 757 | return fldDescs[0].Name |
| 758 | } |
| 759 | |
| 760 | totalSize := len(fldDescs) - 1 // Space for separator bytes. |
| 761 | for _, d := range fldDescs { |
| 762 | totalSize += len(d.Name) |
| 763 | } |
| 764 | var b strings.Builder |
| 765 | b.Grow(totalSize) |
| 766 | b.WriteString(fldDescs[0].Name) |
| 767 | for _, d := range fldDescs[1:] { |
| 768 | b.WriteByte(0) // Join with NUL byte as it's (presumably) not a valid column character. |
| 769 | b.WriteString(d.Name) |
| 770 | } |
| 771 | return b.String() |
| 772 | } |
| 773 | |
| 774 | func computeNamedStructFields( |
| 775 | fldDescs []pgconn.FieldDescription, |
no test coverage detected