Delve Code Analysis Notes (1)--main.go

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

delveProject homepage: Https://github.com/derekparker/delve.
main.goThe code is relatively simple:

package mainimport (    "github.com/derekparker/delve/cmd/dlv/cmds"    "github.com/derekparker/delve/version")// Build is the git sha of this binaries build.var Build stringfunc main() {    version.DelveVersion.Build = Build    cmds.New().Execute()}

mainThe function did two things:
(1) Build Assign the value to the version.DelveVersion member in the variable Build ;
(2) cmds.New() returns one cobra.Command tree , and then invokes the Execute() function to execute the corresponding subcommand, for example dlv version .

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.