mirror of
https://github.com/onyx-and-iris/exclude.git
synced 2026-04-16 14:13:39 +00:00
remove the type assertions update the tests: the tests now check output as well as file contents separately.
19 lines
375 B
Go
19 lines
375 B
Go
package cmd
|
|
|
|
import "bytes"
|
|
|
|
// seekBuffer wraps bytes.Buffer to satisfy the readWriteTruncater interface,
|
|
// allowing it to be used in place of *os.File in tests.
|
|
type seekBuffer struct {
|
|
bytes.Buffer
|
|
}
|
|
|
|
func (s *seekBuffer) Seek(offset int64, whence int) (int64, error) {
|
|
return 0, nil
|
|
}
|
|
|
|
func (s *seekBuffer) Truncate(size int64) error {
|
|
s.Buffer.Reset()
|
|
return nil
|
|
}
|