MCPcopy Create free account
hub / github.com/go-git/go-git / ReadConfig

Function ReadConfig

config/config.go:146–158  ·  view source on GitHub ↗

ReadConfig reads a config file from a io.Reader.

(r io.Reader)

Source from the content-addressed store, hash-verified

144
145// ReadConfig reads a config file from a io.Reader.
146func ReadConfig(r io.Reader) (*Config, error) {
147 b, err := io.ReadAll(r)
148 if err != nil {
149 return nil, err
150 }
151
152 cfg := NewConfig()
153 if err = cfg.Unmarshal(b); err != nil {
154 return nil, err
155 }
156
157 return cfg, nil
158}
159
160// LoadConfig loads a config file from a given scope. The returned Config,
161// contains exclusively information from the given scope. If it couldn't find a

Callers 2

ConfigMethod · 0.92
LoadConfigFunction · 0.85

Calls 2

UnmarshalMethod · 0.95
NewConfigFunction · 0.85

Tested by

no test coverage detected