Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
automigrated err2 handler func signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
lainio committed Aug 23, 2023
1 parent 7c45411 commit d9379fc
Show file tree
Hide file tree
Showing 31 changed files with 62 additions and 62 deletions.
4 changes: 2 additions & 2 deletions cmd/agency/ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 31 in cmd/agency/ops.go

View check run for this annotation

Codecov / codecov/patch

cmd/agency/ops.go#L31

Added line #L31 was not covered by tests

flags := OpsCmd.PersistentFlags()
flags.StringVar(&CmdData.JWT, "jwt", "",
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 34 in cmd/agent/agent.go

View check run for this annotation

Codecov / codecov/patch

cmd/agent/agent.go#L34

Added line #L34 was not covered by tests

flags := AgentCmd.PersistentFlags()
flags.StringVar(&CmdData.JWT, "jwt", "",
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ var (
)

func init() {
defer err2.Catch(func(err error) {
defer err2.Catch(err2.Err(func(err error) {
fmt.Println(err)
})
}))

Check warning on line 96 in cmd/agent/connect.go

View check run for this annotation

Codecov / codecov/patch

cmd/agent/connect.go#L96

Added line #L96 was not covered by tests

connectCmd.Flags().StringVar(&invitationStr, "invitation", "", "invitation json")
connectCmd.Flags().StringVar(&ourLabel, "label", "", "our Aries connection Label ")
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/createcreddef.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 56 in cmd/agent/createcreddef.go

View check run for this annotation

Codecov / codecov/patch

cmd/agent/createcreddef.go#L56

Added line #L56 was not covered by tests
createCredDefCmd.Flags().StringVarP(&schemaID, "id", "i", "",
cmd.FlagInfo("Schema ID", "", getSchemaEnvs["id"]))
createCredDefCmd.Flags().StringVarP(&tag, "tag", "t", "", "tag of the creddef")
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/createschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ var (
)

func init() {
defer err2.Catch(func(err error) {
defer err2.Catch(err2.Err(func(err error) {
fmt.Println(err)
})
}))

Check warning on line 63 in cmd/agent/createschema.go

View check run for this annotation

Codecov / codecov/patch

cmd/agent/createschema.go#L63

Added line #L63 was not covered by tests
createSchemaCmd.Flags().StringVarP(&name, "name", "a", "", "schema name")
createSchemaCmd.Flags().StringVar(&version, "version", "", "schema version")
createSchemaCmd.MarkFlagRequired("name")
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/getcreddef.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ var (
)

func init() {
defer err2.Catch(func(err error) {
defer err2.Catch(err2.Err(func(err error) {
fmt.Println(err)
})
}))

Check warning on line 76 in cmd/agent/getcreddef.go

View check run for this annotation

Codecov / codecov/patch

cmd/agent/getcreddef.go#L76

Added line #L76 was not covered by tests

flags := getCredDefCmd.Flags()
flags.StringVarP(&CredDefID, "id", "i", "",
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/getschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ var (
)

func init() {
defer err2.Catch(func(err error) {
defer err2.Catch(err2.Err(func(err error) {
fmt.Println(err)
})
}))

Check warning on line 78 in cmd/agent/getschema.go

View check run for this annotation

Codecov / codecov/patch

cmd/agent/getschema.go#L78

Added line #L78 was not covered by tests

flags := getSchemaCmd.Flags()
flags.StringVarP(&schemaID, "schema-id", "i", "",
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/invitation.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ var (
)

func init() {
defer err2.Catch(func(err error) {
defer err2.Catch(err2.Err(func(err error) {
fmt.Println(err)
})
}))

Check warning on line 72 in cmd/agent/invitation.go

View check run for this annotation

Codecov / codecov/patch

cmd/agent/invitation.go#L72

Added line #L72 was not covered by tests

invitationCmd.Flags().BoolVarP(&urlFormat,
"url", "u", false, "if set returns URL formatted invitation")
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/listen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 108 in cmd/agent/listen.go

View check run for this annotation

Codecov / codecov/patch

cmd/agent/listen.go#L108

Added line #L108 was not covered by tests

listenCmd.Flags().BoolVarP(&stressTest, "stress", "t", false,
"stress mode = immediate connection retry")
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 55 in cmd/agent/ping.go

View check run for this annotation

Codecov / codecov/patch

cmd/agent/ping.go#L55

Added line #L55 was not covered by tests
pingCmd.Flags().BoolVarP(&andController, "and-controller", "a", false,
"ping service agent as well")
AgentCmd.AddCommand(pingCmd)
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/salisten.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 135 in cmd/agent/salisten.go

View check run for this annotation

Codecov / codecov/patch

cmd/agent/salisten.go#L135

Added line #L135 was not covered by tests

saListenCmd.Flags().BoolVarP(&ack, "reply_ack", "a", true,
"used reply ack for all request")
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/setimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 78 in cmd/agent/setimpl.go

View check run for this annotation

Codecov / codecov/patch

cmd/agent/setimpl.go#L78

Added line #L78 was not covered by tests
enterModeCmd.Flags().BoolVarP(&auto, "auto", "a", false,
"set controller communication mode to auto")
enterModeCmd.Flags().BoolVarP(&read, "read", "r", false,
Expand Down
4 changes: 2 additions & 2 deletions cmd/authn/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 48 in cmd/authn/add.go

View check run for this annotation

Codecov / codecov/patch

cmd/authn/add.go#L48

Added line #L48 was not covered by tests

addCmd.Flags().StringVar(&authnCmd.Token, "jwt", authnCmd.Token,
cmd.FlagInfo("Existing token to register a NEW authenticator", "", envs["jwt"]))
Expand Down
4 changes: 2 additions & 2 deletions cmd/authn/authn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 54 in cmd/authn/authn.go

View check run for this annotation

Codecov / codecov/patch

cmd/authn/authn.go#L54

Added line #L54 was not covered by tests

flags := acatorCmd.PersistentFlags()
flags.StringVarP(&authnCmd.UserName, "user-name", "u", "",
Expand Down
4 changes: 2 additions & 2 deletions cmd/authn/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 52 in cmd/authn/login.go

View check run for this annotation

Codecov / codecov/patch

cmd/authn/login.go#L52

Added line #L52 was not covered by tests

acatorCmd.AddCommand(loginCmd)
}
4 changes: 2 additions & 2 deletions cmd/authn/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 51 in cmd/authn/register.go

View check run for this annotation

Codecov / codecov/patch

cmd/authn/register.go#L51

Added line #L51 was not covered by tests

acatorCmd.AddCommand(registerCmd)
}
4 changes: 2 additions & 2 deletions cmd/bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 44 in cmd/bot/bot.go

View check run for this annotation

Codecov / codecov/patch

cmd/bot/bot.go#L44

Added line #L44 was not covered by tests

flags := botCmd.PersistentFlags()
flags.StringVar(&CmdData.JWT, "jwt", "",
Expand Down
4 changes: 2 additions & 2 deletions cmd/bot/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 59 in cmd/bot/chat.go

View check run for this annotation

Codecov / codecov/patch

cmd/bot/chat.go#L59

Added line #L59 was not covered by tests
chatCmd.Flags().BoolVarP(&ack, "reply_ack", "a", true, "used reply ack for all request")
botCmd.AddCommand(chatCmd)
}
4 changes: 2 additions & 2 deletions cmd/bot/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 96 in cmd/bot/read.go

View check run for this annotation

Codecov / codecov/patch

cmd/bot/read.go#L96

Added line #L96 was not covered by tests
readCmd.Flags().BoolVarP(&ack, "reply_ack", "a", true, "used reply ack for all request")
botCmd.AddCommand(readCmd)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/bot/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ var (
)

func init() {
defer err2.Catch(func(err error) {
defer err2.Catch(err2.Err(func(err error) {
fmt.Println(err)
})
}))

Check warning on line 82 in cmd/bot/start.go

View check run for this annotation

Codecov / codecov/patch

cmd/bot/start.go#L82

Added line #L82 was not covered by tests
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)
Expand Down
4 changes: 2 additions & 2 deletions cmd/bot/uml.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 59 in cmd/bot/uml.go

View check run for this annotation

Codecov / codecov/patch

cmd/bot/uml.go#L59

Added line #L59 was not covered by tests
umlCmd.Flags().StringVarP(&fType, "type", "t", ".yaml",
"file type used for state machine load")
botCmd.AddCommand(umlCmd)
Expand Down
4 changes: 2 additions & 2 deletions cmd/connection/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 45 in cmd/connection/connection.go

View check run for this annotation

Codecov / codecov/patch

cmd/connection/connection.go#L45

Added line #L45 was not covered by tests

flags := ConnectionCmd.PersistentFlags()
flags.StringVar(&CmdData.JWT, "jwt", "",
Expand Down
4 changes: 2 additions & 2 deletions cmd/connection/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 62 in cmd/connection/issue.go

View check run for this annotation

Codecov / codecov/patch

cmd/connection/issue.go#L62

Added line #L62 was not covered by tests

issueCmd.Flags().StringVar(&attrJSON, "attrs", "",
cmd.FlagInfo("attrs json", "", issueEnvs["attrs"]))
Expand Down
4 changes: 2 additions & 2 deletions cmd/connection/reqproof.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 66 in cmd/connection/reqproof.go

View check run for this annotation

Codecov / codecov/patch

cmd/connection/reqproof.go#L66

Added line #L66 was not covered by tests

reqProofCmd.Flags().StringVar(&attrJSON, "attrs", "", "attrs json")

Expand Down
4 changes: 2 additions & 2 deletions cmd/connection/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 64 in cmd/connection/status.go

View check run for this annotation

Codecov / codecov/patch

cmd/connection/status.go#L64

Added line #L64 was not covered by tests

statusCmd.Flags().StringVarP(&MyProtocolID, "id", "i", "", "protocol id for continue")
statusCmd.Flags().Int32VarP(&MyTypeID, "type", "t", 4, "4=trust ping, 1=issue, ... see usage")
Expand Down
4 changes: 2 additions & 2 deletions cmd/connection/trustping.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 61 in cmd/connection/trustping.go

View check run for this annotation

Codecov / codecov/patch

cmd/connection/trustping.go#L61

Added line #L61 was not covered by tests
ConnectionCmd.AddCommand(pingCmd)
}
4 changes: 2 additions & 2 deletions cmd/connection/unpause.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ var (
)

func init() {
defer err2.Catch(func(err error) {
defer err2.Catch(err2.Err(func(err error) {
fmt.Println(err)
})
}))

Check warning on line 74 in cmd/connection/unpause.go

View check run for this annotation

Codecov / codecov/patch

cmd/connection/unpause.go#L74

Added line #L74 was not covered by tests

unpauseCmd.Flags().StringVarP(&MyProtocolID, "id", "i", "", "protocol id for continue")
unpauseCmd.Flags().BoolVarP(&ACK, "ack", "a", true, "how to proceed with the protocol")
Expand Down
4 changes: 2 additions & 2 deletions cmd/newkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 33 in cmd/newkey.go

View check run for this annotation

Codecov / codecov/patch

cmd/newkey.go#L33

Added line #L33 was not covered by tests

rootCmd.AddCommand(newKeyCmd)
}
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 135 in cmd/root.go

View check run for this annotation

Codecov / codecov/patch

cmd/root.go#L135

Added line #L135 was not covered by tests

cobra.OnInitialize(initConfig)

Expand Down
4 changes: 2 additions & 2 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}))

Check warning on line 29 in cmd/version.go

View check run for this annotation

Codecov / codecov/patch

cmd/version.go#L29

Added line #L29 was not covered by tests

rootCmd.AddCommand(versionCmd)
}
4 changes: 2 additions & 2 deletions completionhelp/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit d9379fc

Please sign in to comment.