Skip to content

Instantly share code, notes, and snippets.

@gnagel
Forked from anonymous/main.js
Last active September 10, 2015 18:09
Show Gist options
  • Save gnagel/e31a1fd502d50324c0bc to your computer and use it in GitHub Desktop.
Save gnagel/e31a1fd502d50324c0bc 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