Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config 那篇文章有个示例 go 代码用了中文右括号 #215

Open
kvii opened this issue Aug 15, 2024 · 0 comments · May be fixed by #216
Open

config 那篇文章有个示例 go 代码用了中文右括号 #215

kvii opened this issue Aug 15, 2024 · 0 comments · May be fixed by #216

Comments

@kvii
Copy link
Contributor

kvii commented Aug 15, 2024

这里的path就是配置文件的路径,这里也可以填写一个目录名,这样会将整个目录中的所有文件进行解析加载,合并到同一个map中。
```go
import (
"github.com/go-kratos/kratos/v2/config"
"github.com/go-kratos/kratos/v2/config/file"
)
path := "configs/config.yaml"
c := config.New(
config.WithSource(
file.NewSource(path),
)
```

这里面倒数第二行用的是中文的右括号。

kvii added a commit to kvii/go-kratos.dev that referenced this issue Aug 15, 2024
kvii added a commit to kvii/go-kratos.dev that referenced this issue Aug 15, 2024
@kvii kvii linked a pull request Aug 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant