Minor code improvements
This commit is contained in:
parent
db9f275317
commit
ba46288041
6
scope.go
6
scope.go
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user