diff --git a/.github/workflows/go-quality.yml b/.github/workflows/go-quality.yml index f15912d..9d740c0 100644 --- a/.github/workflows/go-quality.yml +++ b/.github/workflows/go-quality.yml @@ -9,12 +9,12 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: '1.16' + go-version: '1.18' - name: Install Dependencies run: | go version - go get -u golang.org/x/lint/golint - go get -u github.com/fzipp/gocyclo/cmd/gocyclo + go install golang.org/x/lint/golint@latest + go install github.com/fzipp/gocyclo/cmd/gocyclo@latest - name: Tests run: | go test -v -coverprofile=coverage.out ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3beeff3..150da42 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: '1.16' + go-version: '1.18' - name: Get the version id: get_version diff --git a/.hookz.yaml b/.hookz.yaml index 942fa0f..6c75a04 100644 --- a/.hookz.yaml +++ b/.hookz.yaml @@ -1,16 +1,20 @@ - version: 2.3.0 + version: 2.4.0 + sources: + - source: github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest + - source: github.com/devops-kung-fu/lucha@latest + - source: github.com/devops-kung-fu/hinge@latest + - source: github.com/kisielk/errcheck@latest + - source: golang.org/x/lint/golint@latest + - source: github.com/fzipp/gocyclo/cmd/gocyclo@latest hooks: - type: pre-commit actions: - name: "git: Pull (Ensure there are no upstream changes that are not local)" exec: git - args: ["pull"] - - name: "go: Tidy (Recursive)" - script: " - #!/bin/bash \n - echo -e Tidying all found go.mod occurrences\n - find . -name go.mod -print0 | xargs -0 -n1 dirname | xargs -L 1 bash -c 'cd \"$0\" && pwd && go mod tidy' \n - " + args: ["pull"] + - name: "go: Tidy mod file" + exec: go + args: ["mod", "tidy"] - name: "go: Update all dependencies to latest" exec: go args: ["get", "-u", "./..."] @@ -20,12 +24,15 @@ - name: "golint: Lint all go files" exec: golint args: ["./..."] #to error out, add the arg "-set_exit_status" - - name: "errcheck: Check that errors are checked" + - name: "errcheck: Ensure that errors are checked" exec: errcheck args: ["-ignoretests", "./..."] - name: "gocyclo: Check cyclomatic complexities" exec: gocyclo args: ["-over", "7", "."] + - name: Hinge + exec: hinge + args: ["."] - name: "go: Build (Ensure pulled modules do not break the build)" exec: go args: ["build", "-v"] @@ -37,10 +44,7 @@ args: ["tool", "cover", "-func=coverage.out"] - name: "cyclone-dx: Generate a Software Bill of Materials (SBoM)" exec: cyclonedx-gomod - args: ["-json", "-output", "hookz-sbom.json", "-std", "-licenses"] - - name: Hinge - url: https://github.com/devops-kung-fu/hinge/releases/download/v0.1.0/hinge-0.1.0-%%PLATFORM%%-amd64 - args: ["."] + args: ["app", "-json", "-output", "hookz-sbom.json"] - name: "git: Add all changed files during the pre-commit stage" exec: git args: ["add", "."] \ No newline at end of file diff --git a/.vscode/configurationCache.log b/.vscode/configurationCache.log new file mode 100644 index 0000000..4da2f15 --- /dev/null +++ b/.vscode/configurationCache.log @@ -0,0 +1 @@ +{"buildTargets":[".PHONY","all","build","help","install","test","title"],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}} \ No newline at end of file diff --git a/.vscode/dryrun.log b/.vscode/dryrun.log new file mode 100644 index 0000000..b95f467 --- /dev/null +++ b/.vscode/dryrun.log @@ -0,0 +1,5 @@ +make --dry-run --always-make --keep-going --print-directory +make: Entering directory `/Users/dj/code/hookz' +awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $1, $2}' Makefile +make: Leaving directory `/Users/dj/code/hookz' + diff --git a/.vscode/targets.log b/.vscode/targets.log new file mode 100644 index 0000000..cf79041 --- /dev/null +++ b/.vscode/targets.log @@ -0,0 +1,287 @@ +make all --print-data-base --no-builtin-variables --no-builtin-rules --question +# GNU Make 3.81 +# Copyright (C) 2006 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. +# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# This program built for i386-apple-darwin11.3.0 + + +# Make data base, printed on Mon May 23 08:31:31 2022 + +# Variables + +# automatic +/dev/null || echo /Developer)/Makefiles +# environment +VSCODE_CODE_CACHE_PATH = /Users/dj/Library/Application Support/Code/CachedData/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5 +# environment +LOGNAME = dj +# environment +APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL = 1 +# environment +VSCODE_HANDLES_UNCAUGHT_ERRORS = true +# automatic +^D = $(patsubst %/,%,$(dir $^)) +# environment +XPC_FLAGS = 0x0 +# default +MAKE = $(MAKE_COMMAND) +# default +MAKECMDGOALS := all +# environment +SHLVL = 2 +# default +MAKE_VERSION := 3.81 +# environment +USER = dj +# environment +CR_PAT = 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 +# makefile (from `Makefile', line 9) +.DEFAULT_GOAL := help +# automatic +%D = $(patsubst %/,%,$(dir $%)) +# default +MAKE_COMMAND := /Library/Developer/CommandLineTools/usr/bin/make +# default +.VARIABLES := +# environment +TMPDIR = /var/folders/nm/ppzx3wrs5t5b4s92j5lzr5t00000gn/T/ +# automatic +*F = $(notdir $*) +# environment +VSCODE_IPC_HOOK = /Users/dj/Library/Application Support/Code/1.67.2-main.sock +# makefile +MAKEFLAGS = Rrqp +# environment +MFLAGS = -Rrqp +# automatic +*D = $(patsubst %/,%,$(dir $*)) +# environment +XPC_SERVICE_NAME = application.com.microsoft.VSCode.16094751.16094757 +# automatic ++D = $(patsubst %/,%,$(dir $+)) +# automatic ++F = $(notdir $+) +# environment +TEMP = /tmp +# environment +__CF_USER_TEXT_ENCODING = 0x1F5:0x0:0x0 +# environment +COMMAND_MODE = unix2003 +# default +MAKEFILES := +# automatic + 0 && Verbose { + util.DoIf(Verbose, func() { + util.PrintInfo("Installing sources...") + }) + return + } + for _, s := range sources { + util.DoIf(Verbose, func() { + util.PrintTabbedf("Installing Source: %s", s.Source) + }) + err = lib.InstallSource(s) + if err != nil { + log.Printf("There was a problem installing source %s, error: %s", s.Source, err) + return + } + } + return +} diff --git a/cmd/completion.go b/cmd/completion.go deleted file mode 100644 index 72a234c..0000000 --- a/cmd/completion.go +++ /dev/null @@ -1,71 +0,0 @@ -package cmd - -import ( - "os" - - "github.com/devops-kung-fu/hookz/lib" - "github.com/spf13/cobra" -) - -var completionCmd = &cobra.Command{ - Use: "completion [bash|zsh|fish|powershell]", - Short: "Generate completion script", - Long: `To load completions: - -Bash: - - $ source <(yourprogram completion bash) - - # To load completions for each session, execute once: - # Linux: - $ yourprogram completion bash > /etc/bash_completion.d/yourprogram - # macOS : - $ yourprogram completion bash > /usr/local/etc/bash_completion.d/yourprogram - -Zsh: - - # If shell completion is not already enabled in your environment, - # you will need to enable it. You can execute the following once: - - $ echo "autoload -U compinit; compinit" >> ~/.zshrc - - # To load completions for each session, execute once: - $ yourprogram completion zsh > "${fpath[1]}/_yourprogram" - - # You will need to start a new shell for this setup to take effect. - -fish: - - $ yourprogram completion fish | source - - # To load completions for each session, execute once: - $ yourprogram completion fish > ~/.config/fish/completions/yourprogram.fish - -PowerShell: - - PS> yourprogram completion powershell | Out-String | Invoke-Expression - - # To load completions for every new session, run: - PS> yourprogram completion powershell > yourprogram.ps1 - # and source this file from your PowerShell profile. -`, - DisableFlagsInUseLine: true, - ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, - Args: cobra.ExactValidArgs(1), - Run: func(cmd *cobra.Command, args []string) { - switch args[0] { - case "bash": - lib.IfErrorLog(cmd.Root().GenBashCompletion(os.Stdout), "ERROR") - case "zsh": - lib.IfErrorLog(cmd.Root().GenZshCompletion(os.Stdout), "ERROR") - case "fish": - lib.IfErrorLog(cmd.Root().GenFishCompletion(os.Stdout, true), "ERROR") - case "powershell": - lib.IfErrorLog(cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout), "ERROR") - } - }, -} - -func init() { - rootCmd.AddCommand(completionCmd) -} diff --git a/cmd/init.go b/cmd/init.go index 3ebc97e..30a9d1a 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -4,9 +4,10 @@ import ( "fmt" "os" - "github.com/devops-kung-fu/hookz/lib" - "github.com/gookit/color" + "github.com/devops-kung-fu/common/util" "github.com/spf13/cobra" + + "github.com/devops-kung-fu/hookz/lib" ) var ( @@ -16,36 +17,32 @@ var ( Short: "Initializes the hooks as defined in the .hookz.yaml file.", Long: "Initializes the hooks as defined in the .hookz.yaml file.", PreRun: func(cmd *cobra.Command, args []string) { - existingHookz := lib.HasExistingHookz(lib.NewOsFs()) + existingHookz := lib.HasExistingHookz(Afs) if existingHookz { fmt.Println("Existing hooks detected") fmt.Println("\nDid you mean to reset?") - fmt.Println(" hookz reset [--verbose] [--debug]") + fmt.Println(" hookz reset [--verbose] [--debug] [--verbose-output") fmt.Println("\nRun 'hookz --help' for usage.") fmt.Println() os.Exit(1) } }, Run: func(cmd *cobra.Command, args []string) { - fs := lib.NewOsFs() - color.Style{color.FgLightBlue, color.OpBold}.Println("Initializing Hooks") - fmt.Println() - config, err := lib.ReadConfig(fs, version) - if err != nil && err.Error() == "NO_CONFIG" { - os.Exit(1) - } - if lib.IsErrorBool(err, "[ERROR]") { - return - } - if lib.IsErrorBool(lib.WriteHooks(fs, config, verbose, debug), "[ERROR]") { + util.DoIf(Verbose, func() { + util.PrintInfo("Creating hooks") + }) + config := CheckConfig() + _ = InstallSources(config.Sources) + if util.IsErrorBool(lib.WriteHooks(Afs, config, Verbose, VerboseOutput)) { return } - color.Style{color.FgLightGreen}.Println("Done!") + util.DoIf(Verbose, func() { + util.PrintSuccess("Done") + }) }, } ) func init() { rootCmd.AddCommand(initCmd) - initCmd.PersistentFlags().BoolVarP(&debug, "debug", "d", false, "If true, output from commands is displayed when the hook executes.") } diff --git a/cmd/init_config.go b/cmd/init_config.go index c9e4a46..99f3c70 100644 --- a/cmd/init_config.go +++ b/cmd/init_config.go @@ -4,9 +4,11 @@ import ( "fmt" "os" - "github.com/devops-kung-fu/hookz/lib" + "github.com/devops-kung-fu/common/util" "github.com/gookit/color" "github.com/spf13/cobra" + + "github.com/devops-kung-fu/hookz/lib" ) var ( @@ -15,8 +17,7 @@ var ( Short: "Creates a starter .hookz.yaml file.", Long: "Creates a starter .hookz.yaml file.", PreRun: func(cmd *cobra.Command, args []string) { - existingHookz := lib.HasExistingHookzYaml(lib.NewOsFs()) - if existingHookz { + if lib.HasExistingHookzYaml(Afs) { color.Style{color.FgRed, color.OpBold}.Println("Existing .hookz.yaml file detected!") fmt.Println("\nThis file must be deleted before running this command.") fmt.Println() @@ -24,14 +25,12 @@ var ( } }, Run: func(cmd *cobra.Command, args []string) { - fs := lib.NewOsFs() - color.Style{color.FgLightBlue, color.OpBold}.Println("Creating Sample Config") - fmt.Println() - _, err := lib.CreateConfig(fs, version) - if lib.IsErrorBool(err, "[ERROR]") { + util.PrintInfo("Creating Sample Config") + _, err := lib.CreateConfig(Afs, version) + if util.IsErrorBool(err) { return } - color.Style{color.FgLightGreen}.Println("Done!") + util.PrintSuccess("Done") }, } ) diff --git a/cmd/remove.go b/cmd/remove.go index cbd8664..8e28d61 100644 --- a/cmd/remove.go +++ b/cmd/remove.go @@ -1,26 +1,28 @@ package cmd import ( - "fmt" + "github.com/devops-kung-fu/common/util" + "github.com/spf13/cobra" "github.com/devops-kung-fu/hookz/lib" - "github.com/gookit/color" - "github.com/spf13/cobra" ) var ( removeCmd = &cobra.Command{ Use: "remove", Aliases: []string{"delete"}, - Short: "Removes the hooks as defined in the .hooks.yaml file and any generated scripts.", - Long: "Removes the hooks as defined in the .hooks.yaml file and any generated scripts.", + Short: "Removes the hooks as defined in the .hookz.yaml file and any generated scripts.", + Long: "Removes the hooks as defined in the .hookz.yaml file and any generated scripts.", Run: func(cmd *cobra.Command, args []string) { - color.Style{color.FgLightBlue, color.OpBold}.Println("Removing Hooks") - fmt.Println() - if lib.IsErrorBool(lib.RemoveHooks(lib.NewOsFs(), verbose), "[ERROR]") { + util.DoIf(Verbose, func() { + util.PrintInfo("Removing hooks and supporting files...") + }) + if util.IsErrorBool(lib.RemoveHooks(Afs, Verbose)) { return } - color.Style{color.FgLightGreen}.Println("Done!") + util.DoIf(Verbose, func() { + util.PrintSuccess("Done") + }) }, } ) diff --git a/cmd/reset.go b/cmd/reset.go index 0189087..48b7fe6 100644 --- a/cmd/reset.go +++ b/cmd/reset.go @@ -2,42 +2,35 @@ package cmd import ( "fmt" - "os" - "github.com/devops-kung-fu/hookz/lib" - "github.com/gookit/color" + "github.com/devops-kung-fu/common/util" "github.com/spf13/cobra" + + "github.com/devops-kung-fu/hookz/lib" ) var ( resetCmd = &cobra.Command{ Use: "reset", - Short: "Rebuilds the hooks as defined in the .hooks.yaml file.", - Long: "Rebuilds the hooks as defined in the .hooks.yaml file.", + Short: "Rebuilds the hooks as defined in the .hookz.yaml file.", + Long: "Rebuilds the hooks as defined in the .hookz.yaml file.", Run: func(cmd *cobra.Command, args []string) { - fs := lib.NewOsFs() - color.Style{color.FgLightBlue, color.OpBold}.Println("Reset Hooks") + util.PrintInfo("Resetting Hooks") fmt.Println() - if lib.IsErrorBool(lib.RemoveHooks(fs, verbose), "[ERROR]") { - return - } - config, err := lib.ReadConfig(fs, version) - if err != nil && err.Error() == "NO_CONFIG" { - os.Exit(1) - } - if lib.IsErrorBool(err, "[ERROR]") { + if util.IsErrorBool(lib.RemoveHooks(Afs, Verbose)) { return } - if lib.IsErrorBool(lib.WriteHooks(fs, config, verbose, debug), "[ERROR]") { + config := CheckConfig() + _ = InstallSources(config.Sources) + if util.IsErrorBool(lib.WriteHooks(Afs, config, Verbose, VerboseOutput)) { return } - color.Style{color.FgLightGreen}.Println("Done!") + util.PrintSuccess("Done") }, } ) func init() { rootCmd.AddCommand(resetCmd) - resetCmd.PersistentFlags().BoolVarP(&debug, "debug", "d", false, "If true, output from commands is displayed when the hook executes.") } diff --git a/cmd/root.go b/cmd/root.go index 6b8af05..b3abf7d 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -4,36 +4,53 @@ package cmd import ( "errors" "fmt" + "io/ioutil" + "log" "os" - "github.com/devops-kung-fu/hookz/lib" + "github.com/devops-kung-fu/common/util" "github.com/gookit/color" "github.com/spf13/afero" "github.com/spf13/cobra" ) var ( - version = "2.3.0" - debug bool - verbose bool - rootCmd = &cobra.Command{ + version = "2.4.0" + Afs = &afero.Afero{Fs: afero.NewOsFs()} + debug bool + Verbose bool + VerboseOutput bool + rootCmd = &cobra.Command{ Use: "hookz", Short: `Manages commit hooks inside a local git repository`, Version: version, + PersistentPreRun: func(cmd *cobra.Command, args []string) { + if !debug { + log.SetOutput(ioutil.Discard) + } + util.DoIf(Verbose, func() { + fmt.Println() + color.Style{color.FgWhite, color.OpBold}.Println("█ █ █▀█ █▀█ █▄▀ ▀█") + color.Style{color.FgWhite, color.OpBold}.Println("█▀█ █▄█ █▄█ █░█ █▄") + fmt.Println() + fmt.Println("DKFM - DevOps Kung Fu Mafia") + fmt.Println("https://github.com/devops-kung-fu/hookz") + fmt.Printf("Version: %s\n", version) + fmt.Println() + }) + }, } ) // Execute creates the command tree and handles any error condition returned func Execute() { cobra.OnInitialize(func() { - var fs = afero.NewOsFs() - afs := &afero.Afero{Fs: fs} - b, err := afs.DirExists(".git") - lib.IfErrorLog(err, "[ERROR]") + b, err := Afs.DirExists(".git") + util.IfErrorLog(err) if !b { - e := errors.New("Hookz must be run in a local .git repository") - lib.IfErrorLog(e, "ERROR") + e := errors.New("hookz must be run in a local .git repository") + util.PrintErr(e) os.Exit(1) } }) @@ -45,10 +62,7 @@ func Execute() { } func init() { - color.Style{color.FgWhite, color.OpBold}.Println("Hookz") - fmt.Println("https://github.com/devops-kung-fu/hookz") - fmt.Printf("Version: %s\n", version) - fmt.Println("") - - rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Extended output as hookz executes.") + rootCmd.PersistentFlags().BoolVarP(&debug, "debug", "d", false, "show debug output") + rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", true, "show verbose output") + rootCmd.PersistentFlags().BoolVar(&VerboseOutput, "verbose-output", false, "show verbose hook output while executing hooks") } diff --git a/cmd/update.go b/cmd/update.go index c483437..bcef9cc 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -1,34 +1,25 @@ package cmd import ( - "fmt" - "os" + "github.com/devops-kung-fu/common/util" + "github.com/spf13/cobra" "github.com/devops-kung-fu/hookz/lib" - "github.com/gookit/color" - "github.com/spf13/cobra" ) var ( updateCmd = &cobra.Command{ Use: "update", - Short: "Updates any executable defined as an URL attribute in .hooks.yaml.", - Long: "Rebuilds the hooks as defined in the .hooks.yaml file.", + Short: "Updates any defined sources and/or executable defined as an URL attribute in .hookz.yaml.", + Long: "Updates any defined sources and/or executable defined as an URL attribute in .hookz.yaml.", Run: func(cmd *cobra.Command, args []string) { - fs := lib.NewOsFs() - color.Style{color.FgLightBlue, color.OpBold}.Println("Update Executables") - fmt.Println() - config, err := lib.ReadConfig(fs, version) - if err != nil && err.Error() == "NO_CONFIG" { - os.Exit(1) - } - if lib.IsErrorBool(err, "[ERROR]") { - return - } - if lib.IsErrorBool(lib.UpdateExecutables(fs, config), "[ERROR]") { + util.PrintInfo("Updating sources and executables") + config := CheckConfig() + _ = InstallSources(config.Sources) + if util.IsErrorBool(lib.UpdateExecutables(Afs, config)) { return } - color.Style{color.FgLightGreen}.Println("Done!") + util.PrintSuccess("Done!") }, } ) diff --git a/go.mod b/go.mod index 1861945..9deca77 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,26 @@ module github.com/devops-kung-fu/hookz -go 1.16 +go 1.18 require ( github.com/dustin/go-humanize v1.0.0 - github.com/gookit/color v1.4.2 - github.com/jarcoal/httpmock v1.0.8 + github.com/gookit/color v1.5.0 + github.com/jarcoal/httpmock v1.2.0 github.com/segmentio/ksuid v1.0.4 - github.com/spf13/afero v1.6.0 - github.com/spf13/cobra v1.2.1 - github.com/stretchr/testify v1.7.0 - golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect - golang.org/x/text v0.3.6 // indirect + github.com/spf13/afero v1.8.2 + github.com/spf13/cobra v1.4.0 + github.com/stretchr/testify v1.7.1 gopkg.in/yaml.v2 v2.4.0 ) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/devops-kung-fu/common v0.2.0 + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect +) diff --git a/go.sum b/go.sum index 1c77536..ea16c05 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,7 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -15,9 +16,7 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -26,7 +25,6 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -36,15 +34,10 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -53,12 +46,12 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/devops-kung-fu/common v0.2.0 h1:a9Gk1caowxArQdNgwxgLxocp8PRvThu+HzT6/mbabq4= +github.com/devops-kung-fu/common v0.2.0/go.mod h1:1eupDyY9wxRUGpb/d5kdEHO2fVLGnoIPDP7pIBhyX/g= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -66,16 +59,10 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -87,7 +74,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -102,9 +88,6 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -115,10 +98,7 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -131,47 +111,24 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gookit/color v1.4.2 h1:tXy44JFSFkKnELV6WaMo/lLfu/meqITX3iAV52do7lk= -github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gookit/color v1.5.0 h1:1Opow3+BWDwqor78DcJkJCIwnkviFi+rrOANki9BUFw= +github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jarcoal/httpmock v1.0.8 h1:8kI16SoO6LQKgPE7PvQuV+YuD/inwHd7fOOe2zMbo4k= -github.com/jarcoal/httpmock v1.0.8/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jarcoal/httpmock v1.2.0 h1:gSvTxxFR/MEMfsGrvRbdfpRUMBStovlSRLw0Ep1bwwc= +github.com/jarcoal/httpmock v1.2.0/go.mod h1:oCoTsnAz4+UoOUIf5lJOWV2QQIW5UoeUI6aM2YnWAZk= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -179,84 +136,47 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/maxatome/go-testdeep v1.11.0 h1:Tgh5efyCYyJFGUYiT0qxBSIDeXw0F5zSoatlou685kk= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= +github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= +github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -280,7 +200,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -291,11 +210,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -322,12 +238,9 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -337,9 +250,6 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -350,10 +260,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -363,7 +270,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -385,15 +291,12 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -401,9 +304,8 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -413,7 +315,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -423,7 +324,6 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -446,7 +346,6 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -455,9 +354,8 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -481,9 +379,6 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -514,7 +409,6 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -526,12 +420,8 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -545,13 +435,9 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -562,21 +448,15 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/hookz-sbom.json b/hookz-sbom.json index e53b8f7..c4e3721 100644 --- a/hookz-sbom.json +++ b/hookz-sbom.json @@ -1,155 +1,155 @@ { "bomFormat": "CycloneDX", - "specVersion": "1.2", - "serialNumber": "urn:uuid:c57624ba-2ee8-4fc7-a69c-7466346fd09e", + "specVersion": "1.4", + "serialNumber": "urn:uuid:1bf4aa8c-b369-4fb2-9523-019e9555dd41", "version": 1, "metadata": { - "timestamp": "2021-07-01T23:29:27-06:00", + "timestamp": "2022-05-23T08:48:15-06:00", "tools": [ { "vendor": "CycloneDX", "name": "cyclonedx-gomod", - "version": "v0.8.2", + "version": "v0.0.0-unset", "hashes": [ { "alg": "MD5", - "content": "baede878ed3bc50701186dacc078b465" + "content": "fef17a9f71e43c899c3b0cb179fdbd1d" }, { "alg": "SHA-1", - "content": "6667be6a8dab4043e950e87f7f8c69737a128316" + "content": "1a28e1a8992dc85ed1e7b9662098d2f2209f3b42" }, { "alg": "SHA-256", - "content": "f95f6644c623ff2c5c4e4170ca542faafb3a6817b60852436af1ea0605cde08c" + "content": "0f77e1e26d8ac88e210b19f67095a3068bf33e9216a8ce17b9f8f9d7b5c8d014" + }, + { + "alg": "SHA-384", + "content": "a2d423df9bf4e5a92fcafe2eb9a9a97e4de5d62f7c4b1e002cbba6729546af4ec67251e23770895cace2c1f189c162e7" }, { "alg": "SHA-512", - "content": "2ddcf69a911ddaa53274d1ab825754b02da5d1c9601916daed761d5b0d5426035a3bf2d476db471af807fa18d7175cf4087c8a131eeb83e39c6937010fc76d82" + "content": "1b1ddce1c9d3aa659e428c2afcc9d5f3ba3fca6b507517d3e988ba73515869ee623289c5829e21c9b45bc58dbf1446ee668865dcf47aa0fce503f2d660098228" + } + ], + "externalReferences": [ + { + "url": "https://github.com/CycloneDX/cyclonedx-gomod", + "type": "vcs" + }, + { + "url": "https://cyclonedx.org", + "type": "website" } ] } ], "component": { - "bom-ref": "pkg:golang/github.com/devops-kung-fu/hookz@v0.0.0-20210701232658-32b784d796fc", + "bom-ref": "pkg:golang/github.com/devops-kung-fu/hookz@v2.3.1-0.20210706231702-1c879079cb03?type=module", "type": "application", "name": "github.com/devops-kung-fu/hookz", - "version": "v0.0.0-20210701232658-32b784d796fc", - "purl": "pkg:golang/github.com/devops-kung-fu/hookz@v0.0.0-20210701232658-32b784d796fc", + "version": "v2.3.1-0.20210706231702-1c879079cb03", + "purl": "pkg:golang/github.com/devops-kung-fu/hookz@v2.3.1-0.20210706231702-1c879079cb03?type=module", "externalReferences": [ { "url": "https://github.com/devops-kung-fu/hookz", "type": "vcs" } + ], + "properties": [ + { + "name": "cdx:gomod:build:env:CGO_ENABLED", + "value": "1" + }, + { + "name": "cdx:gomod:build:env:GOARCH", + "value": "amd64" + }, + { + "name": "cdx:gomod:build:env:GOOS", + "value": "darwin" + }, + { + "name": "cdx:gomod:build:env:GOVERSION", + "value": "go1.18.2" + } ] } }, "components": [ { - "bom-ref": "pkg:golang/github.com/dustin/go-humanize@v1.0.0", + "bom-ref": "pkg:golang/github.com/devops-kung-fu/common@v0.2.0?type=module", "type": "library", - "name": "github.com/dustin/go-humanize", - "version": "v1.0.0", + "name": "github.com/devops-kung-fu/common", + "version": "v0.2.0", "scope": "required", "hashes": [ { "alg": "SHA-256", - "content": "5529d3b180a79451da336fe280ed61e97dc703bd637286d0bb17a6824ab8cd8a" + "content": "6bd1a4d5c6a8c3102b41d360c3180bc68729f0f46f4e1bbe1f34fafe66da6eae" } ], - "licenses": [ - { - "license": { - "id": "MIT", - "url": "https://spdx.org/licenses/MIT.html" - } - } - ], - "purl": "pkg:golang/github.com/dustin/go-humanize@v1.0.0", + "purl": "pkg:golang/github.com/devops-kung-fu/common@v0.2.0?type=module", "externalReferences": [ { - "url": "https://github.com/dustin/go-humanize", + "url": "https://github.com/devops-kung-fu/common", "type": "vcs" } ] }, { - "bom-ref": "pkg:golang/github.com/gookit/color@v1.4.2", + "bom-ref": "pkg:golang/github.com/dustin/go-humanize@v1.0.0?type=module", "type": "library", - "name": "github.com/gookit/color", - "version": "v1.4.2", + "name": "github.com/dustin/go-humanize", + "version": "v1.0.0", "scope": "required", "hashes": [ { "alg": "SHA-256", - "content": "b57cb8e091521642a710b57a59a328fe52dfbbf99ea884d7de2015e76768ee59" - } - ], - "licenses": [ - { - "license": { - "id": "MIT", - "url": "https://spdx.org/licenses/MIT.html" - } + "content": "5529d3b180a79451da336fe280ed61e97dc703bd637286d0bb17a6824ab8cd8a" } ], - "purl": "pkg:golang/github.com/gookit/color@v1.4.2", + "purl": "pkg:golang/github.com/dustin/go-humanize@v1.0.0?type=module", "externalReferences": [ { - "url": "https://github.com/gookit/color", + "url": "https://github.com/dustin/go-humanize", "type": "vcs" } ] }, { - "bom-ref": "pkg:golang/github.com/inconshreveable/mousetrap@v1.0.0", + "bom-ref": "pkg:golang/github.com/gookit/color@v1.5.0?type=module", "type": "library", - "name": "github.com/inconshreveable/mousetrap", - "version": "v1.0.0", + "name": "github.com/gookit/color", + "version": "v1.5.0", "scope": "required", "hashes": [ { "alg": "SHA-256", - "content": "67cb6ee6cada2d709721c011c41a7ff1c6ef97055aed9d4d1e0f5710a86d4af3" + "content": "d4ea68c37f81583c2aa2befc0dc2642422309e4be2162fabace00d922f41505c" } ], - "licenses": [ - { - "license": { - "id": "Apache-2.0", - "url": "https://spdx.org/licenses/Apache-2.0.html" - } - } - ], - "purl": "pkg:golang/github.com/inconshreveable/mousetrap@v1.0.0", + "purl": "pkg:golang/github.com/gookit/color@v1.5.0?type=module", "externalReferences": [ { - "url": "https://github.com/inconshreveable/mousetrap", + "url": "https://github.com/gookit/color", "type": "vcs" } ] }, { - "bom-ref": "pkg:golang/github.com/segmentio/ksuid@v1.0.3", + "bom-ref": "pkg:golang/github.com/segmentio/ksuid@v1.0.4?type=module", "type": "library", "name": "github.com/segmentio/ksuid", - "version": "v1.0.3", + "version": "v1.0.4", "scope": "required", "hashes": [ { "alg": "SHA-256", - "content": "16845eb31be5790c1888f01529ed6d3149448aba1d66a96a82522e16c7439ed6" + "content": "b01a3605d4a15e399cba000cc23ba0a0651d515d29731639996e312919f7bf87" } ], - "licenses": [ - { - "license": { - "id": "MIT", - "url": "https://spdx.org/licenses/MIT.html" - } - } - ], - "purl": "pkg:golang/github.com/segmentio/ksuid@v1.0.3", + "purl": "pkg:golang/github.com/segmentio/ksuid@v1.0.4?type=module", "externalReferences": [ { "url": "https://github.com/segmentio/ksuid", @@ -158,26 +158,18 @@ ] }, { - "bom-ref": "pkg:golang/github.com/spf13/afero@v1.6.0", + "bom-ref": "pkg:golang/github.com/spf13/afero@v1.8.2?type=module", "type": "library", "name": "github.com/spf13/afero", - "version": "v1.6.0", + "version": "v1.8.2", "scope": "required", "hashes": [ { "alg": "SHA-256", - "content": "c686b1dac2760d3f12f31036a5a3c58c309270235e5ac83be551b40cb46b7a26" - } - ], - "licenses": [ - { - "license": { - "id": "Apache-2.0", - "url": "https://spdx.org/licenses/Apache-2.0.html" - } + "content": "c5e852c956b46271d6b09e3d2459633298351d7d7d57a3436757e49b55f39dba" } ], - "purl": "pkg:golang/github.com/spf13/afero@v1.6.0", + "purl": "pkg:golang/github.com/spf13/afero@v1.8.2?type=module", "externalReferences": [ { "url": "https://github.com/spf13/afero", @@ -186,26 +178,18 @@ ] }, { - "bom-ref": "pkg:golang/github.com/spf13/cobra@v1.2.0", + "bom-ref": "pkg:golang/github.com/spf13/cobra@v1.4.0?type=module", "type": "library", "name": "github.com/spf13/cobra", - "version": "v1.2.0", + "version": "v1.4.0", "scope": "required", "hashes": [ { "alg": "SHA-256", - "content": "2071a8f772942638a1d06cf8e3d3020432ae6963ea70a71bb9433b1975859e5c" + "content": "cbec09a71eb8c5c80ed55f91727c16d0b107c532918b66433d20635a7ae0f3c4" } ], - "licenses": [ - { - "license": { - "id": "Apache-2.0", - "url": "https://spdx.org/licenses/Apache-2.0.html" - } - } - ], - "purl": "pkg:golang/github.com/spf13/cobra@v1.2.0", + "purl": "pkg:golang/github.com/spf13/cobra@v1.4.0?type=module", "externalReferences": [ { "url": "https://github.com/spf13/cobra", @@ -214,7 +198,7 @@ ] }, { - "bom-ref": "pkg:golang/github.com/spf13/pflag@v1.0.5", + "bom-ref": "pkg:golang/github.com/spf13/pflag@v1.0.5?type=module", "type": "library", "name": "github.com/spf13/pflag", "version": "v1.0.5", @@ -225,15 +209,7 @@ "content": "8b2f951543823f56bef3216da3f76b836089e6ed3246807b7d9c370cabff2570" } ], - "licenses": [ - { - "license": { - "id": "BSD-3-Clause", - "url": "https://spdx.org/licenses/BSD-3-Clause.html" - } - } - ], - "purl": "pkg:golang/github.com/spf13/pflag@v1.0.5", + "purl": "pkg:golang/github.com/spf13/pflag@v1.0.5?type=module", "externalReferences": [ { "url": "https://github.com/spf13/pflag", @@ -242,7 +218,7 @@ ] }, { - "bom-ref": "pkg:golang/github.com/xo/terminfo@v0.0.0-20210125001918-ca9a967f8778", + "bom-ref": "pkg:golang/github.com/xo/terminfo@v0.0.0-20210125001918-ca9a967f8778?type=module", "type": "library", "name": "github.com/xo/terminfo", "version": "v0.0.0-20210125001918-ca9a967f8778", @@ -253,15 +229,7 @@ "content": "42577222efcbeb7a0fa72bd098782f822724a75630e75d0a24ea97ec7db89a0f" } ], - "licenses": [ - { - "license": { - "id": "MIT", - "url": "https://spdx.org/licenses/MIT.html" - } - } - ], - "purl": "pkg:golang/github.com/xo/terminfo@v0.0.0-20210125001918-ca9a967f8778", + "purl": "pkg:golang/github.com/xo/terminfo@v0.0.0-20210125001918-ca9a967f8778?type=module", "externalReferences": [ { "url": "https://github.com/xo/terminfo", @@ -270,51 +238,21 @@ ] }, { - "bom-ref": "pkg:golang/golang.org/x/sys@v0.0.0-20210630005230-0f9fa26af87c", - "type": "library", - "name": "golang.org/x/sys", - "version": "v0.0.0-20210630005230-0f9fa26af87c", - "scope": "required", - "hashes": [ - { - "alg": "SHA-256", - "content": "1758d958616161f8740a2e79b08a482ed28a2bca778b6fe4ad3af41f5ae0ef82" - } - ], - "licenses": [ - { - "license": { - "id": "BSD-3-Clause", - "url": "https://spdx.org/licenses/BSD-3-Clause.html" - } - } - ], - "purl": "pkg:golang/golang.org/x/sys@v0.0.0-20210630005230-0f9fa26af87c" - }, - { - "bom-ref": "pkg:golang/golang.org/x/text@v0.3.6", + "bom-ref": "pkg:golang/golang.org/x/text@v0.3.7?type=module", "type": "library", "name": "golang.org/x/text", - "version": "v0.3.6", + "version": "v0.3.7", "scope": "required", "hashes": [ { "alg": "SHA-256", - "content": "691631371bfa886425c956999a4e998181036be260d7c0f179b3d2adde9b8353" + "content": "a25a70bcfd8a69c5b5656bec47bb90868c9362f280ba97d0ad118114cdf9d869" } ], - "licenses": [ - { - "license": { - "id": "BSD-3-Clause", - "url": "https://spdx.org/licenses/BSD-3-Clause.html" - } - } - ], - "purl": "pkg:golang/golang.org/x/text@v0.3.6" + "purl": "pkg:golang/golang.org/x/text@v0.3.7?type=module" }, { - "bom-ref": "pkg:golang/gopkg.in/yaml.v2@v2.4.0", + "bom-ref": "pkg:golang/gopkg.in/yaml.v2@v2.4.0?type=module", "type": "library", "name": "gopkg.in/yaml.v2", "version": "v2.4.0", @@ -325,108 +263,71 @@ "content": "0fcc60c04098ec262fc7e6369f8b01cfddc99fd251bf1762cb2a3c0937ee29a6" } ], - "licenses": [ - { - "license": { - "id": "Apache-2.0", - "url": "https://spdx.org/licenses/Apache-2.0.html" - } - } - ], - "purl": "pkg:golang/gopkg.in/yaml.v2@v2.4.0", + "purl": "pkg:golang/gopkg.in/yaml.v2@v2.4.0?type=module", "externalReferences": [ { "url": "https://github.com/go-yaml/yaml", "type": "vcs" } ] - }, - { - "bom-ref": "pkg:golang/std@1.16.3", - "type": "library", - "name": "std", - "version": "1.16.3", - "description": "The Go standard library", - "scope": "required", - "purl": "pkg:golang/std@1.16.3", - "externalReferences": [ - { - "url": "https://golang.org/pkg/", - "type": "documentation" - }, - { - "url": "https://go.googlesource.com/go", - "type": "vcs" - }, - { - "url": "https://golang.org/", - "type": "website" - } - ] } ], "dependencies": [ { - "ref": "pkg:golang/github.com/dustin/go-humanize@v1.0.0" - }, - { - "ref": "pkg:golang/github.com/gookit/color@v1.4.2", + "ref": "pkg:golang/github.com/devops-kung-fu/hookz@v2.3.1-0.20210706231702-1c879079cb03?type=module", "dependsOn": [ - "pkg:golang/golang.org/x/sys@v0.0.0-20210630005230-0f9fa26af87c", - "pkg:golang/github.com/xo/terminfo@v0.0.0-20210125001918-ca9a967f8778" + "pkg:golang/github.com/devops-kung-fu/common@v0.2.0?type=module", + "pkg:golang/github.com/dustin/go-humanize@v1.0.0?type=module", + "pkg:golang/github.com/gookit/color@v1.5.0?type=module", + "pkg:golang/github.com/segmentio/ksuid@v1.0.4?type=module", + "pkg:golang/github.com/spf13/afero@v1.8.2?type=module", + "pkg:golang/github.com/spf13/cobra@v1.4.0?type=module", + "pkg:golang/gopkg.in/yaml.v2@v2.4.0?type=module" ] }, { - "ref": "pkg:golang/github.com/inconshreveable/mousetrap@v1.0.0" - }, - { - "ref": "pkg:golang/github.com/segmentio/ksuid@v1.0.3" - }, - { - "ref": "pkg:golang/github.com/spf13/afero@v1.6.0", + "ref": "pkg:golang/github.com/devops-kung-fu/common@v0.2.0?type=module", "dependsOn": [ - "pkg:golang/golang.org/x/text@v0.3.6" + "pkg:golang/github.com/gookit/color@v1.5.0?type=module", + "pkg:golang/github.com/xo/terminfo@v0.0.0-20210125001918-ca9a967f8778?type=module" ] }, { - "ref": "pkg:golang/github.com/spf13/cobra@v1.2.0", + "ref": "pkg:golang/github.com/dustin/go-humanize@v1.0.0?type=module" + }, + { + "ref": "pkg:golang/github.com/gookit/color@v1.5.0?type=module", "dependsOn": [ - "pkg:golang/gopkg.in/yaml.v2@v2.4.0", - "pkg:golang/github.com/spf13/pflag@v1.0.5", - "pkg:golang/github.com/inconshreveable/mousetrap@v1.0.0" + "pkg:golang/github.com/xo/terminfo@v0.0.0-20210125001918-ca9a967f8778?type=module" ] }, { - "ref": "pkg:golang/github.com/spf13/pflag@v1.0.5" + "ref": "pkg:golang/github.com/segmentio/ksuid@v1.0.4?type=module" }, { - "ref": "pkg:golang/github.com/xo/terminfo@v0.0.0-20210125001918-ca9a967f8778" + "ref": "pkg:golang/github.com/spf13/afero@v1.8.2?type=module", + "dependsOn": [ + "pkg:golang/golang.org/x/text@v0.3.7?type=module" + ] }, { - "ref": "pkg:golang/golang.org/x/sys@v0.0.0-20210630005230-0f9fa26af87c" + "ref": "pkg:golang/github.com/spf13/cobra@v1.4.0?type=module", + "dependsOn": [ + "pkg:golang/github.com/spf13/pflag@v1.0.5?type=module", + "pkg:golang/gopkg.in/yaml.v2@v2.4.0?type=module" + ] }, { - "ref": "pkg:golang/golang.org/x/text@v0.3.6" + "ref": "pkg:golang/github.com/spf13/pflag@v1.0.5?type=module" }, { - "ref": "pkg:golang/gopkg.in/yaml.v2@v2.4.0" + "ref": "pkg:golang/github.com/xo/terminfo@v0.0.0-20210125001918-ca9a967f8778?type=module" }, { - "ref": "pkg:golang/github.com/devops-kung-fu/hookz@v0.0.0-20210701232658-32b784d796fc", - "dependsOn": [ - "pkg:golang/github.com/dustin/go-humanize@v1.0.0", - "pkg:golang/github.com/gookit/color@v1.4.2", - "pkg:golang/github.com/segmentio/ksuid@v1.0.3", - "pkg:golang/github.com/spf13/afero@v1.6.0", - "pkg:golang/github.com/spf13/cobra@v1.2.0", - "pkg:golang/golang.org/x/sys@v0.0.0-20210630005230-0f9fa26af87c", - "pkg:golang/golang.org/x/text@v0.3.6", - "pkg:golang/gopkg.in/yaml.v2@v2.4.0", - "pkg:golang/std@1.16.3" - ] + "ref": "pkg:golang/golang.org/x/text@v0.3.7?type=module" }, { - "ref": "pkg:golang/std@1.16.3" + "ref": "pkg:golang/gopkg.in/yaml.v2@v2.4.0?type=module" } ] } diff --git a/lib/configreader.go b/lib/configreader.go index 93bab29..52f8341 100644 --- a/lib/configreader.go +++ b/lib/configreader.go @@ -3,31 +3,25 @@ package lib import ( "errors" - "fmt" "path/filepath" + "github.com/spf13/afero" "gopkg.in/yaml.v2" ) //HasExistingHookzYaml returns true if an existing .hookz.yaml file exists -func HasExistingHookzYaml(fs FileSystem) bool { +func HasExistingHookzYaml(afs *afero.Afero) bool { filename, _ := filepath.Abs(".hookz.yaml") - _, readErr := fs.Afero().ReadFile(filename) + _, readErr := afs.ReadFile(filename) return readErr == nil } //ReadConfig reads the .hookz.yaml file in from the filesystem and //ensures it matches the provided version -func ReadConfig(fs FileSystem, version string) (config Configuration, err error) { - +func ReadConfig(afs *afero.Afero, version string) (config Configuration, err error) { filename, _ := filepath.Abs(".hookz.yaml") - yamlFile, readErr := fs.Afero().ReadFile(filename) + yamlFile, readErr := afs.ReadFile(filename) if readErr != nil { - fmt.Println(".hookz.yaml file not found") - fmt.Println("\nTo create a sample configuration run:") - fmt.Println(" hookz init config") - fmt.Println("\nRun 'hookz --help' for usage.") - fmt.Println() err = errors.New("NO_CONFIG") return } diff --git a/lib/configreader_test.go b/lib/configreader_test.go index 094ac84..ca9ad89 100644 --- a/lib/configreader_test.go +++ b/lib/configreader_test.go @@ -9,27 +9,24 @@ import ( ) var ( - fs FileSystem = FileSystem{ - fs: afero.NewMemMapFs(), - } version string = "1.0.0" - config Configuration ) func TestDeps_ReadConfig(t *testing.T) { - newFs := FileSystem{ - fs: afero.NewMemMapFs(), - } + afs := &afero.Afero{Fs: afero.NewMemMapFs()} - _, err := ReadConfig(newFs, version) + _, err := ReadConfig(afs, version) assert.Error(t, err, "There should be no config created so an error should be thrown.") - config, _ = CreateConfig(newFs, version) - readConfig, err := ReadConfig(newFs, version) + CreateConfig(afs, "1.0.0") + readConfig, err := ReadConfig(afs, version) assert.NoError(t, err, "ReadConfig should not have generated an error") assert.Equal(t, version, readConfig.Version, "Versions should match") - _, err = ReadConfig(newFs, "") + readConfig, err = ReadConfig(afs, "0.1.0") + assert.Error(t, err) + + _, err = ReadConfig(afs, "") assert.Error(t, err, "Passing an empty string should cause an error") } diff --git a/lib/configvalidator.go b/lib/configvalidator.go index ae15385..37b37e5 100644 --- a/lib/configvalidator.go +++ b/lib/configvalidator.go @@ -4,13 +4,17 @@ import ( "crypto/sha256" "errors" "fmt" + "log" "path/filepath" "strings" + + "github.com/devops-kung-fu/common/util" + "github.com/spf13/afero" ) -func generateShasum(fs FileSystem) (shasum string, err error) { +func generateShasum(afs *afero.Afero) (shasum string, err error) { filename, _ := filepath.Abs(".hookz.yaml") - yamlFile, err := fs.Afero().ReadFile(filename) + yamlFile, err := afs.ReadFile(filename) if err != nil { return } @@ -19,13 +23,15 @@ func generateShasum(fs FileSystem) (shasum string, err error) { } //WriteShasum writes the shasum of the JSON representation of the configuration to hookz.shasum -func WriteShasum(fs FileSystem) (err error) { - shasum, err := generateShasum(fs) +func WriteShasum(afs *afero.Afero) (err error) { + shasum, err := generateShasum(afs) if err != nil { return err } filename, _ := filepath.Abs(".git/hooks/hookz.shasum") - err = fs.Afero().WriteFile(filename, []byte(shasum), 0644) + err = afs.WriteFile(filename, []byte(shasum), 0644) + util.IfErrorLog(err) + log.Printf("generated shasum: %s", shasum) return } @@ -33,16 +39,19 @@ func WriteShasum(fs FileSystem) (err error) { func ValidateVersion(config Configuration, version string) (err error) { if config.Version == "" { err = errors.New("no configuration version value found in .hookz.yaml") + util.IfErrorLog(err) return } if version == "" { err = errors.New("a version should not be empty") + util.IfErrorLog(err) return } ver := strings.Split(config.Version, ".") verMatch := strings.Split(version, ".") if fmt.Sprintf("%v.%v", ver[0], ver[1]) != fmt.Sprintf("%v.%v", verMatch[0], verMatch[1]) { err = fmt.Errorf("version mismatch: Expected v%v.%v - Check your .hookz.yaml configuration", verMatch[0], verMatch[1]) + util.IfErrorLog(err) } return } diff --git a/lib/configvalidator_test.go b/lib/configvalidator_test.go index 8a5439c..516a2cc 100644 --- a/lib/configvalidator_test.go +++ b/lib/configvalidator_test.go @@ -1,8 +1,7 @@ package lib import ( - "fmt" - "os" + "path/filepath" "testing" "github.com/spf13/afero" @@ -10,42 +9,38 @@ import ( ) func Test_generateShasum(t *testing.T) { - newFs := FileSystem{ - fs: afero.NewMemMapFs(), - } + afs := &afero.Afero{Fs: afero.NewMemMapFs()} - CreateConfig(newFs, version) + CreateConfig(afs, version) - shasum, err := generateShasum(newFs) + shasum, err := generateShasum(afs) assert.NoError(t, err, "Likely .hookz.yaml couldn't be read") - assert.Equal(t, "bae340195673fed855200d34dace2fc3c6ed44ff37678a2a941b1e58557882e9", shasum, "shasums do not match, but should") + assert.Equal(t, "0213f04ee70cc7b48d6de58e7dd62338259d16ae8e52016d19f83559051dd57c", shasum, "shasums do not match, but should") } func Test_WriteShasum(t *testing.T) { - newFs := FileSystem{ - fs: afero.NewMemMapFs(), - } + afs := &afero.Afero{Fs: afero.NewMemMapFs()} - CreateConfig(newFs, version) + CreateConfig(afs, version) - err := WriteShasum(newFs) + err := WriteShasum(afs) assert.NoError(t, err, "A shasum write should not have caused an error") - path, _ := os.Getwd() - filename := fmt.Sprintf("%s/%s", path, ".git/hooks/hookz.shasum") + filename, _ := filepath.Abs(".git/hooks/hookz.shasum") - contains, _ := newFs.Afero().FileContainsBytes(filename, []byte("bae340195673fed855200d34dace2fc3c6ed44ff37678a2a941b1e58557882e9")) + exists, _ := afs.Exists(filename) + assert.True(t, exists) + + contains, _ := afs.FileContainsBytes(filename, []byte("0213f04ee70cc7b48d6de58e7dd62338259d16ae8e52016d19f83559051dd57c")) assert.True(t, contains, "The expected shasum was not written to the hookz.shasum file") } func TestDeps_CheckVersion(t *testing.T) { - newFs := FileSystem{ - fs: afero.NewMemMapFs(), - } + afs := &afero.Afero{Fs: afero.NewMemMapFs()} - CreateConfig(newFs, version) + CreateConfig(afs, version) - readConfig, err := ReadConfig(newFs, version) + readConfig, err := ReadConfig(afs, version) assert.NoError(t, err, "ReadConfig should not have generated an error") err = ValidateVersion(readConfig, version) diff --git a/lib/configwriter.go b/lib/configwriter.go index 4e3f6f4..bea10ec 100644 --- a/lib/configwriter.go +++ b/lib/configwriter.go @@ -3,14 +3,20 @@ package lib import ( "path/filepath" + "github.com/spf13/afero" "gopkg.in/yaml.v2" ) //CreateConfig creates a starter .hookz.yaml file -func CreateConfig(fs FileSystem, version string) (config Configuration, err error) { +func CreateConfig(afs *afero.Afero, version string) (config Configuration, err error) { command := "echo" config = Configuration{ Version: version, + Sources: []Source{ + { + Source: "github.com/devops-kung-fu/hinge@latest", + }, + }, Hooks: []Hook{ { Type: "pre-commit", @@ -31,7 +37,7 @@ func CreateConfig(fs FileSystem, version string) (config Configuration, err erro return } filename, _ := filepath.Abs(".hookz.yaml") - err = fs.Afero().WriteFile(filename, file, 0644) + err = afs.WriteFile(filename, file, 0644) return } diff --git a/lib/configwriter_test.go b/lib/configwriter_test.go index c08e356..886b3e9 100644 --- a/lib/configwriter_test.go +++ b/lib/configwriter_test.go @@ -9,20 +9,17 @@ import ( ) func Test_CreateConfig(t *testing.T) { + afs := &afero.Afero{Fs: afero.NewMemMapFs()} - newFs := FileSystem{ - fs: afero.NewMemMapFs(), - } - - exists := HasExistingHookzYaml(newFs) + exists := HasExistingHookzYaml(afs) assert.False(t, exists, "No hookz.yaml file should exist") - _, err := CreateConfig(newFs, version) + _, err := CreateConfig(afs, version) assert.NoError(t, err, "CreateConfig should not have generated an error") - exists = HasExistingHookzYaml(newFs) + exists = HasExistingHookzYaml(afs) assert.True(t, exists, "A hookz.yaml file should exist") - readConfig, _ := ReadConfig(newFs, version) + readConfig, _ := ReadConfig(afs, version) assert.Equal(t, version, readConfig.Version, "A Version should have been detected in the config after creation.") } diff --git a/lib/error.go b/lib/error.go deleted file mode 100644 index 8109ff4..0000000 --- a/lib/error.go +++ /dev/null @@ -1,30 +0,0 @@ -package lib - -import "log" - -//IsError Checks to see if an error exists, and if so -//writes it to the log with the provided prefix -func IsError(err error, prefix string) error { - if err != nil { - log.Printf("%v: %v", prefix, err) - } - return err -} - -//IsErrorBool Checks to see if an error exists, and if so -//returns true after writing the error to the log with the provided prefix -func IsErrorBool(err error, prefix string) (b bool) { - if err != nil { - log.Printf("%v: %v", prefix, err) - b = true - } - return -} - -//IfErrorLog Checks to see if an error exists, and if so -//simply writes it to the log. -func IfErrorLog(err error, prefix string) { - if err != nil { - log.Printf("%v: %v", prefix, err) - } -} diff --git a/lib/error_test.go b/lib/error_test.go deleted file mode 100644 index d06c40c..0000000 --- a/lib/error_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package lib - -import ( - "bytes" - "errors" - "log" - "os" - "strings" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestIsError(t *testing.T) { - output := captureOutput(func() { - IsError(errors.New("Test Error"), "[TEST]") - }) - - if output.Len() == 0 { - assert.GreaterOrEqual(t, output.Len(), 0, "No information logged to STDOUT") - assert.GreaterOrEqual(t, strings.Count(output.String(), "\n"), 1, "Expected only a single line of log output") - } -} - -func TestIsErrorBool(t *testing.T) { - output := captureOutput(func() { - IsErrorBool(errors.New("Test Error"), "[TEST]") - }) - - assert.GreaterOrEqual(t, output.Len(), 0, "No information logged to STDOUT") - assert.GreaterOrEqual(t, strings.Count(output.String(), "\n"), 1, "Expected only a single line of log output") -} - -func TestIfErrorLog(t *testing.T) { - output := captureOutput(func() { - IfErrorLog(errors.New("Test Error"), "[TEST]") - }) - - assert.GreaterOrEqual(t, output.Len(), 0, "No information logged to STDOUT") - assert.GreaterOrEqual(t, strings.Count(output.String(), "\n"), 1, "Expected only a single line of log output") -} - -func captureOutput(f func()) bytes.Buffer { - var buf bytes.Buffer - log.SetOutput(&buf) - f() - log.SetOutput(os.Stderr) - return buf -} diff --git a/lib/hookdeleter.go b/lib/hookdeleter.go index eae9256..cf89f18 100644 --- a/lib/hookdeleter.go +++ b/lib/hookdeleter.go @@ -7,63 +7,49 @@ import ( "path/filepath" "strings" - "github.com/gookit/color" + "github.com/devops-kung-fu/common/util" + "github.com/spf13/afero" ) //RemoveHooks purges all hooks from the filesystem that Hookz has created //and deletes any generated scripts -func RemoveHooks(fs FileSystem, verbose bool) (err error) { - DoIf(func() { - color.Style{color.FgLightYellow}.Print("■") - fmt.Println(" Removing existing hooks...") - }, verbose) - +func RemoveHooks(afs *afero.Afero, verbose bool) (err error) { path, _ := os.Getwd() ext := ".hookz" p := fmt.Sprintf("%s/%s", path, ".git/hooks") - dirFiles, _ := fs.Afero().ReadDir(p) + dirFiles, _ := afs.ReadDir(p) for index := range dirFiles { file := dirFiles[index] name := file.Name() fullPath := fmt.Sprintf("%s/%s", p, name) - info, _ := fs.Afero().Stat(fullPath) + info, _ := afs.Stat(fullPath) isHookzFile := strings.Contains(info.Name(), ext) if isHookzFile { var hookName = fullPath[0 : len(fullPath)-len(ext)] - removeErr := fs.fs.Remove(fullPath) + removeErr := afs.Fs.Remove(fullPath) if removeErr != nil { return removeErr } - removeErr = fs.fs.Remove(hookName) + removeErr = afs.Fs.Remove(hookName) if removeErr != nil { return removeErr } parts := strings.Split(hookName, "/") - DoIf(func() { - fmt.Printf(" Deleted %s\n", parts[len(parts)-1]) - }, verbose) + util.DoIf(verbose, func() { + util.PrintTabbedf("Deleted %s", parts[len(parts)-1]) + }) } } - removeShasum(fs) - - DoIf(func() { - color.Style{color.FgGreen}.Print("■") - fmt.Print(" Successfully removed existing hooks!\n") - }, verbose) - - DoIf(func() { - fmt.Println() - }, verbose) - + removeShasum(afs) return } -func removeShasum(fs FileSystem) { +func removeShasum(afs *afero.Afero) { filename, _ := filepath.Abs(".git/hooks/hookz.shasum") - _ = fs.Afero().Remove(filename) + _ = afs.Remove(filename) } diff --git a/lib/hookdeleter_test.go b/lib/hookdeleter_test.go index ae22256..3f36801 100644 --- a/lib/hookdeleter_test.go +++ b/lib/hookdeleter_test.go @@ -11,40 +11,39 @@ import ( ) func TestFileSystem_RemoveHooks(t *testing.T) { + afs := &afero.Afero{Fs: afero.NewMemMapFs()} path, _ := os.Getwd() content := "Test Script" - CreateScriptFile(fs, content) + CreateScriptFile(afs, content) p := fmt.Sprintf("%s/%s", path, ".git/hooks") - dirFiles, _ := fs.Afero().ReadDir(p) + dirFiles, _ := afs.ReadDir(p) assert.Equal(t, 2, len(dirFiles), "Incorrect number of created script files") - err := RemoveHooks(fs, true) + err := RemoveHooks(afs, true) assert.NoError(t, err, "RemoveHooks should not have generated an error") - dirFiles, _ = fs.Afero().ReadDir(p) + dirFiles, _ = afs.ReadDir(p) assert.Equal(t, 0, len(dirFiles), "Incorrect number of created script files") } func Test_removeShasum(t *testing.T) { - newFs := FileSystem{ - fs: afero.NewMemMapFs(), - } + afs := &afero.Afero{Fs: afero.NewMemMapFs()} - CreateConfig(newFs, version) - _ = WriteShasum(newFs) + CreateConfig(afs, version) + _ = WriteShasum(afs) path, _ := os.Getwd() filename := fmt.Sprintf("%s/%s", path, ".git/hooks/hookz.shasum") - exists, _ := newFs.Afero().Exists(filename) + exists, _ := afs.Exists(filename) assert.True(t, exists, "A shasum file needs to exist in order to test removal") - removeShasum(newFs) + removeShasum(afs) - exists, _ = newFs.Afero().Exists(filename) + exists, _ = afs.Exists(filename) assert.False(t, exists, "The shasum file should no longer exist") } diff --git a/lib/hookwriter.go b/lib/hookwriter.go index 670d1b5..5895d8c 100644 --- a/lib/hookwriter.go +++ b/lib/hookwriter.go @@ -3,12 +3,14 @@ package lib import ( "fmt" + "log" "os" "strings" "text/template" - "github.com/gookit/color" + "github.com/devops-kung-fu/common/util" "github.com/segmentio/ksuid" + "github.com/spf13/afero" ) type command struct { @@ -20,9 +22,9 @@ type command struct { } //CreateFile creates a file for a provided FileSystem and file name -func CreateFile(fs FileSystem, name string) (err error) { +func CreateFile(afs *afero.Afero, name string) (err error) { - file, err := fs.fs.Create(name) + file, err := afs.Fs.Create(name) if err != nil { return err } @@ -35,11 +37,11 @@ func CreateFile(fs FileSystem, name string) (err error) { } //CreateScriptFile creates an executable script file with a random name given a string of content -func CreateScriptFile(fs FileSystem, content string) (name string, err error) { +func CreateScriptFile(afs *afero.Afero, content string) (name string, err error) { k, idErr := ksuid.NewRandom() name = k.String() - if IsErrorBool(idErr, "ERROR") { + if util.IsErrorBool(idErr) { err = idErr return } @@ -49,17 +51,17 @@ func CreateScriptFile(fs FileSystem, content string) (name string, err error) { hookzFile := fmt.Sprintf("%s/%s.hookz", p, name) scriptName := fmt.Sprintf("%s/%s", p, name) - err = CreateFile(fs, hookzFile) + err = CreateFile(afs, hookzFile) if err != nil { return } - err = fs.Afero().WriteFile(scriptName, []byte(content), 0644) + err = afs.WriteFile(scriptName, []byte(content), 0644) if err != nil { return } - err = fs.fs.Chmod(scriptName, 0777) + err = afs.Fs.Chmod(scriptName, 0777) if err != nil { return } @@ -83,63 +85,56 @@ func buildFullCommand(action Action, debug bool) string { } //WriteHooks writes all of the generated scripts to the .git/hooks directory -func WriteHooks(fs FileSystem, config Configuration, verbose bool, debug bool) (err error) { - +func WriteHooks(afs *afero.Afero, config Configuration, verbose bool, verboseOutput bool) (err error) { + log.Println("Writing hooks") for _, hook := range config.Hooks { - var commands []command - DoIf(func() { - color.Style{color.FgLightYellow}.Print("■") - fmt.Printf(" Writing %s \n", hook.Type) - }, verbose) + util.DoIf(verbose, func() { + util.PrintInfof("Writing %s", hook.Type) + }) for _, action := range hook.Actions { - err = buildExec(fs, &action) + err = buildExec(afs, &action) if err != nil { return err } - DoIf(func() { - fmt.Printf(" Adding %s action: %s\n", hook.Type, action.Name) - }, verbose) + util.DoIf(verbose, func() { + util.PrintTabbedf("Adding %s action: %s", hook.Type, action.Name) + }) - fullCommand := buildFullCommand(action, debug) + fullCommand := buildFullCommand(action, verboseOutput) commands = append(commands, command{ Name: action.Name, Type: hook.Type, ShortCommand: *action.Exec, FullCommand: fullCommand, - Debug: debug, + Debug: verboseOutput, }) } - err = writeTemplate(fs, commands, hook.Type) + err = writeTemplate(afs, commands, hook.Type) if err != nil { return } - DoIf(func() { - color.Style{color.FgGreen}.Print("■") - fmt.Printf(" Successfully wrote %s\n", hook.Type) - }, verbose) - - DoIf(func() { - fmt.Println() - }, verbose) + util.DoIf(verbose, func() { + util.PrintSuccess(fmt.Sprintf("Successfully wrote %s", hook.Type)) + }) } - _ = WriteShasum(fs) - return nil + _ = WriteShasum(afs) + return } -func buildExec(fs FileSystem, action *Action) (err error) { +func buildExec(afs *afero.Afero, action *Action) (err error) { if action.Exec == nil && action.URL != nil { - filename, err := DownloadFile(fs, ".git/hooks", *action.URL) + filename, err := DownloadFile(afs, ".git/hooks", *action.URL) action.Exec = &filename if err != nil { return err } } if action.Exec == nil && action.Script != nil { - scriptFileName, _ := CreateScriptFile(fs, *action.Script) + scriptFileName, _ := CreateScriptFile(afs, *action.Script) path, err := os.Getwd() if err != nil { return err @@ -150,18 +145,18 @@ func buildExec(fs FileSystem, action *Action) (err error) { return } -func writeTemplate(fs FileSystem, commands []command, hookType string) (err error) { +func writeTemplate(afs *afero.Afero, commands []command, hookType string) (err error) { path, _ := os.Getwd() p := fmt.Sprintf("%s/%s", path, ".git/hooks") hookzFile := fmt.Sprintf("%s/%s.hookz", p, hookType) - err = CreateFile(fs, hookzFile) + err = CreateFile(afs, hookzFile) if err != nil { return } filename := fmt.Sprintf("%s/%s", p, hookType) - file, err := fs.Afero().Create(filename) + file, err := afs.Create(filename) if err != nil { return err } @@ -170,7 +165,7 @@ func writeTemplate(fs FileSystem, commands []command, hookType string) (err erro if err != nil { return err } - err = fs.fs.Chmod(filename, 0777) + err = afs.Fs.Chmod(filename, 0777) if err != nil { return err } @@ -179,18 +174,18 @@ func writeTemplate(fs FileSystem, commands []command, hookType string) (err erro } //HasExistingHookz determines if any .hookz touch files exist in the .git/hooks directory -func HasExistingHookz(fs FileSystem) (exists bool) { +func HasExistingHookz(afs *afero.Afero) (exists bool) { path, _ := os.Getwd() ext := ".hookz" p := fmt.Sprintf("%s/%s", path, ".git/hooks") - dirFiles, _ := fs.Afero().ReadDir(p) + dirFiles, _ := afs.ReadDir(p) for index := range dirFiles { file := dirFiles[index] name := file.Name() fullPath := fmt.Sprintf("%s/%s", p, name) - info, _ := fs.Afero().Stat(fullPath) + info, _ := afs.Stat(fullPath) isHookzFile := strings.Contains(info.Name(), ext) if isHookzFile { return true @@ -222,7 +217,7 @@ if [ "$check" != "$shasum" ]; then echo "Please regenerate your hooks with the following" echo "command and try again." echo - echo " hookz reset [--verbose] [--debug]" + echo " hookz reset [--verbose] [--debug] [--verbose-output]" echo echo "Run 'hookz --help' for usage." echo diff --git a/lib/hookwriter_test.go b/lib/hookwriter_test.go index 2b50774..dc74484 100644 --- a/lib/hookwriter_test.go +++ b/lib/hookwriter_test.go @@ -12,14 +12,15 @@ import ( ) func TestDeps_CreateScriptFile(t *testing.T) { + afs := &afero.Afero{Fs: afero.NewMemMapFs()} content := "Test Script" - filename, err := CreateScriptFile(fs, content) + filename, err := CreateScriptFile(afs, content) assert.NoError(t, err, "CreateScriptFile should not have generated an error") assert.NotEmpty(t, filename, "A filename should have been returned") path, _ := os.Getwd() fullFileName := fmt.Sprintf("%s/%s/%s", path, ".git/hooks", filename) - contains, _ := fs.Afero().FileContainsBytes(fullFileName, []byte(content)) + contains, _ := afs.FileContainsBytes(fullFileName, []byte(content)) assert.True(t, contains, "Script file should have the phrase `Test Script` in it") } @@ -30,7 +31,8 @@ func Test_genTemplate(t *testing.T) { } func Test_buildFullCommand(t *testing.T) { - config, err := CreateConfig(fs, version) + afs := &afero.Afero{Fs: afero.NewMemMapFs()} + config, err := CreateConfig(afs, version) assert.NoError(t, err, "createConfig should not have generated an error") action := config.Hooks[0].Actions[0] @@ -41,55 +43,64 @@ func Test_buildFullCommand(t *testing.T) { } func Test_WriteHooks(t *testing.T) { - config, err := CreateConfig(fs, version) + afs := &afero.Afero{Fs: afero.NewMemMapFs()} + config, err := CreateConfig(afs, version) assert.NoError(t, err, "createConfig should not have generated an error") - err = WriteHooks(fs, config, true, true) + err = WriteHooks(afs, config, true, true) assert.NoError(t, err, "WriteHooks should not have generated an error") filename, _ := filepath.Abs(".git/hooks/pre-commit") - contains, _ := fs.Afero().FileContainsBytes(filename, []byte("Hookz")) + contains, _ := afs.FileContainsBytes(filename, []byte("Hookz")) assert.True(t, contains, "Generated hook should have the word Hookz in it") } func Test_createFile(t *testing.T) { - err := CreateFile(fs, "test") + afs := &afero.Afero{Fs: afero.NewMemMapFs()} + err := CreateFile(afs, "test") assert.NoError(t, err, "Create file should not generate an error") - exists, _ := fs.Afero().Exists("test") + exists, _ := afs.Exists("test") assert.True(t, exists, "A file should have been created") } func Test_writeTemplate(t *testing.T) { - err := writeTemplate(fs, nil, "") + afs := &afero.Afero{Fs: afero.NewMemMapFs()} + err := writeTemplate(afs, nil, "") assert.Error(t, err, "writeTemplate should throw an error if there is no file created") } func Test_HasExistingHookz(t *testing.T) { - exists := HasExistingHookz(fs) + afs := &afero.Afero{Fs: afero.NewMemMapFs()} + exists := HasExistingHookz(afs) assert.False(t, exists, "No hookz files should exist") - config, err := CreateConfig(fs, version) + config, err := CreateConfig(afs, version) assert.NoError(t, err, "createConfig should not have generated an error") - err = WriteHooks(fs, config, true, true) + err = WriteHooks(afs, config, true, true) assert.NoError(t, err, "WriteHooks should not have generated an error") - exists = HasExistingHookz(fs) + exists = HasExistingHookz(afs) assert.True(t, exists, "hookz files should exist") } func Test_buildExec(t *testing.T) { - newFs := FileSystem{ - fs: afero.NewMemMapFs(), - } + afs := &afero.Afero{Fs: afero.NewMemMapFs()} script := "#!/bin/bash" action := Action{ Script: &script, } - err := buildExec(newFs, &action) + err := buildExec(afs, &action) assert.NoError(t, err, "buildExec shouldn't have generated an error") assert.NotNil(t, action.Exec, "action.Exec field should not be nil") + + url := "test" + action = Action{ + URL: &url, + } + err = buildExec(afs, &action) + assert.Error(t, err) } diff --git a/lib/sourcerunner.go b/lib/sourcerunner.go new file mode 100644 index 0000000..da8393a --- /dev/null +++ b/lib/sourcerunner.go @@ -0,0 +1,19 @@ +package lib + +import ( + "log" + "os/exec" +) + +func InstallSource(source Source) (err error) { + + log.Printf("installing: %s", source.Source) + cmd := exec.Command("go", "install", source.Source) + + err = cmd.Run() + if err != nil { + log.Print(err) + } + + return +} diff --git a/lib/sourcerunner_test.go b/lib/sourcerunner_test.go new file mode 100644 index 0000000..09df00a --- /dev/null +++ b/lib/sourcerunner_test.go @@ -0,0 +1,32 @@ +package lib + +import ( + "testing" + + "github.com/devops-kung-fu/common/util" + "github.com/stretchr/testify/assert" +) + +func TestInstallSources(t *testing.T) { + sources := []Source{ + { + Source: "github.com/devops-kung-fu/hinge@latest", + }, + } + output := util.CaptureOutput(func() { + _ = InstallSource(sources[len(sources)-1]) + }) + + assert.NotNil(t, output) + assert.Contains(t, output, "installing: github.com/devops-kung-fu/hinge@latest\n") + + sources = []Source{ + { + Source: "yeah", + }, + } + output = util.CaptureOutput(func() { + _ = InstallSource(sources[len(sources)-1]) + }) + assert.Contains(t, output, "exit status 1\n") +} diff --git a/lib/structs.go b/lib/structs.go index 6c52b0b..d783a6a 100644 --- a/lib/structs.go +++ b/lib/structs.go @@ -1,14 +1,11 @@ //Package lib Functionality for the Hookz CLI package lib -import ( - "github.com/spf13/afero" -) - //Configuration represents the content of .hookz.yaml type Configuration struct { - Version string `json:"version"` - Hooks []Hook `json:"hooks"` + Version string `json:"version"` + Hooks []Hook `json:"hooks"` + Sources []Source `json:"source"` } //Hook is the definition of a collection of actions to be run at @@ -27,20 +24,6 @@ type Action struct { Script *string `json:"script,omitempty"` } -//FileSystem wraps the afero.Fs interface to allow for mocking -type FileSystem struct { - fs afero.Fs -} - -//NewOsFs creates a new disk based file system -func NewOsFs() FileSystem { - var d FileSystem - d.fs = afero.NewOsFs() - return d -} - -//Afero returns a new Afero struct wraping the current file system -func (fs FileSystem) Afero() (afs *afero.Afero) { - afs = &afero.Afero{Fs: fs.fs} - return +type Source struct { + Source string `json:"source"` } diff --git a/lib/structs_test.go b/lib/structs_test.go deleted file mode 100644 index c26c1fc..0000000 --- a/lib/structs_test.go +++ /dev/null @@ -1,19 +0,0 @@ -//Package lib Functionality for the Hookz CLI -package lib - -import ( - "testing" - - "github.com/spf13/afero" - "github.com/stretchr/testify/assert" -) - -func TestNewOsFs(t *testing.T) { - f := FileSystem{} - - var i interface{} = NewOsFs() - var fs interface{} = afero.NewOsFs() - - assert.IsType(t, f, i, "NewDeps is not returning a Deps struct") - assert.IsType(t, fs, NewOsFs().fs, "fs should be an afero.OsFs") -} diff --git a/lib/util.go b/lib/util.go deleted file mode 100644 index 028ef09..0000000 --- a/lib/util.go +++ /dev/null @@ -1,8 +0,0 @@ -package lib - -//DoIf runs a passed function if the condition is true -func DoIf(f func(), condition bool) { - if condition { - f() - } -} diff --git a/lib/util_test.go b/lib/util_test.go deleted file mode 100644 index c1d2f3e..0000000 --- a/lib/util_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package lib - -import ( - "fmt" - "log" - "os" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestDoIf(t *testing.T) { - result, err := CaptureStdout(func() { DoIf(func() { fmt.Println("Test") }, true) }) - - assert.Equal(t, "Test\n", result, "Should match the string Test") - assert.NoError(t, err, "No error should have been generated") -} - -func CaptureStdout(f func()) (captured string, err error) { - r, w, err := os.Pipe() - if err != nil { - log.Fatal(err) - } - origStdout := os.Stdout - os.Stdout = w - - f() - - buf := make([]byte, 1024) - n, err := r.Read(buf) - if err != nil { - log.Fatal(err) - } - os.Stdout = origStdout - captured = string(buf[:n]) - return -} diff --git a/lib/web.go b/lib/web.go index dfdf59f..78b75e3 100644 --- a/lib/web.go +++ b/lib/web.go @@ -11,7 +11,9 @@ import ( "runtime" "strings" + "github.com/devops-kung-fu/common/util" "github.com/dustin/go-humanize" + "github.com/spf13/afero" ) //WriteCounter encapsulates the total number of bytes captured and rendered @@ -36,18 +38,18 @@ func (wc WriteCounter) PrintProgress() { //UpdateExecutables parses the configuration for URL's and re-downloads //the contents into the .git/hooks folder -func UpdateExecutables(fs FileSystem, config Configuration) (err error) { +func UpdateExecutables(afs *afero.Afero, config Configuration) (err error) { var updateCount = 0 for _, hook := range config.Hooks { for _, action := range hook.Actions { if action.URL != nil { updateCount++ - _, err = DownloadFile(fs, ".git/hooks", *action.URL) + _, err = DownloadFile(afs, ".git/hooks", *action.URL) } } } if updateCount == 0 { - fmt.Println("Nothing to Update!") + util.PrintInfo("Nothing to Update!") } return @@ -56,7 +58,7 @@ func UpdateExecutables(fs FileSystem, config Configuration) (err error) { // DownloadFile will download a url to a local file. It's efficient because it will // write as it downloads and not load the whole file into memory. We pass an io.TeeReader // into Copy() to report progress on the download. -func DownloadFile(fs FileSystem, filepath string, URL string) (filename string, err error) { +func DownloadFile(afs *afero.Afero, filepath string, URL string) (filename string, err error) { URL = platformURLIfDefined(URL) _, err = url.ParseRequestURI(URL) if err != nil { @@ -64,7 +66,7 @@ func DownloadFile(fs FileSystem, filepath string, URL string) (filename string, } filename = path.Base(URL) fullFileName := fmt.Sprintf("%s/%s", filepath, filename) - out, err := fs.Afero().Create(fmt.Sprintf("%s.tmp", fullFileName)) + out, err := afs.Create(fmt.Sprintf("%s.tmp", fullFileName)) if err != nil { return } diff --git a/lib/web_test.go b/lib/web_test.go index 83d3e1a..782b5a0 100644 --- a/lib/web_test.go +++ b/lib/web_test.go @@ -10,6 +10,7 @@ import ( ) func TestUpdateExecutables(t *testing.T) { + afs := &afero.Afero{Fs: afero.NewMemMapFs()} botchedConfig := Configuration{ Version: "s", Hooks: []Hook{ @@ -23,12 +24,13 @@ func TestUpdateExecutables(t *testing.T) { }, }, } - err := UpdateExecutables(fs, botchedConfig) + err := UpdateExecutables(afs, botchedConfig) assert.NoError(t, err, "UpdateExecutables should only happen if action.URL != nil") } func Test_DownloadFile(t *testing.T) { - _, err := DownloadFile(fs, "x", "x") + afs := &afero.Afero{Fs: afero.NewMemMapFs()} + _, err := DownloadFile(afs, "x", "x") assert.Error(t, err, "URL should be a valid URI") } @@ -55,9 +57,7 @@ func TestWriteCounter_Write(t *testing.T) { } func TestDownloadFile(t *testing.T) { - newFs := FileSystem{ - fs: afero.NewMemMapFs(), - } + afs := &afero.Afero{Fs: afero.NewMemMapFs()} URL := "https://github.com/devops-kung-fu/hinge/releases/download/v0.1.0/hinge-0.1.0-linux-amd64" httpmock.Activate() defer httpmock.DeactivateAndReset() @@ -65,7 +65,7 @@ func TestDownloadFile(t *testing.T) { httpmock.RegisterResponder("GET", URL, httpmock.NewBytesResponder(200, []byte("test"))) - filename, err := DownloadFile(newFs, ".git/hooks", URL) + filename, err := DownloadFile(afs, ".git/hooks", URL) assert.NoError(t, err) assert.Equal(t, "hinge-0.1.0-linux-amd64", filename) diff --git a/tackle/go/cyclonedx.yaml b/tackle/go/cyclonedx.yaml index 090d9b0..ac5d62e 100644 --- a/tackle/go/cyclonedx.yaml +++ b/tackle/go/cyclonedx.yaml @@ -3,4 +3,4 @@ # HOOK: pre-commit - name: "cyclone-dx: Generate a Software Bill of Materials (SBoM)" exec: cyclonedx-gomod - args: ["-json", "-output", "hookz-sbom.json", "-std", "-licenses"] \ No newline at end of file + args: ["app", "-json", "-output", "hookz-sbom.json"] \ No newline at end of file diff --git a/temp b/temp deleted file mode 100644 index e69de29..0000000