Skip to content

Commit

Permalink
use io.NopCloser
Browse files Browse the repository at this point in the history
  • Loading branch information
ftl committed Dec 9, 2023
1 parent f80adf3 commit 049b6a3
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pkg/hamdeck/hamdeck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,7 @@ func openTestConfigFile(filename string) (io.ReadCloser, error) {
}

func openTestConfigString(config string) (io.ReadCloser, error) {
buffer := bytes.NewBufferString(config)
return &readCloseWrapper{buffer}, nil
}

type readCloseWrapper struct {
io.Reader
}

func (w *readCloseWrapper) Close() error {
return nil
return io.NopCloser(bytes.NewBufferString(config)), nil
}

type testDevice struct {
Expand Down

0 comments on commit 049b6a3

Please sign in to comment.