mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-02 20:16:15 -04:00
Use any instead of interface
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
8153390a57
commit
29206ac845
10 changed files with 19 additions and 19 deletions
|
@ -76,7 +76,7 @@ func (h *Handler) Write(name string, data []byte, options Option) error {
|
|||
|
||||
// ReadJSON reads a JSON file from name and unmarshals it into the content interface.
|
||||
// The interface content must be a pointer to a JSON marchalable object.
|
||||
func (h *Handler) ReadJSON(name string, content interface{}) error {
|
||||
func (h *Handler) ReadJSON(name string, content any) error {
|
||||
data, err := h.Read(name)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -85,7 +85,7 @@ func (h *Handler) ReadJSON(name string, content interface{}) error {
|
|||
}
|
||||
|
||||
// WriteJSON marshals the content interface to JSON and writes it to the path with the given name.
|
||||
func (h *Handler) WriteJSON(name string, content interface{}, options Option) error {
|
||||
func (h *Handler) WriteJSON(name string, content any, options Option) error {
|
||||
jsonData, err := json.MarshalIndent(content, "", "\t")
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue