From 870556044d7f14ae1f3a0a671250712acb8680a4 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 5 Apr 2024 14:01:26 +0200 Subject: [PATCH] Add check_type option to collect_and_parse_symbols Add check_type option to collect_and_parse_symbols to skip checking the filetype when not needed. Also comment print() statement Signed-off-by: Philippe Ombredanne --- src/go_inspector/plugin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/go_inspector/plugin.py b/src/go_inspector/plugin.py index f247ade..e830215 100644 --- a/src/go_inspector/plugin.py +++ b/src/go_inspector/plugin.py @@ -104,13 +104,15 @@ def is_executable_binary(location): return True -def collect_and_parse_symbols(location, **kwargs): + +def collect_and_parse_symbols(location, check_type=True, **kwargs): """ Run GoReSym and return a mapping of symbols of interest for the Go binary file at ``location``. + If ``check_type`` is True, the file is checked. """ - if not is_executable_binary(location): - print("Not an executable binary") + if check_type and not is_executable_binary(location): + # print("Not an executable binary") return goresym_args = ["-p", location]