Skip to content

Commit 9c50d33

Browse files
committed
common: update New*() functions to return interface type
Change the return types from pointers to the inheriting type (e.g. 'userProvider') to the interface type ('UserProvider'). This is more consistent with the rest of the codebase, and more readily provides compiler errors when the type does not implement the interface. Signed-off-by: Victoria Dye <[email protected]>
1 parent bec0c2f commit 9c50d33

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

internal/common/command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type CommandExecutor interface {
1111

1212
type commandExecutor struct{}
1313

14-
func NewCommandExecutor() *commandExecutor {
14+
func NewCommandExecutor() CommandExecutor {
1515
return &commandExecutor{}
1616
}
1717

internal/common/filesystem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type FileSystem interface {
1818

1919
type fileSystem struct{}
2020

21-
func NewFileSystem() *fileSystem {
21+
func NewFileSystem() FileSystem {
2222
return &fileSystem{}
2323
}
2424

internal/common/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type UserProvider interface {
1010

1111
type userProvider struct{}
1212

13-
func NewUserProvider() *userProvider {
13+
func NewUserProvider() UserProvider {
1414
return &userProvider{}
1515
}
1616

0 commit comments

Comments
 (0)