卓越飞翔博客卓越飞翔博客

卓越飞翔 - 您值得收藏的技术分享站
技术文章34447本站已运行393

如何在 Mac 上设置 Go 的 Wails 路径?

如何在 mac 上设置 go 的 wails 路径?

php小编西瓜为大家带来了一篇关于如何在 Mac 上设置 Go 的 Wails 路径的文章。在使用 Go 开发桌面应用时,Wails 是一个非常实用的工具。但是在 Mac 上设置 Wails 路径可能会有些麻烦。本文将详细介绍如何正确设置 Go 的 Wails 路径,让你能够顺利使用 Wails 开发桌面应用。无论你是新手还是有经验的开发者,本文都将为你提供一步步的操作指南,让你轻松掌握这个技巧。让我们一起来学习吧!

问题内容

我尝试在 Mac 上将 Wails 与 Go 结合使用,但在设置正确路径时遇到问题。我已经安装了 Wails 和 Go,但是当我尝试使用 wails build 构建我的 Wails 应用程序时,我收到一条错误消息:“在路径上找不到 Go。”

如何为 Go 设置正确的路径以便 Wails 可以找到它?任何帮助将不胜感激。谢谢!

解决方法

要设置,请遵循以下准则:

devn@macbook-pro-2 ~ % wails doctor
zsh: command not found: wails
devn@macbook-pro-2 ~ % mkdir ~/go
mkdir: /Users/devn/go: File exists
devn@macbook-pro-2 ~ % export GOPATH=~/go 
devn@macbook-pro-2 ~ % go install github.com/wailsapp/wails/v2/cmd/wails@latest

devn@macbook-pro-2 ~ % export PATH=$PATH:$(go env GOPATH)/bin

devn@macbook-pro-2 ~ % ~/.bashrc
zsh: permission denied: /Users/devn/.bashrc
devn@macbook-pro-2 ~ % sudo ~/.bashrc
Password:
sudo: /Users/devn/.bashrc: command not found
devn@macbook-pro-2 ~ % sudo ~/.bash_profile
sudo: /Users/devn/.bash_profile: command not found
devn@macbook-pro-2 ~ % source ~/.bashrc
devn@macbook-pro-2 ~ % wails version
v2.4.1
 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony
devn@macbook-pro-2 ~ %
卓越飞翔博客
上一篇: 如何使用中间件更改http请求的响应代码?
下一篇: 返回列表
留言与评论(共有 0 条评论)
   
验证码:
隐藏边栏