ConfigProtect: support annotation without initial /

This commit is contained in:
Daniele Rondina 2020-11-07 11:39:13 +01:00
parent 6819a28f07
commit e5f44eee09

View File

@ -48,6 +48,9 @@ type ConfigProtect struct {
}
func NewConfigProtect(annotationDir string) *ConfigProtect {
if len(annotationDir) > 0 && annotationDir[0:1] != "/" {
annotationDir = "/" + annotationDir
}
return &ConfigProtect{
AnnotationDir: annotationDir,
MapProtected: make(map[string]bool, 0),