diff --git a/.travis.yml b/.travis.yml index 0ec7d6d1..eebcb8fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,7 @@ before_install: - go get golang.org/x/tools/cmd/cover - go get github.com/mattn/goveralls # Required for dot parser checks. - - ./.travis/install-gocc.sh 0e2cfc030005b281b2e5a2de04fa7fe1d5063722 + - ./.travis/install-gocc.sh 66c61e91b3657c517a6f89d2837d370e61fb9430 addons: apt: diff --git a/graph/formats/dot/internal/errors/errors.go b/graph/formats/dot/internal/errors/errors.go index 7b640a0d..ecbef4c6 100644 --- a/graph/formats/dot/internal/errors/errors.go +++ b/graph/formats/dot/internal/errors/errors.go @@ -13,8 +13,8 @@ package errors import ( - "bytes" "fmt" + "strings" "gonum.org/v1/gonum/graph/formats/dot/internal/token" ) @@ -31,7 +31,7 @@ type Error struct { } func (e *Error) String() string { - w := new(bytes.Buffer) + w := new(strings.Builder) fmt.Fprintf(w, "Error") if e.Err != nil { fmt.Fprintf(w, " %s\n", e.Err) @@ -52,7 +52,7 @@ func (e *Error) String() string { } func (e *Error) Error() string { - w := new(bytes.Buffer) + w := new(strings.Builder) fmt.Fprintf(w, "Error in S%d: %s, %s", e.StackTop, token.TokMap.TokenString(e.ErrorToken), e.ErrorToken.Pos.String()) if e.Err != nil { fmt.Fprintf(w, ": %+v", e.Err) diff --git a/graph/formats/dot/internal/parser/parser.go b/graph/formats/dot/internal/parser/parser.go index 4c54b469..52e49513 100644 --- a/graph/formats/dot/internal/parser/parser.go +++ b/graph/formats/dot/internal/parser/parser.go @@ -13,8 +13,8 @@ package parser import ( - "bytes" "fmt" + "strings" parseError "gonum.org/v1/gonum/graph/formats/dot/internal/errors" "gonum.org/v1/gonum/graph/formats/dot/internal/token" @@ -76,7 +76,7 @@ func (s *stack) popN(items int) []Attrib { } func (s *stack) String() string { - w := new(bytes.Buffer) + w := new(strings.Builder) fmt.Fprintf(w, "stack:\n") for i, st := range s.state { fmt.Fprintf(w, "\t%d: %d , ", i, st)