Skip to content

Instantly share code, notes, and snippets.

@jcdan3
Created December 12, 2021 19:50
Show Gist options
  • Select an option

  • Save jcdan3/980752332df4f7aeaa3e100c063ac03d to your computer and use it in GitHub Desktop.

Select an option

Save jcdan3/980752332df4f7aeaa3e100c063ac03d to your computer and use it in GitHub Desktop.
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