func NewScannerWithScratchBuffer(osDirname string, scratchBuffer []byte) (*Scanner, error) {
	dh, err := os.Open(osDirname)
	if err != nil {
		return nil, err
	}
	if len(scratchBuffer) < MinimumScratchBufferSize {
		scratchBuffer = newScratchBuffer()
	}
	scanner := &Scanner{
		scratchBuffer: scratchBuffer,
		osDirname:     osDirname,
		dh:            dh,
		fd:            int(dh.Fd()),
	}
	return scanner, nil
}
NewScannerWithScratchBuffer returns a new directory Scanner that lazily
enumerates the contents of a single directory. On platforms other than
Windows it uses the provided scratch buffer to read from the file system. On
Windows the scratch buffer is ignored.
package godirwalk
import (
	"os"
	"syscall"
	"unsafe"
)
type Scanner struct {
	scratchBuffer []byte  
	workBuffer    []byte  
	osDirname     string
	childName     string
	err           error     
	statErr       error     
	dh            *os.File  
	de            *Dirent   
	sde           syscall.Dirent
	fd            int  
}
func NewScanner(osDirname string) (*Scanner, error) {
	return NewScannerWithScratchBuffer(osDirname, nil)
}