Skip to content

Commit 96d724b

Browse files
committed
Replace concrete filesystem usage with interface
1 parent 5723fd7 commit 96d724b

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ require (
1515
github.com/go-gl/mathgl v0.0.0-20190713194549-592312d8590a
1616
github.com/golang-source-engine/filesystem v0.1.2
1717
github.com/golang-source-engine/stringtable v0.1.0
18-
github.com/golang-source-engine/vmt v0.1.0
18+
github.com/golang-source-engine/vmt v0.1.1
1919
)

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ github.com/golang-source-engine/vmt v0.0.0-20190917225430-668305ff2fd8 h1:jBRzeb
4343
github.com/golang-source-engine/vmt v0.0.0-20190917225430-668305ff2fd8/go.mod h1:NVdf67X6t/Uu2WsOIyVNMJPGR9DIhBJMqrU2rpJlqQM=
4444
github.com/golang-source-engine/vmt v0.1.0 h1:B9RVSozvfgnfK0FWao/XPgf83FVIByeMeQNm5onInU8=
4545
github.com/golang-source-engine/vmt v0.1.0/go.mod h1:bXMpaO+WnKcuJ+CyR8sgrKnxQ+2+13OribIL+pgZmeg=
46+
github.com/golang-source-engine/vmt v0.1.1 h1:yBl2XzwBhmwmpEWxEK5t7HpfL63ZTOwGcEMsA/xUrTc=
47+
github.com/golang-source-engine/vmt v0.1.1/go.mod h1:devs1P7sA/Spthvxw8+wzuEsN3Ibadbia6n3SQQfdW8=
4648
github.com/logrusorgru/aurora v0.0.0-20190428105938-cea283e61946 h1:z+WaKrgu3kCpcdnbK9YG+JThpOCd1nU5jO5ToVmSlR4=
4749
github.com/logrusorgru/aurora v0.0.0-20190428105938-cea283e61946/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
4850
golang.org/x/image v0.0.0-20190209060608-ef4a1470e0dc/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=

loader/material/common.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package material
2+
3+
import "io"
4+
5+
type VirtualFilesystem interface {
6+
GetFile(string) (io.Reader, error)
7+
}

loader/material/vmt.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
package material
22

33
import (
4-
"github.com/golang-source-engine/filesystem"
54
"github.com/golang-source-engine/vmt"
65
)
76

8-
func LoadVmtFromFilesystem(fs *filesystem.FileSystem, filePath string) (*vmt.Properties, error) {
7+
func LoadVmtFromFilesystem(fs VirtualFilesystem, filePath string) (*vmt.Properties, error) {
98
mat,err := vmt.FromFilesystem(filePath, fs, vmt.NewProperties())
109
if err != nil {
1110
return nil, err

0 commit comments

Comments
 (0)