Pretty print json main config
continuous-integration/drone/tag Build is passing
Details
continuous-integration/drone/tag Build is passing
Details
This commit is contained in:
parent
6e1fd8bfa9
commit
30d50e8be2
11
main.go
11
main.go
|
@ -151,11 +151,16 @@ func main() {
|
|||
log.Fatal(err)
|
||||
}
|
||||
|
||||
buff = nil
|
||||
if buff, err = json.Marshal(&lib.Project); err != nil {
|
||||
//buff = nil
|
||||
var buffer bytes.Buffer
|
||||
err = lib.PrettyEncode(&lib.Project, &buffer)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err = os.WriteFile(filepath.Join(dir, fmt.Sprintf("%s.json", filenameWithoutExt)), buff, 0755); err != nil {
|
||||
/*if buff, err = json.Marshal(&lib.Project); err != nil {
|
||||
log.Fatal(err)
|
||||
}*/
|
||||
if err = os.WriteFile(filepath.Join(dir, fmt.Sprintf("%s.json", filenameWithoutExt)), buffer.Bytes(), 0755); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue