This gist has an example SAM template.yaml file and a main.go to demonstrate how to write Golang binaries that operate within the AWS Lambda Custom Runtime environment.
From the AWS documentation on custom runtimes, all the examples in each respective shell script/language are provided as non-terminating loop-type processes. The reason why this is the case is quite unclear. When writing a non-custom runtime function, such as a python program in a "regular" lambda function, the function is written to run and then terminate.
When writing a custom runtime, however, the script or binary should be written to run in perpetuity, continuously checking the next invocation for a new event. If a new event is not available, then the program execution is frozen - and then restarted upon the invocation of a new lambda function.