golang依赖注入wire使用 执行wire命令时报错:bash: wire: command not found

在windows平台使用wire时,执行到wire . 命令生成代码时报错:bash: wire: command not found
在这里插入图片描述

1、首先执行 go env命令,查找goPath,然后把此bin路径加入到path中
在这里插入图片描述
2、执行 go get github.com/google/wire/cmd/wire 命令
3、执行 go install github.com/google/wire/cmd/wire@latest命令

猜你喜欢

转载自blog.csdn.net/qq_40585384/article/details/124259728