Skip to content

Commit

Permalink
fix: fix toc parallell appender
Browse files Browse the repository at this point in the history
  • Loading branch information
moisespsena committed Apr 26, 2019
1 parent 3ff7d41 commit 2bfff64
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ var (
type tocRegister struct {
toc []Asset
byName map[string]int
mu sync.Mutex
}

func (t *tocRegister) Append(asset ...Asset) {
t.mu.Lock()
defer t.mu.Unlock()
for _, asset := range asset {
if i, ok := t.byName[asset.Name]; ok {
t.toc[i] = asset
Expand Down

0 comments on commit 2bfff64

Please sign in to comment.