// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 package tree // functions to import and export the protobuf // data to and from config files import ( "fmt" "go.wit.com/lib/config" ) // load the ~/.config/forge/ files func configLoad() *ToolkitConfigs { cfg := NewToolkitConfigs() cfg.Filename = config.MakeConfigFilename("forge", "toolkit") err := config.ReLoad(cfg) if err != nil { // first time user. insert a sample option cfg.sampleConfig() } return cfg } // makes a sample config (and saves it) func (cfg *ToolkitConfigs) sampleConfig() *ToolkitConfigs { new1 := new(ToolkitConfig) new1.Plugin = "tree" new1.Name = "test" new1.Value = "apple" cfg.Append(new1) fmt.Println("first time user. adding an example config file with", cfg.Len(), "options") return cfg }