Files
zeekayandHanzo Dev a4328f359f test: move the fission function fixture into testdata
hello.go is a fission function, not a program: package main with a Handler and
no main. It is uploaded to the builder image by `fission package create --src`
and compiled there, never by this module. Sitting in a normal package it broke
`go build ./...` with "function main is undeclared in the main package".

testdata is the directory Go ignores, so the file still ships to the builder
byte-for-byte while leaving the module build alone.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-28 01:30:56 -07:00

21 lines
382 B
Go

package main
import (
"io"
"log"
"net/http"
)
// Handler is the entry point for this fission function
func Handler(w http.ResponseWriter, r *http.Request) { //nolint:golint,unused,deadcode
bytes, err := io.ReadAll(r.Body)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
_, err = w.Write(bytes)
if err != nil {
log.Fatal(err)
}
}