MCPcopy Create free account
hub / github.com/LissaGreense/GO4SQL / getColumWidths

Function getColumWidths

engine/table.go:149–167  ·  view source on GitHub ↗
(columns []*Column)

Source from the content-addressed store, hash-verified

147}
148
149func getColumWidths(columns []*Column) []int {
150 widths := make([]int, 0)
151
152 for iColumn := range columns {
153 maxLength := len(columns[iColumn].Name)
154 for iRow := range columns[iColumn].Values {
155 valueLength := len(columns[iColumn].Values[iRow].ToString())
156 if columns[iColumn].Type.Literal == token.TEXT {
157 valueLength += 2 // double '
158 }
159 if valueLength > maxLength {
160 maxLength = valueLength
161 }
162 }
163 widths = append(widths, maxLength)
164 }
165
166 return widths
167}

Callers 1

ToStringMethod · 0.85

Calls 1

ToStringMethod · 0.65

Tested by

no test coverage detected