Skip to content

Commit

Permalink
Reintroduce cloning of vars to avoid concurrency issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Jun 28, 2017
1 parent 849d41c commit ec4a71a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ func formatSeverity() string {

type Vars map[string]string

func (v Vars) Copy() Vars {
out := Vars{}
for k, v := range v {
out[k] = v
}
return out
}

func (v Vars) Replace(s string) string {
for k, v := range v {
prefix := regexp.MustCompile(fmt.Sprintf("{%s=([^}]*)}", k))
Expand Down Expand Up @@ -433,7 +441,7 @@ func runLinters(linters map[string]*Linter, paths []string, concurrency int, exc
Linter: linter,
issues: incomingIssues,
paths: paths,
vars: vars,
vars: vars.Copy(),
exclude: exclude,
include: include,
deadline: deadline,
Expand Down

0 comments on commit ec4a71a

Please sign in to comment.