MCPcopy Create free account
hub / github.com/supabase/auth / readFile

Method readFile

internal/conf/confload/loader.go:248–261  ·  view source on GitHub ↗
(name string, dst map[string]string)

Source from the content-addressed store, hash-verified

246}
247
248func (o *Loader) readFile(name string, dst map[string]string) error {
249 f, err := o.sys.Open(name)
250 if err != nil {
251 return fmt.Errorf("ReadFile: %w", err)
252 }
253 defer f.Close()
254
255 switch filepath.Ext(name) {
256 case ".json":
257 return o.readJSON(f, dst)
258 default:
259 return o.readDotenv(f, dst)
260 }
261}
262
263func (o *Loader) readJSON(r io.Reader, dst map[string]string) error {
264 data, err := io.ReadAll(r)

Callers 2

loadFileMethod · 0.95
loadDirMethod · 0.95

Calls 4

readJSONMethod · 0.95
readDotenvMethod · 0.95
CloseMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected