diff --git a/src/build/token/Token.go b/src/build/token/Token.go index e10f8bc..bf1208b 100644 --- a/src/build/token/Token.go +++ b/src/build/token/Token.go @@ -1,6 +1,9 @@ package token -import "fmt" +import ( + "fmt" + "unsafe" +) // Token represents a single element in a source file. // The characters that make up an identifier are grouped into a single token. @@ -30,5 +33,5 @@ func (t *Token) Reset() { // Text returns the token text. func (t *Token) Text() string { - return string(t.Bytes) + return unsafe.String(unsafe.SliceData(t.Bytes), len(t.Bytes)) }