Minor code improvements

This commit is contained in:
Aleksandr Kretov 2018-05-31 00:10:24 +10:00
parent db9f275317
commit ba46288041

View File

@ -279,12 +279,12 @@ func (scope *Scope) AddToVars(value interface{}) string {
// WrapPlaceholder returns a field's value placeholder wrapped into wrapper function // WrapPlaceholder returns a field's value placeholder wrapped into wrapper function
func (scope *Scope) WrapPlaceholder(field *Field, placeholder string) string { func (scope *Scope) WrapPlaceholder(field *Field, placeholder string) string {
if wr, exists := field.TagSettings["WRAPPER"]; !exists || len(wr) == 0 { if wr, exists := field.TagSettings["WRAPPER"]; exists || len(wr) > 0 {
return placeholder
} else {
// Wrap a placeholder into wrapper // Wrap a placeholder into wrapper
return strings.Replace(wr, "?", placeholder, 1) return strings.Replace(wr, "?", placeholder, 1)
} }
// Nothing to do
return placeholder
} }
// SelectAttrs return selected attributes // SelectAttrs return selected attributes