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}