#!/bin/bash # 编译插件 go build -buildmode=plugin -o example.so example.go # 检查编译结果 if [ $? -eq 0 ]; then echo "插件编译成功: example.so" else echo "插件编译失败" exit 1 fi