go-graphite / carbonapi

Implementation of graphite API (graphite-web) in golang
Other
309 stars 140 forks source link

Skip all whitespace during expr parsing #771

Closed leizor closed 1 year ago

leizor commented 1 year ago

Fixes https://github.com/go-graphite/carbonapi/issues/747.

This PR expands definition of whitespace being trimmed during query parsing to include any rune that satisfies unicode.IsSpace.

This allows the parser to parse queries that look like this:

alias(
    foo.bar.baz,
    'asdf',
)

The above query will be parsed the same as this:

alias(foo.bar.baz, 'asdf')

This behavior is consistent with the behavior in https://github.com/graphite-project/graphite-web.