2
0

Make use of strings.Cut

This commit is contained in:
Ville Skyttä
2023-10-04 20:41:55 +03:00
parent 163eb68866
commit 24ed0e4257
6 changed files with 25 additions and 33 deletions
+1 -1
View File
@@ -697,7 +697,7 @@ func (rs *namedStructRowScanner) appendScanTargets(dstElemValue reflect.Value, s
} else {
dbTag, dbTagPresent := sf.Tag.Lookup(structTagKey)
if dbTagPresent {
dbTag = strings.Split(dbTag, ",")[0]
dbTag, _, _ = strings.Cut(dbTag, ",")
}
if dbTag == "-" {
// Field is ignored, skip it.