MCPcopy Index your code
hub / github.com/perkeep/perkeep / openFile

Function openFile

internal/media/audio_test.go:28–39  ·  view source on GitHub ↗

openFile opens fn, a file within the testdata dir, and returns an FD and the file's size.

(fn string)

Source from the content-addressed store, hash-verified

26
27// openFile opens fn, a file within the testdata dir, and returns an FD and the file's size.
28func openFile(fn string) (*os.File, int64, error) {
29 f, err := os.Open(filepath.Join("testdata", fn))
30 if err != nil {
31 return nil, 0, err
32 }
33 s, err := f.Stat()
34 if err != nil {
35 f.Close()
36 return nil, 0, err
37 }
38 return f, s.Size(), nil
39}
40
41func TestHasID3v1Tag(t *testing.T) {
42 tests := []struct {

Callers 2

TestHasID3v1TagFunction · 0.85
TestGetMPEGAudioDurationFunction · 0.85

Calls 4

OpenMethod · 0.65
StatMethod · 0.65
CloseMethod · 0.65
SizeMethod · 0.65

Tested by

no test coverage detected