lib/config: Change folder type attribute to a FolderType type

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3032
This commit is contained in:
Jakob Borg
2016-05-04 11:26:36 +00:00
committed by Audrius Butkevicius
parent eabd2fc936
commit 09832abe50
7 changed files with 48 additions and 11 deletions

View File

@@ -104,7 +104,7 @@ type folderFactory func(*Model, config.FolderConfiguration, versioner.Versioner)
var (
symlinkWarning = stdsync.Once{}
folderFactories = make(map[string]folderFactory, 0)
folderFactories = make(map[config.FolderType]folderFactory, 0)
)
// NewModel creates and starts a new model. The model starts in read-only mode,
@@ -176,7 +176,7 @@ func (m *Model) StartFolder(folder string) {
folderFactory, ok := folderFactories[cfg.Type]
if !ok {
panic("unknown folder type " + cfg.Type)
panic(fmt.Sprintf("unknown folder type 0x%x", cfg.Type))
}
var ver versioner.Versioner