< Summary - go-semantic-release Coverage

Line coverage
100%
Covered lines: 16
Uncovered lines: 0
Coverable lines: 16
Total lines: 41
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ReadFile0%00100%
WriteFile0%00100%
Exists0%00100%
Walk0%00100%
Glob0%00100%

File(s)

/home/runner/work/go-semantic-release/go-semantic-release/internal/adapters/fs/filesystem.go

#LineLine coverage
 1package fs
 2
 3import (
 4  "io/fs"
 5  "os"
 6  "path/filepath"
 7
 8  "github.com/jedi-knights/go-semantic-release/internal/ports"
 9)
 10
 11// Compile-time interface compliance check.
 12var _ ports.FileSystem = (*OSFileSystem)(nil)
 13
 14// OSFileSystem implements ports.FileSystem using the real filesystem.
 15type OSFileSystem struct{}
 16
 17// NewOSFileSystem creates a real filesystem adapter.
 18func NewOSFileSystem() *OSFileSystem {
 19  return &OSFileSystem{}
 20}
 21
 222func (f *OSFileSystem) ReadFile(path string) ([]byte, error) {
 223  return os.ReadFile(path)
 224}
 25
 126func (f *OSFileSystem) WriteFile(path string, data []byte, perm fs.FileMode) error {
 127  return os.WriteFile(path, data, perm)
 128}
 29
 230func (f *OSFileSystem) Exists(path string) bool {
 231  _, err := os.Stat(path)
 232  return err == nil
 233}
 34
 135func (f *OSFileSystem) Walk(root string, fn fs.WalkDirFunc) error {
 136  return filepath.WalkDir(root, fn)
 137}
 38
 139func (f *OSFileSystem) Glob(pattern string) ([]string, error) {
 140  return filepath.Glob(pattern)
 141}

Methods/Properties

ReadFile
WriteFile
Exists
Walk
Glob