refactor: Use string-backed enums consistently

This commit is contained in:
Felicitas Pojtinger
2021-12-15 21:11:18 +01:00
parent 6bc9c84579
commit 8d922ccd81
7 changed files with 19 additions and 29 deletions
+1 -15
View File
@@ -24,21 +24,7 @@ func headerToCSV(hdr *models.Header) []string {
}
func headerEventToCSV(event *config.HeaderEvent) []string {
headerType := "unknown"
switch event.Type {
case config.HeaderEventTypeArchive:
headerType = "archive"
case config.HeaderEventTypeDelete:
headerType = "delete"
case config.HeaderEventTypeMove:
headerType = "move"
case config.HeaderEventTypeRestore:
headerType = "restore"
case config.HeaderEventTypeUpdate:
headerType = "update"
}
return append([]string{headerType, fmt.Sprintf("%v", event.Indexed)}, headerToCSV(event.Header)...)
return append([]string{event.Type, fmt.Sprintf("%v", event.Indexed)}, headerToCSV(event.Header)...)
}
type Logger struct {