Comments (3)
Sorry, haven't had a chance to study this. Were you able to figure this out?
from koanf.
currently no time due to private reasons, will come back to this maybe next week.
from koanf.
the solution is to make the second test pass by updating the CustomTextUnmarshalHookFunc()
.
This is an extended form of the issue at hand where a
type Foo string
not only is a string under the hood (for which the type assertion .(string) does not work) but that custom string type additionally implements both, the TextMarshaler and TextUnmarshaler interfaces which allow the internal string representation (deserialized) to differ from the external string representation (serialized).
The third test is a test to somehow deduce that the value type as well as the pointer type do not implement the TextMarshaler interface.
The third test is a little bit of a playground for the implementation that I need in CustomTextUnmarshalHookFunc()
at TODO
A potential direction is to copy the values and have both pointer type and value type (pointer/value receiver) inside of an empty interface (.Interface()
) for which you may then try to type assert TextMarshaler.
from koanf.
Related Issues (20)
- How to stop file watcher? HOT 3
- Is it possible to define a parameter reference another parameter in mock.toml file? HOT 1
- How to retrieve/print the final YAML string after YAML files are loaded and merged? HOT 5
- Alternativ to pflag? HOT 4
- basicflag Provider does not exclude default values HOT 3
- Why not create new file when file not exists. HOT 1
- Read enviroments secrets from github HOT 2
- Can not parse environment variable HOT 1
- Switch from mitchellh/mapstructure to go-viper/mapstructure HOT 14
- Can't unmarshall env variable with multiple words
- Support for merging slices HOT 2
- File watching error when saving with vi/vim or neovim HOT 1
- How to populate a map[string]string from environment variables HOT 1
- When loading with providers/env, koanf.Unmarshal doesn't work. HOT 5
- koanf.Unmarshal doesn't work when loaded with env provider HOT 2
- Default values from Tags for missing config values HOT 2
- posflag provider overrides values even if flags are not set for special delimiters HOT 1
- Convert non-string type to string in StringMap() HOT 1
- feature: search file HOT 1
- Difficulty Handling Multi-Word Environment Variables HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from koanf.