Documentation
¶
Overview ¶
Package recent remembers the directories that have been attached, most recent first.
It is a convenience and nothing more, so every failure in it is swallowed: a read-only home directory should cost the list, not the session. That is the same bargain the catalog cache and the query history strike.
A JSON file rather than a table. The catalog database is the schema cache and the history database is the query log; a list of twenty paths belongs in neither, and giving it a third database would be more machinery than the thing it stores.
Index ¶
Constants ¶
const Limit = 20
Limit is how many paths are kept. Long enough to cover the checkouts someone moves between, short enough that the list is still a shortcut.
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
DefaultPath returns the on-disk location, alongside the catalog cache and the query history.
Types ¶
type List ¶
type List struct {
// contains filtered or unexported fields
}
List is an ordered set of paths, most recent first.
The zero value is an empty list that remembers nothing across runs, which is what a session gets when the state directory could not be read.
func Open ¶
Open reads a list.
A missing file is the ordinary first run, and an unreadable or malformed one is treated the same way: starting over loses a list of paths, whereas refusing to start loses the feature for good, and nobody is going to hand- repair a state file to get their directory history back.