feat: download all src files for go mod dependencies for use in vscode
Without this, the LSP within the container continually complains that the source for go files cannot be found. While this method isn't _exactly_ correct, it does help with development.
This commit is contained in:
1 parent
03f43b602d
commit
524ce9b7d7
2 files changed
+26
-1
No files matched your search
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
main() {
|
||||
declare PLUGIN_NAME="$1"
|
||||
local plugin_root="/root/go/src/github.com/dokku/dokku/plugins"
|
||||
|
||||
export GO111MODULE=off
|
||||
echo "-----> Fetching onsi/gomega dependency for tests"
|
||||
go get github.com/onsi/gomega || true
|
||||
|
||||
echo "-----> Fetching spf13/pflag dependency for subcommands"
|
||||
go get github.com/spf13/pflag || true
|
||||
pushd "$plugin_root" >/dev/null
|
||||
find "$plugin_root/" -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
|
||||
pushd "$plugin_root/$plugin" >/dev/null
|
||||
if [[ -f "go.mod" ]]; then
|
||||
echo "-----> Fetching dependencies for $plugin plugin"
|
||||
go get || true
|
||||
fi
|
||||
popd >/dev/null
|
||||
done
|
||||
popd >/dev/null
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in new issue
Block a user