1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-10-30 23:57:50 +02:00

readPipelineEnv -> Serialize Directly to os.Stdout (#3180)

* Serialize CPE Directly to os.Stdout
This commit is contained in:
tiloKo
2022-01-12 09:17:03 +01:00
committed by GitHub
parent af6a1801ab
commit 24a2340921

View File

@@ -37,13 +37,11 @@ func runReadPipelineEnv() error {
return err
}
bytes, err := json.MarshalIndent(cpe, "", "\t")
if err != nil {
return err
}
_, err = os.Stdout.Write(bytes)
if err != nil {
encoder := json.NewEncoder(os.Stdout)
encoder.SetIndent("", "\t")
if err := encoder.Encode(cpe); err != nil {
return err
}
return nil
}