new extensions

This commit is contained in:
Brian Seymour 2018-09-20 22:17:46 -05:00
parent c55d472a7b
commit e9c952216b
3 changed files with 9 additions and 2 deletions

View file

@ -79,8 +79,14 @@ func Execute(res http.ResponseWriter, req *http.Request) {
}
func launch(inbound2 inbound, res http.ResponseWriter){
var ext string = "code";
if inbound2.Language == "go" {
ext = "go"
}
// write the code to temp dir
filename := fmt.Sprintf("/tmp/%d.code", time.Now().UnixNano())
filename := fmt.Sprintf("/tmp/%d." + ext, time.Now().UnixNano())
ioutil.WriteFile(filename, []byte(inbound2.Source), 0644)