add override functionallity
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
@@ -69,3 +71,13 @@ func RunElevatedCommand(command string, service string) (string, error) {
|
||||
}
|
||||
return string(output), nil
|
||||
}
|
||||
|
||||
func IndentJson(body []byte) ([]byte, error) {
|
||||
newBody := new([]byte)
|
||||
unmarshaledBody := bytes.NewBuffer(*newBody)
|
||||
err := json.Indent(unmarshaledBody, body, "", " ")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return unmarshaledBody.Bytes(), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user