From d809e06791c6b6c8844b103a8323b4be7f955174 Mon Sep 17 00:00:00 2001 From: Seohyun Lee Date: Sat, 1 Jan 2022 17:33:23 +0900 Subject: [PATCH] feat: add support for golang & rust --- Dockerfile | 7 ++++ res/test.html | 93 ++++++++++++++++---------------------------- src/runner/golang.ts | 16 ++++++++ src/runner/index.ts | 4 +- 4 files changed, 60 insertions(+), 60 deletions(-) create mode 100644 src/runner/golang.ts diff --git a/Dockerfile b/Dockerfile index 0e91e8c..5bd6cb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,13 @@ RUN java -version RUN apk add rust RUN rustc --version +# Install Go +RUN apk add go +RUN mkdir /tmp/gocache +RUN chmod 777 /tmp/gocache +ENV GOROOT /usr/lib/go +ENV GOCACHE /tmp/gocache +ENV PATH /go/bin:$PATH # Copy files & Install requirements RUN addgroup execute diff --git a/res/test.html b/res/test.html index aaa963d..5954fb1 100644 --- a/res/test.html +++ b/res/test.html @@ -137,6 +137,15 @@ CP: 'Compiling', RUN: 'Running', } + const supportedLanguages = [ + 'C', + 'CPP', + 'PYTHON3', + 'PYPY3', + 'JAVA', + 'RUST', + 'GO', + ] const ext = { PYTHON3: 'py', PYPY3: 'py', @@ -144,6 +153,7 @@ C: 'c', JAVA: 'java', RUST: 'rs', + GO: 'go', } const exampleCode = { @@ -202,6 +212,17 @@ }; println!("{}", number_a + number_b); +}`, + GO: `package main + +import ( +\t"fmt" +) + +func main() { +\tvar a, b int +\tfmt.Scanf("%d %d", &a, &b) +\tfmt.Println(a+b) }`, } @@ -358,7 +379,7 @@

State

], }, timeLimit: 2000, - memoryLimit: 100, + memoryLimit: 1000, }), }) } @@ -373,6 +394,17 @@

State

} document.addEventListener('DOMContentLoaded', () => { + for (let i of supportedLanguages) { + document.getElementById('supportedLang').innerHTML += `
  • + + ${i} +
  • ` + } setInterval(() => { if (document.documentElement.scrollTop) document @@ -482,64 +514,7 @@

    Problem

    - +