@@ -119,7 +119,7 @@ func (f *fileSource) LoadWithKeys(ctx context.Context) (map[string]any, map[stri
119119 }
120120 }
121121 if f .opts .SnakeCaseKeys || f .opts .KeyPrefix != "" {
122- adapted , adaptedOriginal , adaptErr := adaptFlattenedKeys (flattened , originalKeys , f .opts )
122+ adapted , adaptedOriginal , adaptErr := adaptFlattenedKeys (flattened , originalKeys , f .opts , f . path )
123123 if adaptErr != nil {
124124 return nil , nil , adaptErr
125125 }
@@ -130,7 +130,7 @@ func (f *fileSource) LoadWithKeys(ctx context.Context) (map[string]any, map[stri
130130 return flattened , originalKeys , nil
131131}
132132
133- func adaptFlattenedKeys (flattened map [string ]any , originalKeys map [string ]string , opts Options ) (map [string ]any , map [string ]string , error ) {
133+ func adaptFlattenedKeys (flattened map [string ]any , originalKeys map [string ]string , opts Options , sourcePath string ) (map [string ]any , map [string ]string , error ) {
134134 adapted := make (map [string ]any , len (flattened ))
135135 adaptedOriginalKeys := make (map [string ]string , len (originalKeys ))
136136
@@ -146,7 +146,8 @@ func adaptFlattenedKeys(flattened map[string]any, originalKeys map[string]string
146146 existingOriginal = adaptedKey
147147 }
148148 return nil , nil , fmt .Errorf (
149- "sourcefile: adapted key collision for %q (from %q and %q)" ,
149+ "sourcefile: adapted key collision in %q for %q (from %q and %q)" ,
150+ sourcePath ,
150151 adaptedKey ,
151152 existingOriginal ,
152153 currentOriginal ,
0 commit comments