mustNotBeEmpty prevents us from accidentally writing configuration to the current directory. This is primarily valuable in development, where we may accidentally use an empty root.
()
| 21 | // current directory. This is primarily valuable in development, where we may |
| 22 | // accidentally use an empty root. |
| 23 | func (r Root) mustNotEmpty() { |
| 24 | if r == "" { |
| 25 | panic("config root must not be empty") |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func (r Root) Session() File { |
| 30 | r.mustNotEmpty() |
no outgoing calls
no test coverage detected