This commit is contained in:
lychang
2026-05-20 03:25:35 +08:00
parent 5e3dac3020
commit 7f5350db62
30 changed files with 3370 additions and 1752 deletions

28
build_wasm.bat Normal file
View File

@@ -0,0 +1,28 @@
@echo off
REM 编译Go代码为WASM的批处理脚本
echo 正在编译Go代码为WASM...
REM 检查是否安装了Go
go version >nul 2>&1
if %errorlevel% neq 0 (
echo 错误: 未找到Go。请先安装Go并将其添加到PATH。
pause
exit /b 1
)
REM 设置目标目录
set TARGET_DIR=E:\code\go\wasm-go\web
REM 检查目标目录是否存在,不存在则创建
if not exist "%TARGET_DIR%" (
mkdir "%TARGET_DIR%"
)
REM 编译Go代码为WASM
echo 编译WASM...
set GOOS=js
set GOARCH=wasm
go build -o "%TARGET_DIR%\main.wasm" E:\code\go\wasm-go\cmd\wasm\main.go
pause