Code Monkey home page Code Monkey logo

Comments (6)

lyzhang1999 avatar lyzhang1999 commented on May 25, 2024

Yes, debug config example: https://github.com/lyzhang1999/zadig/blob/main/.nocalhost/config.yaml
now we support Goland and IDEA for v0.4.18, and will support PyCharm and PhpStorm in v0.4.19(this week).

if you use Goland or IDEA, you can add "Nocalhost Go" or "Nocalhost Java" after you set debug config, and click "debug" icon after enter develop mode.

截屏2021-08-02 下午2 36 07

from nocalhost.

zou2699 avatar zou2699 commented on May 25, 2024

@lyzhang1999 Is there a guide?

from nocalhost.

lyzhang1999 avatar lyzhang1999 commented on May 25, 2024

video: https://www.bilibili.com/video/BV1Fh411B7Vb?from=search&seid=7008395873990702689
tutorials for zadig: https://koderover.com/tutorials/codelabs/Nocalhost/index.html?index=..%2F..index#3

from nocalhost.

zou2699 avatar zou2699 commented on May 25, 2024

@lyzhang1999 按照下面所配置的,在goland中,run 是可以的,debug几乎总是失败。

name: gin-demo
serviceType: deployment
containers:
  - name: gin-demo
    dev:
        gitUrl: ""
        image: codingcorp-docker.pkg.coding.net/nocalhost/dev-images/golang:1.16
        shell: ""
        workDir: /home/nocalhost-dev
        storageClass: ""
        resources: null
        persistentVolumeDirs: []
        command:
            build: []
            run:
              - go
              - run
              - ./main.go
            debug:
              - dlv
              - debug
              - ./main.go
              - --listen=:2345
              - --headless=true
              - --api-version=2
              - --accept-multiclient
            hotReloadRun: []
            hotReloadDebug: []
        debug:
            remoteDebugPort: 2345
        useDevContainer: false
        sync: null
        env:
          - name: GOPROXY
            value: https://goproxy.cn
        envFrom: null
        portForward: []

debug 日志

/home/zouhl/.nh/bin/nhctl exec default.application --deployment gin-demo --command sh --command -c --command "dlv debug ./main.go --listen=:2345 --headless=true --api-version=2 --accept-multiclient" --kubeconfig /home/zouhl/.nh/intellij-plugin/kubeConfigs/bb64f37b-ce28-4215-9d52-8e2a4ef5516b_config --namespace default
API server listening at: [::]:2345
2021-08-12T06:34:17Z error layer=rpc rpc:invalid character 'p' looking for beginning of value
2021-08-12T06:34:21Z error layer=rpc rpc:invalid character 'p' looking for beginning of value

or

/home/zouhl/.nh/bin/nhctl exec default.application --deployment gin-demo --command sh --command -c --command "dlv debug ./main.go --listen=:2345 --headless=true --api-version=2 --accept-multiclient" --kubeconfig /home/zouhl/.nh/intellij-plugin/kubeConfigs/bb64f37b-ce28-4215-9d52-8e2a4ef5516b_config --namespace default
API server listening at: [::]:2345
^C 

from nocalhost.

lyzhang1999 avatar lyzhang1999 commented on May 25, 2024

方便留一个邮箱吗?

from nocalhost.

von1994 avatar von1994 commented on May 25, 2024

I hava met this question too. Remote Debug will run command dlv debug in remote container and set up one port map :. But when I use nocalhost go Debug function,the debugger cannot connect to localhost mapped port(always at connecting state). Actually I can telnet localhost mappedPort.
Finally I make a port map manually like 36789:6789,and use Go Remote to connect to port 36789 which at localhost.

from nocalhost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.