[#221] Unify source file naming

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2021-08-20 15:19:49 +03:00
parent a0f59bb348
commit bf3d81f928
8 changed files with 0 additions and 0 deletions

20
api/auth/regexp_utils.go Normal file
View file

@ -0,0 +1,20 @@
package auth
import "regexp"
type regexpSubmatcher struct {
re *regexp.Regexp
}
func (r *regexpSubmatcher) getSubmatches(target string) map[string]string {
matches := r.re.FindStringSubmatch(target)
l := len(matches)
sub := make(map[string]string, l)
for i, name := range r.re.SubexpNames() {
if i > 0 && i <= l {
sub[name] = matches[i]
}
}
return sub
}