feat: arr and map methods now output json to make the read, mutate, write loop easier.
This commit is contained in:
1 parent
aa3d497139
commit
1892fd9e8a
2 files changed
+12
-2
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package hmsecrets
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -20,7 +21,11 @@ var getArrCmd = &cobra.Command{
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(secret)
|
||||
secretJSON, err := json.MarshalIndent(secret, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(string(secretJSON))
|
||||
return nil
|
||||
},
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package hmsecrets
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -20,7 +21,11 @@ var getMapCmd = &cobra.Command{
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(secret)
|
||||
secretJSON, err := json.MarshalIndent(secret, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(string(secretJSON))
|
||||
return nil
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user