I have a Go project that consists of a command line tool and some Go plugins. I have a build script that builds the CLI, and then goes into a plugins directory and compiles each plugin with the -buildmode=plugin
option. I would like to figure out if launch.json
can be configured to selectively pass the buildmode
flag.
If I pre-build the plugins and then run the debugger on just the CLI tool, the plugins won't load because they were "built with different version of package X".
I created a task in tasks.json
to call my build script, and added that task as a preLaunchTask
for my debug session, but that's not doing the trick.
#!/bin/bash
set -x
go build ./cmd/...
cd plugins
for DIR in `find . ! -path . -type d`
do
go build -buildmode=plugin $DIR/*.go
done