MCPcopy Index your code
hub / github.com/mathaou/termdbms / cleanHeader

Function cleanHeader

tuiutil/csv2sql.go:176–202  ·  view source on GitHub ↗
(headField string)

Source from the content-addressed store, hash-verified

174}
175
176func cleanHeader(headField string) string {
177 // ok - remove any spaces and replace with _
178 headField = strings.Replace(headField, " ", "_", -1)
179 // ok - remove any | and replace with _
180 headField = strings.Replace(headField, "|", "_", -1)
181 // ok - remove any - and replace with _
182 headField = strings.Replace(headField, "-", "_", -1)
183 // ok - remove any + and replace with _
184 headField = strings.Replace(headField, "+", "_", -1)
185 // ok - remove any @ and replace with _
186 headField = strings.Replace(headField, "@", "_", -1)
187 // ok - remove any # and replace with _
188 headField = strings.Replace(headField, "#", "_", -1)
189 // ok - remove any / and replace with _
190 headField = strings.Replace(headField, "/", "_", -1)
191 // ok - remove any \ and replace with _
192 headField = strings.Replace(headField, "\\", "_", -1)
193 // ok - remove any : and replace with _
194 headField = strings.Replace(headField, ":", "_", -1)
195 // ok - remove any ( and replace with _
196 headField = strings.Replace(headField, "(", "_", -1)
197 // ok - remove any ) and replace with _
198 headField = strings.Replace(headField, ")", "_", -1)
199 // ok - remove any ' and replace with _
200 headField = strings.Replace(headField, "'", "_", -1)
201 return headField
202}

Callers 1

ConvertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected