You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sumdb.go
    path of file: ./repos/under-the-hood/gosrc/cmd/go/internal/modfetch
    
    the code of the file until where you have to start completion: // Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Go checksum database lookup

// +build !cmd_go_bootstrap

package modfetch

import (
	"bytes"
	"errors"
	"fmt"
	"io/ioutil"
	"net/url"
	"os"
	"path/filepath"
	"strings"
	"sync"
	"time"

	"cmd/go/internal/base"
	"cmd/go/internal/cfg"
	"cmd/go/in
    
func (c *dbClient) initBase() {
	if c.base != nil {
		return
	}

	// Try proxies in turn until we find out how to connect to this database.
	urls, err := proxyURLs()
	if err != nil {
		c.baseErr = err
		return
	}
	for _, proxyURL := range urls {
		if proxyURL == "noproxy" {
			continue
		}
		if proxyURL == "direct" || proxyURL == "off" {
			break
		}
		proxy, err := url.Parse(proxyURL)
		if err != nil {
			c.baseErr = err
			return
		}
		// Quoting https://golang.org/design/25530-sumdb#proxying-a-checksum-database:
		//
		// Before accessing any checksum database URL using a proxy,
		// the proxy client should first fetch <proxyURL>/sumdb/<sumdb-name>/supported.
		// If that request returns a successful (HTTP 200) response, then the proxy supports
		// proxying checksum database requests. In that case, the client should use
		// the proxied access method only, never falling back to a direct connection to the database.
		// If the /sumdb/<sumdb-name>/supported check fails with a “not found” (HTTP 404)
		// or “gone” (HTTP 410) response, the proxy is unwilling to proxy the checksum database,
		// and the client should connect directly to the database.
		// Any other response is treated as the database being unavailable.
		_, err = web.GetBytes(web.Join(proxy, "sumdb/"+c.name+"/supported"))
		if err == nil {
			// Success! This proxy will help us.
			c.base = web.Join(proxy, "sumdb/"+c.name)
			return
		}
		// If the proxy serves a non-404/410, give up.
		if !errors.Is(err, os.ErrNotExist) {
			c.baseErr = err
			return
		}
	}

	// No proxies, or all proxies said 404, or we reached an explicit "direct".
	c.base = c.direct
}