Closed ch3rub1m closed 5 years ago
I created a new PR #440.
It used spf13/cast
to cast interface{}
to map[string]interface{}
to avoided crash.
The package spf13/cast
is the dependency of viper
, so there is no introduced package.
I've merged your PR. A part of me wanted to simply remove yaml support instead as that's a much better decision in the long run, but unfortunately there may be others that took advantage of our apathy when it came to using viper and just allowing all the file formats and that would essentially be a breaking change which isn't to be taken lightly. I'd urge you to stop using yaml now and forever, it's got too many features and as a consequence no trivial parser can possibly exist for it, it can possibly be used as an attack vector since it allows execution in certain contexts, even the creator (I've talked to him face to face on this subject) never intended for it to be used for config it was meant for data serialization, it's white space sensitive which can be damaging in certain contexts. There's almost no end to the reasons why one should -not- use it. Anyhow, I've spoken my piece on it. Enjoy your day, and thanks for the PR!
What version of SQLBoiler are you using (
sqlboiler --version
)?SQLBoiler v3.1.0
What is the output of the command above with the
-d
flag added to it? (Provided you are comfortable sharing this, it contains a blueprint of your schema)Further information. What did you do, what did you expect?
For example, It's my yaml file:
The viper will infer that
aliases.tables
andaliases.tables.columns
are[]map[interface{}]interface{}
and it's different with toml.However, in
boilingcore/config.go
there are many hardcode about type assertions, likesomething.(map[string]interface{})
. It will cause crash if use yaml as config file.