#8 skip path if branch exists #12

Merged
vtolstov merged 90 commits from kgorbunov/pkgdash:master into master 2024-04-03 08:28:17 +03:00
2 changed files with 7 additions and 7 deletions
Showing only changes of commit 27331048f3 - Show all commits

View File

@ -145,7 +145,7 @@ func Query(modpath string, cached bool) (*Module, bool, error) {
if msg == "" {
msg = res.Status
}
return nil, false, fmt.Error("proxy: %s", msg)
return nil, false, fmt.Errorf("proxy: %s", msg)
}
var mod Module
mod.Path = modpath
@ -167,7 +167,7 @@ func Latest(modpath string, cached bool) (*Module, error) {
return nil, err
}
if !ok {
return nil, fmt.Error("module not found: %s", modpath)
return nil, fmt.Errorf("module not found: %s", modpath)
}
for i := 0; i < 100; i++ {
nextpath, ok := latest.NextMajorPath()
@ -197,7 +197,7 @@ func Latest(modpath string, cached bool) (*Module, error) {
}
latest = next
}
return nil, fmt.Error("request limit exceeded")
return nil, fmt.Errorf("request limit exceeded")
}
// QueryPackage tries to find the module path for the provided package path
@ -217,9 +217,9 @@ func QueryPackage(pkgpath string, cached bool) (*Module, error) {
if major, ok := ModMajor(modpath); ok {
if v := mod.MaxVersion(major, false); v != "" {
spec := JoinPath(modprefix, "", pkgdir) + "@" + v
return nil, fmt.Error("%s doesn't support import versioning; use %s", major, spec)
return nil, fmt.Errorf("%s doesn't support import versioning; use %s", major, spec)
}
return nil, fmt.Error("failed to find module for package: %s", pkgpath)
return nil, fmt.Errorf("failed to find module for package: %s", pkgpath)
}
}
return mod, nil
@ -231,7 +231,7 @@ func QueryPackage(pkgpath string, cached bool) (*Module, error) {
}
prefix = strings.TrimSuffix(remaining, "/")
}
return nil, fmt.Error("failed to find module for package: %s", pkgpath)
return nil, fmt.Errorf("failed to find module for package: %s", pkgpath)
}
// Update reports a newer version of a module.

View File

@ -108,7 +108,7 @@ func FindModFile(dir string) (string, error) {
}
parent := filepath.Dir(dir)
if parent == dir {
return "", fmt.Error("cannot find go.mod")
return "", fmt.Errorf("cannot find go.mod")
}
dir = parent
}