Skip to content

Commit

Permalink
cleanup: don't return an internal type from VolumeGroupJournal.Connect()
Browse files Browse the repository at this point in the history
The VolumeGroupJournal interface does not need to return anything except
for a potential error. Any instance that implements the
VolumeGroupJournal interface can be used to call all functions.

Signed-off-by: Niels de Vos <[email protected]>
  • Loading branch information
nixpanic authored and mergify[bot] committed Mar 14, 2024
1 parent 9276aeb commit 32de268
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/journal/volumegroupjournal.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type VolumeGroupJournal interface {
Connect(
monitors,
namespace string,
cr *util.Credentials) (*volumeGroupJournalConfig, error)
cr *util.Credentials) error
// Destroy frees any resources and invalidates the journal connection.
Destroy()
// SetNamespace sets the namespace for the journal.
Expand Down Expand Up @@ -115,14 +115,14 @@ func (sgj *volumeGroupJournalConfig) Connect(
monitors,
namespace string,
cr *util.Credentials,
) (*volumeGroupJournalConfig, error) {
) error {
conn, err := sgj.Config.Connect(monitors, namespace, cr)
if err != nil {
return nil, err
return err
}
sgj.Connection = conn

return sgj, nil
return nil
}

func (sgj *volumeGroupJournalConfig) Destroy() {
Expand Down

0 comments on commit 32de268

Please sign in to comment.