diff --git a/gherkin/ast.go b/gherkin/ast.go index 06df0e8..7ffc7f7 100644 --- a/gherkin/ast.go +++ b/gherkin/ast.go @@ -1,10 +1,6 @@ package gherkin -import ( - "sync" - - "github.com/l3pp4rd/go-behat/gherkin/lexer" -) +import "github.com/l3pp4rd/go-behat/gherkin/lexer" type item struct { next, prev *item @@ -13,17 +9,13 @@ type item struct { type AST struct { head, tail *item - mut *sync.Mutex } func newAST() *AST { - return &AST{mut: &sync.Mutex{}} + return &AST{} } func (l *AST) addTail(t *lexer.Token) *item { - l.mut.Lock() - defer l.mut.Unlock() - it := &item{next: nil, prev: l.tail, value: t} if l.head == nil { l.head = it @@ -35,9 +27,6 @@ func (l *AST) addTail(t *lexer.Token) *item { } func (l *AST) addBefore(t *lexer.Token, i *item) *item { - l.mut.Lock() - defer l.mut.Unlock() - it := &item{next: i, prev: i.prev, value: t} i.prev = it if it.prev == nil { @@ -47,9 +36,6 @@ func (l *AST) addBefore(t *lexer.Token, i *item) *item { } func (l *AST) addAfter(t *lexer.Token, i *item) *item { - l.mut.Lock() - defer l.mut.Unlock() - it := &item{next: i.next, prev: i, value: t} i.next = it if it.next == nil {