// Create always creates a new index for the go module cache that is in cachedir. func Create(cachedir string) error { … } // Update the index for the go module cache that is in cachedir, // If there is no existing index it will build one. // If there are changed directories since the last index, it will // write a new one and return true. Otherwise it returns false. func Update(cachedir string) (bool, error) { … } // indexModCache writes an index current as of when it is called. // If clear is true the index is constructed from all of GOMODCACHE // otherwise the index is constructed from the last previous index // and the updates to the cache. It returns true if it wrote an index, // false otherwise. func indexModCache(cachedir string, clear bool) (bool, error) { … } // modindexTimed writes an index current as of onlyBefore. // If clear is true the index is constructed from all of GOMODCACHE // otherwise the index is constructed from the last previous index // and all the updates to the cache before onlyBefore. // It returns true if it wrote a new index, false if it wrote nothing. func modindexTimed(onlyBefore time.Time, cachedir Abspath, clear bool) (bool, error) { … } type work … func (w *work) buildIndex() error { … } func (w *work) writeIndex() error { … }