You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/blog/golang-debugging.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ categories:
17
17
It's not hard to work with DDEV's Go code, but you definitely need a development environment and the know-how to do step-debugging. Here's our [Contributor Training](contributor-training.md) showing some of the nuances with DDEV, followed by a short summary of the details.
18
18
19
19
<divclass="video-container">
20
-
<iframewidth="560"height="315"src="https://www.youtube.com/embed/E-AEzC1p76E?si=XYP23HYcxgqiJ2_M"title="YouTube video player"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"referrerpolicy="strict-origin-when-cross-origin"allowfullscreen></iframe>
20
+
<iframewidth="560"height="315"src="https://www.youtube.com/embed/MZkgTjWRJLM?si=jO_BWehQx_-EDiEl"title="YouTube video player"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"referrerpolicy="strict-origin-when-cross-origin"allowfullscreen></iframe>
Copy file name to clipboardExpand all lines: src/content/blog/setting-up-a-go-development-environment.md
+33-23Lines changed: 33 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,83 +14,93 @@ categories:
14
14
- Community
15
15
---
16
16
17
-
The DDEV Community has regular contributor training sessions, and in July, 2023 we talked about setting up a Go development environment for DDEV. This blog summarizes [the contributor training session](https://youtu.be/IjrJw0Ay-dk). The (Min digit) syntax added below provides the minute on which each subject is covered on the recording.
17
+
The DDEV Community has regular contributor training sessions, and in July, 2023 we talked about setting up a Go development environment for DDEV. This blog summarizes [the contributor training session](https://youtu.be/HHoMa1N_5S4). The (Min digit) syntax added below provides the minute on which each subject is covered on the recording.
18
18
19
-
## Installing Go on different Operating Systems ([Min 10:51](https://youtu.be/IjrJw0Ay-dk?t=647))
19
+
<divclass="video-container">
20
+
<iframewidth="560"height="315"src="https://www.youtube.com/embed/HHoMa1N_5S4?si=5XB2sI_E6tYELwkm"title="YouTube video player"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"referrerpolicy="strict-origin-when-cross-origin"allowfullscreen></iframe>
21
+
</div>
22
+
23
+
## Installing Go on different Operating Systems ([Min 10:51](https://youtu.be/HHoMa1N_5S4?t=647))
20
24
21
25
Randy used macOS and recommended Homebrew as the tool to manage Go updates.
22
26
23
27
The first command recommended was
24
28
25
-
```
29
+
```bash
26
30
brew install go golangci-lint
27
31
```
28
32
29
-
DDEV uses [make](https://www.gnu.org/software/make/) ([Min 13:32](https://youtu.be/IjrJw0Ay-dk?t=810)) to build its binary. Make is included with the macOS Command-Line Tools for Xcode and can be installed with `xcode-select --install`, but that is already required to install Homebrew, so should already be installed.
33
+
DDEV uses [make](https://www.gnu.org/software/make/) ([Min 13:32](https://youtu.be/HHoMa1N_5S4?t=810)) to build its binary. Make is included with the macOS Command-Line Tools for Xcode and can be installed with `xcode-select --install`, but that is already required to install Homebrew, so should already be installed.
Check out the `ddev` repository with `git clone [email protected]:ddev/ddev -o upstream`. Run `make` to create a new binary. The DDEV Makefile will automatically detect your host OS and build the appropriate binary. However, one can provide a parameter to build others. As an example, `make darwin_amd64` builds the macOS AMD64 binary.
34
38
35
-
At ([Min 16:30](https://youtu.be/IjrJw0Ay-dk?t=982)) the Makefile located in the root of the DDEV project is lightly explained.
39
+
At ([Min 16:30](https://youtu.be/HHoMa1N_5S4?t=982)) the Makefile located in the root of the DDEV project is lightly explained.
36
40
37
41
Randy usually symlinks the built binary version to a place inside the `$PATH`, but to run a newly compiled binary one can specify its fully qualified path. For example:
38
42
39
-
```
43
+
```bash
40
44
./.gotmp/bin/darwin_arm64/ddev --version
41
45
```
42
46
43
-
If we want to avoid prefixing ddev with its built path instructions are included at ([Min 17:37](https://youtu.be/IjrJw0Ay-dk?t=1056)). `ddev --version` describes which binary version is currently used; it's selected by your `$PATH`.
47
+
If we want to avoid prefixing ddev with its built path instructions are included at ([Min 17:37](https://youtu.be/HHoMa1N_5S4?t=1056)). `ddev --version` describes which binary version is currently used; it's selected by your `$PATH`.
44
48
45
-
## The role of `mkdocs` ([Min 21:22](https://youtu.be/IjrJw0Ay-dk?t=1276))
49
+
## The role of `mkdocs` ([Min 21:22](https://youtu.be/HHoMa1N_5S4?t=1276))
46
50
47
51
`mkdocs` can be tested with `make makedocs`
48
52
49
53
Makedocs is used for previewing and contributing to the docs. It's named makedocs but it's not related to the make tool or compiling the binary.
50
54
51
55
You can preview a built version of the docs you're working with using `make mkdocs-serve`.
52
56
53
-
## Randy's IDE of choice is GoLand ([Min 23:50](https://youtu.be/IjrJw0Ay-dk?t=1547))
57
+
## Randy's IDE of choice is GoLand ([Min 23:50](https://youtu.be/HHoMa1N_5S4?t=1547))
54
58
55
59
GoLand is very similar to PhpStorm and of course is made by the same JetBrains company.
56
60
57
-
One fantastic thing about Go is that there is only one way to format it ([Min 26:10](https://youtu.be/IjrJw0Ay-dk?t=1576)). It always uses tabs and the same indentation. It all follows the standards set by `gofmt`.
61
+
One fantastic thing about Go is that there is only one way to format it ([Min 26:10](https://youtu.be/HHoMa1N_5S4?t=1576)). It always uses tabs and the same indentation. It all follows the standards set by `gofmt`.
58
62
59
-
## Debugging DDEV Go Code ([Min 28:17](https://youtu.be/IjrJw0Ay-dk?t=1699))
63
+
## Debugging DDEV Go Code ([Min 28:17](https://youtu.be/HHoMa1N_5S4?t=1699))
60
64
61
65
To verify formatting and static analysis use `make golangci-lint`
62
66
63
67
`golangci-lint` is the tool used on DDEV CI/CD for incoming pull requests.
64
68
65
-
For new feature-based pull requests ([Min 31:34](https://youtu.be/IjrJw0Ay-dk?t=1892)) Randy recommends starting with an issue to explain to maintainers the context surrounding their concerns before beginning a PR.
69
+
For new feature-based pull requests ([Min 31:34](https://youtu.be/HHoMa1N_5S4?t=1892)) Randy recommends starting with an issue to explain to maintainers the context surrounding their concerns before beginning a PR.
66
70
67
-
The [DDEV Docs development tab](https://docs.ddev.com/en/latest/developers/) ([Min 32:20](https://youtu.be/IjrJw0Ay-dk?t=1938)) includes plenty of tips and insights.
71
+
The [DDEV Docs development tab](https://docs.ddev.com/en/latest/developers/) ([Min 32:20](https://youtu.be/HHoMa1N_5S4?t=1938)) includes plenty of tips and insights.
At this point Randy showed us a demo on how to run `ddev/cmd/debug-config-yml.go` by first running main.go and then setting the working directory to match an active ddev project.
72
76
73
-
#### VS Code Go debugging ([Min 37:50](https://youtu.be/IjrJw0Ay-dk?t=2268))
77
+
#### VS Code Go debugging ([Min 37:50](https://youtu.be/HHoMa1N_5S4?t=2268))
74
78
75
79
The following extension is mentioned, [Go](https://marketplace.visualstudio.com/items?itemName=golang.Go) by the Go team at Google.
76
80
77
-
DDEV comes with a launch.json prebuilt for you. It includes the config that might be found in GoLand UI but for VS Code. The one item Randy usually has to change is the working directory ([Min 39:57](https://youtu.be/IjrJw0Ay-dk?t=2395)). He then showed an example on how to debug Go in VS Code.
81
+
DDEV comes with a launch.json prebuilt for you. It includes the config that might be found in GoLand UI but for VS Code. The one item Randy usually has to change is the working directory ([Min 39:57](https://youtu.be/HHoMa1N_5S4?t=2395)). He then showed an example on how to debug Go in VS Code.
78
82
79
-
The most important GO files are in pkg/ddevapp ([Min 44:26](https://youtu.be/IjrJw0Ay-dk?t=2660)), the ones in cmd are the ones associated with a commands and the pkg Go files are functionality.
83
+
The most important GO files are in pkg/ddevapp ([Min 44:26](https://youtu.be/HHoMa1N_5S4?t=2660)), the ones in cmd are the ones associated with a commands and the pkg Go files are functionality.
80
84
81
85
[Cobra](https://cobra.dev/) is the library used for command flags and arguments. A lot of the commands in the cmd directory are an implementation that calls upon other things.
82
86
83
-
At ([Min 49:43](https://youtu.be/IjrJw0Ay-dk?t=2977)) a question arose from a user's ability to get VS Code Go working:
87
+
At ([Min 49:43](https://youtu.be/HHoMa1N_5S4?t=2977)) a question arose from a user's ability to get VS Code Go working:
84
88
85
-
```
86
-
"cwd":"${workspaceRoot}/../d9simple"
89
+
```json
90
+
{
91
+
"configurations": [
92
+
{
93
+
"cwd": "${workspaceRoot}/../d9simple"
94
+
}
95
+
]
96
+
}
87
97
```
88
98
89
99
The issue was that "d9simple" is a placeholder string that needs to point to a real DDEV directory.
90
100
91
-
At ([Min 50:50](https://youtu.be/IjrJw0Ay-dk?t=3048)) we can see a walkthrough of running Go tests in VS Code.
101
+
At ([Min 50:50](https://youtu.be/HHoMa1N_5S4?t=3048)) we can see a walkthrough of running Go tests in VS Code.
92
102
93
-
devcontainer.json ([Min 58:35](https://youtu.be/IjrJw0Ay-dk?t=3507)) is a file for GitHub Codespaces.
103
+
devcontainer.json ([Min 58:35](https://youtu.be/HHoMa1N_5S4?t=3507)) is a file for GitHub Codespaces.
Copy file name to clipboardExpand all lines: src/content/blog/xdebug-debugging.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ PHP developers have long had a variety of complications using Xdebug. It's a net
19
19
Here's a recording of our **Xdebug contributor Training** walking through DDEV and Xdebug.
20
20
21
21
<divclass="video-container">
22
-
<iframewidth="560"height="315"src="https://www.youtube.com/embed/4MrwXTaHfnc?si=nwocfW8FjXitbtSa"title="YouTube video player"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"referrerpolicy="strict-origin-when-cross-origin"allowfullscreen></iframe>
22
+
<iframewidth="560"height="315"src="https://www.youtube.com/embed/IiKB8-sCiJk?si=Hs8uyjhuy0qn7cz0"title="YouTube video player"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"referrerpolicy="strict-origin-when-cross-origin"allowfullscreen></iframe>
23
23
</div>
24
24
25
25
First of all, congratulations for making step-debugging a priority. It's my opinion that step-debugging is one of the very first things to learn in any language or environment that we undertake.
0 commit comments