chore: stabilize lint and verify builds

This commit is contained in:
2026-02-06 11:51:32 +08:00
parent edede17880
commit 1782f64417
114 changed files with 3032 additions and 1345 deletions

View File

@@ -1,18 +1,24 @@
package app
import (
"fmt"
"go.ipao.vip/atom/container"
"go.ipao.vip/atom/opt"
)
func Provide(opts ...opt.Option) error {
o := opt.New(opts...)
options := opt.New(opts...)
var config Config
if err := o.UnmarshalConfig(&config); err != nil {
return err
if err := options.UnmarshalConfig(&config); err != nil {
return fmt.Errorf("unmarshal app config: %w", err)
}
return container.Container.Provide(func() (*Config, error) {
if err := container.Container.Provide(func() (*Config, error) {
return &config, nil
}, o.DiOptions()...)
}, options.DiOptions()...); err != nil {
return fmt.Errorf("provide app config: %w", err)
}
return nil
}

View File

@@ -18,7 +18,7 @@ func DefaultProvider() container.ProviderContainer {
// swagger:enum AppMode
// ENUM(development, release, test)
type AppMode string
type AppMode string //nolint:revive // keep enum name stable with generated helpers
type Config struct {
Mode AppMode