Delve Code Analysis Notes (3)--config

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

DelveAfter the program is run, the configuration file is loaded and parsed first:

func New() *cobra.Command {    // Config setup and load.    conf = config.LoadConfig()    ......}

DelveThe configuration file is located under home the folder under the user directory .dlv , and the file name is config.yml . For example, if you are a root user, the full path to the configuration file is: /root/.dlv/config.yml . The current configuration file only supports assigning aliases to commands.

configA package contains only one config.go file. The code is also relatively simple, summed up is: if the user does not create a configuration file, create one for the user (there is no substance), and then read the configuration file contents, and the Config structure (defined below) to return to the caller.

// Config defines all configuration options available to be set through the config file.type Config struct {    Aliases map[string][]string}

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.