Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for ErrCache (0.21 sec)

  1. src/cmd/go/internal/par/work.go

    		w.mu.Unlock()
    
    		w.f(item)
    	}
    }
    
    // ErrCache is like Cache except that it also stores
    // an error value alongside the cached value V.
    type ErrCache[K comparable, V any] struct {
    	Cache[K, errValue[V]]
    }
    
    type errValue[V any] struct {
    	v   V
    	err error
    }
    
    func (c *ErrCache[K, V]) Do(key K, f func() (V, error)) (V, error) {
    	v := c.Cache.Do(key, func() errValue[V] {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 15:54:54 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  2. src/cmd/go/internal/cfg/lookpath.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package cfg
    
    import (
    	"cmd/go/internal/par"
    	"os/exec"
    )
    
    var lookPathCache par.ErrCache[string, string]
    
    // LookPath wraps exec.LookPath and caches the result
    // which can be called by multiple Goroutines at the same time.
    func LookPath(file string) (path string, err error) {
    	return lookPathCache.Do(file,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 11 20:12:18 UTC 2023
    - 534 bytes
    - Viewed (0)
  3. src/cmd/go/internal/modfetch/cache.go

    // It serializes calls to the underlying Repo.
    type cachingRepo struct {
    	path          string
    	versionsCache par.ErrCache[string, *Versions]
    	statCache     par.ErrCache[string, *RevInfo]
    	latestCache   par.ErrCache[struct{}, *RevInfo]
    	gomodCache    par.ErrCache[string, []byte]
    
    	once     sync.Once
    	initRepo func(context.Context) (Repo, error)
    	r        Repo
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 18:15:22 UTC 2024
    - 24.7K bytes
    - Viewed (0)
  4. src/cmd/go/internal/modfetch/fetch.go

    	"cmd/go/internal/robustio"
    	"cmd/go/internal/str"
    	"cmd/go/internal/trace"
    
    	"golang.org/x/mod/module"
    	"golang.org/x/mod/sumdb/dirhash"
    	modzip "golang.org/x/mod/zip"
    )
    
    var downloadCache par.ErrCache[module.Version, string] // version → directory
    
    var ErrToolchain = errors.New("internal error: invalid operation on toolchain module")
    
    // Download downloads the specific module version to the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 14:56:56 UTC 2024
    - 30.3K bytes
    - Viewed (0)
  5. src/cmd/go/proxy_test.go

    		if err != nil {
    			fmt.Fprintf(os.Stderr, "go proxy_test: %v\n", err)
    			continue
    		}
    		modList = append(modList, module.Version{Path: path, Version: vers})
    	}
    }
    
    var zipCache par.ErrCache[*txtar.Archive, []byte]
    
    const (
    	testSumDBName        = "localhost.localdev/sumdb"
    	testSumDBVerifierKey = "localhost.localdev/sumdb+00000c67+AcTrnkbUA+TU4heY3hkjiSES/DSQniBqIeQ/YppAUtK6"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 03 09:56:24 UTC 2023
    - 12K bytes
    - Viewed (0)
  6. src/cmd/go/internal/modload/modfile.go

    					VersionInterval: ret.VersionInterval,
    					Rationale:       ret.Rationale,
    				})
    			}
    		}
    
    		return summary, nil
    	})
    }
    
    var rawGoModSummaryCache par.ErrCache[module.Version, *modFileSummary]
    
    // rawGoModData returns the content of the go.mod file for module m, ignoring
    // all replacements that may apply to m.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 26 17:53:40 UTC 2023
    - 26.7K bytes
    - Viewed (0)
  7. src/cmd/go/internal/modfetch/codehost/git.go

    	err error
    }
    
    func (e notExistError) Error() string   { return e.err.Error() }
    func (notExistError) Is(err error) bool { return err == fs.ErrNotExist }
    
    const gitWorkDirType = "git3"
    
    var gitRepoCache par.ErrCache[gitCacheKey, Repo]
    
    type gitCacheKey struct {
    	remote  string
    	localOK bool
    }
    
    func newGitRepoCached(ctx context.Context, remote string, localOK bool) (Repo, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 11 22:10:38 UTC 2024
    - 27.4K bytes
    - Viewed (0)
  8. src/cmd/go/internal/modindex/read.go

    	if str.HasFilePathPrefix(modroot, cfg.GOROOTsrc) || !str.HasFilePathPrefix(modroot, cfg.GOMODCACHE) {
    		return nil, errNotFromModuleCache
    	}
    	return openIndexModule(modroot, true)
    }
    
    var mcache par.ErrCache[string, *Module]
    
    // openIndexModule returns the module index for modPath.
    // It will return ErrNotIndexed if the module can not be read
    // using the index because it contains symlinks.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 14:34:32 UTC 2024
    - 29.7K bytes
    - Viewed (0)
  9. src/cmd/go/internal/modfetch/codehost/vcs.go

    		repo, err := newVCSRepo(ctx, vcs, remote)
    		if err != nil {
    			return nil, &VCSError{err}
    		}
    		return repo, nil
    	})
    }
    
    var vcsRepoCache par.ErrCache[vcsCacheKey, Repo]
    
    type vcsRepo struct {
    	mu lockedfile.Mutex // protects all commands, so we don't have to decide which are safe on a per-VCS basis
    
    	remote string
    	cmd    *vcsCmd
    	dir    string
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Apr 14 18:50:24 UTC 2024
    - 17.3K bytes
    - Viewed (0)
  10. src/cmd/go/internal/modload/import.go

    	return mpath == path ||
    		len(path) > len(mpath) && path[len(mpath)] == '/' && path[:len(mpath)] == mpath
    }
    
    var (
    	haveGoModCache   par.Cache[string, bool]    // dir → bool
    	haveGoFilesCache par.ErrCache[string, bool] // dir → haveGoFiles
    )
    
    // dirInModule locates the directory that would hold the package named by the given path,
    // if it were in the module with module path mpath and root mdir.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 15:21:14 UTC 2024
    - 27.7K bytes
    - Viewed (0)
Back to top