map initialization tweak
@@ -113,7 +113,10 @@ func decodeHexSuffix(s string, length int) ([]byte, error) {
var SupportedFormats []string
// FormatterFactories maps known block formatters to their factory functions.
-var FormatterFactories = map[string]func(f FormattingOptions) (Formatter, error){
+var FormatterFactories map[string]func(f FormattingOptions) (Formatter, error)
+
+func init() {
+ FormatterFactories = map[string]func(f FormattingOptions) (Formatter, error){
"TESTONLY_MD5": func(f FormattingOptions) (Formatter, error) {
return &unencryptedFormat{computeHash(md5.New, md5.Size)}, nil
},
@@ -131,12 +134,12 @@ func decodeHexSuffix(s string, length int) ([]byte, error) {
},
}
-func init() {
for k := range FormatterFactories {
if !strings.HasPrefix(k, "TESTONLY_") {
SupportedFormats = append(SupportedFormats, k)
}
}
+
sort.Strings(SupportedFormats)
}
