w 5IFDBMMFSPGGVODUJPODBOIBWFHSFBUFSBDDFTTUPSFUVSOFEWBMVF w %FQFOEFODZ*OWFSTJPO1SJODJQMF %*1 w %FQFOEPOBCTUSBDUJPOT OPUDPODSFUJPOT w 3FEVDFEFQFOEFODZDPNQMFYJUZ w 5IJTJEPNJTVTFEJONBOZQMBDFTJO,VCFSOFUFTDPEFCBTF // Accepting interface func Foo(g getter) // Instead of accepting concrete type func Foo(s *store.Store) // Returning concrete type func NewFoo() (*Thing, error) // Instead of returning interface func NewFoo() (Thinger, error)
channel over which // directory entries will be published. When the list // of entries is exhausted, the channel will be closed. func ListDirectory(dir string) chan string // ListDirectory returns the contents of dir. func ListDirectory(dir string) ([]string, error) 'SPNEBWFDIFOFZOFU
channel over which // directory entries will be published. When the list // of entries is exhausted, the channel will be closed. func ListDirectory(dir string) chan string // ListDirectory returns the contents of dir. func ListDirectory(dir string) ([]string, error) 'SPNEBWFDIFOFZOFU func ListDirectory(dir string, fn func(string))
channel over which // directory entries will be published. When the list // of entries is exhausted, the channel will be closed. func ListDirectory(dir string) chan string // ListDirectory returns the contents of dir. func ListDirectory(dir string) ([]string, error) 'SPNEBWFDIFOFZOFU func ListDirectory(dir string, fn func(string)) 5IJTNJHIUCFXIZXFIBWFUIFTBNFJOUFSGBDFGPS UIF8BML%JSGVODUJPOJOUIFTUBOEBSE fi MFQBUIQBDLBHF func WalkDir(root string, fn fs.WalkDirFunc) error
MFEFMFUJPOXIFOUIF fi MFJTPQFOJOBQSPDFTT w 8JOEPXT w EPFTOPUQFSNJUCZSFUVSOJOHBOFSSPS w SFRVJSFTVTFSUP fi OEBOELJMMUIFQSPDFTT fi STU w 6OJY w KVTUNBSLTUIF fi MFGPSEFMFUJPOXIFOSFBEZBOESFUVSOTOPFSSPS 3FUVSOJOHFSSPSTJTFBTZIBOEMJOHUIFNJTIBSE
&SSPSTBSFWBMVFT(P#MPH w 5IF;FOPG(P%BWF$IFOOFZ w 1SBDUJDBM(P3FBMXPSMEBEWJDFGPS XSJUJOHNBJOUBJOBCMF(PQSPHSBNT%BWF$IFOOFZ w 5BMLT w 4JNQMJDJUZJT$PNQMJDBUFE3PC1JLF