File: fs.go

package info (click to toggle)
golang-github-unrolled-render 1.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 260 kB
  • sloc: makefile: 13
file content (21 lines) | stat: -rw-r--r-- 431 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package render

import (
	"io/ioutil"
	"path/filepath"
)

type FileSystem interface {
	Walk(root string, walkFn filepath.WalkFunc) error
	ReadFile(filename string) ([]byte, error)
}

type LocalFileSystem struct{}

func (LocalFileSystem) Walk(root string, walkFn filepath.WalkFunc) error {
	return filepath.Walk(root, walkFn)
}

func (LocalFileSystem) ReadFile(filename string) ([]byte, error) {
	return ioutil.ReadFile(filename)
}