test: restructure test packages

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel
2022-08-31 14:21:54 +02:00
parent 82ca0f4146
commit ef8be95fcc
52 changed files with 227 additions and 105 deletions

13
pkg/util/json.go Normal file
View File

@@ -0,0 +1,13 @@
package util
import "encoding/json"
func ReIndentJSON(j []byte, prefix, indent string) ([]byte, error) {
u := map[string]any{}
if err := json.Unmarshal(j, &u); err != nil {
return nil, err
}
return json.MarshalIndent(u, prefix, indent)
}