perf: use viper as source for format

This commit is contained in:
Antoine Aflalo
2024-08-27 15:32:05 -04:00
parent 85cefbe8b3
commit 7d824d2aa3
2 changed files with 16 additions and 6 deletions

View File

@@ -29,3 +29,14 @@ func ListAll() []string {
}
return formats
}
func FindConversionFormat(format string) ConversionFormat {
for convFormat, names := range CommandValue {
for _, name := range names {
if name == format {
return convFormat
}
}
}
return DefaultConversion
}