mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-09 23:34:26 +00:00
29 lines
317 B
Go
29 lines
317 B
Go
|
//go:build dev
|
||
|
|
||
|
package bindata
|
||
|
|
||
|
import (
|
||
|
"io"
|
||
|
"io/fs"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
type GottyFS struct {
|
||
|
fs.FS
|
||
|
}
|
||
|
|
||
|
var Fs GottyFS
|
||
|
|
||
|
func (gfs *GottyFS) ReadFile(name string) ([]byte, error) {
|
||
|
fp, err := gfs.Open(name)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
return io.ReadAll(fp)
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
Fs = GottyFS{os.DirFS("bindata")}
|
||
|
}
|