From c399393473a1fdf7e2c3e7a153df2a96cf7a3e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Hed=C3=A9n?= Date: Wed, 19 Jun 2024 09:58:24 +0200 Subject: [PATCH] Adds documentation for Go callgraph generation --- internal/callgraph/language/golang/README.md | 23 +++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/internal/callgraph/language/golang/README.md b/internal/callgraph/language/golang/README.md index 867d867e..53491cc1 100644 --- a/internal/callgraph/language/golang/README.md +++ b/internal/callgraph/language/golang/README.md @@ -1 +1,22 @@ -# TODO: add docs to this readme on how we generate go CGs \ No newline at end of file +# Go CallGraph Generation + +Building callgraphs for Go is generally easy, but there are some caveats. +If your project depends on building non-Go components then you need to manually build the project before building the callgraph. +Once the project is built you can generate the callgraph with the following command: +```shell +debricked callgraph . +``` + +And then upload it and scan it using: + + +```shell +debricked scan . +``` + +# Additional Information + +The callgraph generation depends only on internal functionality in the Go standard library, for more information about this and the implementation see: +https://cs.opensource.google/go/x/tools/+/refs/tags/v0.19.0:cmd/callgraph/main.go + +As always, callgraph cannot be expected to include all possible calls in your program and not all included calls are guaranteed to be reachable.