MCPcopy Create free account
hub / github.com/gogs/gogs / getRuleBody

Function getRuleBody

internal/form/form.go:64–71  ·  view source on GitHub ↗
(field reflect.StructField, prefix string)

Source from the content-addressed store, hash-verified

62}
63
64func getRuleBody(field reflect.StructField, prefix string) string {
65 for _, rule := range strings.Split(field.Tag.Get("binding"), ";") {
66 if strings.HasPrefix(rule, prefix) {
67 return rule[len(prefix) : len(rule)-1]
68 }
69 }
70 return ""
71}
72
73func getSize(field reflect.StructField) string {
74 return getRuleBody(field, "Size(")

Callers 4

getSizeFunction · 0.85
getMinSizeFunction · 0.85
getMaxSizeFunction · 0.85
getIncludeFunction · 0.85

Calls 2

SplitMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected