func TestConcurrentAccess(t *testing.T) {
file, _ := os.Open("../../testdata/cool_images.doc") // a file with small number of embedded images
defer file.Close()
doc, err := mscfb.New(file)
if err != nil {
log.Fatal(err)
}
var wg sync.WaitGroup
wg.Add(len(doc.File))
for _, f := range doc.File {
go func() {
defer wg.Done()
_, err := io.Copy(io.Discard, f)
if err != nil {
log.Println(err)
}
}()
}
wg.Wait()
}
Race is on r.buf in mscfb.(*Reader).readAt()
if _, err := r.ra.ReadAt(r.buf[:length], offset); err != nil {
Race is on
r.buf
inmscfb.(*Reader).readAt()