summaryrefslogtreecommitdiff
path: root/flags.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-14 00:49:35 -0500
committerJeff Carr <[email protected]>2025-10-14 00:49:35 -0500
commit96378c70293b7367f43e630a8d334c19f701b4db (patch)
tree8460d772f069a3e7e30e1bd29786ce23afa32e8e /flags.go
parentfc17dc394aedbc5fd636676202bad40c1f98c1de (diff)
make config.Set(key, value)v0.0.22
Diffstat (limited to 'flags.go')
-rw-r--r--flags.go19
1 files changed, 12 insertions, 7 deletions
diff --git a/flags.go b/flags.go
index d827f7e..31d6801 100644
--- a/flags.go
+++ b/flags.go
@@ -11,13 +11,18 @@ func Get(flag string) string {
return found.Value
}
-func GetError(flag string) error {
- return nil
-}
-
-func Set(flag string) {
-}
+func Set(key string, newValue string) error {
+ if configPB == nil {
+ return NotInitialized
+ }
+ found := configPB.FindByKey(key)
+ if found != nil {
+ found.Value = newValue
+ }
-func SetError(flag string) error {
+ newvar := new(Config)
+ newvar.Key = key
+ newvar.Value = newValue
+ configPB.Append(newvar)
return nil
}