go - fyne GUI compile to Web Assembly failed
问题描述
i was checking the possibility to use fyne in browser using Web Assembly , but i am getting error ...
main.go :
package main
import (
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
)
func main() {
a := app.New()
w := a.NewWindow("Hello")
hello := widget.NewLabel("Hello Fyne!")
w.SetContent(container.NewVBox(
hello,
widget.NewButton("Hi!", func() {
hello.SetText("Welcome :)")
}),
))
w.ShowAndRun()
}
i ran this command ,
GOOS=js GOARCH=wasm go build -o main.wasm main.go
Output (error) :
package command-line-arguments
imports fyne.io/fyne/v2/app
imports fyne.io/fyne/v2/internal/driver/glfw
imports fyne.io/fyne/v2/internal/driver/common
imports fyne.io/fyne/v2/internal/painter/gl
imports github.com/go-gl/gl/v3.2-core/gl: build constraints exclude all Go files in /home/ahmed/go/pkg/mod/github.com/go-gl/gl@v0.0.0-20210813123233-e4099ee2221f/v3.2-core/gl
解决方案
Fyne does not yet support web assembly or delivering through a browser. You can watch our Tech Preview video from FyneConf last week to get an update on this work. https://youtu.be/t8gEzPujIVI
推荐阅读
- angular - 如何让红色“无效”轮廓样式显示在 Angular 自定义控件上
- python - 无法打印使用随机字母数字字符串调用的变量
- c# - 版本 83.4.20 中的 CefSharp 自动播放
- linux - Linux 问题解决:需要通过 BMC 工具监控活动日志文件的解决方案
- java - 以编程方式创建的 TestNG 套件未按顺序执行测试方法
- image - Flutter:调整/放大使用 ClipRect 剪辑的图像
- javascript - Someone who can explain me how ReactionCollector function?
- jmeter - vuser 如何在 blazemeter 中显示?
- mongodb - 如何在官方 Go MongoDB 驱动程序中使用逻辑查询选择器 ($or) 执行 FindOne()?
- php - 如何知道路径 '/usr/lib/php/{number_name}' 的 PHP 版本的目录名称?(安装 xdebug)