Created
November 24, 2014 22:25
-
-
Save anonymous/b9d76a9b342945793673 to your computer and use it in GitHub Desktop.
AWS Lambda Functions in Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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