github.com/docker/docker@v299999999.0.0-20200612211812-aaf470eca7b5+incompatible/pkg/ioutils/temp_windows.go (about)

     1  package ioutils // import "github.com/docker/docker/pkg/ioutils"
     2  
     3  import (
     4  	"io/ioutil"
     5  
     6  	"github.com/docker/docker/pkg/longpath"
     7  )
     8  
     9  // TempDir is the equivalent of ioutil.TempDir, except that the result is in Windows longpath format.
    10  func TempDir(dir, prefix string) (string, error) {
    11  	tempDir, err := ioutil.TempDir(dir, prefix)
    12  	if err != nil {
    13  		return "", err
    14  	}
    15  	return longpath.AddPrefix(tempDir), nil
    16  }