{"id":21274489,"url":"https://github.com/ncbrown1/go-playground","last_synced_at":"2026-04-18T00:02:26.939Z","repository":{"id":85899727,"uuid":"87325213","full_name":"ncbrown1/go-playground","owner":"ncbrown1","description":"Reimplementation of the Go playground in Go to run via the browser (javascript + go): [https://play.golang.org] without the restrictions (but requiring a login)","archived":false,"fork":false,"pushed_at":"2017-06-09T11:38:13.000Z","size":1744,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-06T11:43:21.848Z","etag":null,"topics":["code","communication","golang","javascript","react","reimplementation","websocket"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ncbrown1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-05T15:21:18.000Z","updated_at":"2018-10-01T01:36:09.000Z","dependencies_parsed_at":"2023-05-30T07:30:40.086Z","dependency_job_id":null,"html_url":"https://github.com/ncbrown1/go-playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ncbrown1/go-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncbrown1%2Fgo-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncbrown1%2Fgo-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncbrown1%2Fgo-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncbrown1%2Fgo-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ncbrown1","download_url":"https://codeload.github.com/ncbrown1/go-playground/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncbrown1%2Fgo-playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code","communication","golang","javascript","react","reimplementation","websocket"],"created_at":"2024-11-21T09:22:33.695Z","updated_at":"2026-04-18T00:02:26.924Z","avatar_url":"https://github.com/ncbrown1.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Playground (Redux)\n\n[UCSB](http://cs.ucsb.edu) - [CS 263](http://cs.ucsb.edu/~cs263) - [Chandra Krintz](http://www.cs.ucsb.edu/~ckrintz/) - Spring 2017\n\nThis is a reimplementation of the Go playground [https://play.golang.org] in Go to run via the browser (javascript + go) without the\nrestrictions of the original (but requiring a login to bypass those restrictions).\n\n# Getting Started\n\nThis package uses Go and Node.JS-based packages in its implementation. Ensure you have those tools installed.\n\nGo installation: [https://golang.org/doc/install](https://golang.org/doc/install)\\\nNode.JS/NPM: [https://nodejs.org/en/download/package-manager/](https://nodejs.org/en/download/package-manager/)\n\nNote that all development for Go-related packages should take place in your `$GOPATH/src` directory. If you have not set\nup your `$GOPATH`, be sure to create a new empty directory somewhere and export that directory as the value. For example:\n\n```\n$ echo $GOPATH\n\n$ mkdir $HOME/go\n$ export GOPATH=$HOME/go\n$ echo $GOPATH\n/Users/ncbrown/go\n$ mkdir $GOPATH/src\n```\n\nAlso be sure to create a directory `$GOPATH/src` to hold your go code. This is where you should be working when developing\nin Go.\n\nIf you are unfamiliar with Go, you may be used to retrieving a project from github.com via `git clone`. However, the Go\necosystem is slightly different. You will want to retrieve this project via `go get github.com/ncbrown1/go-playground`,\nwhich will check out this repository under `$GOPATH/src/github.com/ncbrown1/go-playground`.\n\nFor package management in Go and Node.JS, we use [govendor](https://github.com/kardianos/govendor) and\n[Yarn](https://yarnpkg.com), respectively. Ensure you have those tools installed.\n\ngovendor: `go get -u github.com/kardianos/govendor`\\\nYarn: `npm install -g yarn`\n\nNow that you have the proper tooling, you can update your dependency trees to gather all the required packages and dependencies:\n\n```\n$ govendor sync\n$ yarn install\n```\n\nWith all the required tools and packages, you can run a development version of the service via `./serve`.\n\nTo run in production, run `go install`, which will create `$GOPATH/bin/go-playground`. Run that command from this directory.\n\n# Development\n\nAll Go source files are located in the `app/` subdirectory. All front-end resources are located in the `resources/` subdirectory. Anything in the `public/` subdirectory is directly served from the web server off of the root (`\"/\"`) path.\n \nStyle resources located in the `resources/css` directory are written in [Sass/Scss](http://sass-lang.com/). The entry point for all styles is `resources/css/app.scss`. Any styles referred to or imported in that file will be included in the final transpiled/compiled output (`public/css/main.css`).\n\nJavascript resources located in the `resources/js` directory are written using the new syntax of javascript, i.e. ES6/ES2015. The entry point for all javascript sources is `resources/js/app.js`. Any scripts/libraries referred to or imported in that file will be included in the final transpiled/compiled output (`public/js/bundle.js`).\n\nTo add a Go dependency: `govendor fetch github.com/foo/bar`\\\nTo add a Yarn dependency: `yarn add foo/bar`\n\n# Project Vision\n\nThis project will consist of three parts: the web page for showing content and allowing input, the web socket for transmitting data\nbetween the client and the server, and the job runner to compile and run the playground code on the fly.\n\nThe web page portion will be a relatively simple replica of the original at [https://play.golang.org], except the javascript functionality\nwill be replaced with a websocket connection to our Go server. When the user makes a request, the page's javascript will send the code\nwritten by the user and the desired action to the server. The websocket server will respond with an output stream from the job runner.\n\nThe web socket layer is a small communication layer between web clients and the actual Go job runner, allowing requests to be made\nthat compile, format, and run Go code. When a request is received, this layer will send the parameters to the job runner and open an\noutput stream from the job runner to the web client. As this layer scans the output, if it sees a terminating character/signal, it will\nclose the output stream and notify the client, which will signal the end of the request. This layer is in charge of queueing requests and\nload balancing to any number of Go job runners. It also does some caching to make sure that repeated requests don't take too much time.\n\nThe Go job runner will be connected to the web socket layer (not clients), processing the forwarded client requests. I believe that this\nportion should just be a matter of making a call to the go binary in some sandboxed environment. As such, this could and should be simple\nto implement.\n\nI will be taking advantage of the article written about the official playground implementation here: https://blog.golang.org/playground\n\nTo take this project to the next level beyond what is written above, it may be worthwhile to investiage the use of Google's \"Native\nClient\", which allows compiled C/C++ (and Go) code to be run in the browser efficiently and securely. In this case, the output stream\nfrom the job runner will stream the compiled binary to the web client instead of the output from the program being run on the server.\nThis investigation would be very interesting, as the code would be running under different circumstances than usual. There are many\naspects of running in a browser that are quite different than running on hardware, such as the file system, the network, and concurrency.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncbrown1%2Fgo-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncbrown1%2Fgo-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncbrown1%2Fgo-playground/lists"}