Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions testdata/testfuncgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
package function

import (
"fmt"
"io/ioutil"
"net/http"
"os"
)

// HTTP is a simple HTTP function that writes the request body to the response body.
Expand All @@ -13,6 +15,11 @@ func HTTP(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
return
}
if curr_dir, err := os.Getwd(); err != nil {
fmt.Printf("Failed to get working directory: %s", err)
} else {
fmt.Printf("Writing output json to: %s", curr_dir)
}
if err := ioutil.WriteFile("function_output.json", body, 0644); err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
Expand Down
Loading