Toml: what's the definition when two toml config file merged to one

Created on 24 May 2021  路  7Comments  路  Source: toml-lang/toml

when merge 2 toml config file2, how to treat the fields in second one? :

1.toml:
k1=v1
[struct]
name=name1

  1. toml:
    k2=v2

so, in this case, we treat the k2 as a field under struct?

Most helpful comment

=/

"Your application" == "The application you're developing".

All 7 comments

TOML files are self-contained; the notion of merging config files doesn't appear in the spec, so there's no standard way to do this. If your application needs to do this the semantics are entirely up to you.

What @marzer said, with a rephrasing: :)

If your application needs to do this the semantics are entirely up to you.

If your application needs to do this, the semantics are chosen/decided on by the developers of said application.

=/

"Your application" == "The application you're developing".

Not very understand, the behavior seems to be defined by viper, with the function MergeCofig/MergeInconfig?
further more, we have no way to load multiple remote configs. For example, multiple dataids of the nacos. If we implement the remote provider, there is no way to do merge. if the provider merge its self, we have to implement most functions of the viper.

@gangxie112 it sounds like you're referring to a particular application or implementation; note this repository is for the TOML _language_, not any library or application that makes use of it.

You should ask here instead: https://github.com/spf13/viper

Oops锛宻orry

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChristianSi picture ChristianSi  路  4Comments

chillum picture chillum  路  4Comments

paiden picture paiden  路  3Comments

jdfergason picture jdfergason  路  4Comments

Silentdoer picture Silentdoer  路  4Comments