From a4058512d5b39aec23c9cecfc8baf182e4033c1e Mon Sep 17 00:00:00 2001 From: Leo Date: Wed, 28 Oct 2020 22:41:38 +0100 Subject: [PATCH] bridge: migrate cmd/ to cobra Reviewer note: Does not touch any of the business logic. Avoided renaming files whereever possible to make it easier to spot differences. Verbatim migration, in a future CL, we could replace some of the flag validation code with cobra features and eliminate the global vars. Moved the dlv tool definition out of the way for the top-level wrapper. tools/bin/cobra is a helper utility that generates boilerplate (we slightly deviate from their default scheme by having guardiand in a separate package, rather than stuffing everything into cmd/) ghstack-source-id: caec9a38a69c9c5b1baa982074b3375d153718e1 Pull Request resolved: https://github.com/certusone/wormhole/pull/67 --- .run/guardiand build only.run.xml | 2 +- README.md | 6 +- Tiltfile | 2 +- bridge/Dockerfile | 7 +-- bridge/cmd/guardiand/{main.go => bridge.go} | 58 +++++++++++++------ bridge/cmd/guardiand/nodekeys.go | 2 +- bridge/cmd/root.go | 62 +++++++++++++++++++++ bridge/go.mod | 8 ++- bridge/go.sum | 33 ++++------- bridge/main.go | 7 +++ bridge/tools/go.mod | 5 ++ bridge/tools/go.sum | 56 +++++++++++++++++++ bridge/{ => tools}/tools.go | 2 +- devnet/bridge.yaml | 12 ++-- tools/build.sh | 2 + tools/go.mod | 1 + tools/go.sum | 15 +++++ tools/tools.go | 1 + 18 files changed, 222 insertions(+), 59 deletions(-) rename bridge/cmd/guardiand/{main.go => bridge.go} (78%) create mode 100644 bridge/cmd/root.go create mode 100644 bridge/main.go create mode 100644 bridge/tools/go.mod create mode 100644 bridge/tools/go.sum rename bridge/{ => tools}/tools.go (77%) diff --git a/.run/guardiand build only.run.xml b/.run/guardiand build only.run.xml index 621a8898e..97f9970ff 100644 --- a/.run/guardiand build only.run.xml +++ b/.run/guardiand build only.run.xml @@ -3,7 +3,7 @@ - +