From 06a593df2521316b41248304c41e7b0322d736b0 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Thu, 22 Aug 2024 19:54:05 -0400 Subject: [PATCH] Add warning about disk writes/reads to Config --- config/config.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 711c255..ad93e3a 100644 --- a/config/config.go +++ b/config/config.go @@ -54,11 +54,13 @@ type Config interface { // not a boolean, it will return fallback. GetBool (key string, fallback bool) (bool, error) // Set sets a value in the user-level config file. If the key is - // invalid, it returns ErrMalformedKey. + // invalid, it returns ErrMalformedKey. Note that *will* cause a write + // to disk, and a read from disk for whatever is watching the user file. Set (key string, value Value) error // Reset removes the value from the user-level config file, resetting it // to what is described by the system-level config files. If the key is - // invalid, it returns ErrMalformedKey. + // invalid, it returns ErrMalformedKey. Note that *will* cause a write + // to disk, and a read from disk for whatever is watching the user file. Reset (key string) error // OnChange specifies a function to be called whenever a value is // changed. The callback is always run within the backend's event loop