MCPcopy Create free account
hub / github.com/basecamp/hey-cli / LoadOld

Function LoadOld

internal/config/config.go:209–222  ·  view source on GitHub ↗

LoadOld reads the config file as the old format (with embedded credentials). Used only during migration.

()

Source from the content-addressed store, hash-verified

207// LoadOld reads the config file as the old format (with embedded credentials).
208// Used only during migration.
209func LoadOld() (*OldConfig, error) {
210 path := globalConfigPath()
211
212 data, err := os.ReadFile(path)
213 if err != nil {
214 return nil, err
215 }
216
217 var cfg OldConfig
218 if err := json.Unmarshal(data, &cfg); err != nil {
219 return nil, err
220 }
221 return &cfg, nil
222}
223
224func (c *Config) Save() error {
225 path := globalConfigPath()

Callers 1

migrateOldCredentialsFunction · 0.92

Calls 1

globalConfigPathFunction · 0.85

Tested by

no test coverage detected