We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8dde2fc commit 3859c00Copy full SHA for 3859c00
1 file changed
flatten/store.go
@@ -237,6 +237,17 @@ func (s *Storage) Get(key string, def ...string) string {
237
return v.Value
238
}
239
240
+// Lookup retrieves the value associated with the given flattened key.
241
+// Returns the value and true if the key is found, or an empty string and
242
+// false if the key is not found.
243
+func (s *Storage) Lookup(key string) (string, bool) {
244
+ v, ok := s.data[key]
245
+ if !ok {
246
+ return "", false
247
+ }
248
+ return v.Value, true
249
+}
250
+
251
// Set inserts or updates a flattened key with the given value and
252
// the index of the file it originated from.
253
//
0 commit comments