weaver icon indicating copy to clipboard operation
weaver copied to clipboard

feat: adding a Global Config Default Configuration

Open godcong opened this issue 1 year ago • 0 comments

In the process of using Weaver, I found that I could not set the default value of Config. This makes it impossible to use the correct settings when you have not configured config.toml. We hope to add a setting for the default Config value at startup.

type Main struct {
	weaver.Implements[weaver.Main]
	weaver.WithConfig[config.Config]
}

func (m *Main) Init(ctx context.Context) error {
	
        // config only can loads from toml?
        // fmt.Println("config:", m.Config())
	return nil
}

godcong avatar Feb 18 '24 11:02 godcong