mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
76e5fda8b7
This commit fixes the index out of range error discussed in #5646 and adds error handling to avoid that `fmt` panics when such errors are encountered by the formatter The error handling procedure introduced is similar to the one used by the Scanner struct responsible for the parsing of a `rego` file, since it uses a slice which is filled with all the eventual errors that can be found during the format procedure Fixes: #5646 Signed-off-by: Gianluca Oldani <oldanigianluca@gmail.com>