{"id":13489629,"url":"https://github.com/danieljoos/go-wasm-examples","last_synced_at":"2025-04-24T02:10:35.302Z","repository":{"id":74644497,"uuid":"139985277","full_name":"danieljoos/go-wasm-examples","owner":"danieljoos","description":"Some small examples of using Go and WebAssembly","archived":false,"fork":false,"pushed_at":"2019-08-20T06:31:42.000Z","size":12,"stargazers_count":38,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T09:34:33.197Z","etag":null,"topics":["example","golang","wasm","webassembly"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danieljoos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-07-06T12:59:03.000Z","updated_at":"2025-02-21T11:03:09.000Z","dependencies_parsed_at":"2023-06-19T02:08:49.503Z","dependency_job_id":null,"html_url":"https://github.com/danieljoos/go-wasm-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieljoos%2Fgo-wasm-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieljoos%2Fgo-wasm-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieljoos%2Fgo-wasm-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieljoos%2Fgo-wasm-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danieljoos","download_url":"https://codeload.github.com/danieljoos/go-wasm-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250546086,"owners_count":21448260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["example","golang","wasm","webassembly"],"created_at":"2024-07-31T19:00:32.043Z","updated_at":"2025-04-24T02:10:35.285Z","avatar_url":"https://github.com/danieljoos.png","language":"Go","funding_links":[],"categories":["Go Guest Examples"],"sub_categories":[],"readme":"# go-wasm-examples\nSome small examples of using Go and WebAssembly\n\nThe examples require at least **Go version 1.12**!\n\n# Usage\n\nThe `server` directory contains a very small HTTP server implementation that \nsimply hosts the files of the current working directory.\nIt also downloads the `wasm_exec.js` JavaScript bridge from the official golang\nrepository, if the file doesn't already exist.\n\n```bash\ngo build -o server.bin ./server\n./server.bin\n```\nYou can also use any other web-server that provides static file hosting.\n\n## Example 1:\n\nThe first example prints a \"Hello World\" to the console of the browser.\nBrowse to http://localhost:3000 after building the example:\n\n```bash\nGOARCH=wasm GOOS=js go build -o test.wasm ./wasm1\n```\n\n## Example 2:\n\nThe second example interacts with the DOM of the page and enables the \"Stop\"\nbutton.\nIt also registers a click handler on the button and keeps the go program alive \nuntil the button was pressed.\nBrowse to http://localhost:3000 after building the example:\n\n```bash\nGOARCH=wasm GOOS=js go build -o test.wasm ./wasm2\n```\n\n## Example 3:\n\nThe third example shows how to create elements in the DOM. It uses the\n`github.com/PaulRosset/go-hacknews` package to fetch the top 10 stories from\nHacker News and displays them as list of anchors in the DOM.\nBrowse to http://localhost:3000 after building the example:\n\n```bash\ngo get -u github.com/PaulRosset/go-hacknews\nGOARCH=wasm GOOS=js go build -o test.wasm ./wasm3\n```\n\n## Example 4:\n\nThe fourth example implements a very simple markdown editor that uses the\npackage `github.com/shurcooL/github_flavored_markdown` to render\ngithub-flavoured markdown to HTML.\nBrowse to http://localhost:3000 after building the example:\n\n```bash\ngo get -u github.com/shurcooL/github_flavored_markdown\nGOARCH=wasm GOOS=js go build -o test.wasm ./wasm4\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieljoos%2Fgo-wasm-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanieljoos%2Fgo-wasm-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieljoos%2Fgo-wasm-examples/lists"}