在Windows上如何构建Go插件?

huangapple go评论86阅读模式
英文:

How do I build plugin Go in windows?

问题

我在Go语言中编写了一个简单的插件,当我执行"go build -buildmode=plugin"命令时,出现以下错误:

在windows/amd64上不支持-buildmode=plugin

Go版本为:go1.18.1
Windows 10

英文:

I wrote a simple plugin in Go, it gives the following error when I execute the go build -buildmode=plugin
command:

-buildmode=plugin not supported on windows/amd64

Version go is :go1.18.1
windows 10

答案1

得分: 3

错误消息告诉你插件在Windows上不受支持。唯一支持的平台是Linux、FreeBSD和macOS。请参考https://pkg.go.dev/plugin:

> 目前插件仅在Linux、FreeBSD和macOS上受支持。

英文:

As error message tells you plugins are not supported on Windows. Only supported platforms are Linux, FreeBSD and macOS. See https://pkg.go.dev/plugin :

> Currently plugins are only supported on Linux, FreeBSD, and macOS.

huangapple
  • 本文由 发表于 2022年6月10日 19:59:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/72573956.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定