diff --git a/AUTHORS.rst b/AUTHORS.rst index 51a19cc..8b106ca 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -1,3 +1,5 @@ The following organizations or individuals have contributed to this repo: -- +- Tushar Goel @TG1999 +- Philippe Ombredanne @pombredanne +- nexB Inc. diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ffe0364..1952b1f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,3 +7,11 @@ v0.1.0 (8th April 2024) - Add goresym support in go-inspector. + + +v0.2.0 (9th April 2024) +------------------------ + +- Add missing ABOUT file and license for goresym. +- Bump to version GoReSym 2.7.2 +- Add support for dependencies and build info diff --git a/NOTICE b/NOTICE index 65936b2..686740f 100644 --- a/NOTICE +++ b/NOTICE @@ -1,6 +1,6 @@ # # Copyright (c) nexB Inc. and others. -# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: Apache-2.0 AND MIT AND BSD-3-Clause WITH LicenRef-scancode-google-patent-license-golang # # Visit https://aboutcode.org and https://github.com/nexB/ for support and download. # ScanCode is a trademark of nexB Inc. diff --git a/README.rst b/README.rst index 79aeec2..c5ef98d 100644 --- a/README.rst +++ b/README.rst @@ -1,16 +1,75 @@ -Go-Inspector +go-inspector ================================ -- To enable the GoReSym plugin, first you need to install goresym from https://github.com/mandiant/GoReSym/releases/download/v2.6.4/GoReSym.zip -- Unzip the GoReSym.zip, extract goresym for linux and add it in src/go_inspector/bin. -- then change it to executable ```chmod u+x src/go_inspector/bin/GoReSym_lin``` -- Install requirements and dependencies using ```make dev``` -- Use ```scancode --json-pp - --go-symbol --verbose``` to get debug symbols. +go-inspector is a utility to extract dependencies and symbols from Go binaries. +It is desigend to work as a ScanCode Toolkit plugin. +To install and use: -How to generate test binaries -============================ +- Run ``pip install go-inspector`` +- Use with ``scancode --json-pp - --go-symbol --verbose `` -- Run `go tool dist list` to get all possible pairs of OSes and arches to compile the binary. -- Then use a OS/arch pair like this ``GOOS= GOARCH= go build -o ./tests/data/app_exe ./tests/data/main.go`` - to get compiled binary. +The JSON output will contain various dependencies and symbols found in Go binaries if any. + + +- License: Apache-2.0 AND MIT AND BSD-3-Clause WITH LicenRef-scancode-google-patent-license-golang +- Copyright (c) nexB Inc., Mandiant, The Go Authors, Elliot Chance and others +- Homepage: https://github.com/nexB/go-inspector/ + +See the src/go_inspector/bin for detailed license and credits for bundled third-party packages. + + +Development +---------------- + +- Install requirements and dependencies using ``make dev`` +- Then ``source venv/bin/activate`` + +Testing: + +- To run tests: ``pytest -vvs`` +- To regen test fixtures: ``SCANCODE_REGEN_TEST_FIXTURES=yes pytest -vvs`` +- To update the bundled GoReSym, see src/bin/update.sh + + +How to re-generate test binaries +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +These are compiled (and committed) from code in tests/data/basic : + +- Run ``go tool dist list`` to get all possible pairs of OSes and arches to compile the binary. +- Then build a OS/arch pair like this to get compiled binaries: + ``GOOS= GOARCH= go build -o ./tests/data/basic/app__exe ./tests/data/main.go`` +- Make a copy and run strip of the Linux executable as "app_lin_exe_stripped" + + +Funding and sponsoring +--------------------------- + +This project is funded in part through: + +- NGI0 Entrust https://nlnet.nl/entrust, a fund established by NLnet with + financial support from the European Commission's Next Generation Internet https://ngi.eu program. + Learn more at the NLnet project page https://nlnet.nl/purl2all. + + |nlnet| and |ngi0entrust| + +- Support from nexB Inc. |nexb| + +- Generous support from users like you! + + +.. |nlnet| image:: https://nlnet.nl/logo/banner.png + :target: https://nlnet.nl + :width: 20% + :alt: NLnet foundation logo + +.. |ngi0entrust| image:: https://nlnet.nl/image/logos/NGI0_tag.svg + :target: https://nlnet.nl/entrust + :width: 20% + :alt: NGI Zero Logo + +.. |nexb| image:: https://nexb.com/wp-content/uploads/2022/04/nexB.svg + :target: https://nexb.com + :width: 20% + :alt: nexB logo diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 18e4250..aff16c3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,7 +11,7 @@ jobs: parameters: job_name: ubuntu20_cpython image_name: ubuntu-20.04 - python_versions: ['3.8', '3.9', '3.10', '3.11'] + python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12'] test_suites: all: venv/bin/pytest -n 2 -vvs @@ -19,7 +19,7 @@ jobs: parameters: job_name: ubuntu22_cpython image_name: ubuntu-22.04 - python_versions: ['3.8', '3.9', '3.10', '3.11'] + python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12'] test_suites: all: venv/bin/pytest -n 2 -vvs @@ -27,7 +27,7 @@ jobs: # parameters: # job_name: macos11_cpython # image_name: macOS-11 - # python_versions: ['3.8', '3.9', '3.10', '3.11'] + # python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12'] # test_suites: # all: venv/bin/pytest -n 2 -vvs @@ -35,7 +35,7 @@ jobs: # parameters: # job_name: macos12_cpython # image_name: macOS-12 - # python_versions: ['3.8', '3.9', '3.10', '3.11'] + # python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12'] # test_suites: # all: venv/bin/pytest -n 2 -vvs @@ -43,7 +43,7 @@ jobs: # parameters: # job_name: macos13_cpython # image_name: macOS-13 - # python_versions: ['3.8', '3.9', '3.10', '3.11'] + # python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12'] # test_suites: # all: venv/bin/pytest -n 2 -vvs @@ -51,7 +51,7 @@ jobs: # parameters: # job_name: win2019_cpython # image_name: windows-2019 - # python_versions: ['3.8', '3.9', '3.10', '3.11'] + # python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12'] # test_suites: # all: venv\Scripts\pytest -n 2 -vvs @@ -59,6 +59,6 @@ jobs: # parameters: # job_name: win2022_cpython # image_name: windows-2022 - # python_versions: ['3.8', '3.9', '3.10', '3.11'] + # python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12'] # test_suites: # all: venv\Scripts\pytest -n 2 -vvs diff --git a/setup.cfg b/setup.cfg index 2545ddf..445b9bb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,12 +1,12 @@ [metadata] -name = skeleton -license = Apache-2.0 +name = go-inspector +license = Apache-2.0 AND MIT AND BSD-3-Clause WITH LicenRef-scancode-google-patent-license-golang # description must be on ONE line https://github.com/pypa/setuptools/issues/1390 -description = skeleton +description = go-inspector is a scancode plugin to extract symbols and dependencies found in Go binaries. long_description = file:README.rst long_description_content_type = text/x-rst -url = https://github.com/nexB/skeleton +url = https://github.com/nexB/go-inspector author = nexB. Inc. and others author_email = info@aboutcode.org @@ -38,14 +38,13 @@ zip_safe = false setup_requires = setuptools_scm[toml] >= 4 -python_requires = >=3.7 +python_requires = >=3.8 install_requires = + commoncode plugincode scancode-toolkit typecode - commoncode - importlib-metadata [options.entry_points] @@ -74,4 +73,3 @@ docs = sphinx-autobuild sphinx-rtd-dark-mode>=1.3.0 sphinx-copybutton - diff --git a/src/go_inspector/__init__.py b/src/go_inspector/__init__.py index 36e61c6..d3ec452 100644 --- a/src/go_inspector/__init__.py +++ b/src/go_inspector/__init__.py @@ -1,2 +1 @@ - -__version__ = "0.1.0" +__version__ = "0.2.0" diff --git a/src/go_inspector/bin/GoReSym.zip.sums b/src/go_inspector/bin/GoReSym.zip.sums new file mode 100644 index 0000000..06870eb --- /dev/null +++ b/src/go_inspector/bin/GoReSym.zip.sums @@ -0,0 +1 @@ +24c50fc10f169d36814b43da006bb5cd313baa04fcf94af99c730ef56eee62fe GoReSym.zip diff --git a/src/go_inspector/bin/GoReSym_lin b/src/go_inspector/bin/GoReSym_lin index ae7d976..0e135dd 100755 Binary files a/src/go_inspector/bin/GoReSym_lin and b/src/go_inspector/bin/GoReSym_lin differ diff --git a/src/go_inspector/bin/GoReSym_lin.ABOUT b/src/go_inspector/bin/GoReSym_lin.ABOUT new file mode 100644 index 0000000..8158ea1 --- /dev/null +++ b/src/go_inspector/bin/GoReSym_lin.ABOUT @@ -0,0 +1,10 @@ +about_resource: GoReSym_lin +name: goresym +version: 2.7.2 +download_url: https://github.com/mandiant/GoReSym/releases/download/v2.7.2/GoReSym.zip +package_url: pkg:github/mandiant/goresym@2.7.2?download_url=https://github.com/mandiant/GoReSym/releases/download/v2.7.2/GoReSym.zip +copyright: Copyright (c) 2022 MANDIANT +checksum_sha1: d1a3252a3a174c8baacbe16b8d060b3affc9d05b +checksum_sha256: 24c50fc10f169d36814b43da006bb5cd313baa04fcf94af99c730ef56eee62fe +license_expression: mit +license_text_file: GoReSym_lin.LICENSE \ No newline at end of file diff --git a/src/go_inspector/bin/GoReSym_lin.LICENSE b/src/go_inspector/bin/GoReSym_lin.LICENSE new file mode 100644 index 0000000..e76c4a0 --- /dev/null +++ b/src/go_inspector/bin/GoReSym_lin.LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 MANDIANT + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/src/go_inspector/bin/arch-52c3e6f60cffa0133a3f9b2fc7f6862504a6cba0.tar.gz.ABOUT b/src/go_inspector/bin/arch-52c3e6f60cffa0133a3f9b2fc7f6862504a6cba0.tar.gz.ABOUT new file mode 100644 index 0000000..7276d57 --- /dev/null +++ b/src/go_inspector/bin/arch-52c3e6f60cffa0133a3f9b2fc7f6862504a6cba0.tar.gz.ABOUT @@ -0,0 +1,16 @@ +about_resource: GoReSym_lin +notes: GoReSym_lin embeds this package +name: arch +version: 52c3e6f60cffa0133a3f9b2fc7f6862504a6cba0 +download_url: https://github.com/golang/arch/archive/52c3e6f60cffa0133a3f9b2fc7f6862504a6cba0.tar.gz +package_url: pkg:github/golang/arch@52c3e6f60cffa0133a3f9b2fc7f6862504a6cba0 +license_expression: bsd-new AND google-patent-license-golang +copyright: Copyright The Go Authors +attribute: yes +licenses: + - key: bsd-new + name: BSD-3-Clause + file: bsd-new.LICENSE + - key: google-patent-license-golang + name: Google Patent License for Go + file: google-patent-license-golang.LICENSE diff --git a/src/go_inspector/bin/binaryregexp-0.2.0.tar.gz.ABOUT b/src/go_inspector/bin/binaryregexp-0.2.0.tar.gz.ABOUT new file mode 100644 index 0000000..73d1578 --- /dev/null +++ b/src/go_inspector/bin/binaryregexp-0.2.0.tar.gz.ABOUT @@ -0,0 +1,13 @@ +about_resource: GoReSym_lin +notes: GoReSym_lin embeds this package +name: binaryregexp +version: 0.2.0 +download_url: https://github.com/rsc/binaryregexp/archive/refs/tags/v0.2.0.tar.gz +package_url: pkg:github/rsc/binaryregexp@0.2.0?version_prefix=v +license_expression: bsd-new +copyright: Copyright The Go Authors +attribute: yes +licenses: + - key: bsd-new + name: BSD-3-Clause + file: bsd-new.LICENSE diff --git a/src/go_inspector/bin/bsd-new.LICENSE b/src/go_inspector/bin/bsd-new.LICENSE new file mode 100644 index 0000000..57326dd --- /dev/null +++ b/src/go_inspector/bin/bsd-new.LICENSE @@ -0,0 +1,9 @@ +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/go_inspector/bin/exp-89c5cff77bcbacf5bc89bd83d69d4fa8c80cf8af.tar.gz.ABOUT b/src/go_inspector/bin/exp-89c5cff77bcbacf5bc89bd83d69d4fa8c80cf8af.tar.gz.ABOUT new file mode 100644 index 0000000..8c7e084 --- /dev/null +++ b/src/go_inspector/bin/exp-89c5cff77bcbacf5bc89bd83d69d4fa8c80cf8af.tar.gz.ABOUT @@ -0,0 +1,16 @@ +about_resource: GoReSym_lin +notes: GoReSym_lin embeds this package +name: exp +version: 89c5cff77bcbacf5bc89bd83d69d4fa8c80cf8af +download_url: https://github.com/golang/exp/archive/89c5cff77bcbacf5bc89bd83d69d4fa8c80cf8af.tar.gz +package_url: pkg:github/golang/exp@89c5cff77bcbacf5bc89bd83d69d4fa8c80cf8af +license_expression: bsd-new AND google-patent-license-golang +copyright: Copyright The Go Authors +attribute: yes +licenses: + - key: bsd-new + name: BSD-3-Clause + file: bsd-new.LICENSE + - key: google-patent-license-golang + name: Google Patent License for Go + file: google-patent-license-golang.LICENSE diff --git a/src/go_inspector/bin/google-patent-license-golang.LICENSE b/src/go_inspector/bin/google-patent-license-golang.LICENSE new file mode 100644 index 0000000..9cf0b08 --- /dev/null +++ b/src/go_inspector/bin/google-patent-license-golang.LICENSE @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. \ No newline at end of file diff --git a/src/go_inspector/bin/mit.LICENSE b/src/go_inspector/bin/mit.LICENSE new file mode 100644 index 0000000..e662c78 --- /dev/null +++ b/src/go_inspector/bin/mit.LICENSE @@ -0,0 +1,5 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/src/go_inspector/bin/orderedmap-1.4.0.tar.gz.ABOUT b/src/go_inspector/bin/orderedmap-1.4.0.tar.gz.ABOUT new file mode 100644 index 0000000..852817d --- /dev/null +++ b/src/go_inspector/bin/orderedmap-1.4.0.tar.gz.ABOUT @@ -0,0 +1,13 @@ +about_resource: GoReSym_lin +notes: GoReSym_lin embeds this package +name: orderedmap +version: 1.4.0 +download_url: https://github.com/elliotchance/orderedmap/archive/refs/tags/v1.4.0.tar.gz +package_url: pkg:github/elliotchance/orderedmap@1.4.0?version_prefix=v +license_expression: mit +copyright: Copyright Elliot Chance +attribute: yes +licenses: + - key: mit + name: MIT License + file: mit.LICENSE diff --git a/src/go_inspector/bin/update.sh b/src/go_inspector/bin/update.sh new file mode 100755 index 0000000..3d30b47 --- /dev/null +++ b/src/go_inspector/bin/update.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# +# Copyright (c) nexB Inc. and others. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# See http://www.apache.org/licenses/LICENSE-2.0 for the license text. +# See https://github.com/nexB/go-inspector for support or download. +# See https://aboutcode.org for more information about nexB OSS projects. + +# Use this script to update GoReSym binary to a new version + +set +e +GORESYM_VERSION=v2.7.2 + +rm -rf GoReSym.zip goresymzip + +wget https://github.com/mandiant/GoReSym/releases/download/$GORESYM_VERSION/GoReSym.zip + +# recompute the sha256 by hand with: +# sha256sum GoReSym.zip > GoReSym.zip.sums +sha256sum -c GoReSym.zip.sums + +unzip -qd goresymzip GoReSym.zip +mv goresymzip/GoReSym_lin . +chmod u+x GoReSym_lin + +rm -rf GoReSym.zip goresymzip + +# finally run a binary analysis on this GoReSym executable and update the ABOUT files accordingly diff --git a/src/go_inspector/plugin.py b/src/go_inspector/plugin.py index e830215..e451b15 100644 --- a/src/go_inspector/plugin.py +++ b/src/go_inspector/plugin.py @@ -4,7 +4,7 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/scancode-plugins for support or download. +# See https://github.com/nexB/go-inspector for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # @@ -23,7 +23,7 @@ from typecode.contenttype import get_type """ -Extract symbols information from source code files with ctags. +Extract symbols information from Go binaries using GoReSym. """ LOG = logging.getLogger(__name__) @@ -31,15 +31,6 @@ from os.path import dirname from os.path import join -""" -https://github.com/mandiant/GoReSym/archive/refs/tags/v2.6.4.tar.gz -Download this zip at: -https://github.com/mandiant/GoReSym/releases/download/v2.6.4/GoReSym.zip -Extract goresym for linux -And then change it to executable -chmod u+x src/go_inspector/bin/GoReSym_lin -""" - def get_goresym_location(): curr_dir = dirname(abspath(__file__)) @@ -76,8 +67,7 @@ def get_scanner(self, **kwargs): def is_macho(location): """ - Return True if the file at ``location`` is macho, - otherwise False + Return True if the file at ``location`` is macho, otherwise False. """ t = get_type(location) return t.filetype_file.lower().startswith("mach-o") or t.mimetype_file.lower().startswith( @@ -96,23 +86,31 @@ def is_executable_binary(location): if not os.path.isfile(location): return False - type = contenttype.Type(location) + typ = contenttype.Type(location) - if not (type.is_elf or type.is_winexe or is_macho(location=location)): + if not (typ.is_elf or typ.is_winexe or is_macho(location=location)): return False return True +def clean_files(file_paths): + """ + Return a cleaned list of file_paths removing duplicates, and junk. + """ + files = set(file_paths) + files = [f for f in files if f != ""] + files.sort() + return files + 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. + Return a mapping of Go symbols of interest for the Go binary file at ``location``. + If ``check_type`` is True, the file is checked and None is returned if file is not an + executable binary. Raise exceptions on errors. """ if check_type and not is_executable_binary(location): - # print("Not an executable binary") return goresym_args = ["-p", location] @@ -132,11 +130,9 @@ def collect_and_parse_symbols(location, check_type=True, **kwargs): with open(stdo) as syms: symbols = json.load(syms) - files = symbols.get("Files") or [] - files.sort() - return dict( - go_symbols=dict(build_info=symbols.get("BuildInfo") or {}, file_paths=files or []) - ) + files = clean_files(symbols.get("Files") or []) + build_info = symbols.get("BuildInfo") or {} + return dict(go_symbols=dict(build_info=build_info, file_paths=files)) finally: fileutils.delete(goresym_temp_dir) diff --git a/tests/README.rst b/tests/README.rst deleted file mode 100644 index d94783e..0000000 --- a/tests/README.rst +++ /dev/null @@ -1,2 +0,0 @@ -Put your Python test modules in this directory. - diff --git a/tests/data/GoReSym_lin-goresym.json b/tests/data/GoReSym_lin-goresym.json new file mode 100644 index 0000000..27872ff --- /dev/null +++ b/tests/data/GoReSym_lin-goresym.json @@ -0,0 +1,458 @@ +{ + "go_symbols": { + "build_info": { + "GoVersion": "go1.22.0", + "Path": "github.com/mandiant/GoReSym", + "Main": { + "Path": "github.com/mandiant/GoReSym", + "Version": "(devel)", + "Sum": "", + "Replace": null + }, + "Deps": [ + { + "Path": "github.com/elliotchance/orderedmap", + "Version": "v1.4.0", + "Sum": "h1:wZtfeEONCbx6in1CZyE6bELEt/vFayMvsxqI5SgsR+A=", + "Replace": null + }, + { + "Path": "golang.org/x/arch", + "Version": "v0.0.0-20201008161808-52c3e6f60cff", + "Sum": "h1:XmKBi9R6duxOB3lfc72wyrwiOY7X2Jl1wuI+RFOyMDE=", + "Replace": null + }, + { + "Path": "golang.org/x/exp", + "Version": "v0.0.0-20230811145659-89c5cff77bcb", + "Sum": "h1:mIKbk8weKhSeLH2GmUTrvx8CjkyJmnU1wFmg59CUjFA=", + "Replace": null + }, + { + "Path": "rsc.io/binaryregexp", + "Version": "v0.2.0", + "Sum": "h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE=", + "Replace": null + } + ], + "Settings": [ + { + "Key": "-buildmode", + "Value": "exe" + }, + { + "Key": "-compiler", + "Value": "gc" + }, + { + "Key": "DefaultGODEBUG", + "Value": "httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1" + }, + { + "Key": "CGO_ENABLED", + "Value": "0" + }, + { + "Key": "GOARCH", + "Value": "amd64" + }, + { + "Key": "GOOS", + "Value": "linux" + }, + { + "Key": "GOAMD64", + "Value": "v1" + }, + { + "Key": "vcs", + "Value": "git" + }, + { + "Key": "vcs.revision", + "Value": "76f8f7c2d365808283ceabec23b8636773f8ef53" + }, + { + "Key": "vcs.time", + "Value": "2024-02-23T17:49:00Z" + }, + { + "Key": "vcs.modified", + "Value": "false" + } + ] + }, + "file_paths": [ + "C:/Users/runneradmin/go/pkg/mod/github.com/elliotchance/orderedmap@v1.4.0/element.go", + "C:/Users/runneradmin/go/pkg/mod/github.com/elliotchance/orderedmap@v1.4.0/orderedmap.go", + "C:/Users/runneradmin/go/pkg/mod/golang.org/x/arch@v0.0.0-20201008161808-52c3e6f60cff/arm/armasm/decode.go", + "C:/Users/runneradmin/go/pkg/mod/golang.org/x/arch@v0.0.0-20201008161808-52c3e6f60cff/arm/armasm/gnu.go", + "C:/Users/runneradmin/go/pkg/mod/golang.org/x/arch@v0.0.0-20201008161808-52c3e6f60cff/arm64/arm64asm/decode.go", + "C:/Users/runneradmin/go/pkg/mod/golang.org/x/arch@v0.0.0-20201008161808-52c3e6f60cff/arm64/arm64asm/plan9x.go", + "C:/Users/runneradmin/go/pkg/mod/golang.org/x/arch@v0.0.0-20201008161808-52c3e6f60cff/ppc64/ppc64asm/decode.go", + "C:/Users/runneradmin/go/pkg/mod/golang.org/x/arch@v0.0.0-20201008161808-52c3e6f60cff/ppc64/ppc64asm/plan9.go", + "C:/Users/runneradmin/go/pkg/mod/golang.org/x/arch@v0.0.0-20201008161808-52c3e6f60cff/ppc64/ppc64asm/tables.go", + "C:/Users/runneradmin/go/pkg/mod/golang.org/x/arch@v0.0.0-20201008161808-52c3e6f60cff/x86/x86asm/gnu.go", + "C:/Users/runneradmin/go/pkg/mod/golang.org/x/arch@v0.0.0-20201008161808-52c3e6f60cff/x86/x86asm/inst.go", + "C:/Users/runneradmin/go/pkg/mod/golang.org/x/arch@v0.0.0-20201008161808-52c3e6f60cff/x86/x86asm/intel.go", + "C:/Users/runneradmin/go/pkg/mod/golang.org/x/exp@v0.0.0-20230811145659-89c5cff77bcb/slices/slices.go", + "C:/Users/runneradmin/go/pkg/mod/rsc.io/binaryregexp@v0.2.0/backtrack.go", + "C:/Users/runneradmin/go/pkg/mod/rsc.io/binaryregexp@v0.2.0/exec.go", + "C:/Users/runneradmin/go/pkg/mod/rsc.io/binaryregexp@v0.2.0/onepass.go", + "C:/Users/runneradmin/go/pkg/mod/rsc.io/binaryregexp@v0.2.0/regexp.go", + "C:/Users/runneradmin/go/pkg/mod/rsc.io/binaryregexp@v0.2.0/syntax/compile.go", + "C:/Users/runneradmin/go/pkg/mod/rsc.io/binaryregexp@v0.2.0/syntax/parse.go", + "C:/Users/runneradmin/go/pkg/mod/rsc.io/binaryregexp@v0.2.0/syntax/perl_groups.go", + "C:/Users/runneradmin/go/pkg/mod/rsc.io/binaryregexp@v0.2.0/syntax/prog.go", + "C:/Users/runneradmin/go/pkg/mod/rsc.io/binaryregexp@v0.2.0/syntax/regexp.go", + "C:/Users/runneradmin/go/pkg/mod/rsc.io/binaryregexp@v0.2.0/syntax/simplify.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/bufio/bufio.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/bytes/buffer.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/bytes/bytes.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/bytes/reader.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/cmp/cmp.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/compress/flate/dict_decoder.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/compress/flate/huffman_bit_writer.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/compress/flate/huffman_code.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/compress/flate/inflate.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/compress/zlib/reader.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/container/list/list.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/crypto/crypto.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/crypto/internal/boring/notboring.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/crypto/internal/boring/sig/sig_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/crypto/sha1/sha1.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/crypto/sha1/sha1block_amd64.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/crypto/sha1/sha1block_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/crypto/sha256/sha256.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/crypto/sha256/sha256block_amd64.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/crypto/sha256/sha256block_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/dwarf/attr_string.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/dwarf/entry.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/dwarf/line.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/elf/elf.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/elf/file.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/elf/reader.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/macho/fat.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/macho/file.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/macho/macho.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/pe/file.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/pe/section.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/pe/string.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/pe/symbol.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/debug/plan9obj/file.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/encoding/base64/base64.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/encoding/binary/binary.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/encoding/binary/varint.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/encoding/json/decode.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/encoding/json/encode.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/encoding/json/fold.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/encoding/json/indent.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/encoding/json/scanner.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/encoding/json/tags.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/errors/errors.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/errors/wrap.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/flag/flag.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/fmt/errors.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/fmt/format.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/fmt/print.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/hash/adler32/adler32.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/abi/abi.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/abi/switch.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/abi/type.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/bisect/bisect.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/bytealg/bytealg.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/bytealg/compare_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/bytealg/count_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/bytealg/count_native.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/bytealg/equal_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/bytealg/index_amd64.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/bytealg/index_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/bytealg/indexbyte_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/bytealg/lastindexbyte_generic.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/chacha8rand/chacha8.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/chacha8rand/chacha8_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/cpu/cpu.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/cpu/cpu_x86.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/cpu/cpu_x86.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/fmtsort/sort.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/godebug/godebug.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/godebugs/table.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/itoa/itoa.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/poll/errno_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/poll/fd.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/poll/fd_mutex.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/poll/fd_poll_runtime.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/poll/fd_posix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/poll/fd_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/poll/fd_unixjs.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/reflectlite/swapper.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/reflectlite/type.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/reflectlite/value.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/saferio/io.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/syscall/unix/fcntl_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/syscall/unix/nonblocking_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/testlog/exit.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/testlog/log.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/zstd/bits.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/zstd/block.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/zstd/fse.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/zstd/huff.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/zstd/literals.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/zstd/window.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/zstd/xxhash.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/internal/zstd/zstd.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/io/fs/fs.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/io/io.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/log/log.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/math/abs.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/math/bits.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/math/bits/bits.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/math/exp_amd64.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/math/rand/rand.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/math/rand/rng.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/math/unsafe.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/os/dir_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/os/error.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/os/file.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/os/file_open_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/os/file_posix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/os/file_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/os/path_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/os/proc.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/os/stat_linux.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/os/stat_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/os/types.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/os/types_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/path/filepath/path.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/reflect/abi.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/reflect/asm_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/reflect/float32reg_generic.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/reflect/makefunc.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/reflect/type.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/reflect/value.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/regexp/regexp.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/regexp/syntax/perl_groups.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/alg.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/arena.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/asm.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/asm_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/atomic_pointer.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/cgo_mmap.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/cgo_sigaction.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/cgocall.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/chan.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/cpuflags_amd64.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/cpuprof.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/debug.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/debugcall.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/defs_linux_amd64.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/duff_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/env_posix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/error.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/exithook.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/extern.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/fastlog2.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/fds_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/float.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/hash64.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/histogram.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/iface.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/internal/atomic/types.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/internal/sys/intrinsics.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/internal/syscall/asm_linux_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/internal/syscall/syscall_linux.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/lfstack.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/lock_futex.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/lockrank.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/lockrank_off.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/malloc.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/map.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/map_fast32.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/map_fast64.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/map_faststr.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mbarrier.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mbitmap.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mbitmap_allocheaders.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mcache.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mcentral.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mcheckmark.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mem.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mem_linux.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/memclr_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/memmove_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/metrics.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mfinal.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mfixalloc.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mgc.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mgclimit.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mgcmark.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mgcpacer.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mgcscavenge.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mgcstack.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mgcsweep.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mgcwork.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mheap.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mpagealloc.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mpagealloc_64bit.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mpagecache.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mpallocbits.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mprof.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mranges.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/msize_allocheaders.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mspanset.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mstats.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/mwbbuf.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/nbpipe_pipe2.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/netpoll.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/netpoll_epoll.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/os_linux.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/os_linux_generic.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/pagetrace_off.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/panic.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/pinner.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/preempt.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/preempt_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/print.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/proc.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/profbuf.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/rand.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/retry.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/rt0_linux_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/runtime.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/runtime1.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/runtime2.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/rwmutex.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/security_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/select.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/sema.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/signal_amd64.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/signal_linux_amd64.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/signal_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/sigqueue.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/slice.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/stack.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/stkframe.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/string.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/stubs.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/stubs2.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/symtab.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/symtabinl.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/sys_linux_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/sys_x86.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/tagptr_64bit.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/time.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/time_linux_amd64.s", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/time_nofake.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/trace2.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/trace2buf.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/trace2cpu.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/trace2event.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/trace2map.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/trace2region.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/trace2runtime.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/trace2stack.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/trace2status.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/trace2string.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/trace2time.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/traceback.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/type.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/typekind.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/unsafe.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/utf8.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/vdso_linux.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/runtime/write_err.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/slices/slices.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/slices/sort.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/slices/zsortanyfunc.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/slices/zsortordered.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sort/slice.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sort/sort.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sort/sort_impl_go121.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sort/zsortfunc.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sort/zsortinterface.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/strconv/atob.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/strconv/atoi.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/strconv/bytealg.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/strconv/decimal.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/strconv/ftoa.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/strconv/ftoaryu.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/strconv/itoa.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/strconv/quote.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/strings/builder.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/strings/compare.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/strings/replace.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/strings/strings.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sync/atomic/type.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sync/atomic/value.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sync/map.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sync/mutex.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sync/once.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sync/pool.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sync/poolqueue.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sync/runtime.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sync/rwmutex.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/sync/waitgroup.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/syscall/env_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/syscall/exec_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/syscall/rlimit.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/syscall/syscall.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/syscall/syscall_linux.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/syscall/syscall_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/syscall/zsyscall_linux_amd64.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/time/format.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/time/format_rfc3339.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/time/sys_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/time/time.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/time/zoneinfo.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/time/zoneinfo_goroot.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/time/zoneinfo_read.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/time/zoneinfo_unix.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/unicode/digit.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/unicode/graphic.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/unicode/letter.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/unicode/tables.go", + "C:/hostedtoolcache/windows/go/1.22.0/x64/src/unicode/utf8/utf8.go", + "D:/a/GoReSym/GoReSym/archive/archive.go", + "D:/a/GoReSym/GoReSym/bio/buf.go", + "D:/a/GoReSym/GoReSym/bio/buf_mmap.go", + "D:/a/GoReSym/GoReSym/buildid/buildid.go", + "D:/a/GoReSym/GoReSym/buildid/note.go", + "D:/a/GoReSym/GoReSym/buildinfo/buildinfo.go", + "D:/a/GoReSym/GoReSym/debug/dwarf/attr_string.go", + "D:/a/GoReSym/GoReSym/debug/dwarf/class_string.go", + "D:/a/GoReSym/GoReSym/debug/dwarf/const.go", + "D:/a/GoReSym/GoReSym/debug/dwarf/entry.go", + "D:/a/GoReSym/GoReSym/debug/dwarf/line.go", + "D:/a/GoReSym/GoReSym/debug/dwarf/tag_string.go", + "D:/a/GoReSym/GoReSym/debug/dwarf/type.go", + "D:/a/GoReSym/GoReSym/debug/elf/elf.go", + "D:/a/GoReSym/GoReSym/debug/elf/file.go", + "D:/a/GoReSym/GoReSym/debug/elf/reader.go", + "D:/a/GoReSym/GoReSym/debug/gosym/pclntab.go", + "D:/a/GoReSym/GoReSym/debug/gosym/symtab.go", + "D:/a/GoReSym/GoReSym/debug/macho/file.go", + "D:/a/GoReSym/GoReSym/debug/macho/macho.go", + "D:/a/GoReSym/GoReSym/debug/pe/file.go", + "D:/a/GoReSym/GoReSym/debug/pe/section.go", + "D:/a/GoReSym/GoReSym/debug/pe/string.go", + "D:/a/GoReSym/GoReSym/debug/pe/symbol.go", + "D:/a/GoReSym/GoReSym/goobj/builtin.go", + "D:/a/GoReSym/GoReSym/goobj/objfile.go", + "D:/a/GoReSym/GoReSym/io/fs/fs.go", + "D:/a/GoReSym/GoReSym/main.go", + "D:/a/GoReSym/GoReSym/objfile/disasm.go", + "D:/a/GoReSym/GoReSym/objfile/elf.go", + "D:/a/GoReSym/GoReSym/objfile/goobj.go", + "D:/a/GoReSym/GoReSym/objfile/internals.go", + "D:/a/GoReSym/GoReSym/objfile/macho.go", + "D:/a/GoReSym/GoReSym/objfile/objfile.go", + "D:/a/GoReSym/GoReSym/objfile/patterns.go", + "D:/a/GoReSym/GoReSym/objfile/pe.go", + "D:/a/GoReSym/GoReSym/objfile/scanner.go", + "D:/a/GoReSym/GoReSym/runtime/debug/mod.go", + "D:/a/GoReSym/GoReSym/saferio/io.go", + "D:/a/GoReSym/GoReSym/sys/arch.go", + "D:/a/GoReSym/GoReSym/xcoff/file.go" + ] + } +} \ No newline at end of file diff --git a/tests/data/app_lin_exe b/tests/data/basic/app_lin_exe similarity index 100% rename from tests/data/app_lin_exe rename to tests/data/basic/app_lin_exe diff --git a/tests/data/basic/app_lin_exe-goresym.json b/tests/data/basic/app_lin_exe-goresym.json new file mode 100644 index 0000000..d79e37b --- /dev/null +++ b/tests/data/basic/app_lin_exe-goresym.json @@ -0,0 +1,250 @@ +{ + "go_symbols": { + "build_info": { + "GoVersion": "go1.21.7", + "Path": "command-line-arguments", + "Main": { + "Path": "", + "Version": "", + "Sum": "", + "Replace": null + }, + "Deps": null, + "Settings": [ + { + "Key": "-buildmode", + "Value": "exe" + }, + { + "Key": "-compiler", + "Value": "gc" + }, + { + "Key": "CGO_ENABLED", + "Value": "1" + }, + { + "Key": "CGO_CFLAGS", + "Value": "" + }, + { + "Key": "CGO_CPPFLAGS", + "Value": "" + }, + { + "Key": "CGO_CXXFLAGS", + "Value": "" + }, + { + "Key": "CGO_LDFLAGS", + "Value": "" + }, + { + "Key": "GOARCH", + "Value": "amd64" + }, + { + "Key": "GOOS", + "Value": "linux" + }, + { + "Key": "GOAMD64", + "Value": "v1" + } + ] + }, + "file_paths": [ + "/home/tg1999/Desktop/mini-app/main.go", + "/usr/lib/go-1.21/src/errors/errors.go", + "/usr/lib/go-1.21/src/errors/wrap.go", + "/usr/lib/go-1.21/src/fmt/format.go", + "/usr/lib/go-1.21/src/fmt/print.go", + "/usr/lib/go-1.21/src/internal/abi/abi.go", + "/usr/lib/go-1.21/src/internal/abi/type.go", + "/usr/lib/go-1.21/src/internal/abi/unsafestring_go120.go", + "/usr/lib/go-1.21/src/internal/bytealg/compare_amd64.s", + "/usr/lib/go-1.21/src/internal/bytealg/equal_amd64.s", + "/usr/lib/go-1.21/src/internal/bytealg/index_amd64.go", + "/usr/lib/go-1.21/src/internal/bytealg/indexbyte_amd64.s", + "/usr/lib/go-1.21/src/internal/cpu/cpu.go", + "/usr/lib/go-1.21/src/internal/cpu/cpu_x86.go", + "/usr/lib/go-1.21/src/internal/cpu/cpu_x86.s", + "/usr/lib/go-1.21/src/internal/fmtsort/sort.go", + "/usr/lib/go-1.21/src/internal/itoa/itoa.go", + "/usr/lib/go-1.21/src/internal/poll/errno_unix.go", + "/usr/lib/go-1.21/src/internal/poll/fd.go", + "/usr/lib/go-1.21/src/internal/poll/fd_mutex.go", + "/usr/lib/go-1.21/src/internal/poll/fd_poll_runtime.go", + "/usr/lib/go-1.21/src/internal/poll/fd_unix.go", + "/usr/lib/go-1.21/src/internal/poll/fd_unixjs.go", + "/usr/lib/go-1.21/src/internal/reflectlite/type.go", + "/usr/lib/go-1.21/src/internal/syscall/unix/fcntl_unix.go", + "/usr/lib/go-1.21/src/internal/syscall/unix/nonblocking_unix.go", + "/usr/lib/go-1.21/src/io/fs/fs.go", + "/usr/lib/go-1.21/src/math/bits/bits.go", + "/usr/lib/go-1.21/src/math/exp_amd64.go", + "/usr/lib/go-1.21/src/math/unsafe.go", + "/usr/lib/go-1.21/src/os/dir.go", + "/usr/lib/go-1.21/src/os/dir_unix.go", + "/usr/lib/go-1.21/src/os/error.go", + "/usr/lib/go-1.21/src/os/file.go", + "/usr/lib/go-1.21/src/os/file_posix.go", + "/usr/lib/go-1.21/src/os/file_unix.go", + "/usr/lib/go-1.21/src/os/path_unix.go", + "/usr/lib/go-1.21/src/os/proc.go", + "/usr/lib/go-1.21/src/path/filepath/match.go", + "/usr/lib/go-1.21/src/path/filepath/path.go", + "/usr/lib/go-1.21/src/path/filepath/path_unix.go", + "/usr/lib/go-1.21/src/reflect/abi.go", + "/usr/lib/go-1.21/src/reflect/asm_amd64.s", + "/usr/lib/go-1.21/src/reflect/float32reg_generic.go", + "/usr/lib/go-1.21/src/reflect/makefunc.go", + "/usr/lib/go-1.21/src/reflect/type.go", + "/usr/lib/go-1.21/src/reflect/value.go", + "/usr/lib/go-1.21/src/runtime/alg.go", + "/usr/lib/go-1.21/src/runtime/arena.go", + "/usr/lib/go-1.21/src/runtime/asm.s", + "/usr/lib/go-1.21/src/runtime/asm_amd64.s", + "/usr/lib/go-1.21/src/runtime/atomic_pointer.go", + "/usr/lib/go-1.21/src/runtime/cgo_mmap.go", + "/usr/lib/go-1.21/src/runtime/cgo_sigaction.go", + "/usr/lib/go-1.21/src/runtime/cgocall.go", + "/usr/lib/go-1.21/src/runtime/chan.go", + "/usr/lib/go-1.21/src/runtime/cpuflags_amd64.go", + "/usr/lib/go-1.21/src/runtime/cpuprof.go", + "/usr/lib/go-1.21/src/runtime/debug.go", + "/usr/lib/go-1.21/src/runtime/debugcall.go", + "/usr/lib/go-1.21/src/runtime/defs_linux_amd64.go", + "/usr/lib/go-1.21/src/runtime/duff_amd64.s", + "/usr/lib/go-1.21/src/runtime/env_posix.go", + "/usr/lib/go-1.21/src/runtime/error.go", + "/usr/lib/go-1.21/src/runtime/exithook.go", + "/usr/lib/go-1.21/src/runtime/extern.go", + "/usr/lib/go-1.21/src/runtime/fastlog2.go", + "/usr/lib/go-1.21/src/runtime/float.go", + "/usr/lib/go-1.21/src/runtime/hash64.go", + "/usr/lib/go-1.21/src/runtime/histogram.go", + "/usr/lib/go-1.21/src/runtime/iface.go", + "/usr/lib/go-1.21/src/runtime/internal/atomic/types.go", + "/usr/lib/go-1.21/src/runtime/internal/sys/intrinsics.go", + "/usr/lib/go-1.21/src/runtime/internal/syscall/asm_linux_amd64.s", + "/usr/lib/go-1.21/src/runtime/internal/syscall/syscall_linux.go", + "/usr/lib/go-1.21/src/runtime/lfstack.go", + "/usr/lib/go-1.21/src/runtime/lock_futex.go", + "/usr/lib/go-1.21/src/runtime/lockrank.go", + "/usr/lib/go-1.21/src/runtime/lockrank_off.go", + "/usr/lib/go-1.21/src/runtime/malloc.go", + "/usr/lib/go-1.21/src/runtime/map.go", + "/usr/lib/go-1.21/src/runtime/map_fast32.go", + "/usr/lib/go-1.21/src/runtime/map_fast64.go", + "/usr/lib/go-1.21/src/runtime/map_faststr.go", + "/usr/lib/go-1.21/src/runtime/mbarrier.go", + "/usr/lib/go-1.21/src/runtime/mbitmap.go", + "/usr/lib/go-1.21/src/runtime/mcache.go", + "/usr/lib/go-1.21/src/runtime/mcentral.go", + "/usr/lib/go-1.21/src/runtime/mcheckmark.go", + "/usr/lib/go-1.21/src/runtime/mem.go", + "/usr/lib/go-1.21/src/runtime/mem_linux.go", + "/usr/lib/go-1.21/src/runtime/memclr_amd64.s", + "/usr/lib/go-1.21/src/runtime/memmove_amd64.s", + "/usr/lib/go-1.21/src/runtime/mfinal.go", + "/usr/lib/go-1.21/src/runtime/mfixalloc.go", + "/usr/lib/go-1.21/src/runtime/mgc.go", + "/usr/lib/go-1.21/src/runtime/mgclimit.go", + "/usr/lib/go-1.21/src/runtime/mgcmark.go", + "/usr/lib/go-1.21/src/runtime/mgcpacer.go", + "/usr/lib/go-1.21/src/runtime/mgcscavenge.go", + "/usr/lib/go-1.21/src/runtime/mgcstack.go", + "/usr/lib/go-1.21/src/runtime/mgcsweep.go", + "/usr/lib/go-1.21/src/runtime/mgcwork.go", + "/usr/lib/go-1.21/src/runtime/mheap.go", + "/usr/lib/go-1.21/src/runtime/mpagealloc.go", + "/usr/lib/go-1.21/src/runtime/mpagealloc_64bit.go", + "/usr/lib/go-1.21/src/runtime/mpagecache.go", + "/usr/lib/go-1.21/src/runtime/mpallocbits.go", + "/usr/lib/go-1.21/src/runtime/mprof.go", + "/usr/lib/go-1.21/src/runtime/mranges.go", + "/usr/lib/go-1.21/src/runtime/msize.go", + "/usr/lib/go-1.21/src/runtime/mspanset.go", + "/usr/lib/go-1.21/src/runtime/mstats.go", + "/usr/lib/go-1.21/src/runtime/mwbbuf.go", + "/usr/lib/go-1.21/src/runtime/nbpipe_pipe2.go", + "/usr/lib/go-1.21/src/runtime/netpoll.go", + "/usr/lib/go-1.21/src/runtime/netpoll_epoll.go", + "/usr/lib/go-1.21/src/runtime/os_linux.go", + "/usr/lib/go-1.21/src/runtime/os_linux_generic.go", + "/usr/lib/go-1.21/src/runtime/pagetrace_off.go", + "/usr/lib/go-1.21/src/runtime/panic.go", + "/usr/lib/go-1.21/src/runtime/pinner.go", + "/usr/lib/go-1.21/src/runtime/preempt.go", + "/usr/lib/go-1.21/src/runtime/preempt_amd64.s", + "/usr/lib/go-1.21/src/runtime/print.go", + "/usr/lib/go-1.21/src/runtime/proc.go", + "/usr/lib/go-1.21/src/runtime/profbuf.go", + "/usr/lib/go-1.21/src/runtime/retry.go", + "/usr/lib/go-1.21/src/runtime/rt0_linux_amd64.s", + "/usr/lib/go-1.21/src/runtime/runtime.go", + "/usr/lib/go-1.21/src/runtime/runtime1.go", + "/usr/lib/go-1.21/src/runtime/runtime2.go", + "/usr/lib/go-1.21/src/runtime/rwmutex.go", + "/usr/lib/go-1.21/src/runtime/security_unix.go", + "/usr/lib/go-1.21/src/runtime/select.go", + "/usr/lib/go-1.21/src/runtime/sema.go", + "/usr/lib/go-1.21/src/runtime/signal_amd64.go", + "/usr/lib/go-1.21/src/runtime/signal_linux_amd64.go", + "/usr/lib/go-1.21/src/runtime/signal_unix.go", + "/usr/lib/go-1.21/src/runtime/sigqueue.go", + "/usr/lib/go-1.21/src/runtime/slice.go", + "/usr/lib/go-1.21/src/runtime/stack.go", + "/usr/lib/go-1.21/src/runtime/stkframe.go", + "/usr/lib/go-1.21/src/runtime/string.go", + "/usr/lib/go-1.21/src/runtime/stubs.go", + "/usr/lib/go-1.21/src/runtime/stubs2.go", + "/usr/lib/go-1.21/src/runtime/symtab.go", + "/usr/lib/go-1.21/src/runtime/symtabinl.go", + "/usr/lib/go-1.21/src/runtime/sys_linux_amd64.s", + "/usr/lib/go-1.21/src/runtime/sys_x86.go", + "/usr/lib/go-1.21/src/runtime/tagptr_64bit.go", + "/usr/lib/go-1.21/src/runtime/time.go", + "/usr/lib/go-1.21/src/runtime/time_linux_amd64.s", + "/usr/lib/go-1.21/src/runtime/time_nofake.go", + "/usr/lib/go-1.21/src/runtime/trace.go", + "/usr/lib/go-1.21/src/runtime/traceback.go", + "/usr/lib/go-1.21/src/runtime/type.go", + "/usr/lib/go-1.21/src/runtime/typekind.go", + "/usr/lib/go-1.21/src/runtime/unsafe.go", + "/usr/lib/go-1.21/src/runtime/utf8.go", + "/usr/lib/go-1.21/src/runtime/vdso_linux.go", + "/usr/lib/go-1.21/src/runtime/write_err.go", + "/usr/lib/go-1.21/src/sort/sort.go", + "/usr/lib/go-1.21/src/sort/zsortinterface.go", + "/usr/lib/go-1.21/src/strconv/atoi.go", + "/usr/lib/go-1.21/src/strconv/decimal.go", + "/usr/lib/go-1.21/src/strconv/ftoa.go", + "/usr/lib/go-1.21/src/strconv/ftoaryu.go", + "/usr/lib/go-1.21/src/strconv/itoa.go", + "/usr/lib/go-1.21/src/strconv/quote.go", + "/usr/lib/go-1.21/src/strings/builder.go", + "/usr/lib/go-1.21/src/strings/strings.go", + "/usr/lib/go-1.21/src/sync/atomic/type.go", + "/usr/lib/go-1.21/src/sync/atomic/value.go", + "/usr/lib/go-1.21/src/sync/map.go", + "/usr/lib/go-1.21/src/sync/mutex.go", + "/usr/lib/go-1.21/src/sync/once.go", + "/usr/lib/go-1.21/src/sync/pool.go", + "/usr/lib/go-1.21/src/sync/poolqueue.go", + "/usr/lib/go-1.21/src/sync/runtime.go", + "/usr/lib/go-1.21/src/syscall/env_unix.go", + "/usr/lib/go-1.21/src/syscall/exec_unix.go", + "/usr/lib/go-1.21/src/syscall/rlimit.go", + "/usr/lib/go-1.21/src/syscall/syscall_linux.go", + "/usr/lib/go-1.21/src/syscall/syscall_unix.go", + "/usr/lib/go-1.21/src/syscall/zsyscall_linux_amd64.go", + "/usr/lib/go-1.21/src/time/format.go", + "/usr/lib/go-1.21/src/time/time.go", + "/usr/lib/go-1.21/src/unicode/casetables.go", + "/usr/lib/go-1.21/src/unicode/tables.go", + "/usr/lib/go-1.21/src/unicode/utf8/utf8.go" + ] + } +} \ No newline at end of file diff --git a/tests/data/basic/app_lin_exe-scancode.expected.json b/tests/data/basic/app_lin_exe-scancode.expected.json new file mode 100644 index 0000000..e678c2f --- /dev/null +++ b/tests/data/basic/app_lin_exe-scancode.expected.json @@ -0,0 +1,257 @@ +{ + "files": [ + { + "path": "app_lin_exe", + "type": "file", + "go_symbols": { + "build_info": { + "GoVersion": "go1.21.7", + "Path": "command-line-arguments", + "Main": { + "Path": "", + "Version": "", + "Sum": "", + "Replace": null + }, + "Deps": null, + "Settings": [ + { + "Key": "-buildmode", + "Value": "exe" + }, + { + "Key": "-compiler", + "Value": "gc" + }, + { + "Key": "CGO_ENABLED", + "Value": "1" + }, + { + "Key": "CGO_CFLAGS", + "Value": "" + }, + { + "Key": "CGO_CPPFLAGS", + "Value": "" + }, + { + "Key": "CGO_CXXFLAGS", + "Value": "" + }, + { + "Key": "CGO_LDFLAGS", + "Value": "" + }, + { + "Key": "GOARCH", + "Value": "amd64" + }, + { + "Key": "GOOS", + "Value": "linux" + }, + { + "Key": "GOAMD64", + "Value": "v1" + } + ] + }, + "file_paths": [ + "/home/tg1999/Desktop/mini-app/main.go", + "/usr/lib/go-1.21/src/errors/errors.go", + "/usr/lib/go-1.21/src/errors/wrap.go", + "/usr/lib/go-1.21/src/fmt/format.go", + "/usr/lib/go-1.21/src/fmt/print.go", + "/usr/lib/go-1.21/src/internal/abi/abi.go", + "/usr/lib/go-1.21/src/internal/abi/type.go", + "/usr/lib/go-1.21/src/internal/abi/unsafestring_go120.go", + "/usr/lib/go-1.21/src/internal/bytealg/compare_amd64.s", + "/usr/lib/go-1.21/src/internal/bytealg/equal_amd64.s", + "/usr/lib/go-1.21/src/internal/bytealg/index_amd64.go", + "/usr/lib/go-1.21/src/internal/bytealg/indexbyte_amd64.s", + "/usr/lib/go-1.21/src/internal/cpu/cpu.go", + "/usr/lib/go-1.21/src/internal/cpu/cpu_x86.go", + "/usr/lib/go-1.21/src/internal/cpu/cpu_x86.s", + "/usr/lib/go-1.21/src/internal/fmtsort/sort.go", + "/usr/lib/go-1.21/src/internal/itoa/itoa.go", + "/usr/lib/go-1.21/src/internal/poll/errno_unix.go", + "/usr/lib/go-1.21/src/internal/poll/fd.go", + "/usr/lib/go-1.21/src/internal/poll/fd_mutex.go", + "/usr/lib/go-1.21/src/internal/poll/fd_poll_runtime.go", + "/usr/lib/go-1.21/src/internal/poll/fd_unix.go", + "/usr/lib/go-1.21/src/internal/poll/fd_unixjs.go", + "/usr/lib/go-1.21/src/internal/reflectlite/type.go", + "/usr/lib/go-1.21/src/internal/syscall/unix/fcntl_unix.go", + "/usr/lib/go-1.21/src/internal/syscall/unix/nonblocking_unix.go", + "/usr/lib/go-1.21/src/io/fs/fs.go", + "/usr/lib/go-1.21/src/math/bits/bits.go", + "/usr/lib/go-1.21/src/math/exp_amd64.go", + "/usr/lib/go-1.21/src/math/unsafe.go", + "/usr/lib/go-1.21/src/os/dir.go", + "/usr/lib/go-1.21/src/os/dir_unix.go", + "/usr/lib/go-1.21/src/os/error.go", + "/usr/lib/go-1.21/src/os/file.go", + "/usr/lib/go-1.21/src/os/file_posix.go", + "/usr/lib/go-1.21/src/os/file_unix.go", + "/usr/lib/go-1.21/src/os/path_unix.go", + "/usr/lib/go-1.21/src/os/proc.go", + "/usr/lib/go-1.21/src/path/filepath/match.go", + "/usr/lib/go-1.21/src/path/filepath/path.go", + "/usr/lib/go-1.21/src/path/filepath/path_unix.go", + "/usr/lib/go-1.21/src/reflect/abi.go", + "/usr/lib/go-1.21/src/reflect/asm_amd64.s", + "/usr/lib/go-1.21/src/reflect/float32reg_generic.go", + "/usr/lib/go-1.21/src/reflect/makefunc.go", + "/usr/lib/go-1.21/src/reflect/type.go", + "/usr/lib/go-1.21/src/reflect/value.go", + "/usr/lib/go-1.21/src/runtime/alg.go", + "/usr/lib/go-1.21/src/runtime/arena.go", + "/usr/lib/go-1.21/src/runtime/asm.s", + "/usr/lib/go-1.21/src/runtime/asm_amd64.s", + "/usr/lib/go-1.21/src/runtime/atomic_pointer.go", + "/usr/lib/go-1.21/src/runtime/cgo_mmap.go", + "/usr/lib/go-1.21/src/runtime/cgo_sigaction.go", + "/usr/lib/go-1.21/src/runtime/cgocall.go", + "/usr/lib/go-1.21/src/runtime/chan.go", + "/usr/lib/go-1.21/src/runtime/cpuflags_amd64.go", + "/usr/lib/go-1.21/src/runtime/cpuprof.go", + "/usr/lib/go-1.21/src/runtime/debug.go", + "/usr/lib/go-1.21/src/runtime/debugcall.go", + "/usr/lib/go-1.21/src/runtime/defs_linux_amd64.go", + "/usr/lib/go-1.21/src/runtime/duff_amd64.s", + "/usr/lib/go-1.21/src/runtime/env_posix.go", + "/usr/lib/go-1.21/src/runtime/error.go", + "/usr/lib/go-1.21/src/runtime/exithook.go", + "/usr/lib/go-1.21/src/runtime/extern.go", + "/usr/lib/go-1.21/src/runtime/fastlog2.go", + "/usr/lib/go-1.21/src/runtime/float.go", + "/usr/lib/go-1.21/src/runtime/hash64.go", + "/usr/lib/go-1.21/src/runtime/histogram.go", + "/usr/lib/go-1.21/src/runtime/iface.go", + "/usr/lib/go-1.21/src/runtime/internal/atomic/types.go", + "/usr/lib/go-1.21/src/runtime/internal/sys/intrinsics.go", + "/usr/lib/go-1.21/src/runtime/internal/syscall/asm_linux_amd64.s", + "/usr/lib/go-1.21/src/runtime/internal/syscall/syscall_linux.go", + "/usr/lib/go-1.21/src/runtime/lfstack.go", + "/usr/lib/go-1.21/src/runtime/lock_futex.go", + "/usr/lib/go-1.21/src/runtime/lockrank.go", + "/usr/lib/go-1.21/src/runtime/lockrank_off.go", + "/usr/lib/go-1.21/src/runtime/malloc.go", + "/usr/lib/go-1.21/src/runtime/map.go", + "/usr/lib/go-1.21/src/runtime/map_fast32.go", + "/usr/lib/go-1.21/src/runtime/map_fast64.go", + "/usr/lib/go-1.21/src/runtime/map_faststr.go", + "/usr/lib/go-1.21/src/runtime/mbarrier.go", + "/usr/lib/go-1.21/src/runtime/mbitmap.go", + "/usr/lib/go-1.21/src/runtime/mcache.go", + "/usr/lib/go-1.21/src/runtime/mcentral.go", + "/usr/lib/go-1.21/src/runtime/mcheckmark.go", + "/usr/lib/go-1.21/src/runtime/mem.go", + "/usr/lib/go-1.21/src/runtime/mem_linux.go", + "/usr/lib/go-1.21/src/runtime/memclr_amd64.s", + "/usr/lib/go-1.21/src/runtime/memmove_amd64.s", + "/usr/lib/go-1.21/src/runtime/mfinal.go", + "/usr/lib/go-1.21/src/runtime/mfixalloc.go", + "/usr/lib/go-1.21/src/runtime/mgc.go", + "/usr/lib/go-1.21/src/runtime/mgclimit.go", + "/usr/lib/go-1.21/src/runtime/mgcmark.go", + "/usr/lib/go-1.21/src/runtime/mgcpacer.go", + "/usr/lib/go-1.21/src/runtime/mgcscavenge.go", + "/usr/lib/go-1.21/src/runtime/mgcstack.go", + "/usr/lib/go-1.21/src/runtime/mgcsweep.go", + "/usr/lib/go-1.21/src/runtime/mgcwork.go", + "/usr/lib/go-1.21/src/runtime/mheap.go", + "/usr/lib/go-1.21/src/runtime/mpagealloc.go", + "/usr/lib/go-1.21/src/runtime/mpagealloc_64bit.go", + "/usr/lib/go-1.21/src/runtime/mpagecache.go", + "/usr/lib/go-1.21/src/runtime/mpallocbits.go", + "/usr/lib/go-1.21/src/runtime/mprof.go", + "/usr/lib/go-1.21/src/runtime/mranges.go", + "/usr/lib/go-1.21/src/runtime/msize.go", + "/usr/lib/go-1.21/src/runtime/mspanset.go", + "/usr/lib/go-1.21/src/runtime/mstats.go", + "/usr/lib/go-1.21/src/runtime/mwbbuf.go", + "/usr/lib/go-1.21/src/runtime/nbpipe_pipe2.go", + "/usr/lib/go-1.21/src/runtime/netpoll.go", + "/usr/lib/go-1.21/src/runtime/netpoll_epoll.go", + "/usr/lib/go-1.21/src/runtime/os_linux.go", + "/usr/lib/go-1.21/src/runtime/os_linux_generic.go", + "/usr/lib/go-1.21/src/runtime/pagetrace_off.go", + "/usr/lib/go-1.21/src/runtime/panic.go", + "/usr/lib/go-1.21/src/runtime/pinner.go", + "/usr/lib/go-1.21/src/runtime/preempt.go", + "/usr/lib/go-1.21/src/runtime/preempt_amd64.s", + "/usr/lib/go-1.21/src/runtime/print.go", + "/usr/lib/go-1.21/src/runtime/proc.go", + "/usr/lib/go-1.21/src/runtime/profbuf.go", + "/usr/lib/go-1.21/src/runtime/retry.go", + "/usr/lib/go-1.21/src/runtime/rt0_linux_amd64.s", + "/usr/lib/go-1.21/src/runtime/runtime.go", + "/usr/lib/go-1.21/src/runtime/runtime1.go", + "/usr/lib/go-1.21/src/runtime/runtime2.go", + "/usr/lib/go-1.21/src/runtime/rwmutex.go", + "/usr/lib/go-1.21/src/runtime/security_unix.go", + "/usr/lib/go-1.21/src/runtime/select.go", + "/usr/lib/go-1.21/src/runtime/sema.go", + "/usr/lib/go-1.21/src/runtime/signal_amd64.go", + "/usr/lib/go-1.21/src/runtime/signal_linux_amd64.go", + "/usr/lib/go-1.21/src/runtime/signal_unix.go", + "/usr/lib/go-1.21/src/runtime/sigqueue.go", + "/usr/lib/go-1.21/src/runtime/slice.go", + "/usr/lib/go-1.21/src/runtime/stack.go", + "/usr/lib/go-1.21/src/runtime/stkframe.go", + "/usr/lib/go-1.21/src/runtime/string.go", + "/usr/lib/go-1.21/src/runtime/stubs.go", + "/usr/lib/go-1.21/src/runtime/stubs2.go", + "/usr/lib/go-1.21/src/runtime/symtab.go", + "/usr/lib/go-1.21/src/runtime/symtabinl.go", + "/usr/lib/go-1.21/src/runtime/sys_linux_amd64.s", + "/usr/lib/go-1.21/src/runtime/sys_x86.go", + "/usr/lib/go-1.21/src/runtime/tagptr_64bit.go", + "/usr/lib/go-1.21/src/runtime/time.go", + "/usr/lib/go-1.21/src/runtime/time_linux_amd64.s", + "/usr/lib/go-1.21/src/runtime/time_nofake.go", + "/usr/lib/go-1.21/src/runtime/trace.go", + "/usr/lib/go-1.21/src/runtime/traceback.go", + "/usr/lib/go-1.21/src/runtime/type.go", + "/usr/lib/go-1.21/src/runtime/typekind.go", + "/usr/lib/go-1.21/src/runtime/unsafe.go", + "/usr/lib/go-1.21/src/runtime/utf8.go", + "/usr/lib/go-1.21/src/runtime/vdso_linux.go", + "/usr/lib/go-1.21/src/runtime/write_err.go", + "/usr/lib/go-1.21/src/sort/sort.go", + "/usr/lib/go-1.21/src/sort/zsortinterface.go", + "/usr/lib/go-1.21/src/strconv/atoi.go", + "/usr/lib/go-1.21/src/strconv/decimal.go", + "/usr/lib/go-1.21/src/strconv/ftoa.go", + "/usr/lib/go-1.21/src/strconv/ftoaryu.go", + "/usr/lib/go-1.21/src/strconv/itoa.go", + "/usr/lib/go-1.21/src/strconv/quote.go", + "/usr/lib/go-1.21/src/strings/builder.go", + "/usr/lib/go-1.21/src/strings/strings.go", + "/usr/lib/go-1.21/src/sync/atomic/type.go", + "/usr/lib/go-1.21/src/sync/atomic/value.go", + "/usr/lib/go-1.21/src/sync/map.go", + "/usr/lib/go-1.21/src/sync/mutex.go", + "/usr/lib/go-1.21/src/sync/once.go", + "/usr/lib/go-1.21/src/sync/pool.go", + "/usr/lib/go-1.21/src/sync/poolqueue.go", + "/usr/lib/go-1.21/src/sync/runtime.go", + "/usr/lib/go-1.21/src/syscall/env_unix.go", + "/usr/lib/go-1.21/src/syscall/exec_unix.go", + "/usr/lib/go-1.21/src/syscall/rlimit.go", + "/usr/lib/go-1.21/src/syscall/syscall_linux.go", + "/usr/lib/go-1.21/src/syscall/syscall_unix.go", + "/usr/lib/go-1.21/src/syscall/zsyscall_linux_amd64.go", + "/usr/lib/go-1.21/src/time/format.go", + "/usr/lib/go-1.21/src/time/time.go", + "/usr/lib/go-1.21/src/unicode/casetables.go", + "/usr/lib/go-1.21/src/unicode/tables.go", + "/usr/lib/go-1.21/src/unicode/utf8/utf8.go" + ] + }, + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/data/basic/app_lin_exe_stripped b/tests/data/basic/app_lin_exe_stripped new file mode 100755 index 0000000..151a47c Binary files /dev/null and b/tests/data/basic/app_lin_exe_stripped differ diff --git a/tests/data/basic/app_lin_exe_stripped-goresym.json b/tests/data/basic/app_lin_exe_stripped-goresym.json new file mode 100644 index 0000000..d79e37b --- /dev/null +++ b/tests/data/basic/app_lin_exe_stripped-goresym.json @@ -0,0 +1,250 @@ +{ + "go_symbols": { + "build_info": { + "GoVersion": "go1.21.7", + "Path": "command-line-arguments", + "Main": { + "Path": "", + "Version": "", + "Sum": "", + "Replace": null + }, + "Deps": null, + "Settings": [ + { + "Key": "-buildmode", + "Value": "exe" + }, + { + "Key": "-compiler", + "Value": "gc" + }, + { + "Key": "CGO_ENABLED", + "Value": "1" + }, + { + "Key": "CGO_CFLAGS", + "Value": "" + }, + { + "Key": "CGO_CPPFLAGS", + "Value": "" + }, + { + "Key": "CGO_CXXFLAGS", + "Value": "" + }, + { + "Key": "CGO_LDFLAGS", + "Value": "" + }, + { + "Key": "GOARCH", + "Value": "amd64" + }, + { + "Key": "GOOS", + "Value": "linux" + }, + { + "Key": "GOAMD64", + "Value": "v1" + } + ] + }, + "file_paths": [ + "/home/tg1999/Desktop/mini-app/main.go", + "/usr/lib/go-1.21/src/errors/errors.go", + "/usr/lib/go-1.21/src/errors/wrap.go", + "/usr/lib/go-1.21/src/fmt/format.go", + "/usr/lib/go-1.21/src/fmt/print.go", + "/usr/lib/go-1.21/src/internal/abi/abi.go", + "/usr/lib/go-1.21/src/internal/abi/type.go", + "/usr/lib/go-1.21/src/internal/abi/unsafestring_go120.go", + "/usr/lib/go-1.21/src/internal/bytealg/compare_amd64.s", + "/usr/lib/go-1.21/src/internal/bytealg/equal_amd64.s", + "/usr/lib/go-1.21/src/internal/bytealg/index_amd64.go", + "/usr/lib/go-1.21/src/internal/bytealg/indexbyte_amd64.s", + "/usr/lib/go-1.21/src/internal/cpu/cpu.go", + "/usr/lib/go-1.21/src/internal/cpu/cpu_x86.go", + "/usr/lib/go-1.21/src/internal/cpu/cpu_x86.s", + "/usr/lib/go-1.21/src/internal/fmtsort/sort.go", + "/usr/lib/go-1.21/src/internal/itoa/itoa.go", + "/usr/lib/go-1.21/src/internal/poll/errno_unix.go", + "/usr/lib/go-1.21/src/internal/poll/fd.go", + "/usr/lib/go-1.21/src/internal/poll/fd_mutex.go", + "/usr/lib/go-1.21/src/internal/poll/fd_poll_runtime.go", + "/usr/lib/go-1.21/src/internal/poll/fd_unix.go", + "/usr/lib/go-1.21/src/internal/poll/fd_unixjs.go", + "/usr/lib/go-1.21/src/internal/reflectlite/type.go", + "/usr/lib/go-1.21/src/internal/syscall/unix/fcntl_unix.go", + "/usr/lib/go-1.21/src/internal/syscall/unix/nonblocking_unix.go", + "/usr/lib/go-1.21/src/io/fs/fs.go", + "/usr/lib/go-1.21/src/math/bits/bits.go", + "/usr/lib/go-1.21/src/math/exp_amd64.go", + "/usr/lib/go-1.21/src/math/unsafe.go", + "/usr/lib/go-1.21/src/os/dir.go", + "/usr/lib/go-1.21/src/os/dir_unix.go", + "/usr/lib/go-1.21/src/os/error.go", + "/usr/lib/go-1.21/src/os/file.go", + "/usr/lib/go-1.21/src/os/file_posix.go", + "/usr/lib/go-1.21/src/os/file_unix.go", + "/usr/lib/go-1.21/src/os/path_unix.go", + "/usr/lib/go-1.21/src/os/proc.go", + "/usr/lib/go-1.21/src/path/filepath/match.go", + "/usr/lib/go-1.21/src/path/filepath/path.go", + "/usr/lib/go-1.21/src/path/filepath/path_unix.go", + "/usr/lib/go-1.21/src/reflect/abi.go", + "/usr/lib/go-1.21/src/reflect/asm_amd64.s", + "/usr/lib/go-1.21/src/reflect/float32reg_generic.go", + "/usr/lib/go-1.21/src/reflect/makefunc.go", + "/usr/lib/go-1.21/src/reflect/type.go", + "/usr/lib/go-1.21/src/reflect/value.go", + "/usr/lib/go-1.21/src/runtime/alg.go", + "/usr/lib/go-1.21/src/runtime/arena.go", + "/usr/lib/go-1.21/src/runtime/asm.s", + "/usr/lib/go-1.21/src/runtime/asm_amd64.s", + "/usr/lib/go-1.21/src/runtime/atomic_pointer.go", + "/usr/lib/go-1.21/src/runtime/cgo_mmap.go", + "/usr/lib/go-1.21/src/runtime/cgo_sigaction.go", + "/usr/lib/go-1.21/src/runtime/cgocall.go", + "/usr/lib/go-1.21/src/runtime/chan.go", + "/usr/lib/go-1.21/src/runtime/cpuflags_amd64.go", + "/usr/lib/go-1.21/src/runtime/cpuprof.go", + "/usr/lib/go-1.21/src/runtime/debug.go", + "/usr/lib/go-1.21/src/runtime/debugcall.go", + "/usr/lib/go-1.21/src/runtime/defs_linux_amd64.go", + "/usr/lib/go-1.21/src/runtime/duff_amd64.s", + "/usr/lib/go-1.21/src/runtime/env_posix.go", + "/usr/lib/go-1.21/src/runtime/error.go", + "/usr/lib/go-1.21/src/runtime/exithook.go", + "/usr/lib/go-1.21/src/runtime/extern.go", + "/usr/lib/go-1.21/src/runtime/fastlog2.go", + "/usr/lib/go-1.21/src/runtime/float.go", + "/usr/lib/go-1.21/src/runtime/hash64.go", + "/usr/lib/go-1.21/src/runtime/histogram.go", + "/usr/lib/go-1.21/src/runtime/iface.go", + "/usr/lib/go-1.21/src/runtime/internal/atomic/types.go", + "/usr/lib/go-1.21/src/runtime/internal/sys/intrinsics.go", + "/usr/lib/go-1.21/src/runtime/internal/syscall/asm_linux_amd64.s", + "/usr/lib/go-1.21/src/runtime/internal/syscall/syscall_linux.go", + "/usr/lib/go-1.21/src/runtime/lfstack.go", + "/usr/lib/go-1.21/src/runtime/lock_futex.go", + "/usr/lib/go-1.21/src/runtime/lockrank.go", + "/usr/lib/go-1.21/src/runtime/lockrank_off.go", + "/usr/lib/go-1.21/src/runtime/malloc.go", + "/usr/lib/go-1.21/src/runtime/map.go", + "/usr/lib/go-1.21/src/runtime/map_fast32.go", + "/usr/lib/go-1.21/src/runtime/map_fast64.go", + "/usr/lib/go-1.21/src/runtime/map_faststr.go", + "/usr/lib/go-1.21/src/runtime/mbarrier.go", + "/usr/lib/go-1.21/src/runtime/mbitmap.go", + "/usr/lib/go-1.21/src/runtime/mcache.go", + "/usr/lib/go-1.21/src/runtime/mcentral.go", + "/usr/lib/go-1.21/src/runtime/mcheckmark.go", + "/usr/lib/go-1.21/src/runtime/mem.go", + "/usr/lib/go-1.21/src/runtime/mem_linux.go", + "/usr/lib/go-1.21/src/runtime/memclr_amd64.s", + "/usr/lib/go-1.21/src/runtime/memmove_amd64.s", + "/usr/lib/go-1.21/src/runtime/mfinal.go", + "/usr/lib/go-1.21/src/runtime/mfixalloc.go", + "/usr/lib/go-1.21/src/runtime/mgc.go", + "/usr/lib/go-1.21/src/runtime/mgclimit.go", + "/usr/lib/go-1.21/src/runtime/mgcmark.go", + "/usr/lib/go-1.21/src/runtime/mgcpacer.go", + "/usr/lib/go-1.21/src/runtime/mgcscavenge.go", + "/usr/lib/go-1.21/src/runtime/mgcstack.go", + "/usr/lib/go-1.21/src/runtime/mgcsweep.go", + "/usr/lib/go-1.21/src/runtime/mgcwork.go", + "/usr/lib/go-1.21/src/runtime/mheap.go", + "/usr/lib/go-1.21/src/runtime/mpagealloc.go", + "/usr/lib/go-1.21/src/runtime/mpagealloc_64bit.go", + "/usr/lib/go-1.21/src/runtime/mpagecache.go", + "/usr/lib/go-1.21/src/runtime/mpallocbits.go", + "/usr/lib/go-1.21/src/runtime/mprof.go", + "/usr/lib/go-1.21/src/runtime/mranges.go", + "/usr/lib/go-1.21/src/runtime/msize.go", + "/usr/lib/go-1.21/src/runtime/mspanset.go", + "/usr/lib/go-1.21/src/runtime/mstats.go", + "/usr/lib/go-1.21/src/runtime/mwbbuf.go", + "/usr/lib/go-1.21/src/runtime/nbpipe_pipe2.go", + "/usr/lib/go-1.21/src/runtime/netpoll.go", + "/usr/lib/go-1.21/src/runtime/netpoll_epoll.go", + "/usr/lib/go-1.21/src/runtime/os_linux.go", + "/usr/lib/go-1.21/src/runtime/os_linux_generic.go", + "/usr/lib/go-1.21/src/runtime/pagetrace_off.go", + "/usr/lib/go-1.21/src/runtime/panic.go", + "/usr/lib/go-1.21/src/runtime/pinner.go", + "/usr/lib/go-1.21/src/runtime/preempt.go", + "/usr/lib/go-1.21/src/runtime/preempt_amd64.s", + "/usr/lib/go-1.21/src/runtime/print.go", + "/usr/lib/go-1.21/src/runtime/proc.go", + "/usr/lib/go-1.21/src/runtime/profbuf.go", + "/usr/lib/go-1.21/src/runtime/retry.go", + "/usr/lib/go-1.21/src/runtime/rt0_linux_amd64.s", + "/usr/lib/go-1.21/src/runtime/runtime.go", + "/usr/lib/go-1.21/src/runtime/runtime1.go", + "/usr/lib/go-1.21/src/runtime/runtime2.go", + "/usr/lib/go-1.21/src/runtime/rwmutex.go", + "/usr/lib/go-1.21/src/runtime/security_unix.go", + "/usr/lib/go-1.21/src/runtime/select.go", + "/usr/lib/go-1.21/src/runtime/sema.go", + "/usr/lib/go-1.21/src/runtime/signal_amd64.go", + "/usr/lib/go-1.21/src/runtime/signal_linux_amd64.go", + "/usr/lib/go-1.21/src/runtime/signal_unix.go", + "/usr/lib/go-1.21/src/runtime/sigqueue.go", + "/usr/lib/go-1.21/src/runtime/slice.go", + "/usr/lib/go-1.21/src/runtime/stack.go", + "/usr/lib/go-1.21/src/runtime/stkframe.go", + "/usr/lib/go-1.21/src/runtime/string.go", + "/usr/lib/go-1.21/src/runtime/stubs.go", + "/usr/lib/go-1.21/src/runtime/stubs2.go", + "/usr/lib/go-1.21/src/runtime/symtab.go", + "/usr/lib/go-1.21/src/runtime/symtabinl.go", + "/usr/lib/go-1.21/src/runtime/sys_linux_amd64.s", + "/usr/lib/go-1.21/src/runtime/sys_x86.go", + "/usr/lib/go-1.21/src/runtime/tagptr_64bit.go", + "/usr/lib/go-1.21/src/runtime/time.go", + "/usr/lib/go-1.21/src/runtime/time_linux_amd64.s", + "/usr/lib/go-1.21/src/runtime/time_nofake.go", + "/usr/lib/go-1.21/src/runtime/trace.go", + "/usr/lib/go-1.21/src/runtime/traceback.go", + "/usr/lib/go-1.21/src/runtime/type.go", + "/usr/lib/go-1.21/src/runtime/typekind.go", + "/usr/lib/go-1.21/src/runtime/unsafe.go", + "/usr/lib/go-1.21/src/runtime/utf8.go", + "/usr/lib/go-1.21/src/runtime/vdso_linux.go", + "/usr/lib/go-1.21/src/runtime/write_err.go", + "/usr/lib/go-1.21/src/sort/sort.go", + "/usr/lib/go-1.21/src/sort/zsortinterface.go", + "/usr/lib/go-1.21/src/strconv/atoi.go", + "/usr/lib/go-1.21/src/strconv/decimal.go", + "/usr/lib/go-1.21/src/strconv/ftoa.go", + "/usr/lib/go-1.21/src/strconv/ftoaryu.go", + "/usr/lib/go-1.21/src/strconv/itoa.go", + "/usr/lib/go-1.21/src/strconv/quote.go", + "/usr/lib/go-1.21/src/strings/builder.go", + "/usr/lib/go-1.21/src/strings/strings.go", + "/usr/lib/go-1.21/src/sync/atomic/type.go", + "/usr/lib/go-1.21/src/sync/atomic/value.go", + "/usr/lib/go-1.21/src/sync/map.go", + "/usr/lib/go-1.21/src/sync/mutex.go", + "/usr/lib/go-1.21/src/sync/once.go", + "/usr/lib/go-1.21/src/sync/pool.go", + "/usr/lib/go-1.21/src/sync/poolqueue.go", + "/usr/lib/go-1.21/src/sync/runtime.go", + "/usr/lib/go-1.21/src/syscall/env_unix.go", + "/usr/lib/go-1.21/src/syscall/exec_unix.go", + "/usr/lib/go-1.21/src/syscall/rlimit.go", + "/usr/lib/go-1.21/src/syscall/syscall_linux.go", + "/usr/lib/go-1.21/src/syscall/syscall_unix.go", + "/usr/lib/go-1.21/src/syscall/zsyscall_linux_amd64.go", + "/usr/lib/go-1.21/src/time/format.go", + "/usr/lib/go-1.21/src/time/time.go", + "/usr/lib/go-1.21/src/unicode/casetables.go", + "/usr/lib/go-1.21/src/unicode/tables.go", + "/usr/lib/go-1.21/src/unicode/utf8/utf8.go" + ] + } +} \ No newline at end of file diff --git a/tests/data/app_mac_exe b/tests/data/basic/app_mac_exe similarity index 100% rename from tests/data/app_mac_exe rename to tests/data/basic/app_mac_exe diff --git a/tests/data/basic/app_mac_exe-goresym.json b/tests/data/basic/app_mac_exe-goresym.json new file mode 100644 index 0000000..81d5a99 --- /dev/null +++ b/tests/data/basic/app_mac_exe-goresym.json @@ -0,0 +1,250 @@ +{ + "go_symbols": { + "build_info": { + "GoVersion": "go1.21.7", + "Path": "command-line-arguments", + "Main": { + "Path": "", + "Version": "", + "Sum": "", + "Replace": null + }, + "Deps": null, + "Settings": [ + { + "Key": "-buildmode", + "Value": "exe" + }, + { + "Key": "-compiler", + "Value": "gc" + }, + { + "Key": "CGO_ENABLED", + "Value": "0" + }, + { + "Key": "GOARCH", + "Value": "arm64" + }, + { + "Key": "GOOS", + "Value": "darwin" + } + ] + }, + "file_paths": [ + "/home/tg1999/Desktop/mini-app/main.go", + "/usr/lib/go-1.21/src/errors/errors.go", + "/usr/lib/go-1.21/src/errors/wrap.go", + "/usr/lib/go-1.21/src/fmt/format.go", + "/usr/lib/go-1.21/src/fmt/print.go", + "/usr/lib/go-1.21/src/internal/abi/abi.go", + "/usr/lib/go-1.21/src/internal/abi/type.go", + "/usr/lib/go-1.21/src/internal/abi/unsafestring_go120.go", + "/usr/lib/go-1.21/src/internal/bytealg/compare_arm64.s", + "/usr/lib/go-1.21/src/internal/bytealg/equal_arm64.s", + "/usr/lib/go-1.21/src/internal/bytealg/index_arm64.go", + "/usr/lib/go-1.21/src/internal/bytealg/indexbyte_arm64.s", + "/usr/lib/go-1.21/src/internal/cpu/cpu.go", + "/usr/lib/go-1.21/src/internal/cpu/cpu_arm64.go", + "/usr/lib/go-1.21/src/internal/cpu/cpu_arm64_darwin.go", + "/usr/lib/go-1.21/src/internal/fmtsort/sort.go", + "/usr/lib/go-1.21/src/internal/itoa/itoa.go", + "/usr/lib/go-1.21/src/internal/poll/errno_unix.go", + "/usr/lib/go-1.21/src/internal/poll/fd.go", + "/usr/lib/go-1.21/src/internal/poll/fd_mutex.go", + "/usr/lib/go-1.21/src/internal/poll/fd_poll_runtime.go", + "/usr/lib/go-1.21/src/internal/poll/fd_unix.go", + "/usr/lib/go-1.21/src/internal/poll/fd_unixjs.go", + "/usr/lib/go-1.21/src/internal/reflectlite/type.go", + "/usr/lib/go-1.21/src/internal/syscall/unix/fcntl_unix.go", + "/usr/lib/go-1.21/src/internal/syscall/unix/nonblocking_unix.go", + "/usr/lib/go-1.21/src/internal/testlog/log.go", + "/usr/lib/go-1.21/src/io/fs/fs.go", + "/usr/lib/go-1.21/src/math/bits/bits.go", + "/usr/lib/go-1.21/src/math/unsafe.go", + "/usr/lib/go-1.21/src/os/dir.go", + "/usr/lib/go-1.21/src/os/dir_darwin.go", + "/usr/lib/go-1.21/src/os/env.go", + "/usr/lib/go-1.21/src/os/error.go", + "/usr/lib/go-1.21/src/os/executable_darwin.go", + "/usr/lib/go-1.21/src/os/file.go", + "/usr/lib/go-1.21/src/os/file_posix.go", + "/usr/lib/go-1.21/src/os/file_unix.go", + "/usr/lib/go-1.21/src/os/getwd.go", + "/usr/lib/go-1.21/src/os/path_unix.go", + "/usr/lib/go-1.21/src/os/proc.go", + "/usr/lib/go-1.21/src/os/stat_darwin.go", + "/usr/lib/go-1.21/src/os/stat_unix.go", + "/usr/lib/go-1.21/src/os/types.go", + "/usr/lib/go-1.21/src/os/types_unix.go", + "/usr/lib/go-1.21/src/path/filepath/match.go", + "/usr/lib/go-1.21/src/path/filepath/path.go", + "/usr/lib/go-1.21/src/path/filepath/path_unix.go", + "/usr/lib/go-1.21/src/reflect/abi.go", + "/usr/lib/go-1.21/src/reflect/asm_arm64.s", + "/usr/lib/go-1.21/src/reflect/float32reg_generic.go", + "/usr/lib/go-1.21/src/reflect/makefunc.go", + "/usr/lib/go-1.21/src/reflect/type.go", + "/usr/lib/go-1.21/src/reflect/value.go", + "/usr/lib/go-1.21/src/runtime/alg.go", + "/usr/lib/go-1.21/src/runtime/arena.go", + "/usr/lib/go-1.21/src/runtime/asm.s", + "/usr/lib/go-1.21/src/runtime/asm_arm64.s", + "/usr/lib/go-1.21/src/runtime/atomic_pointer.go", + "/usr/lib/go-1.21/src/runtime/cgocall.go", + "/usr/lib/go-1.21/src/runtime/chan.go", + "/usr/lib/go-1.21/src/runtime/cpuflags_arm64.go", + "/usr/lib/go-1.21/src/runtime/cpuprof.go", + "/usr/lib/go-1.21/src/runtime/debug.go", + "/usr/lib/go-1.21/src/runtime/debugcall.go", + "/usr/lib/go-1.21/src/runtime/defs_darwin_arm64.go", + "/usr/lib/go-1.21/src/runtime/duff_arm64.s", + "/usr/lib/go-1.21/src/runtime/env_posix.go", + "/usr/lib/go-1.21/src/runtime/error.go", + "/usr/lib/go-1.21/src/runtime/exithook.go", + "/usr/lib/go-1.21/src/runtime/extern.go", + "/usr/lib/go-1.21/src/runtime/fastlog2.go", + "/usr/lib/go-1.21/src/runtime/float.go", + "/usr/lib/go-1.21/src/runtime/hash64.go", + "/usr/lib/go-1.21/src/runtime/histogram.go", + "/usr/lib/go-1.21/src/runtime/iface.go", + "/usr/lib/go-1.21/src/runtime/internal/atomic/types.go", + "/usr/lib/go-1.21/src/runtime/internal/sys/intrinsics.go", + "/usr/lib/go-1.21/src/runtime/lfstack.go", + "/usr/lib/go-1.21/src/runtime/lock_sema.go", + "/usr/lib/go-1.21/src/runtime/lockrank.go", + "/usr/lib/go-1.21/src/runtime/lockrank_off.go", + "/usr/lib/go-1.21/src/runtime/malloc.go", + "/usr/lib/go-1.21/src/runtime/map.go", + "/usr/lib/go-1.21/src/runtime/map_fast32.go", + "/usr/lib/go-1.21/src/runtime/map_fast64.go", + "/usr/lib/go-1.21/src/runtime/map_faststr.go", + "/usr/lib/go-1.21/src/runtime/mbarrier.go", + "/usr/lib/go-1.21/src/runtime/mbitmap.go", + "/usr/lib/go-1.21/src/runtime/mcache.go", + "/usr/lib/go-1.21/src/runtime/mcentral.go", + "/usr/lib/go-1.21/src/runtime/mcheckmark.go", + "/usr/lib/go-1.21/src/runtime/mem.go", + "/usr/lib/go-1.21/src/runtime/mem_darwin.go", + "/usr/lib/go-1.21/src/runtime/memclr_arm64.s", + "/usr/lib/go-1.21/src/runtime/memmove_arm64.s", + "/usr/lib/go-1.21/src/runtime/mfinal.go", + "/usr/lib/go-1.21/src/runtime/mfixalloc.go", + "/usr/lib/go-1.21/src/runtime/mgc.go", + "/usr/lib/go-1.21/src/runtime/mgclimit.go", + "/usr/lib/go-1.21/src/runtime/mgcmark.go", + "/usr/lib/go-1.21/src/runtime/mgcpacer.go", + "/usr/lib/go-1.21/src/runtime/mgcscavenge.go", + "/usr/lib/go-1.21/src/runtime/mgcstack.go", + "/usr/lib/go-1.21/src/runtime/mgcsweep.go", + "/usr/lib/go-1.21/src/runtime/mgcwork.go", + "/usr/lib/go-1.21/src/runtime/mheap.go", + "/usr/lib/go-1.21/src/runtime/mpagealloc.go", + "/usr/lib/go-1.21/src/runtime/mpagealloc_64bit.go", + "/usr/lib/go-1.21/src/runtime/mpagecache.go", + "/usr/lib/go-1.21/src/runtime/mpallocbits.go", + "/usr/lib/go-1.21/src/runtime/mprof.go", + "/usr/lib/go-1.21/src/runtime/mranges.go", + "/usr/lib/go-1.21/src/runtime/msize.go", + "/usr/lib/go-1.21/src/runtime/mspanset.go", + "/usr/lib/go-1.21/src/runtime/mstats.go", + "/usr/lib/go-1.21/src/runtime/mwbbuf.go", + "/usr/lib/go-1.21/src/runtime/nbpipe_pipe.go", + "/usr/lib/go-1.21/src/runtime/netpoll.go", + "/usr/lib/go-1.21/src/runtime/netpoll_kqueue.go", + "/usr/lib/go-1.21/src/runtime/os_darwin.go", + "/usr/lib/go-1.21/src/runtime/os_darwin_arm64.go", + "/usr/lib/go-1.21/src/runtime/os_unix.go", + "/usr/lib/go-1.21/src/runtime/os_unix_nonlinux.go", + "/usr/lib/go-1.21/src/runtime/pagetrace_off.go", + "/usr/lib/go-1.21/src/runtime/panic.go", + "/usr/lib/go-1.21/src/runtime/pinner.go", + "/usr/lib/go-1.21/src/runtime/preempt.go", + "/usr/lib/go-1.21/src/runtime/preempt_arm64.s", + "/usr/lib/go-1.21/src/runtime/print.go", + "/usr/lib/go-1.21/src/runtime/proc.go", + "/usr/lib/go-1.21/src/runtime/profbuf.go", + "/usr/lib/go-1.21/src/runtime/retry.go", + "/usr/lib/go-1.21/src/runtime/rt0_darwin_arm64.s", + "/usr/lib/go-1.21/src/runtime/runtime.go", + "/usr/lib/go-1.21/src/runtime/runtime1.go", + "/usr/lib/go-1.21/src/runtime/runtime2.go", + "/usr/lib/go-1.21/src/runtime/rwmutex.go", + "/usr/lib/go-1.21/src/runtime/security_issetugid.go", + "/usr/lib/go-1.21/src/runtime/security_unix.go", + "/usr/lib/go-1.21/src/runtime/select.go", + "/usr/lib/go-1.21/src/runtime/sema.go", + "/usr/lib/go-1.21/src/runtime/signal_arm64.go", + "/usr/lib/go-1.21/src/runtime/signal_darwin_arm64.go", + "/usr/lib/go-1.21/src/runtime/signal_unix.go", + "/usr/lib/go-1.21/src/runtime/sigqueue.go", + "/usr/lib/go-1.21/src/runtime/slice.go", + "/usr/lib/go-1.21/src/runtime/stack.go", + "/usr/lib/go-1.21/src/runtime/stkframe.go", + "/usr/lib/go-1.21/src/runtime/string.go", + "/usr/lib/go-1.21/src/runtime/stubs.go", + "/usr/lib/go-1.21/src/runtime/symtab.go", + "/usr/lib/go-1.21/src/runtime/symtabinl.go", + "/usr/lib/go-1.21/src/runtime/sys_arm64.go", + "/usr/lib/go-1.21/src/runtime/sys_darwin.go", + "/usr/lib/go-1.21/src/runtime/sys_darwin_arm64.go", + "/usr/lib/go-1.21/src/runtime/sys_darwin_arm64.s", + "/usr/lib/go-1.21/src/runtime/sys_libc.go", + "/usr/lib/go-1.21/src/runtime/tagptr_64bit.go", + "/usr/lib/go-1.21/src/runtime/time.go", + "/usr/lib/go-1.21/src/runtime/time_nofake.go", + "/usr/lib/go-1.21/src/runtime/timestub.go", + "/usr/lib/go-1.21/src/runtime/tls_arm64.s", + "/usr/lib/go-1.21/src/runtime/trace.go", + "/usr/lib/go-1.21/src/runtime/traceback.go", + "/usr/lib/go-1.21/src/runtime/type.go", + "/usr/lib/go-1.21/src/runtime/typekind.go", + "/usr/lib/go-1.21/src/runtime/unsafe.go", + "/usr/lib/go-1.21/src/runtime/utf8.go", + "/usr/lib/go-1.21/src/runtime/write_err.go", + "/usr/lib/go-1.21/src/sort/sort.go", + "/usr/lib/go-1.21/src/sort/zsortinterface.go", + "/usr/lib/go-1.21/src/strconv/atoi.go", + "/usr/lib/go-1.21/src/strconv/decimal.go", + "/usr/lib/go-1.21/src/strconv/ftoa.go", + "/usr/lib/go-1.21/src/strconv/ftoaryu.go", + "/usr/lib/go-1.21/src/strconv/itoa.go", + "/usr/lib/go-1.21/src/strconv/quote.go", + "/usr/lib/go-1.21/src/strings/builder.go", + "/usr/lib/go-1.21/src/strings/strings.go", + "/usr/lib/go-1.21/src/sync/atomic/type.go", + "/usr/lib/go-1.21/src/sync/atomic/value.go", + "/usr/lib/go-1.21/src/sync/map.go", + "/usr/lib/go-1.21/src/sync/mutex.go", + "/usr/lib/go-1.21/src/sync/once.go", + "/usr/lib/go-1.21/src/sync/pool.go", + "/usr/lib/go-1.21/src/sync/poolqueue.go", + "/usr/lib/go-1.21/src/sync/runtime.go", + "/usr/lib/go-1.21/src/sync/rwmutex.go", + "/usr/lib/go-1.21/src/syscall/env_unix.go", + "/usr/lib/go-1.21/src/syscall/exec_unix.go", + "/usr/lib/go-1.21/src/syscall/rlimit.go", + "/usr/lib/go-1.21/src/syscall/rlimit_darwin.go", + "/usr/lib/go-1.21/src/syscall/route_bsd.go", + "/usr/lib/go-1.21/src/syscall/syscall.go", + "/usr/lib/go-1.21/src/syscall/syscall_bsd.go", + "/usr/lib/go-1.21/src/syscall/syscall_darwin.go", + "/usr/lib/go-1.21/src/syscall/syscall_unix.go", + "/usr/lib/go-1.21/src/syscall/zsyscall_darwin_arm64.go", + "/usr/lib/go-1.21/src/syscall/zsyscall_darwin_arm64.s", + "/usr/lib/go-1.21/src/time/format.go", + "/usr/lib/go-1.21/src/time/format_rfc3339.go", + "/usr/lib/go-1.21/src/time/sys_unix.go", + "/usr/lib/go-1.21/src/time/time.go", + "/usr/lib/go-1.21/src/time/zoneinfo.go", + "/usr/lib/go-1.21/src/time/zoneinfo_goroot.go", + "/usr/lib/go-1.21/src/time/zoneinfo_read.go", + "/usr/lib/go-1.21/src/time/zoneinfo_unix.go", + "/usr/lib/go-1.21/src/unicode/casetables.go", + "/usr/lib/go-1.21/src/unicode/tables.go", + "/usr/lib/go-1.21/src/unicode/utf8/utf8.go" + ] + } +} \ No newline at end of file diff --git a/tests/data/app_win_exe b/tests/data/basic/app_win_exe similarity index 100% rename from tests/data/app_win_exe rename to tests/data/basic/app_win_exe diff --git a/tests/data/basic/app_win_exe-goresym.json b/tests/data/basic/app_win_exe-goresym.json new file mode 100644 index 0000000..df7d98e --- /dev/null +++ b/tests/data/basic/app_win_exe-goresym.json @@ -0,0 +1,233 @@ +{ + "go_symbols": { + "build_info": { + "GoVersion": "go1.21.7", + "Path": "command-line-arguments", + "Main": { + "Path": "", + "Version": "", + "Sum": "", + "Replace": null + }, + "Deps": null, + "Settings": [ + { + "Key": "-buildmode", + "Value": "exe" + }, + { + "Key": "-compiler", + "Value": "gc" + }, + { + "Key": "CGO_ENABLED", + "Value": "0" + }, + { + "Key": "GOARCH", + "Value": "amd64" + }, + { + "Key": "GOOS", + "Value": "windows" + }, + { + "Key": "GOAMD64", + "Value": "v1" + } + ] + }, + "file_paths": [ + "/home/tg1999/Desktop/mini-app/main.go", + "/usr/lib/go-1.21/src/errors/errors.go", + "/usr/lib/go-1.21/src/errors/wrap.go", + "/usr/lib/go-1.21/src/fmt/format.go", + "/usr/lib/go-1.21/src/fmt/print.go", + "/usr/lib/go-1.21/src/internal/abi/abi.go", + "/usr/lib/go-1.21/src/internal/abi/type.go", + "/usr/lib/go-1.21/src/internal/abi/unsafestring_go120.go", + "/usr/lib/go-1.21/src/internal/bytealg/bytealg.go", + "/usr/lib/go-1.21/src/internal/bytealg/compare_amd64.s", + "/usr/lib/go-1.21/src/internal/bytealg/count_amd64.s", + "/usr/lib/go-1.21/src/internal/bytealg/count_native.go", + "/usr/lib/go-1.21/src/internal/bytealg/equal_amd64.s", + "/usr/lib/go-1.21/src/internal/bytealg/index_amd64.go", + "/usr/lib/go-1.21/src/internal/bytealg/index_amd64.s", + "/usr/lib/go-1.21/src/internal/bytealg/indexbyte_amd64.s", + "/usr/lib/go-1.21/src/internal/cpu/cpu.go", + "/usr/lib/go-1.21/src/internal/cpu/cpu_x86.go", + "/usr/lib/go-1.21/src/internal/cpu/cpu_x86.s", + "/usr/lib/go-1.21/src/internal/fmtsort/sort.go", + "/usr/lib/go-1.21/src/internal/itoa/itoa.go", + "/usr/lib/go-1.21/src/internal/poll/errno_windows.go", + "/usr/lib/go-1.21/src/internal/poll/fd.go", + "/usr/lib/go-1.21/src/internal/poll/fd_mutex.go", + "/usr/lib/go-1.21/src/internal/poll/fd_poll_runtime.go", + "/usr/lib/go-1.21/src/internal/poll/fd_windows.go", + "/usr/lib/go-1.21/src/internal/reflectlite/type.go", + "/usr/lib/go-1.21/src/internal/syscall/windows/net_windows.go", + "/usr/lib/go-1.21/src/internal/syscall/windows/registry/value.go", + "/usr/lib/go-1.21/src/internal/syscall/windows/registry/zsyscall_windows.go", + "/usr/lib/go-1.21/src/internal/syscall/windows/syscall_windows.go", + "/usr/lib/go-1.21/src/internal/syscall/windows/sysdll/sysdll.go", + "/usr/lib/go-1.21/src/internal/syscall/windows/zsyscall_windows.go", + "/usr/lib/go-1.21/src/io/fs/fs.go", + "/usr/lib/go-1.21/src/math/bits/bits.go", + "/usr/lib/go-1.21/src/math/exp_amd64.go", + "/usr/lib/go-1.21/src/math/unsafe.go", + "/usr/lib/go-1.21/src/os/dir.go", + "/usr/lib/go-1.21/src/os/error.go", + "/usr/lib/go-1.21/src/os/exec_windows.go", + "/usr/lib/go-1.21/src/os/executable.go", + "/usr/lib/go-1.21/src/os/executable_windows.go", + "/usr/lib/go-1.21/src/os/file.go", + "/usr/lib/go-1.21/src/os/file_posix.go", + "/usr/lib/go-1.21/src/os/file_windows.go", + "/usr/lib/go-1.21/src/os/path_windows.go", + "/usr/lib/go-1.21/src/os/proc.go", + "/usr/lib/go-1.21/src/path/filepath/match.go", + "/usr/lib/go-1.21/src/path/filepath/path.go", + "/usr/lib/go-1.21/src/path/filepath/path_windows.go", + "/usr/lib/go-1.21/src/reflect/abi.go", + "/usr/lib/go-1.21/src/reflect/asm_amd64.s", + "/usr/lib/go-1.21/src/reflect/float32reg_generic.go", + "/usr/lib/go-1.21/src/reflect/makefunc.go", + "/usr/lib/go-1.21/src/reflect/type.go", + "/usr/lib/go-1.21/src/reflect/value.go", + "/usr/lib/go-1.21/src/runtime/alg.go", + "/usr/lib/go-1.21/src/runtime/arena.go", + "/usr/lib/go-1.21/src/runtime/asm.s", + "/usr/lib/go-1.21/src/runtime/asm_amd64.s", + "/usr/lib/go-1.21/src/runtime/atomic_pointer.go", + "/usr/lib/go-1.21/src/runtime/cgocall.go", + "/usr/lib/go-1.21/src/runtime/chan.go", + "/usr/lib/go-1.21/src/runtime/cpuflags_amd64.go", + "/usr/lib/go-1.21/src/runtime/debug.go", + "/usr/lib/go-1.21/src/runtime/debugcall.go", + "/usr/lib/go-1.21/src/runtime/defs_windows_amd64.go", + "/usr/lib/go-1.21/src/runtime/duff_amd64.s", + "/usr/lib/go-1.21/src/runtime/env_posix.go", + "/usr/lib/go-1.21/src/runtime/error.go", + "/usr/lib/go-1.21/src/runtime/exithook.go", + "/usr/lib/go-1.21/src/runtime/extern.go", + "/usr/lib/go-1.21/src/runtime/fastlog2.go", + "/usr/lib/go-1.21/src/runtime/float.go", + "/usr/lib/go-1.21/src/runtime/hash64.go", + "/usr/lib/go-1.21/src/runtime/histogram.go", + "/usr/lib/go-1.21/src/runtime/iface.go", + "/usr/lib/go-1.21/src/runtime/internal/atomic/types.go", + "/usr/lib/go-1.21/src/runtime/internal/sys/intrinsics.go", + "/usr/lib/go-1.21/src/runtime/lfstack.go", + "/usr/lib/go-1.21/src/runtime/lock_sema.go", + "/usr/lib/go-1.21/src/runtime/lockrank.go", + "/usr/lib/go-1.21/src/runtime/lockrank_off.go", + "/usr/lib/go-1.21/src/runtime/malloc.go", + "/usr/lib/go-1.21/src/runtime/map.go", + "/usr/lib/go-1.21/src/runtime/map_fast32.go", + "/usr/lib/go-1.21/src/runtime/map_fast64.go", + "/usr/lib/go-1.21/src/runtime/map_faststr.go", + "/usr/lib/go-1.21/src/runtime/mbarrier.go", + "/usr/lib/go-1.21/src/runtime/mbitmap.go", + "/usr/lib/go-1.21/src/runtime/mcache.go", + "/usr/lib/go-1.21/src/runtime/mcentral.go", + "/usr/lib/go-1.21/src/runtime/mcheckmark.go", + "/usr/lib/go-1.21/src/runtime/mem.go", + "/usr/lib/go-1.21/src/runtime/mem_windows.go", + "/usr/lib/go-1.21/src/runtime/memclr_amd64.s", + "/usr/lib/go-1.21/src/runtime/memmove_amd64.s", + "/usr/lib/go-1.21/src/runtime/mfinal.go", + "/usr/lib/go-1.21/src/runtime/mfixalloc.go", + "/usr/lib/go-1.21/src/runtime/mgc.go", + "/usr/lib/go-1.21/src/runtime/mgclimit.go", + "/usr/lib/go-1.21/src/runtime/mgcmark.go", + "/usr/lib/go-1.21/src/runtime/mgcpacer.go", + "/usr/lib/go-1.21/src/runtime/mgcscavenge.go", + "/usr/lib/go-1.21/src/runtime/mgcstack.go", + "/usr/lib/go-1.21/src/runtime/mgcsweep.go", + "/usr/lib/go-1.21/src/runtime/mgcwork.go", + "/usr/lib/go-1.21/src/runtime/mheap.go", + "/usr/lib/go-1.21/src/runtime/mpagealloc.go", + "/usr/lib/go-1.21/src/runtime/mpagealloc_64bit.go", + "/usr/lib/go-1.21/src/runtime/mpagecache.go", + "/usr/lib/go-1.21/src/runtime/mpallocbits.go", + "/usr/lib/go-1.21/src/runtime/mprof.go", + "/usr/lib/go-1.21/src/runtime/mranges.go", + "/usr/lib/go-1.21/src/runtime/msize.go", + "/usr/lib/go-1.21/src/runtime/mspanset.go", + "/usr/lib/go-1.21/src/runtime/mstats.go", + "/usr/lib/go-1.21/src/runtime/mwbbuf.go", + "/usr/lib/go-1.21/src/runtime/netpoll.go", + "/usr/lib/go-1.21/src/runtime/netpoll_windows.go", + "/usr/lib/go-1.21/src/runtime/os_windows.go", + "/usr/lib/go-1.21/src/runtime/pagetrace_off.go", + "/usr/lib/go-1.21/src/runtime/panic.go", + "/usr/lib/go-1.21/src/runtime/pinner.go", + "/usr/lib/go-1.21/src/runtime/preempt.go", + "/usr/lib/go-1.21/src/runtime/preempt_amd64.s", + "/usr/lib/go-1.21/src/runtime/print.go", + "/usr/lib/go-1.21/src/runtime/proc.go", + "/usr/lib/go-1.21/src/runtime/rt0_windows_amd64.s", + "/usr/lib/go-1.21/src/runtime/runtime.go", + "/usr/lib/go-1.21/src/runtime/runtime1.go", + "/usr/lib/go-1.21/src/runtime/runtime2.go", + "/usr/lib/go-1.21/src/runtime/rwmutex.go", + "/usr/lib/go-1.21/src/runtime/select.go", + "/usr/lib/go-1.21/src/runtime/sema.go", + "/usr/lib/go-1.21/src/runtime/signal_windows.go", + "/usr/lib/go-1.21/src/runtime/sigqueue.go", + "/usr/lib/go-1.21/src/runtime/slice.go", + "/usr/lib/go-1.21/src/runtime/stack.go", + "/usr/lib/go-1.21/src/runtime/stkframe.go", + "/usr/lib/go-1.21/src/runtime/string.go", + "/usr/lib/go-1.21/src/runtime/stubs.go", + "/usr/lib/go-1.21/src/runtime/symtab.go", + "/usr/lib/go-1.21/src/runtime/symtabinl.go", + "/usr/lib/go-1.21/src/runtime/sys_windows_amd64.s", + "/usr/lib/go-1.21/src/runtime/sys_x86.go", + "/usr/lib/go-1.21/src/runtime/syscall_windows.go", + "/usr/lib/go-1.21/src/runtime/tagptr_64bit.go", + "/usr/lib/go-1.21/src/runtime/time.go", + "/usr/lib/go-1.21/src/runtime/time_nofake.go", + "/usr/lib/go-1.21/src/runtime/time_windows_amd64.s", + "/usr/lib/go-1.21/src/runtime/trace.go", + "/usr/lib/go-1.21/src/runtime/traceback.go", + "/usr/lib/go-1.21/src/runtime/type.go", + "/usr/lib/go-1.21/src/runtime/typekind.go", + "/usr/lib/go-1.21/src/runtime/unsafe.go", + "/usr/lib/go-1.21/src/runtime/utf8.go", + "/usr/lib/go-1.21/src/runtime/write_err.go", + "/usr/lib/go-1.21/src/runtime/zcallback_windows.s", + "/usr/lib/go-1.21/src/sort/sort.go", + "/usr/lib/go-1.21/src/sort/zsortinterface.go", + "/usr/lib/go-1.21/src/strconv/atoi.go", + "/usr/lib/go-1.21/src/strconv/decimal.go", + "/usr/lib/go-1.21/src/strconv/ftoa.go", + "/usr/lib/go-1.21/src/strconv/ftoaryu.go", + "/usr/lib/go-1.21/src/strconv/itoa.go", + "/usr/lib/go-1.21/src/strconv/quote.go", + "/usr/lib/go-1.21/src/strings/builder.go", + "/usr/lib/go-1.21/src/strings/strings.go", + "/usr/lib/go-1.21/src/sync/atomic/type.go", + "/usr/lib/go-1.21/src/sync/map.go", + "/usr/lib/go-1.21/src/sync/mutex.go", + "/usr/lib/go-1.21/src/sync/once.go", + "/usr/lib/go-1.21/src/sync/oncefunc.go", + "/usr/lib/go-1.21/src/sync/pool.go", + "/usr/lib/go-1.21/src/sync/poolqueue.go", + "/usr/lib/go-1.21/src/sync/runtime.go", + "/usr/lib/go-1.21/src/syscall/dll_windows.go", + "/usr/lib/go-1.21/src/syscall/exec_windows.go", + "/usr/lib/go-1.21/src/syscall/syscall.go", + "/usr/lib/go-1.21/src/syscall/syscall_windows.go", + "/usr/lib/go-1.21/src/syscall/wtf8_windows.go", + "/usr/lib/go-1.21/src/syscall/zsyscall_windows.go", + "/usr/lib/go-1.21/src/time/format.go", + "/usr/lib/go-1.21/src/time/time.go", + "/usr/lib/go-1.21/src/time/zoneinfo_abbrs_windows.go", + "/usr/lib/go-1.21/src/unicode/casetables.go", + "/usr/lib/go-1.21/src/unicode/tables.go", + "/usr/lib/go-1.21/src/unicode/utf16/utf16.go", + "/usr/lib/go-1.21/src/unicode/utf8/utf8.go" + ] + } +} \ No newline at end of file diff --git a/tests/data/main.go b/tests/data/basic/main.go similarity index 100% rename from tests/data/main.go rename to tests/data/basic/main.go diff --git a/tests/data/gore_sym_app_lin_exe_output.json b/tests/data/gore_sym_app_lin_exe_output.json deleted file mode 100644 index ada4d6a..0000000 --- a/tests/data/gore_sym_app_lin_exe_output.json +++ /dev/null @@ -1,251 +0,0 @@ -{ - "go_symbols": { - "build_info": { - "GoVersion": "go1.21.7", - "Path": "command-line-arguments", - "Main": { - "Path": "", - "Version": "", - "Sum": "", - "Replace": null - }, - "Deps": null, - "Settings": [ - { - "Key": "-buildmode", - "Value": "exe" - }, - { - "Key": "-compiler", - "Value": "gc" - }, - { - "Key": "CGO_ENABLED", - "Value": "1" - }, - { - "Key": "CGO_CFLAGS", - "Value": "" - }, - { - "Key": "CGO_CPPFLAGS", - "Value": "" - }, - { - "Key": "CGO_CXXFLAGS", - "Value": "" - }, - { - "Key": "CGO_LDFLAGS", - "Value": "" - }, - { - "Key": "GOARCH", - "Value": "amd64" - }, - { - "Key": "GOOS", - "Value": "linux" - }, - { - "Key": "GOAMD64", - "Value": "v1" - } - ] - }, - "file_paths": [ - "/home/tg1999/Desktop/mini-app/main.go", - "/usr/lib/go-1.21/src/errors/errors.go", - "/usr/lib/go-1.21/src/errors/wrap.go", - "/usr/lib/go-1.21/src/fmt/format.go", - "/usr/lib/go-1.21/src/fmt/print.go", - "/usr/lib/go-1.21/src/internal/abi/abi.go", - "/usr/lib/go-1.21/src/internal/abi/type.go", - "/usr/lib/go-1.21/src/internal/abi/unsafestring_go120.go", - "/usr/lib/go-1.21/src/internal/bytealg/compare_amd64.s", - "/usr/lib/go-1.21/src/internal/bytealg/equal_amd64.s", - "/usr/lib/go-1.21/src/internal/bytealg/index_amd64.go", - "/usr/lib/go-1.21/src/internal/bytealg/indexbyte_amd64.s", - "/usr/lib/go-1.21/src/internal/cpu/cpu.go", - "/usr/lib/go-1.21/src/internal/cpu/cpu_x86.go", - "/usr/lib/go-1.21/src/internal/cpu/cpu_x86.s", - "/usr/lib/go-1.21/src/internal/fmtsort/sort.go", - "/usr/lib/go-1.21/src/internal/itoa/itoa.go", - "/usr/lib/go-1.21/src/internal/poll/errno_unix.go", - "/usr/lib/go-1.21/src/internal/poll/fd.go", - "/usr/lib/go-1.21/src/internal/poll/fd_mutex.go", - "/usr/lib/go-1.21/src/internal/poll/fd_poll_runtime.go", - "/usr/lib/go-1.21/src/internal/poll/fd_unix.go", - "/usr/lib/go-1.21/src/internal/poll/fd_unixjs.go", - "/usr/lib/go-1.21/src/internal/reflectlite/type.go", - "/usr/lib/go-1.21/src/internal/syscall/unix/fcntl_unix.go", - "/usr/lib/go-1.21/src/internal/syscall/unix/nonblocking_unix.go", - "/usr/lib/go-1.21/src/io/fs/fs.go", - "/usr/lib/go-1.21/src/math/bits/bits.go", - "/usr/lib/go-1.21/src/math/exp_amd64.go", - "/usr/lib/go-1.21/src/math/unsafe.go", - "/usr/lib/go-1.21/src/os/dir.go", - "/usr/lib/go-1.21/src/os/dir_unix.go", - "/usr/lib/go-1.21/src/os/error.go", - "/usr/lib/go-1.21/src/os/file.go", - "/usr/lib/go-1.21/src/os/file_posix.go", - "/usr/lib/go-1.21/src/os/file_unix.go", - "/usr/lib/go-1.21/src/os/path_unix.go", - "/usr/lib/go-1.21/src/os/proc.go", - "/usr/lib/go-1.21/src/path/filepath/match.go", - "/usr/lib/go-1.21/src/path/filepath/path.go", - "/usr/lib/go-1.21/src/path/filepath/path_unix.go", - "/usr/lib/go-1.21/src/reflect/abi.go", - "/usr/lib/go-1.21/src/reflect/asm_amd64.s", - "/usr/lib/go-1.21/src/reflect/float32reg_generic.go", - "/usr/lib/go-1.21/src/reflect/makefunc.go", - "/usr/lib/go-1.21/src/reflect/type.go", - "/usr/lib/go-1.21/src/reflect/value.go", - "/usr/lib/go-1.21/src/runtime/alg.go", - "/usr/lib/go-1.21/src/runtime/arena.go", - "/usr/lib/go-1.21/src/runtime/asm.s", - "/usr/lib/go-1.21/src/runtime/asm_amd64.s", - "/usr/lib/go-1.21/src/runtime/atomic_pointer.go", - "/usr/lib/go-1.21/src/runtime/cgo_mmap.go", - "/usr/lib/go-1.21/src/runtime/cgo_sigaction.go", - "/usr/lib/go-1.21/src/runtime/cgocall.go", - "/usr/lib/go-1.21/src/runtime/chan.go", - "/usr/lib/go-1.21/src/runtime/cpuflags_amd64.go", - "/usr/lib/go-1.21/src/runtime/cpuprof.go", - "/usr/lib/go-1.21/src/runtime/debug.go", - "/usr/lib/go-1.21/src/runtime/debugcall.go", - "/usr/lib/go-1.21/src/runtime/defs_linux_amd64.go", - "/usr/lib/go-1.21/src/runtime/duff_amd64.s", - "/usr/lib/go-1.21/src/runtime/env_posix.go", - "/usr/lib/go-1.21/src/runtime/error.go", - "/usr/lib/go-1.21/src/runtime/exithook.go", - "/usr/lib/go-1.21/src/runtime/extern.go", - "/usr/lib/go-1.21/src/runtime/fastlog2.go", - "/usr/lib/go-1.21/src/runtime/float.go", - "/usr/lib/go-1.21/src/runtime/hash64.go", - "/usr/lib/go-1.21/src/runtime/histogram.go", - "/usr/lib/go-1.21/src/runtime/iface.go", - "/usr/lib/go-1.21/src/runtime/internal/atomic/types.go", - "/usr/lib/go-1.21/src/runtime/internal/sys/intrinsics.go", - "/usr/lib/go-1.21/src/runtime/internal/syscall/asm_linux_amd64.s", - "/usr/lib/go-1.21/src/runtime/internal/syscall/syscall_linux.go", - "/usr/lib/go-1.21/src/runtime/lfstack.go", - "/usr/lib/go-1.21/src/runtime/lock_futex.go", - "/usr/lib/go-1.21/src/runtime/lockrank.go", - "/usr/lib/go-1.21/src/runtime/lockrank_off.go", - "/usr/lib/go-1.21/src/runtime/malloc.go", - "/usr/lib/go-1.21/src/runtime/map.go", - "/usr/lib/go-1.21/src/runtime/map_fast32.go", - "/usr/lib/go-1.21/src/runtime/map_fast64.go", - "/usr/lib/go-1.21/src/runtime/map_faststr.go", - "/usr/lib/go-1.21/src/runtime/mbarrier.go", - "/usr/lib/go-1.21/src/runtime/mbitmap.go", - "/usr/lib/go-1.21/src/runtime/mcache.go", - "/usr/lib/go-1.21/src/runtime/mcentral.go", - "/usr/lib/go-1.21/src/runtime/mcheckmark.go", - "/usr/lib/go-1.21/src/runtime/mem.go", - "/usr/lib/go-1.21/src/runtime/mem_linux.go", - "/usr/lib/go-1.21/src/runtime/memclr_amd64.s", - "/usr/lib/go-1.21/src/runtime/memmove_amd64.s", - "/usr/lib/go-1.21/src/runtime/mfinal.go", - "/usr/lib/go-1.21/src/runtime/mfixalloc.go", - "/usr/lib/go-1.21/src/runtime/mgc.go", - "/usr/lib/go-1.21/src/runtime/mgclimit.go", - "/usr/lib/go-1.21/src/runtime/mgcmark.go", - "/usr/lib/go-1.21/src/runtime/mgcpacer.go", - "/usr/lib/go-1.21/src/runtime/mgcscavenge.go", - "/usr/lib/go-1.21/src/runtime/mgcstack.go", - "/usr/lib/go-1.21/src/runtime/mgcsweep.go", - "/usr/lib/go-1.21/src/runtime/mgcwork.go", - "/usr/lib/go-1.21/src/runtime/mheap.go", - "/usr/lib/go-1.21/src/runtime/mpagealloc.go", - "/usr/lib/go-1.21/src/runtime/mpagealloc_64bit.go", - "/usr/lib/go-1.21/src/runtime/mpagecache.go", - "/usr/lib/go-1.21/src/runtime/mpallocbits.go", - "/usr/lib/go-1.21/src/runtime/mprof.go", - "/usr/lib/go-1.21/src/runtime/mranges.go", - "/usr/lib/go-1.21/src/runtime/msize.go", - "/usr/lib/go-1.21/src/runtime/mspanset.go", - "/usr/lib/go-1.21/src/runtime/mstats.go", - "/usr/lib/go-1.21/src/runtime/mwbbuf.go", - "/usr/lib/go-1.21/src/runtime/nbpipe_pipe2.go", - "/usr/lib/go-1.21/src/runtime/netpoll.go", - "/usr/lib/go-1.21/src/runtime/netpoll_epoll.go", - "/usr/lib/go-1.21/src/runtime/os_linux.go", - "/usr/lib/go-1.21/src/runtime/os_linux_generic.go", - "/usr/lib/go-1.21/src/runtime/pagetrace_off.go", - "/usr/lib/go-1.21/src/runtime/panic.go", - "/usr/lib/go-1.21/src/runtime/pinner.go", - "/usr/lib/go-1.21/src/runtime/preempt.go", - "/usr/lib/go-1.21/src/runtime/preempt_amd64.s", - "/usr/lib/go-1.21/src/runtime/print.go", - "/usr/lib/go-1.21/src/runtime/proc.go", - "/usr/lib/go-1.21/src/runtime/profbuf.go", - "/usr/lib/go-1.21/src/runtime/retry.go", - "/usr/lib/go-1.21/src/runtime/rt0_linux_amd64.s", - "/usr/lib/go-1.21/src/runtime/runtime.go", - "/usr/lib/go-1.21/src/runtime/runtime1.go", - "/usr/lib/go-1.21/src/runtime/runtime2.go", - "/usr/lib/go-1.21/src/runtime/rwmutex.go", - "/usr/lib/go-1.21/src/runtime/security_unix.go", - "/usr/lib/go-1.21/src/runtime/select.go", - "/usr/lib/go-1.21/src/runtime/sema.go", - "/usr/lib/go-1.21/src/runtime/signal_amd64.go", - "/usr/lib/go-1.21/src/runtime/signal_linux_amd64.go", - "/usr/lib/go-1.21/src/runtime/signal_unix.go", - "/usr/lib/go-1.21/src/runtime/sigqueue.go", - "/usr/lib/go-1.21/src/runtime/slice.go", - "/usr/lib/go-1.21/src/runtime/stack.go", - "/usr/lib/go-1.21/src/runtime/stkframe.go", - "/usr/lib/go-1.21/src/runtime/string.go", - "/usr/lib/go-1.21/src/runtime/stubs.go", - "/usr/lib/go-1.21/src/runtime/stubs2.go", - "/usr/lib/go-1.21/src/runtime/symtab.go", - "/usr/lib/go-1.21/src/runtime/symtabinl.go", - "/usr/lib/go-1.21/src/runtime/sys_linux_amd64.s", - "/usr/lib/go-1.21/src/runtime/sys_x86.go", - "/usr/lib/go-1.21/src/runtime/tagptr_64bit.go", - "/usr/lib/go-1.21/src/runtime/time.go", - "/usr/lib/go-1.21/src/runtime/time_linux_amd64.s", - "/usr/lib/go-1.21/src/runtime/time_nofake.go", - "/usr/lib/go-1.21/src/runtime/trace.go", - "/usr/lib/go-1.21/src/runtime/traceback.go", - "/usr/lib/go-1.21/src/runtime/type.go", - "/usr/lib/go-1.21/src/runtime/typekind.go", - "/usr/lib/go-1.21/src/runtime/unsafe.go", - "/usr/lib/go-1.21/src/runtime/utf8.go", - "/usr/lib/go-1.21/src/runtime/vdso_linux.go", - "/usr/lib/go-1.21/src/runtime/write_err.go", - "/usr/lib/go-1.21/src/sort/sort.go", - "/usr/lib/go-1.21/src/sort/zsortinterface.go", - "/usr/lib/go-1.21/src/strconv/atoi.go", - "/usr/lib/go-1.21/src/strconv/decimal.go", - "/usr/lib/go-1.21/src/strconv/ftoa.go", - "/usr/lib/go-1.21/src/strconv/ftoaryu.go", - "/usr/lib/go-1.21/src/strconv/itoa.go", - "/usr/lib/go-1.21/src/strconv/quote.go", - "/usr/lib/go-1.21/src/strings/builder.go", - "/usr/lib/go-1.21/src/strings/strings.go", - "/usr/lib/go-1.21/src/sync/atomic/type.go", - "/usr/lib/go-1.21/src/sync/atomic/value.go", - "/usr/lib/go-1.21/src/sync/map.go", - "/usr/lib/go-1.21/src/sync/mutex.go", - "/usr/lib/go-1.21/src/sync/once.go", - "/usr/lib/go-1.21/src/sync/pool.go", - "/usr/lib/go-1.21/src/sync/poolqueue.go", - "/usr/lib/go-1.21/src/sync/runtime.go", - "/usr/lib/go-1.21/src/syscall/env_unix.go", - "/usr/lib/go-1.21/src/syscall/exec_unix.go", - "/usr/lib/go-1.21/src/syscall/rlimit.go", - "/usr/lib/go-1.21/src/syscall/syscall_linux.go", - "/usr/lib/go-1.21/src/syscall/syscall_unix.go", - "/usr/lib/go-1.21/src/syscall/zsyscall_linux_amd64.go", - "/usr/lib/go-1.21/src/time/format.go", - "/usr/lib/go-1.21/src/time/time.go", - "/usr/lib/go-1.21/src/unicode/casetables.go", - "/usr/lib/go-1.21/src/unicode/tables.go", - "/usr/lib/go-1.21/src/unicode/utf8/utf8.go", - "" - ] - } - } \ No newline at end of file diff --git a/tests/data/gore_sym_app_mac_exe_output.json b/tests/data/gore_sym_app_mac_exe_output.json deleted file mode 100644 index 6be185c..0000000 --- a/tests/data/gore_sym_app_mac_exe_output.json +++ /dev/null @@ -1,251 +0,0 @@ -{ - "go_symbols": { - "build_info": { - "GoVersion": "go1.21.7", - "Path": "command-line-arguments", - "Main": { - "Path": "", - "Version": "", - "Sum": "", - "Replace": null - }, - "Deps": null, - "Settings": [ - { - "Key": "-buildmode", - "Value": "exe" - }, - { - "Key": "-compiler", - "Value": "gc" - }, - { - "Key": "CGO_ENABLED", - "Value": "0" - }, - { - "Key": "GOARCH", - "Value": "arm64" - }, - { - "Key": "GOOS", - "Value": "darwin" - } - ] - }, - "file_paths": [ - "/home/tg1999/Desktop/mini-app/main.go", - "/usr/lib/go-1.21/src/errors/errors.go", - "/usr/lib/go-1.21/src/errors/wrap.go", - "/usr/lib/go-1.21/src/fmt/format.go", - "/usr/lib/go-1.21/src/fmt/print.go", - "/usr/lib/go-1.21/src/internal/abi/abi.go", - "/usr/lib/go-1.21/src/internal/abi/type.go", - "/usr/lib/go-1.21/src/internal/abi/unsafestring_go120.go", - "/usr/lib/go-1.21/src/internal/bytealg/compare_arm64.s", - "/usr/lib/go-1.21/src/internal/bytealg/equal_arm64.s", - "/usr/lib/go-1.21/src/internal/bytealg/index_arm64.go", - "/usr/lib/go-1.21/src/internal/bytealg/indexbyte_arm64.s", - "/usr/lib/go-1.21/src/internal/cpu/cpu.go", - "/usr/lib/go-1.21/src/internal/cpu/cpu_arm64.go", - "/usr/lib/go-1.21/src/internal/cpu/cpu_arm64_darwin.go", - "/usr/lib/go-1.21/src/internal/fmtsort/sort.go", - "/usr/lib/go-1.21/src/internal/itoa/itoa.go", - "/usr/lib/go-1.21/src/internal/poll/errno_unix.go", - "/usr/lib/go-1.21/src/internal/poll/fd.go", - "/usr/lib/go-1.21/src/internal/poll/fd_mutex.go", - "/usr/lib/go-1.21/src/internal/poll/fd_poll_runtime.go", - "/usr/lib/go-1.21/src/internal/poll/fd_unix.go", - "/usr/lib/go-1.21/src/internal/poll/fd_unixjs.go", - "/usr/lib/go-1.21/src/internal/reflectlite/type.go", - "/usr/lib/go-1.21/src/internal/syscall/unix/fcntl_unix.go", - "/usr/lib/go-1.21/src/internal/syscall/unix/nonblocking_unix.go", - "/usr/lib/go-1.21/src/internal/testlog/log.go", - "/usr/lib/go-1.21/src/io/fs/fs.go", - "/usr/lib/go-1.21/src/math/bits/bits.go", - "/usr/lib/go-1.21/src/math/unsafe.go", - "/usr/lib/go-1.21/src/os/dir.go", - "/usr/lib/go-1.21/src/os/dir_darwin.go", - "/usr/lib/go-1.21/src/os/env.go", - "/usr/lib/go-1.21/src/os/error.go", - "/usr/lib/go-1.21/src/os/executable_darwin.go", - "/usr/lib/go-1.21/src/os/file.go", - "/usr/lib/go-1.21/src/os/file_posix.go", - "/usr/lib/go-1.21/src/os/file_unix.go", - "/usr/lib/go-1.21/src/os/getwd.go", - "/usr/lib/go-1.21/src/os/path_unix.go", - "/usr/lib/go-1.21/src/os/proc.go", - "/usr/lib/go-1.21/src/os/stat_darwin.go", - "/usr/lib/go-1.21/src/os/stat_unix.go", - "/usr/lib/go-1.21/src/os/types.go", - "/usr/lib/go-1.21/src/os/types_unix.go", - "/usr/lib/go-1.21/src/path/filepath/match.go", - "/usr/lib/go-1.21/src/path/filepath/path.go", - "/usr/lib/go-1.21/src/path/filepath/path_unix.go", - "/usr/lib/go-1.21/src/reflect/abi.go", - "/usr/lib/go-1.21/src/reflect/asm_arm64.s", - "/usr/lib/go-1.21/src/reflect/float32reg_generic.go", - "/usr/lib/go-1.21/src/reflect/makefunc.go", - "/usr/lib/go-1.21/src/reflect/type.go", - "/usr/lib/go-1.21/src/reflect/value.go", - "/usr/lib/go-1.21/src/runtime/alg.go", - "/usr/lib/go-1.21/src/runtime/arena.go", - "/usr/lib/go-1.21/src/runtime/asm.s", - "/usr/lib/go-1.21/src/runtime/asm_arm64.s", - "/usr/lib/go-1.21/src/runtime/atomic_pointer.go", - "/usr/lib/go-1.21/src/runtime/cgocall.go", - "/usr/lib/go-1.21/src/runtime/chan.go", - "/usr/lib/go-1.21/src/runtime/cpuflags_arm64.go", - "/usr/lib/go-1.21/src/runtime/cpuprof.go", - "/usr/lib/go-1.21/src/runtime/debug.go", - "/usr/lib/go-1.21/src/runtime/debugcall.go", - "/usr/lib/go-1.21/src/runtime/defs_darwin_arm64.go", - "/usr/lib/go-1.21/src/runtime/duff_arm64.s", - "/usr/lib/go-1.21/src/runtime/env_posix.go", - "/usr/lib/go-1.21/src/runtime/error.go", - "/usr/lib/go-1.21/src/runtime/exithook.go", - "/usr/lib/go-1.21/src/runtime/extern.go", - "/usr/lib/go-1.21/src/runtime/fastlog2.go", - "/usr/lib/go-1.21/src/runtime/float.go", - "/usr/lib/go-1.21/src/runtime/hash64.go", - "/usr/lib/go-1.21/src/runtime/histogram.go", - "/usr/lib/go-1.21/src/runtime/iface.go", - "/usr/lib/go-1.21/src/runtime/internal/atomic/types.go", - "/usr/lib/go-1.21/src/runtime/internal/sys/intrinsics.go", - "/usr/lib/go-1.21/src/runtime/lfstack.go", - "/usr/lib/go-1.21/src/runtime/lock_sema.go", - "/usr/lib/go-1.21/src/runtime/lockrank.go", - "/usr/lib/go-1.21/src/runtime/lockrank_off.go", - "/usr/lib/go-1.21/src/runtime/malloc.go", - "/usr/lib/go-1.21/src/runtime/map.go", - "/usr/lib/go-1.21/src/runtime/map_fast32.go", - "/usr/lib/go-1.21/src/runtime/map_fast64.go", - "/usr/lib/go-1.21/src/runtime/map_faststr.go", - "/usr/lib/go-1.21/src/runtime/mbarrier.go", - "/usr/lib/go-1.21/src/runtime/mbitmap.go", - "/usr/lib/go-1.21/src/runtime/mcache.go", - "/usr/lib/go-1.21/src/runtime/mcentral.go", - "/usr/lib/go-1.21/src/runtime/mcheckmark.go", - "/usr/lib/go-1.21/src/runtime/mem.go", - "/usr/lib/go-1.21/src/runtime/mem_darwin.go", - "/usr/lib/go-1.21/src/runtime/memclr_arm64.s", - "/usr/lib/go-1.21/src/runtime/memmove_arm64.s", - "/usr/lib/go-1.21/src/runtime/mfinal.go", - "/usr/lib/go-1.21/src/runtime/mfixalloc.go", - "/usr/lib/go-1.21/src/runtime/mgc.go", - "/usr/lib/go-1.21/src/runtime/mgclimit.go", - "/usr/lib/go-1.21/src/runtime/mgcmark.go", - "/usr/lib/go-1.21/src/runtime/mgcpacer.go", - "/usr/lib/go-1.21/src/runtime/mgcscavenge.go", - "/usr/lib/go-1.21/src/runtime/mgcstack.go", - "/usr/lib/go-1.21/src/runtime/mgcsweep.go", - "/usr/lib/go-1.21/src/runtime/mgcwork.go", - "/usr/lib/go-1.21/src/runtime/mheap.go", - "/usr/lib/go-1.21/src/runtime/mpagealloc.go", - "/usr/lib/go-1.21/src/runtime/mpagealloc_64bit.go", - "/usr/lib/go-1.21/src/runtime/mpagecache.go", - "/usr/lib/go-1.21/src/runtime/mpallocbits.go", - "/usr/lib/go-1.21/src/runtime/mprof.go", - "/usr/lib/go-1.21/src/runtime/mranges.go", - "/usr/lib/go-1.21/src/runtime/msize.go", - "/usr/lib/go-1.21/src/runtime/mspanset.go", - "/usr/lib/go-1.21/src/runtime/mstats.go", - "/usr/lib/go-1.21/src/runtime/mwbbuf.go", - "/usr/lib/go-1.21/src/runtime/nbpipe_pipe.go", - "/usr/lib/go-1.21/src/runtime/netpoll.go", - "/usr/lib/go-1.21/src/runtime/netpoll_kqueue.go", - "/usr/lib/go-1.21/src/runtime/os_darwin.go", - "/usr/lib/go-1.21/src/runtime/os_darwin_arm64.go", - "/usr/lib/go-1.21/src/runtime/os_unix.go", - "/usr/lib/go-1.21/src/runtime/os_unix_nonlinux.go", - "/usr/lib/go-1.21/src/runtime/pagetrace_off.go", - "/usr/lib/go-1.21/src/runtime/panic.go", - "/usr/lib/go-1.21/src/runtime/pinner.go", - "/usr/lib/go-1.21/src/runtime/preempt.go", - "/usr/lib/go-1.21/src/runtime/preempt_arm64.s", - "/usr/lib/go-1.21/src/runtime/print.go", - "/usr/lib/go-1.21/src/runtime/proc.go", - "/usr/lib/go-1.21/src/runtime/profbuf.go", - "/usr/lib/go-1.21/src/runtime/retry.go", - "/usr/lib/go-1.21/src/runtime/rt0_darwin_arm64.s", - "/usr/lib/go-1.21/src/runtime/runtime.go", - "/usr/lib/go-1.21/src/runtime/runtime1.go", - "/usr/lib/go-1.21/src/runtime/runtime2.go", - "/usr/lib/go-1.21/src/runtime/rwmutex.go", - "/usr/lib/go-1.21/src/runtime/security_issetugid.go", - "/usr/lib/go-1.21/src/runtime/security_unix.go", - "/usr/lib/go-1.21/src/runtime/select.go", - "/usr/lib/go-1.21/src/runtime/sema.go", - "/usr/lib/go-1.21/src/runtime/signal_arm64.go", - "/usr/lib/go-1.21/src/runtime/signal_darwin_arm64.go", - "/usr/lib/go-1.21/src/runtime/signal_unix.go", - "/usr/lib/go-1.21/src/runtime/sigqueue.go", - "/usr/lib/go-1.21/src/runtime/slice.go", - "/usr/lib/go-1.21/src/runtime/stack.go", - "/usr/lib/go-1.21/src/runtime/stkframe.go", - "/usr/lib/go-1.21/src/runtime/string.go", - "/usr/lib/go-1.21/src/runtime/stubs.go", - "/usr/lib/go-1.21/src/runtime/symtab.go", - "/usr/lib/go-1.21/src/runtime/symtabinl.go", - "/usr/lib/go-1.21/src/runtime/sys_arm64.go", - "/usr/lib/go-1.21/src/runtime/sys_darwin.go", - "/usr/lib/go-1.21/src/runtime/sys_darwin_arm64.go", - "/usr/lib/go-1.21/src/runtime/sys_darwin_arm64.s", - "/usr/lib/go-1.21/src/runtime/sys_libc.go", - "/usr/lib/go-1.21/src/runtime/tagptr_64bit.go", - "/usr/lib/go-1.21/src/runtime/time.go", - "/usr/lib/go-1.21/src/runtime/time_nofake.go", - "/usr/lib/go-1.21/src/runtime/timestub.go", - "/usr/lib/go-1.21/src/runtime/tls_arm64.s", - "/usr/lib/go-1.21/src/runtime/trace.go", - "/usr/lib/go-1.21/src/runtime/traceback.go", - "/usr/lib/go-1.21/src/runtime/type.go", - "/usr/lib/go-1.21/src/runtime/typekind.go", - "/usr/lib/go-1.21/src/runtime/unsafe.go", - "/usr/lib/go-1.21/src/runtime/utf8.go", - "/usr/lib/go-1.21/src/runtime/write_err.go", - "/usr/lib/go-1.21/src/sort/sort.go", - "/usr/lib/go-1.21/src/sort/zsortinterface.go", - "/usr/lib/go-1.21/src/strconv/atoi.go", - "/usr/lib/go-1.21/src/strconv/decimal.go", - "/usr/lib/go-1.21/src/strconv/ftoa.go", - "/usr/lib/go-1.21/src/strconv/ftoaryu.go", - "/usr/lib/go-1.21/src/strconv/itoa.go", - "/usr/lib/go-1.21/src/strconv/quote.go", - "/usr/lib/go-1.21/src/strings/builder.go", - "/usr/lib/go-1.21/src/strings/strings.go", - "/usr/lib/go-1.21/src/sync/atomic/type.go", - "/usr/lib/go-1.21/src/sync/atomic/value.go", - "/usr/lib/go-1.21/src/sync/map.go", - "/usr/lib/go-1.21/src/sync/mutex.go", - "/usr/lib/go-1.21/src/sync/once.go", - "/usr/lib/go-1.21/src/sync/pool.go", - "/usr/lib/go-1.21/src/sync/poolqueue.go", - "/usr/lib/go-1.21/src/sync/runtime.go", - "/usr/lib/go-1.21/src/sync/rwmutex.go", - "/usr/lib/go-1.21/src/syscall/env_unix.go", - "/usr/lib/go-1.21/src/syscall/exec_unix.go", - "/usr/lib/go-1.21/src/syscall/rlimit.go", - "/usr/lib/go-1.21/src/syscall/rlimit_darwin.go", - "/usr/lib/go-1.21/src/syscall/route_bsd.go", - "/usr/lib/go-1.21/src/syscall/syscall.go", - "/usr/lib/go-1.21/src/syscall/syscall_bsd.go", - "/usr/lib/go-1.21/src/syscall/syscall_darwin.go", - "/usr/lib/go-1.21/src/syscall/syscall_unix.go", - "/usr/lib/go-1.21/src/syscall/zsyscall_darwin_arm64.go", - "/usr/lib/go-1.21/src/syscall/zsyscall_darwin_arm64.s", - "/usr/lib/go-1.21/src/time/format.go", - "/usr/lib/go-1.21/src/time/format_rfc3339.go", - "/usr/lib/go-1.21/src/time/sys_unix.go", - "/usr/lib/go-1.21/src/time/time.go", - "/usr/lib/go-1.21/src/time/zoneinfo.go", - "/usr/lib/go-1.21/src/time/zoneinfo_goroot.go", - "/usr/lib/go-1.21/src/time/zoneinfo_read.go", - "/usr/lib/go-1.21/src/time/zoneinfo_unix.go", - "/usr/lib/go-1.21/src/unicode/casetables.go", - "/usr/lib/go-1.21/src/unicode/tables.go", - "/usr/lib/go-1.21/src/unicode/utf8/utf8.go", - "" - ] - } - } \ No newline at end of file diff --git a/tests/data/gore_sym_app_win_exe_output.json b/tests/data/gore_sym_app_win_exe_output.json deleted file mode 100644 index ad92e4d..0000000 --- a/tests/data/gore_sym_app_win_exe_output.json +++ /dev/null @@ -1,234 +0,0 @@ -{ - "go_symbols": { - "build_info": { - "GoVersion": "go1.21.7", - "Path": "command-line-arguments", - "Main": { - "Path": "", - "Version": "", - "Sum": "", - "Replace": null - }, - "Deps": null, - "Settings": [ - { - "Key": "-buildmode", - "Value": "exe" - }, - { - "Key": "-compiler", - "Value": "gc" - }, - { - "Key": "CGO_ENABLED", - "Value": "0" - }, - { - "Key": "GOARCH", - "Value": "amd64" - }, - { - "Key": "GOOS", - "Value": "windows" - }, - { - "Key": "GOAMD64", - "Value": "v1" - } - ] - }, - "file_paths": [ - "/home/tg1999/Desktop/mini-app/main.go", - "/usr/lib/go-1.21/src/errors/errors.go", - "/usr/lib/go-1.21/src/errors/wrap.go", - "/usr/lib/go-1.21/src/fmt/format.go", - "/usr/lib/go-1.21/src/fmt/print.go", - "/usr/lib/go-1.21/src/internal/abi/abi.go", - "/usr/lib/go-1.21/src/internal/abi/type.go", - "/usr/lib/go-1.21/src/internal/abi/unsafestring_go120.go", - "/usr/lib/go-1.21/src/internal/bytealg/bytealg.go", - "/usr/lib/go-1.21/src/internal/bytealg/compare_amd64.s", - "/usr/lib/go-1.21/src/internal/bytealg/count_amd64.s", - "/usr/lib/go-1.21/src/internal/bytealg/count_native.go", - "/usr/lib/go-1.21/src/internal/bytealg/equal_amd64.s", - "/usr/lib/go-1.21/src/internal/bytealg/index_amd64.go", - "/usr/lib/go-1.21/src/internal/bytealg/index_amd64.s", - "/usr/lib/go-1.21/src/internal/bytealg/indexbyte_amd64.s", - "/usr/lib/go-1.21/src/internal/cpu/cpu.go", - "/usr/lib/go-1.21/src/internal/cpu/cpu_x86.go", - "/usr/lib/go-1.21/src/internal/cpu/cpu_x86.s", - "/usr/lib/go-1.21/src/internal/fmtsort/sort.go", - "/usr/lib/go-1.21/src/internal/itoa/itoa.go", - "/usr/lib/go-1.21/src/internal/poll/errno_windows.go", - "/usr/lib/go-1.21/src/internal/poll/fd.go", - "/usr/lib/go-1.21/src/internal/poll/fd_mutex.go", - "/usr/lib/go-1.21/src/internal/poll/fd_poll_runtime.go", - "/usr/lib/go-1.21/src/internal/poll/fd_windows.go", - "/usr/lib/go-1.21/src/internal/reflectlite/type.go", - "/usr/lib/go-1.21/src/internal/syscall/windows/net_windows.go", - "/usr/lib/go-1.21/src/internal/syscall/windows/registry/value.go", - "/usr/lib/go-1.21/src/internal/syscall/windows/registry/zsyscall_windows.go", - "/usr/lib/go-1.21/src/internal/syscall/windows/syscall_windows.go", - "/usr/lib/go-1.21/src/internal/syscall/windows/sysdll/sysdll.go", - "/usr/lib/go-1.21/src/internal/syscall/windows/zsyscall_windows.go", - "/usr/lib/go-1.21/src/io/fs/fs.go", - "/usr/lib/go-1.21/src/math/bits/bits.go", - "/usr/lib/go-1.21/src/math/exp_amd64.go", - "/usr/lib/go-1.21/src/math/unsafe.go", - "/usr/lib/go-1.21/src/os/dir.go", - "/usr/lib/go-1.21/src/os/error.go", - "/usr/lib/go-1.21/src/os/exec_windows.go", - "/usr/lib/go-1.21/src/os/executable.go", - "/usr/lib/go-1.21/src/os/executable_windows.go", - "/usr/lib/go-1.21/src/os/file.go", - "/usr/lib/go-1.21/src/os/file_posix.go", - "/usr/lib/go-1.21/src/os/file_windows.go", - "/usr/lib/go-1.21/src/os/path_windows.go", - "/usr/lib/go-1.21/src/os/proc.go", - "/usr/lib/go-1.21/src/path/filepath/match.go", - "/usr/lib/go-1.21/src/path/filepath/path.go", - "/usr/lib/go-1.21/src/path/filepath/path_windows.go", - "/usr/lib/go-1.21/src/reflect/abi.go", - "/usr/lib/go-1.21/src/reflect/asm_amd64.s", - "/usr/lib/go-1.21/src/reflect/float32reg_generic.go", - "/usr/lib/go-1.21/src/reflect/makefunc.go", - "/usr/lib/go-1.21/src/reflect/type.go", - "/usr/lib/go-1.21/src/reflect/value.go", - "/usr/lib/go-1.21/src/runtime/alg.go", - "/usr/lib/go-1.21/src/runtime/arena.go", - "/usr/lib/go-1.21/src/runtime/asm.s", - "/usr/lib/go-1.21/src/runtime/asm_amd64.s", - "/usr/lib/go-1.21/src/runtime/atomic_pointer.go", - "/usr/lib/go-1.21/src/runtime/cgocall.go", - "/usr/lib/go-1.21/src/runtime/chan.go", - "/usr/lib/go-1.21/src/runtime/cpuflags_amd64.go", - "/usr/lib/go-1.21/src/runtime/debug.go", - "/usr/lib/go-1.21/src/runtime/debugcall.go", - "/usr/lib/go-1.21/src/runtime/defs_windows_amd64.go", - "/usr/lib/go-1.21/src/runtime/duff_amd64.s", - "/usr/lib/go-1.21/src/runtime/env_posix.go", - "/usr/lib/go-1.21/src/runtime/error.go", - "/usr/lib/go-1.21/src/runtime/exithook.go", - "/usr/lib/go-1.21/src/runtime/extern.go", - "/usr/lib/go-1.21/src/runtime/fastlog2.go", - "/usr/lib/go-1.21/src/runtime/float.go", - "/usr/lib/go-1.21/src/runtime/hash64.go", - "/usr/lib/go-1.21/src/runtime/histogram.go", - "/usr/lib/go-1.21/src/runtime/iface.go", - "/usr/lib/go-1.21/src/runtime/internal/atomic/types.go", - "/usr/lib/go-1.21/src/runtime/internal/sys/intrinsics.go", - "/usr/lib/go-1.21/src/runtime/lfstack.go", - "/usr/lib/go-1.21/src/runtime/lock_sema.go", - "/usr/lib/go-1.21/src/runtime/lockrank.go", - "/usr/lib/go-1.21/src/runtime/lockrank_off.go", - "/usr/lib/go-1.21/src/runtime/malloc.go", - "/usr/lib/go-1.21/src/runtime/map.go", - "/usr/lib/go-1.21/src/runtime/map_fast32.go", - "/usr/lib/go-1.21/src/runtime/map_fast64.go", - "/usr/lib/go-1.21/src/runtime/map_faststr.go", - "/usr/lib/go-1.21/src/runtime/mbarrier.go", - "/usr/lib/go-1.21/src/runtime/mbitmap.go", - "/usr/lib/go-1.21/src/runtime/mcache.go", - "/usr/lib/go-1.21/src/runtime/mcentral.go", - "/usr/lib/go-1.21/src/runtime/mcheckmark.go", - "/usr/lib/go-1.21/src/runtime/mem.go", - "/usr/lib/go-1.21/src/runtime/mem_windows.go", - "/usr/lib/go-1.21/src/runtime/memclr_amd64.s", - "/usr/lib/go-1.21/src/runtime/memmove_amd64.s", - "/usr/lib/go-1.21/src/runtime/mfinal.go", - "/usr/lib/go-1.21/src/runtime/mfixalloc.go", - "/usr/lib/go-1.21/src/runtime/mgc.go", - "/usr/lib/go-1.21/src/runtime/mgclimit.go", - "/usr/lib/go-1.21/src/runtime/mgcmark.go", - "/usr/lib/go-1.21/src/runtime/mgcpacer.go", - "/usr/lib/go-1.21/src/runtime/mgcscavenge.go", - "/usr/lib/go-1.21/src/runtime/mgcstack.go", - "/usr/lib/go-1.21/src/runtime/mgcsweep.go", - "/usr/lib/go-1.21/src/runtime/mgcwork.go", - "/usr/lib/go-1.21/src/runtime/mheap.go", - "/usr/lib/go-1.21/src/runtime/mpagealloc.go", - "/usr/lib/go-1.21/src/runtime/mpagealloc_64bit.go", - "/usr/lib/go-1.21/src/runtime/mpagecache.go", - "/usr/lib/go-1.21/src/runtime/mpallocbits.go", - "/usr/lib/go-1.21/src/runtime/mprof.go", - "/usr/lib/go-1.21/src/runtime/mranges.go", - "/usr/lib/go-1.21/src/runtime/msize.go", - "/usr/lib/go-1.21/src/runtime/mspanset.go", - "/usr/lib/go-1.21/src/runtime/mstats.go", - "/usr/lib/go-1.21/src/runtime/mwbbuf.go", - "/usr/lib/go-1.21/src/runtime/netpoll.go", - "/usr/lib/go-1.21/src/runtime/netpoll_windows.go", - "/usr/lib/go-1.21/src/runtime/os_windows.go", - "/usr/lib/go-1.21/src/runtime/pagetrace_off.go", - "/usr/lib/go-1.21/src/runtime/panic.go", - "/usr/lib/go-1.21/src/runtime/pinner.go", - "/usr/lib/go-1.21/src/runtime/preempt.go", - "/usr/lib/go-1.21/src/runtime/preempt_amd64.s", - "/usr/lib/go-1.21/src/runtime/print.go", - "/usr/lib/go-1.21/src/runtime/proc.go", - "/usr/lib/go-1.21/src/runtime/rt0_windows_amd64.s", - "/usr/lib/go-1.21/src/runtime/runtime.go", - "/usr/lib/go-1.21/src/runtime/runtime1.go", - "/usr/lib/go-1.21/src/runtime/runtime2.go", - "/usr/lib/go-1.21/src/runtime/rwmutex.go", - "/usr/lib/go-1.21/src/runtime/select.go", - "/usr/lib/go-1.21/src/runtime/sema.go", - "/usr/lib/go-1.21/src/runtime/signal_windows.go", - "/usr/lib/go-1.21/src/runtime/sigqueue.go", - "/usr/lib/go-1.21/src/runtime/slice.go", - "/usr/lib/go-1.21/src/runtime/stack.go", - "/usr/lib/go-1.21/src/runtime/stkframe.go", - "/usr/lib/go-1.21/src/runtime/string.go", - "/usr/lib/go-1.21/src/runtime/stubs.go", - "/usr/lib/go-1.21/src/runtime/symtab.go", - "/usr/lib/go-1.21/src/runtime/symtabinl.go", - "/usr/lib/go-1.21/src/runtime/sys_windows_amd64.s", - "/usr/lib/go-1.21/src/runtime/sys_x86.go", - "/usr/lib/go-1.21/src/runtime/syscall_windows.go", - "/usr/lib/go-1.21/src/runtime/tagptr_64bit.go", - "/usr/lib/go-1.21/src/runtime/time.go", - "/usr/lib/go-1.21/src/runtime/time_nofake.go", - "/usr/lib/go-1.21/src/runtime/time_windows_amd64.s", - "/usr/lib/go-1.21/src/runtime/trace.go", - "/usr/lib/go-1.21/src/runtime/traceback.go", - "/usr/lib/go-1.21/src/runtime/type.go", - "/usr/lib/go-1.21/src/runtime/typekind.go", - "/usr/lib/go-1.21/src/runtime/unsafe.go", - "/usr/lib/go-1.21/src/runtime/utf8.go", - "/usr/lib/go-1.21/src/runtime/write_err.go", - "/usr/lib/go-1.21/src/runtime/zcallback_windows.s", - "/usr/lib/go-1.21/src/sort/sort.go", - "/usr/lib/go-1.21/src/sort/zsortinterface.go", - "/usr/lib/go-1.21/src/strconv/atoi.go", - "/usr/lib/go-1.21/src/strconv/decimal.go", - "/usr/lib/go-1.21/src/strconv/ftoa.go", - "/usr/lib/go-1.21/src/strconv/ftoaryu.go", - "/usr/lib/go-1.21/src/strconv/itoa.go", - "/usr/lib/go-1.21/src/strconv/quote.go", - "/usr/lib/go-1.21/src/strings/builder.go", - "/usr/lib/go-1.21/src/strings/strings.go", - "/usr/lib/go-1.21/src/sync/atomic/type.go", - "/usr/lib/go-1.21/src/sync/map.go", - "/usr/lib/go-1.21/src/sync/mutex.go", - "/usr/lib/go-1.21/src/sync/once.go", - "/usr/lib/go-1.21/src/sync/oncefunc.go", - "/usr/lib/go-1.21/src/sync/pool.go", - "/usr/lib/go-1.21/src/sync/poolqueue.go", - "/usr/lib/go-1.21/src/sync/runtime.go", - "/usr/lib/go-1.21/src/syscall/dll_windows.go", - "/usr/lib/go-1.21/src/syscall/exec_windows.go", - "/usr/lib/go-1.21/src/syscall/syscall.go", - "/usr/lib/go-1.21/src/syscall/syscall_windows.go", - "/usr/lib/go-1.21/src/syscall/wtf8_windows.go", - "/usr/lib/go-1.21/src/syscall/zsyscall_windows.go", - "/usr/lib/go-1.21/src/time/format.go", - "/usr/lib/go-1.21/src/time/time.go", - "/usr/lib/go-1.21/src/time/zoneinfo_abbrs_windows.go", - "/usr/lib/go-1.21/src/unicode/casetables.go", - "/usr/lib/go-1.21/src/unicode/tables.go", - "/usr/lib/go-1.21/src/unicode/utf16/utf16.go", - "/usr/lib/go-1.21/src/unicode/utf8/utf8.go", - "" - ] - } - } \ No newline at end of file diff --git a/tests/data/arm_gentoo_elf b/tests/data/plain_arm_gentoo_elf similarity index 100% rename from tests/data/arm_gentoo_elf rename to tests/data/plain_arm_gentoo_elf diff --git a/tests/data/windows.exe b/tests/data/plain_windows.exe similarity index 100% rename from tests/data/windows.exe rename to tests/data/plain_windows.exe diff --git a/tests/test_go_inspector.py b/tests/test_go_inspector.py index 26f9afe..96141d1 100644 --- a/tests/test_go_inspector.py +++ b/tests/test_go_inspector.py @@ -4,43 +4,66 @@ # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. -# See https://github.com/nexB/scancode-plugins for support or download. +# See https://github.com/nexB/g-inspector for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # -import json import os import pytest +from commoncode.testcase import FileDrivenTesting +from scancode.cli_test_utils import check_json +from scancode.cli_test_utils import check_json_scan +from scancode.cli_test_utils import run_scan_click +from scancode_config import REGEN_TEST_FIXTURES -from src.go_inspector.plugin import collect_and_parse_symbols +from go_inspector.plugin import collect_and_parse_symbols -TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "data") +test_env = FileDrivenTesting() +test_env.test_data_dir = os.path.join(os.path.dirname(__file__), "data") -def test_goresym_with_windows_exe(): - go_binary = os.path.join(TEST_DATA_DIR, "windows.exe") +def test_collect_and_parse_symbols_with_plain_windows_exe(): + go_binary = test_env.get_test_loc("plain_windows.exe") with pytest.raises(Exception) as e: collect_and_parse_symbols(go_binary) -def test_goresym_with_elf(): - go_binary = os.path.join(TEST_DATA_DIR, "arm_gentoo_elf") +def test_collect_and_parse_symbols_with_plain_elf(): + go_binary = test_env.get_test_loc("plain_arm_gentoo_elf") with pytest.raises(Exception) as e: collect_and_parse_symbols(go_binary) @pytest.mark.parametrize( - "path", + "exe_path", [ - "app_lin_exe", - "app_mac_exe", - "app_win_exe", + "basic/app_lin_exe", + "basic/app_mac_exe", + "basic/app_win_exe", + "basic/app_lin_exe_stripped", ], ) -def test_goresym_with_mini_go_app_linux(path): - go_binary = os.path.join(TEST_DATA_DIR, path) - goresym_output = collect_and_parse_symbols(go_binary) - with open(os.path.join(TEST_DATA_DIR, f"gore_sym_{path}_output.json")) as f: - expected_output = json.load(f) - assert expected_output == goresym_output +def test_collect_and_parse_symbols_with_mini_go_app_linux(exe_path): + go_binary = test_env.get_test_loc(exe_path) + expected = f"{go_binary}-goresym.json" + results = collect_and_parse_symbols(go_binary) + check_json(expected, results, regen=REGEN_TEST_FIXTURES) + + +def test_collect_and_parse_symbols_with_large_go_app_linux(): + from pathlib import Path + + go_binary = Path(test_env.test_data_dir).parent.parent / "src/go_inspector/bin/GoReSym_lin" + expected = test_env.get_test_loc(f"GoReSym_lin-goresym.json", must_exist=False) + results = collect_and_parse_symbols(go_binary) + check_json(expected, results, regen=REGEN_TEST_FIXTURES) + + +def test_scancode_plugin_with_go_symbol_option(): + test_file = test_env.get_test_loc("basic/app_lin_exe", copy=True) + result_file = test_env.get_temp_file("json") + args = ["--go-symbol", test_file, "--json", result_file] + run_scan_click(args) + expected = test_env.get_test_loc("basic/app_lin_exe-scancode.expected.json", must_exist=False) + check_json_scan(expected, result_file, regen=REGEN_TEST_FIXTURES) diff --git a/thirdparty/README.rst b/thirdparty/README.rst deleted file mode 100644 index b31482f..0000000 --- a/thirdparty/README.rst +++ /dev/null @@ -1,2 +0,0 @@ -Put your Python dependency wheels to be vendored in this directory. -