We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Here's an example
type Config struct { Port uint16 }
config.yml:
port: 8080
FILEWATCHER | 2022/06/11 19:46:20 adding file to watch: ./config.yml panic: reflect.Set: value of type int is not assignable to type uint16 goroutine 1 [running]: reflect.Value.assignTo({0x111ce80?, 0x13a84e0?, 0xc0001a4300?}, {0x1177edc, 0xb}, 0x111d7c0, 0x0) C:/Program Files/Go/src/reflect/value.go:3062 +0x2ac reflect.Value.Set({0x111d7c0?, 0xc0001a4300?, 0x111ce80?}, {0x111ce80?, 0x13a84e0?, 0x111d7c0?}) C:/Program Files/Go/src/reflect/value.go:2088 +0xeb github.com/lalamove/konfig.(*value).setStruct(0xc00019a3f0, {0xc0001a2600, 0x4}, {0x111ce80, 0x13a84e0}, {0x1113e20?, 0xc0001a4300?, 0x30000?}) C:/Users/steve/go/pkg/mod/github.com/lalamove/konfig@v0.8.3/value.go:221 +0x34f github.com/lalamove/konfig.(*value).setValues(0xc00019a3f0, 0xc00019a8a0?) C:/Users/steve/go/pkg/mod/github.com/lalamove/konfig@v0.8.3/value.go:196 +0x22f github.com/lalamove/konfig.Values.load(0xc00019a510, 0x111b440?, 0xc00019c0b0) C:/Users/steve/go/pkg/mod/github.com/lalamove/konfig@v0.8.3/values.go:61 +0x738 github.com/lalamove/konfig.(*S).loaderLoadRetry(0xc00019c0b0, 0xc000180060, 0x0) C:/Users/steve/go/pkg/mod/github.com/lalamove/konfig@v0.8.3/loader.go:149 +0x276 github.com/lalamove/konfig.(*S).Load(0xc00019c0b0) C:/Users/steve/go/pkg/mod/github.com/lalamove/konfig@v0.8.3/loader.go:69 +0x74 github.com/lalamove/konfig.(*S).LoadWatch(0x1?) C:/Users/steve/go/pkg/mod/github.com/lalamove/konfig@v0.8.3/loader.go:49 +0x1e github.com/lalamove/konfig.LoadWatch() C:/Users/steve/go/pkg/mod/github.com/lalamove/konfig@v0.8.3/loader.go:44 +0x1e
The text was updated successfully, but these errors were encountered:
Seems like uint16 is deliberately elided out
konfig/value.go
Lines 372 to 375 in 5b61527
Sorry, something went wrong.
No branches or pull requests
Here's an example
config.yml:
The text was updated successfully, but these errors were encountered: