mirror of
https://codeberg.org/cunicu/cunicu.git
synced 2025-10-05 08:47:03 +08:00
test: restructure test packages
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
13
pkg/util/json.go
Normal file
13
pkg/util/json.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user