MCPcopy Create free account
hub / github.com/aws-samples/aws-lambda-extensions / writeToFileSystem

Function writeToFileSystem

go-example-ipc-extension/ipc/ipc.go:19–34  ·  view source on GitHub ↗
(filename string, data string)

Source from the content-addressed store, hash-verified

17}
18
19func writeToFileSystem(filename string, data string) {
20 file, err := os.Create(filename)
21 if err != nil {
22 panic(err)
23 }
24 defer file.Close()
25
26 _, err = io.WriteString(file, data)
27 if err != nil {
28 panic(err)
29 }
30 err = file.Sync()
31 if err != nil {
32 panic(err)
33 }
34}
35
36func startHTTPServer(port string) {
37 http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {

Callers 1

StartFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected