Skip to content

Commit 6ae50bd

Browse files
authored
fix: add logging to test func, to try to debug php conformance errors (#187)
1 parent 124b302 commit 6ae50bd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

testdata/testfuncgo.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
package function
33

44
import (
5+
"fmt"
56
"io/ioutil"
67
"net/http"
8+
"os"
79
)
810

911
// HTTP is a simple HTTP function that writes the request body to the response body.
@@ -13,6 +15,11 @@ func HTTP(w http.ResponseWriter, r *http.Request) {
1315
w.WriteHeader(http.StatusInternalServerError)
1416
return
1517
}
18+
if curr_dir, err := os.Getwd(); err != nil {
19+
fmt.Printf("Failed to get working directory: %s", err)
20+
} else {
21+
fmt.Printf("Writing output json to: %s", curr_dir)
22+
}
1623
if err := ioutil.WriteFile("function_output.json", body, 0644); err != nil {
1724
w.WriteHeader(http.StatusInternalServerError)
1825
return

0 commit comments

Comments
 (0)