From cac2b092a6aa6da0c16d6c7e21ab20869d4ed008 Mon Sep 17 00:00:00 2001 From: "lion.chan" Date: Wed, 31 Aug 2022 20:10:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=20trimpath=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=AF=B4=E6=98=8E.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lion.chan --- Software/Development/Language/Go/Basic/Go_Plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Software/Development/Language/Go/Basic/Go_Plugin.md b/Software/Development/Language/Go/Basic/Go_Plugin.md index 3a21d29..a5f2a96 100644 --- a/Software/Development/Language/Go/Basic/Go_Plugin.md +++ b/Software/Development/Language/Go/Basic/Go_Plugin.md @@ -27,7 +27,7 @@ func PrintTest(strInput string) { go build -trimpath -buildmode=plugin -ldflags="-w -s" ``` -其中 -trimpath 用于从二进制文件中删除文件系统路径信息。 +其中 -trimpath 用于从二进制文件中删除文件系统路径信息,如果不增加该参数,主程序加载插件时会去匹配 GOPATH,如果二者的 GOPATH 不一致则不进行加载。 指定文件编译 Go 动态库命令: