mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-20 20:16:26 +02:00
new extensions
This commit is contained in:
parent
c55d472a7b
commit
e9c952216b
3 changed files with 9 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue