You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ginclient/config/config.go
+12-9Lines changed: 12 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ import (
7
7
"path/filepath"
8
8
"strconv"
9
9
"strings"
10
+
"sync"
10
11
11
12
"github.com/G-Node/gin-cli/ginclient/log"
12
13
"github.com/G-Node/gin-cli/gincmd/ginerrors"
@@ -51,7 +52,9 @@ var (
51
52
52
53
// configuration cache: used to avoid rereading during a single command invocation
53
54
configurationGinCliCfg
54
-
set=false
55
+
56
+
// configReadOnce to read config only once per run
57
+
configReadOnce sync.Once
55
58
)
56
59
57
60
// Types
@@ -114,9 +117,11 @@ type GinCliCfg struct {
114
117
// Read loads in the configuration from the config file(s), merges any defined values into the default configuration, and returns a populated GinConfiguration struct.
115
118
// The configuration is cached. Subsequent reads reuse the already loaded configuration.
0 commit comments