github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/registry/config_windows.go (about)

     1  package registry // import "github.com/Prakhar-Agarwal-byte/moby/registry"
     2  
     3  import (
     4  	"os"
     5  	"path/filepath"
     6  	"strings"
     7  )
     8  
     9  // defaultCertsDir is the platform-specific default directory where certificates
    10  // are stored. On Linux, it may be overridden through certsDir, for example, when
    11  // running in rootless mode.
    12  var defaultCertsDir = os.Getenv("programdata") + `\docker\certs.d`
    13  
    14  // cleanPath is used to ensure that a directory name is valid on the target
    15  // platform. It will be passed in something *similar* to a URL such as
    16  // https:\index.docker.io\v1. Not all platforms support directory names
    17  // which contain those characters (such as : on Windows)
    18  func cleanPath(s string) string {
    19  	return filepath.FromSlash(strings.ReplaceAll(s, ":", ""))
    20  }