From d9379fcd0c298dc4b8e197270a11f5a2d5c10dcf Mon Sep 17 00:00:00 2001 From: Harri Lainio Date: Wed, 23 Aug 2023 13:42:23 +0300 Subject: [PATCH] automigrated err2 handler func signatures --- cmd/agency/ops.go | 4 ++-- cmd/agent/agent.go | 4 ++-- cmd/agent/connect.go | 4 ++-- cmd/agent/createcreddef.go | 4 ++-- cmd/agent/createschema.go | 4 ++-- cmd/agent/getcreddef.go | 4 ++-- cmd/agent/getschema.go | 4 ++-- cmd/agent/invitation.go | 4 ++-- cmd/agent/listen.go | 4 ++-- cmd/agent/ping.go | 4 ++-- cmd/agent/salisten.go | 4 ++-- cmd/agent/setimpl.go | 4 ++-- cmd/authn/add.go | 4 ++-- cmd/authn/authn.go | 4 ++-- cmd/authn/login.go | 4 ++-- cmd/authn/register.go | 4 ++-- cmd/bot/bot.go | 4 ++-- cmd/bot/chat.go | 4 ++-- cmd/bot/read.go | 4 ++-- cmd/bot/start.go | 4 ++-- cmd/bot/uml.go | 4 ++-- cmd/connection/connection.go | 4 ++-- cmd/connection/issue.go | 4 ++-- cmd/connection/reqproof.go | 4 ++-- cmd/connection/status.go | 4 ++-- cmd/connection/trustping.go | 4 ++-- cmd/connection/unpause.go | 4 ++-- cmd/newkey.go | 4 ++-- cmd/root.go | 4 ++-- cmd/version.go | 4 ++-- completionhelp/wallet.go | 4 ++-- 31 files changed, 62 insertions(+), 62 deletions(-) diff --git a/cmd/agency/ops.go b/cmd/agency/ops.go index 730e02c..5c24163 100644 --- a/cmd/agency/ops.go +++ b/cmd/agency/ops.go @@ -26,9 +26,9 @@ var CmdData = struct { }{} func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) flags := OpsCmd.PersistentFlags() flags.StringVar(&CmdData.JWT, "jwt", "", diff --git a/cmd/agent/agent.go b/cmd/agent/agent.go index 4b32f75..b3b26cf 100644 --- a/cmd/agent/agent.go +++ b/cmd/agent/agent.go @@ -29,9 +29,9 @@ var CmdData = struct { }{} func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) flags := AgentCmd.PersistentFlags() flags.StringVar(&CmdData.JWT, "jwt", "", diff --git a/cmd/agent/connect.go b/cmd/agent/connect.go index c44e7d7..e35df99 100644 --- a/cmd/agent/connect.go +++ b/cmd/agent/connect.go @@ -91,9 +91,9 @@ var ( ) func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) connectCmd.Flags().StringVar(&invitationStr, "invitation", "", "invitation json") connectCmd.Flags().StringVar(&ourLabel, "label", "", "our Aries connection Label ") diff --git a/cmd/agent/createcreddef.go b/cmd/agent/createcreddef.go index d3c785e..201db7d 100644 --- a/cmd/agent/createcreddef.go +++ b/cmd/agent/createcreddef.go @@ -51,9 +51,9 @@ var createCredDefCmd = &cobra.Command{ var tag string func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) createCredDefCmd.Flags().StringVarP(&schemaID, "id", "i", "", cmd.FlagInfo("Schema ID", "", getSchemaEnvs["id"])) createCredDefCmd.Flags().StringVarP(&tag, "tag", "t", "", "tag of the creddef") diff --git a/cmd/agent/createschema.go b/cmd/agent/createschema.go index 555a41d..54b1f4d 100644 --- a/cmd/agent/createschema.go +++ b/cmd/agent/createschema.go @@ -58,9 +58,9 @@ var ( ) func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) createSchemaCmd.Flags().StringVarP(&name, "name", "a", "", "schema name") createSchemaCmd.Flags().StringVar(&version, "version", "", "schema version") createSchemaCmd.MarkFlagRequired("name") diff --git a/cmd/agent/getcreddef.go b/cmd/agent/getcreddef.go index a9c6ac8..2e26ed6 100644 --- a/cmd/agent/getcreddef.go +++ b/cmd/agent/getcreddef.go @@ -71,9 +71,9 @@ var ( ) func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) flags := getCredDefCmd.Flags() flags.StringVarP(&CredDefID, "id", "i", "", diff --git a/cmd/agent/getschema.go b/cmd/agent/getschema.go index ff4a927..a85e8da 100644 --- a/cmd/agent/getschema.go +++ b/cmd/agent/getschema.go @@ -73,9 +73,9 @@ var ( ) func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) flags := getSchemaCmd.Flags() flags.StringVarP(&schemaID, "schema-id", "i", "", diff --git a/cmd/agent/invitation.go b/cmd/agent/invitation.go index 15ae645..60f7ff6 100644 --- a/cmd/agent/invitation.go +++ b/cmd/agent/invitation.go @@ -67,9 +67,9 @@ var ( ) func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) invitationCmd.Flags().BoolVarP(&urlFormat, "url", "u", false, "if set returns URL formatted invitation") diff --git a/cmd/agent/listen.go b/cmd/agent/listen.go index cc69a53..8a9d8a4 100644 --- a/cmd/agent/listen.go +++ b/cmd/agent/listen.go @@ -103,9 +103,9 @@ func mySleep(_ time.Duration) { var stressTest bool func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) listenCmd.Flags().BoolVarP(&stressTest, "stress", "t", false, "stress mode = immediate connection retry") diff --git a/cmd/agent/ping.go b/cmd/agent/ping.go index 44f9728..bf7cc1f 100644 --- a/cmd/agent/ping.go +++ b/cmd/agent/ping.go @@ -50,9 +50,9 @@ var pingCmd = &cobra.Command{ var andController bool func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) pingCmd.Flags().BoolVarP(&andController, "and-controller", "a", false, "ping service agent as well") AgentCmd.AddCommand(pingCmd) diff --git a/cmd/agent/salisten.go b/cmd/agent/salisten.go index 508a72b..81f7bd7 100644 --- a/cmd/agent/salisten.go +++ b/cmd/agent/salisten.go @@ -130,9 +130,9 @@ var conn client.Conn var ack bool func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) saListenCmd.Flags().BoolVarP(&ack, "reply_ack", "a", true, "used reply ack for all request") diff --git a/cmd/agent/setimpl.go b/cmd/agent/setimpl.go index ee1b5b7..9a947e6 100644 --- a/cmd/agent/setimpl.go +++ b/cmd/agent/setimpl.go @@ -73,9 +73,9 @@ var auto bool var read bool func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) enterModeCmd.Flags().BoolVarP(&auto, "auto", "a", false, "set controller communication mode to auto") enterModeCmd.Flags().BoolVarP(&read, "read", "r", false, diff --git a/cmd/authn/add.go b/cmd/authn/add.go index ae8c5af..36b6af2 100644 --- a/cmd/authn/add.go +++ b/cmd/authn/add.go @@ -43,9 +43,9 @@ var addCmd = &cobra.Command{ } func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) addCmd.Flags().StringVar(&authnCmd.Token, "jwt", authnCmd.Token, cmd.FlagInfo("Existing token to register a NEW authenticator", "", envs["jwt"])) diff --git a/cmd/authn/authn.go b/cmd/authn/authn.go index 031a32d..e0b5510 100644 --- a/cmd/authn/authn.go +++ b/cmd/authn/authn.go @@ -49,9 +49,9 @@ var acatorCmd = &cobra.Command{ } func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) flags := acatorCmd.PersistentFlags() flags.StringVarP(&authnCmd.UserName, "user-name", "u", "", diff --git a/cmd/authn/login.go b/cmd/authn/login.go index 83beebf..cdea75c 100644 --- a/cmd/authn/login.go +++ b/cmd/authn/login.go @@ -47,9 +47,9 @@ var loginCmd = &cobra.Command{ } func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) acatorCmd.AddCommand(loginCmd) } diff --git a/cmd/authn/register.go b/cmd/authn/register.go index 080c4b7..bbd2efc 100644 --- a/cmd/authn/register.go +++ b/cmd/authn/register.go @@ -46,9 +46,9 @@ var registerCmd = &cobra.Command{ } func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) acatorCmd.AddCommand(registerCmd) } diff --git a/cmd/bot/bot.go b/cmd/bot/bot.go index 19b5836..bafb8b8 100644 --- a/cmd/bot/bot.go +++ b/cmd/bot/bot.go @@ -39,9 +39,9 @@ func PrintCmdData() { } func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) flags := botCmd.PersistentFlags() flags.StringVar(&CmdData.JWT, "jwt", "", diff --git a/cmd/bot/chat.go b/cmd/bot/chat.go index 4059f4d..f0aaea0 100644 --- a/cmd/bot/chat.go +++ b/cmd/bot/chat.go @@ -54,9 +54,9 @@ var chatCmd = &cobra.Command{ } func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) chatCmd.Flags().BoolVarP(&ack, "reply_ack", "a", true, "used reply ack for all request") botCmd.AddCommand(chatCmd) } diff --git a/cmd/bot/read.go b/cmd/bot/read.go index 78824ee..5094a93 100644 --- a/cmd/bot/read.go +++ b/cmd/bot/read.go @@ -91,9 +91,9 @@ var readCmd = &cobra.Command{ var ack bool func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) readCmd.Flags().BoolVarP(&ack, "reply_ack", "a", true, "used reply ack for all request") botCmd.AddCommand(readCmd) } diff --git a/cmd/bot/start.go b/cmd/bot/start.go index 2f93907..a1b65e6 100644 --- a/cmd/bot/start.go +++ b/cmd/bot/start.go @@ -77,9 +77,9 @@ var ( ) func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) startCmd.Flags().StringVarP(&fType, "type", "t", ".yaml", "file type used for state machine load") startCmd.Flags().StringVar(&serviceFSM, "service-fsm", "", "FSM file for service level state machine load") botCmd.AddCommand(startCmd) diff --git a/cmd/bot/uml.go b/cmd/bot/uml.go index d21c5a5..93d50e8 100644 --- a/cmd/bot/uml.go +++ b/cmd/bot/uml.go @@ -54,9 +54,9 @@ var umlCmd = &cobra.Command{ } func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) umlCmd.Flags().StringVarP(&fType, "type", "t", ".yaml", "file type used for state machine load") botCmd.AddCommand(umlCmd) diff --git a/cmd/connection/connection.go b/cmd/connection/connection.go index e901ff4..4a0ae27 100644 --- a/cmd/connection/connection.go +++ b/cmd/connection/connection.go @@ -40,9 +40,9 @@ func PrintCmdData() { var conn client.Conn func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) flags := ConnectionCmd.PersistentFlags() flags.StringVar(&CmdData.JWT, "jwt", "", diff --git a/cmd/connection/issue.go b/cmd/connection/issue.go index be58b78..d9f1939 100644 --- a/cmd/connection/issue.go +++ b/cmd/connection/issue.go @@ -57,9 +57,9 @@ var issueCmd = &cobra.Command{ } func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) issueCmd.Flags().StringVar(&attrJSON, "attrs", "", cmd.FlagInfo("attrs json", "", issueEnvs["attrs"])) diff --git a/cmd/connection/reqproof.go b/cmd/connection/reqproof.go index d2fae12..77ab2dd 100644 --- a/cmd/connection/reqproof.go +++ b/cmd/connection/reqproof.go @@ -61,9 +61,9 @@ var reqProofCmd = &cobra.Command{ } func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) reqProofCmd.Flags().StringVar(&attrJSON, "attrs", "", "attrs json") diff --git a/cmd/connection/status.go b/cmd/connection/status.go index 0545788..6de0066 100644 --- a/cmd/connection/status.go +++ b/cmd/connection/status.go @@ -59,9 +59,9 @@ var statusCmd = &cobra.Command{ var MyTypeID int32 func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) statusCmd.Flags().StringVarP(&MyProtocolID, "id", "i", "", "protocol id for continue") statusCmd.Flags().Int32VarP(&MyTypeID, "type", "t", 4, "4=trust ping, 1=issue, ... see usage") diff --git a/cmd/connection/trustping.go b/cmd/connection/trustping.go index b30892f..f3e0c36 100644 --- a/cmd/connection/trustping.go +++ b/cmd/connection/trustping.go @@ -56,8 +56,8 @@ func trustping(_ *cobra.Command, _ []string) (err error) { } func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) ConnectionCmd.AddCommand(pingCmd) } diff --git a/cmd/connection/unpause.go b/cmd/connection/unpause.go index 50efebf..86b6fed 100644 --- a/cmd/connection/unpause.go +++ b/cmd/connection/unpause.go @@ -69,9 +69,9 @@ var ( ) func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) unpauseCmd.Flags().StringVarP(&MyProtocolID, "id", "i", "", "protocol id for continue") unpauseCmd.Flags().BoolVarP(&ACK, "ack", "a", true, "how to proceed with the protocol") diff --git a/cmd/newkey.go b/cmd/newkey.go index a2bb244..13b5523 100644 --- a/cmd/newkey.go +++ b/cmd/newkey.go @@ -28,9 +28,9 @@ var newKeyCmd = &cobra.Command{ } func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) rootCmd.AddCommand(newKeyCmd) } diff --git a/cmd/root.go b/cmd/root.go index e8effb3..2119616 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -130,9 +130,9 @@ var rootEnvs = map[string]string{ } func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { log.Println(err) - }) + })) cobra.OnInitialize(initConfig) diff --git a/cmd/version.go b/cmd/version.go index cca4cc6..34574fb 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -24,9 +24,9 @@ var versionCmd = &cobra.Command{ } func init() { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { fmt.Println(err) - }) + })) rootCmd.AddCommand(versionCmd) } diff --git a/completionhelp/wallet.go b/completionhelp/wallet.go index 93617cb..6c15aea 100644 --- a/completionhelp/wallet.go +++ b/completionhelp/wallet.go @@ -10,9 +10,9 @@ import ( ) func WalletLocations() []string { - defer err2.Catch(func(err error) { + defer err2.Catch(err2.Err(func(err error) { _, _ = fmt.Fprintln(os.Stderr, err) - }) + })) home := try.To1(os.UserHomeDir()) indyWallets := filepath.Join(home, ".indy_client/wallet")