@@ -89,22 +89,18 @@ func manageOutpostResources(adminAPIKey string, serverURL string) {
8989 log .Fatalf ("Failed to publish event: %v\n " , err )
9090 }
9191
92- if err == nil {
93- log .Println ("Event published successfully" )
94- // TODO: result should have an ID property
95- if publishRes != nil && publishRes .HTTPMeta .Response != nil && publishRes .HTTPMeta .Response .Body != nil {
96- bodyBytes , err := io .ReadAll (publishRes .HTTPMeta .Response .Body )
97- if err != nil {
98- log .Printf ("Error reading publish response body: %v" , err )
99- } else {
100- log .Printf ("Publish response body: %s" , string (bodyBytes ))
101- }
102- _ = publishRes .HTTPMeta .Response .Body .Close ()
103- } else if publishRes != nil {
104- log .Printf ("Publish response (raw SDK response struct): %+v" , publishRes )
92+ log .Println ("Event published successfully" )
93+ // TODO: result should have an ID property
94+ if publishRes != nil && publishRes .HTTPMeta .Response != nil && publishRes .HTTPMeta .Response .Body != nil {
95+ bodyBytes , err := io .ReadAll (publishRes .HTTPMeta .Response .Body )
96+ if err != nil {
97+ log .Printf ("Error reading publish response body: %v" , err )
98+ } else {
99+ log .Printf ("Publish response body: %s" , string (bodyBytes ))
105100 }
106- } else {
107- log .Printf ("Event publishing failed: %v\n " , err )
101+ _ = publishRes .HTTPMeta .Response .Body .Close ()
102+ } else if publishRes != nil {
103+ log .Printf ("Publish response (raw SDK response struct): %+v" , publishRes )
108104 }
109105
110106 log .Println ("--- Example finished ---" )
0 commit comments