encPath := strings.ReplaceAll(name[:i], "_", "/")
path, err := module.UnescapePath(encPath)
if err != nil {
- if encPath != "example.com/invalidpath/v1" {
+ if testing.Verbose() && encPath != "example.com/invalidpath/v1" {
fmt.Fprintf(os.Stderr, "go proxy_test: %v\n", err)
}
continue
return
}
- // /mod/quiet/ does not print errors.
- quiet := false
- if strings.HasPrefix(path, "quiet/") {
- path = path[len("quiet/"):]
- quiet = true
- }
-
// Next element may opt into special behavior.
if j := strings.Index(path, "/"); j >= 0 {
n, err := strconv.Atoi(path[:j])
enc := path[:i]
modPath, err := module.UnescapePath(enc)
if err != nil {
- if !quiet {
+ if testing.Verbose() {
fmt.Fprintf(os.Stderr, "go proxy_test: %v\n", err)
}
http.NotFound(w, r)
enc, file := path[:i], path[i+len("/@v/"):]
path, err := module.UnescapePath(enc)
if err != nil {
- if !quiet {
+ if testing.Verbose() {
fmt.Fprintf(os.Stderr, "go proxy_test: %v\n", err)
}
http.NotFound(w, r)
a, err := readArchive(path, vers)
if err != nil {
- if !quiet {
+ if testing.Verbose() {
fmt.Fprintf(os.Stderr, "go proxy: no archive %s %s: %v\n", path, vers, err)
}
if errors.Is(err, os.ErrNotExist) {
}).(cached)
if c.err != nil {
- if !quiet {
+ if testing.Verbose() {
fmt.Fprintf(os.Stderr, "go proxy: %v\n", c.err)
}
http.Error(w, c.err.Error(), 500)