-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed as not planned
Closed as not planned
Copy link
Labels
bugSomething isn't workingSomething isn't working
Description
with this config.yaml
server:
http:
addr: 0.0.0.0:8000
timeout: 100s
grpc:
addr: 0.0.0.0:9000
timeout: 100s
data:
database:
driver: mysql
source: ${DB_USERNAME:root}:${DB_PASSWORD:password}@tcp(${DB_HOST:mysql.default.svc.cluster.local:3306})/${DB_NAME:remoteconfig}?parseTime=True&loc=Local
debug: ${DB_DEBUG:false}
and this config options
c := config.New(
config.WithResolveActualTypes(true),
config.WithSource(
file.NewSource(flagconf),
env.NewSource(),
),
)
What happened:
With the above inputs, when i enable WithResolveActualTypes
the value returned from data.database.source is root
What you expected to happen:
data.database.source should return root:password@tcp(mysql.default.svc.cluster.local:3306)/remoteconfig?parseTime=True&loc=Local
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
The error appears to stem from https://github.com/go-kratos/kratos/blob/main/config/options.go#L189
Environment:
- Kratos version (use
kratos -v
): kratos version v2.8.4 - Go version (use
go version
):go version go1.24.2 darwin/arm64 - OS (e.g:
cat /etc/os-release
):OSX Latest
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working