How to build the plugin in debug mode?

This issue has been created since 2022-04-21.

Hi, how can I use a debugger to go through the module with e.g Goland IDE?

mholt wrote this answer on 2022-04-21

What do you mean by "debug mode"?

StarpTech wrote this answer on 2022-04-21

I'd like to add a breakpoint in the code and debug the code. It would be great to add some instructions to the readme on how to do that with VSCode and Goland.

StarpTech wrote this answer on 2022-04-21

I answered it myself 😄 Of course, I can just create a main.go like https://github.com/caddyserver/caddy/blob/master/cmd/caddy/main.go

mholt wrote this answer on 2022-04-22

Hmm, I'm not sure, I don't really use debuggers with Go. Glad you found something that works for you though!

StarpTech wrote this answer on 2022-04-22

Out of curiosity, how do you debug then? Println?

francislavoie wrote this answer on 2022-04-22

Yeah, I think we tend to just spam fmt.Printf("%+v\n", foo) all over to debug 😅 for me it's a habit from being a PHP dev, I find it quick enough to just run go build && ./caddy run repeatedly to test stuff

StarpTech wrote this answer on 2022-04-22

As reference: I created a cmd/server/main.go and referenced my module in it. Then there is no difference between caddy module development and hacking on a regular go project. For Goland and Vscode you only need to add run to the program arguments in the debugger profile.

More Details About Repo
Owner Name caddyserver
Repo Name xcaddy
Full Name caddyserver/xcaddy
Language Go
Created Date 2020-03-21
Updated Date 2022-09-22
Star Count 381
Watcher Count 14
Fork Count 72
Issue Count 3

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
G36K is actually a G36C 0 2022-01-07 2022-09-28
Problem compiling project from Visual Studio 2022 13 2022-04-24 2022-09-01
Fix registeration of account option 0 2022-02-03 2022-07-11
conflicts among packages when installing a conda environment 11 2022-01-19 2022-07-25
FRD_GetMyScreenName() returning a char 1 2021-12-05 2022-09-25
Electrical system 1 2020-09-15 2022-01-01
播放本地svga文件,会提示type undefine,load方法 3 2022-03-30 2022-09-24
Sometimes refreshes doesn't pin to bottom, Sometimes page missing. 6 2022-04-09 2022-09-19
Armv7 build 11 2020-12-04 2022-01-06
Last item being loaded with lazyLoad: true and items: 1. 0 2019-08-02 2022-07-11
Variables from global scope have empty references array 0 2016-10-17 2022-06-09
S3 Changes not reflect because of ignore lifecycle 4 2022-04-05 2022-09-20
老哥,你这个还更新吗,一堆报错呀, 5 2019-08-14 2022-01-13
getting error while installing it using python. I am using Ubuntu 20.04. 3 2022-02-19 2022-09-25
`typeCheck` only handles serve build 0 2022-08-15 2022-09-14
Internal dependency does not emmited to separated chunk 1 2021-03-29 2022-01-06
Onlyoffice Desktop Editors fails to open on windows 10 10 2022-02-16 2022-09-11
Strange Colouring 8 2020-11-27 2022-01-10
QRL CLI fails to install on Fedora 33 - hardcoded dependency protobuf-3.12.0 is no longer available. 4 2021-01-20 2022-09-19
Code Inspector does not handle multiline statements 1 2021-06-08 2022-09-15
do not collapse Define nodes 0 2021-09-09 2022-09-06
从scratch开始训,mAP先升后减 3 2021-08-22 2022-01-17
yolov4 map降低 1 2021-08-20 2022-01-08
a doubt with mifareClassicReadSector API 0 2021-08-12 2022-08-20
Tiny code snippet to allow manual ordering! 1 2021-05-15 2022-09-27
Bug for action generation 1 2021-05-25 2022-09-25
Android: No position changes are recognised 3 2021-10-28 2022-09-16
Edit dataset UI is broken when we don't have access permission to the dataset 0 2022-09-14 2022-09-26
[bitnami/solr] Persistent Volume is not used in solr deployment 4 2022-09-07 2022-09-04
Unable to send registration link second time 2 2020-07-29 2022-08-09
termux-usb not working 3 2021-05-13 2022-09-29
Errata valorizzazione AttributeConsumingServiceIndex 0 2021-06-30 2022-09-02
Feature Request: add feedback / progress information to output window 2 2021-04-09 2022-09-24
Codeunit 22 new event on procedure InitValueEntry 1 2021-11-05 2022-07-29
Logic analyzer: Cannot trigger on ID1 in single channel mode 1 2020-08-21 2022-09-18
Set-AzResource fails with "The value of parameter api-version is invalid" 4 2022-03-09 2022-09-27
"AssertionError: Cannot find component" for local namedtuple 0 2021-09-16 2022-08-20
Decouple env var from apprunner.yaml 2 2021-05-20 2022-09-22
exported_pod field not available on GKE cluster (but available on AWS) 2 2021-03-04 2022-09-17
How to modify experiment names? 2 2022-03-16 2022-09-24
Restore references to original discussions and sources 1 2019-06-03 2022-09-18
juicefs mount occurs a panic 0 2022-04-25 2022-09-14
Self-types that are type aliases don't work. 0 2015-12-09 2022-09-16
Enhancement suggestion - define clear interface with mixins 0 2016-03-17 2022-09-14
Penscratch 2: Button Borders Don't Look Right on Safari 0 2022-08-08 2022-08-21
In one config, can config two - !SHARDING bug 2 2022-07-01 2022-07-05
Error backend "connection reset" and "request canceled" 2 2020-08-22 2022-09-21
VueUI crashed after creating Vue Project 2 2021-12-05 2022-09-24
Direct local hermes-release.aar file dependencies are not supported when building an AAR 8 2022-01-19 2022-09-21
【share_preference】 Multiple .plist in Library/Preferences of my app? 3 2022-05-12 2022-09-20