Fix Redundant Code in LoadWithRoot Function for Path Resolution

- Removed unnecessary conditional check in the LoadWithRoot function, streamlining the path resolution logic for the configuration root.
- Ensured that the function consistently resolves the absolute path of the configuration root, improving code clarity and maintainability.
This commit is contained in:
Max 2025-12-25 12:05:49 +08:00
parent 7f44e442da
commit 8223a44885

View file

@ -130,7 +130,7 @@ func LoadWithRoot(root string) Config {
if root != "" {
cfg.Root, _ = filepath.Abs(root)
} else {
cfg.Root, _ = filepath.Abs(cfg.Root)
cfg.Root, _ = filepath.Abs(cfg.Root)
}
// App Root