mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
common: remove MarshalJSON helpers for mapstructure
They are not needed anymore since we don't exchange configuration files
using JSON, since baac495b9c.
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"reflect"
|
||||
@@ -234,12 +233,3 @@ func ParametrizedConfigurationMarshalYAML[OuterConfiguration any, InnerConfigura
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// ParametrizedConfigurationMarshalJSON undoes ParametrizedConfigurationUnmarshallerHook().
|
||||
func ParametrizedConfigurationMarshalJSON[OuterConfiguration any, InnerConfiguration any](oc OuterConfiguration, innerConfigurationMap map[string](func() InnerConfiguration)) ([]byte, error) {
|
||||
result, err := ParametrizedConfigurationMarshalYAML(oc, innerConfigurationMap)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return json.Marshal(result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user