WritablePath returns the cleaned WRITABLE_PATH environment variable when it is set. It accepts both uppercase and lowercase variants for compatibility with existing conventions.
()
| 116 | // WritablePath returns the cleaned WRITABLE_PATH environment variable when it is set. |
| 117 | // It accepts both uppercase and lowercase variants for compatibility with existing conventions. |
| 118 | func WritablePath() string { |
| 119 | for _, key := range []string{"WRITABLE_PATH", "writable_path"} { |
| 120 | if value, ok := os.LookupEnv(key); ok { |
| 121 | trimmed := strings.TrimSpace(value) |
| 122 | if trimmed != "" { |
| 123 | return filepath.Clean(trimmed) |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | return "" |
| 128 | } |
no outgoing calls
no test coverage detected