Skip to content

Instantly share code, notes, and snippets.

Created November 24, 2014 22:25
Show Gist options
  • Save anonymous/b9d76a9b342945793673 to your computer and use it in GitHub Desktop.
Save anonymous/b9d76a9b342945793673 to your computer and use it in GitHub Desktop.
AWS Lambda Functions in Go
var exec = require('child_process').exec;
console.log('Loading event');
exports.handler = function(event, context) {
eventJSON = JSON.stringify(event);
exec('./test ' + eventJSON, function callback(error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if(error !== null) {
console.log('exec error: ' + error);
}
context.done(null, "Hello World");
});
}
package main
import (
"fmt"
"os"
)
func main() {
fmt.Printf("HELLO FROM GOLANG WITH ARGS %v", os.Args)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment