Skip to content

Commit

Permalink
docs: Update usage.rst to render code inline (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbarsky authored and jfuss committed Sep 17, 2018
1 parent 7dd6d25 commit 02bf4b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -363,21 +363,21 @@ is run in headless mode, listening on the debug port.

When debugging, you must compile your function in debug mode:

`GOARCH=amd64 GOOS=linux go build -gcflags='-N -l' -o <output path> <path to code directory>
``GOARCH=amd64 GOOS=linux go build -gcflags='-N -l' -o <output path> <path to code directory>``

You must compile `delve` to run in the container and provide its local path
via the `--debugger-path` argument. Build delve locally as follows:

`GOARCH=amd64 GOOS=linux go build -o <delve folder path>/dlv github.com/derekparker/delve/cmd/dlv`
``GOARCH=amd64 GOOS=linux go build -o <delve folder path>/dlv github.com/derekparker/delve/cmd/dlv``

NOTE: The output path needs to end in `/dlv`. The docker container will expect the dlv binary to be in the <delve folder path>
and will cause mounting issue otherwise.

Then invoke `sam` similar to the following:

`sam local start-api -d 5986 --debugger-path <delve folder path>`
``sam local start-api -d 5986 --debugger-path <delve folder path>``

NOTE: The `--debugger-path` is the path to the directory that contains the `dlv` binary compiled from the above.
NOTE: The ``--debugger-path`` is the path to the directory that contains the `dlv` binary compiled from the above.

The following is an example launch configuration for Visual Studio Code to
attach to a debug session.
Expand Down

0 comments on commit 02bf4b0

Please sign in to comment.