Create a gist now

Instantly share code, notes, and snippets.

anonymous /main.js
Created Nov 24, 2014

What would you like to do?
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