File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,10 +37,6 @@ func (c *compiledLocale) retriveJSONByCompositeKey(key string) ([]byte, yaerrors
3737 )
3838 }
3939
40- if len (keyPart ) == 1 {
41- return c .SubMap [keyPart [0 ]].JSON , nil
42- }
43-
4440 subLocale , ok := c .SubMap [keyPart [0 ]]
4541
4642 if ! ok {
@@ -51,6 +47,10 @@ func (c *compiledLocale) retriveJSONByCompositeKey(key string) ([]byte, yaerrors
5147 )
5248 }
5349
50+ if len (keyPart ) == 1 {
51+ return subLocale .JSON , nil
52+ }
53+
5454 value , err := subLocale .retriveJSONByCompositeKey (keyPart [1 ])
5555 if err != nil {
5656 return nil , err .Wrap (fmt .Sprintf ("Failed to retrieve JSON for key part '%s'" , keyPart [0 ]))
@@ -74,10 +74,6 @@ func (c *compiledLocale) retriveValueByCompositeKey(key string) (string, yaerror
7474 )
7575 }
7676
77- if len (keyPart ) == 1 {
78- return c .SubMap [keyPart [0 ]].Value , nil
79- }
80-
8177 subLocale , ok := c .SubMap [keyPart [0 ]]
8278
8379 if ! ok {
@@ -88,6 +84,10 @@ func (c *compiledLocale) retriveValueByCompositeKey(key string) (string, yaerror
8884 )
8985 }
9086
87+ if len (keyPart ) == 1 {
88+ return subLocale .Value , nil
89+ }
90+
9191 value , err := subLocale .retriveValueByCompositeKey (keyPart [1 ])
9292 if err != nil {
9393 return "" , err .Wrap (fmt .Sprintf ("Failed to retrieve value for key part '%s'" , keyPart [0 ]))
You can’t perform that action at this time.
0 commit comments