Created
December 12, 2021 19:50
-
-
Save jcdan3/980752332df4f7aeaa3e100c063ac03d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package mockingdemo | |
| import "fmt" | |
| type FileSystem struct{ | |
| conn FileConnector | |
| } | |
| func NewFS() FileSystem{ | |
| fs := FileSystem{conn: NewFileConnector()} | |
| return fs | |
| } | |
| func (fs* FileSystem) PrintFileContent(fileName string) error{ | |
| fileContent,err := fs.conn.ReadFromFile(fileName) | |
| if err != nil { | |
| return err | |
| } | |
| fmt.Println(string(fileContent)) | |
| return nil | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment