go1.16 and embed

This commit is contained in:
ston1th 2021-02-18 22:36:16 +01:00
commit 82fd34b288
42 changed files with 95 additions and 1236 deletions

View file

@ -28,6 +28,7 @@ var reservedURIs = []string{
core.UsersURI,
core.UserURI,
core.ViewURI,
core.StaticURI,
}
var reservedNames []string

View file

@ -54,6 +54,9 @@ func (db *DB) SectionExists(section string) error {
func (db *DB) CreateSection(section string, members []string, user bool) error {
section = userRe.ReplaceAllString(section, "")
if _, ok := core.Contains(section, reservedNames); ok {
return fmt.Errorf("%s: %s", errNameReserved, section)
}
if err := db.SectionExists(section); err == nil {
return errSectionExists
}