MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / parseFileModeEnv

Function parseFileModeEnv

apps/server/internal/config/config.go:259–272  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

257}
258
259func parseFileModeEnv(name string) (fs.FileMode, bool) {
260 raw := strings.TrimSpace(os.Getenv(name))
261 if raw == "" {
262 return 0, false
263 }
264 if !strings.HasPrefix(raw, "0") {
265 raw = "0" + raw
266 }
267 v, err := strconv.ParseUint(raw, 8, 32)
268 if err != nil {
269 return 0, false
270 }
271 return fs.FileMode(v), true
272}
273
274func envEnabled(name string) bool {
275 raw := strings.TrimSpace(strings.ToLower(os.Getenv(name)))

Callers 2

TestParseFileModeEnvFunction · 0.85
LoadFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestParseFileModeEnvFunction · 0.68