Skip to content

Commit

Permalink
Add steps for generating binaries from mini go app
Browse files Browse the repository at this point in the history
Signed-off-by: Tushar Goel <[email protected]>
  • Loading branch information
TG1999 committed Feb 16, 2024
1 parent da069ff commit 976edc3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ Go-Inspector
- 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 <PATH> --verbose``` to get debug symbols.


How to generate test binaries
============================

- 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=<OS> GOARCH=<arch> go build -o ./tests/data/app_exe ./tests/data/main.go``
to get compiled binary.
11 changes: 11 additions & 0 deletions tests/data/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

import (
"fmt"
"path/filepath"
)

func main() {
s := filepath.Join("a", "b", "c")
fmt.Println(s)
}

0 comments on commit 976edc3

Please sign in to comment.