A Go playground type thing mostly for WASM!
License
crhntr/playground
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
#!/usr/bin/env bash ## UNFORTUNATELY THE SITE AT "https://playground.cazador.codes" IS DONN. I WILL FIX IT WHEN I HAVE TIME. # Playground ## The functions in this file can be invoked like: ### ./README run ## Setup Dependencies function init() { go mod download local assetsDir="cmd/webapp/assets/" mkdir -p "${assetsDir}" cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" "${assetsDir}" } ## Build Webapp Assets function build_webapp() { local webappPackage="cmd/webapp" local serverPackage="cmd/server" rm -rf "${serverPackage}/webapp" cp -rf "${webappPackage}" "${serverPackage}" GOOS=js GOARCH=wasm go build -ldflags="-s -w" -o "${serverPackage}/webapp/assets/main.wasm" "./${webappPackage}/" } ## Run function run() { build_webapp go run ./cmd/server } function deploy() { build_webapp docker pull golang:alpine ko apply --filename cmd/server/deployment.yml } if [ $# -ne 0 ]; then "$1" fi
About
A Go playground type thing mostly for WASM!