Skip to content

Commit

Permalink
Increase buffer for reading lines
Browse files Browse the repository at this point in the history
Fixes `[error] file '~/.awless/aws/rdf/client-name/global/access.nt': bufio.Scanner: token too long`

Related: wallix#300
Related: wallix/triplestore#8
  • Loading branch information
elkargig committed Feb 9, 2022
1 parent a5b9c0b commit 2109d8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,8 @@ func getTemplateText(path string) (content []byte, expanded string, err error) {

func removeComments(b []byte) []byte {
scn := bufio.NewScanner(bytes.NewReader(b))
buf := make([]byte, 0, 64*1024)
scn.Buffer(buf, 1024*1024)
var cleaned bytes.Buffer
for scn.Scan() {
line := scn.Text()
Expand Down
2 changes: 2 additions & 0 deletions vendor/github.com/wallix/triplestore/ntparser.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2109d8c

Please sign in to comment.