Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api,ssh): remove refresh and use air #4179

Merged
merged 2 commits into from
Sep 18, 2024
Merged

feat(api,ssh): remove refresh and use air #4179

merged 2 commits into from
Sep 18, 2024

Conversation

henrybarreto
Copy link
Member

@henrybarreto henrybarreto commented Sep 18, 2024

As refresh package, used to rebuild the service when the code changes,
seem don't be maintained anymore, we have decided to change to air, a
more modern alternative. Beyond that, we also added 'dlv' to the air,
allowing use to attach a debug to the service through the container's IP
on the port :2345.

With the container's IP in your hands, you just need to connect to it
using the 'dlv' connect command. It is worth to notice that, as
agent's container runs on host network, you don't need to specify the
IP when debugging it.

dlv connect <IP>:2345

As the code built in the container lives in another GOPATH, you can
need to remap this path to your local environment. To perform that, you
can open or create the file ~/.config/dlv/config.yml, and insert this
snippet.

substitute-path: [
  { from: "/go", to: "<GOPATH in your local machine>" }
]

As refresh package, used to rebuild the service when the code changes,
seem don't be maintained anymore, we have decided to change to air, a
more modern alternative. Beyond that, we also added 'dlv' to the air,
allowing use to attach a debug to the service through the container's IP
on the port `:2345`.

With the container's IP in your hands, you just need to connect to it
using the 'dlv' connect command. It is worth to notice that, as
`agent`'s container runs on host network, you don't need to specify the
IP when debugging it.

```sh
dlv connect <IP>:2345
```

As the code built in the container lives in another GOPATH, you can
need to remap this path to your local environment. To perform that, you
can open or create the file `~/.config/dlv/config.yml`, and insert this
snippet.

```yml
substitute-path: [
  { from: "/go", to: "<GOPATH in your local machine>" }
]
```
@gustavosbarreto gustavosbarreto merged commit b3c26eb into master Sep 18, 2024
21 checks passed
@gustavosbarreto gustavosbarreto deleted the feat/air branch September 18, 2024 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants