Skip to content

Commit

Permalink
Fix test. Fix error handling which uses old ok values
Browse files Browse the repository at this point in the history
  • Loading branch information
yutopp committed Jul 15, 2024
1 parent fefe95d commit ece6c5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions message/body_encoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func TestEncodeCmdMessageOnStatus(t *testing.T) {
Level: "status",
Code: NetConnectionConnectCodeSuccess,
Description: "Connection succeeded",
Data: map[string]interface{}{},
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion message/net_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (t *NetConnectionConnectResult) FromArgs(args ...interface{}) error {
return errors.Wrapf(err, "failed to mapping arg[0] to NetConnectionConnectResultProperties")

Check warning on line 83 in message/net_connection.go

View check run for this annotation

Codecov / codecov/patch

message/net_connection.go#L83

Added line #L83 was not covered by tests
}

information := args[1].(map[string]interface{})
information, ok := args[1].(map[string]interface{})
if !ok {
return errors.Errorf("expect map[string]interface{} at arg[1], but got %T", args[1])

Check warning on line 88 in message/net_connection.go

View check run for this annotation

Codecov / codecov/patch

message/net_connection.go#L88

Added line #L88 was not covered by tests
}
Expand Down

0 comments on commit ece6c5c

Please sign in to comment.