Source file src/cmd/go/internal/modfetch/cache_test.go

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package modfetch
     6  
     7  import (
     8  	"os"
     9  	"path/filepath"
    10  	"testing"
    11  )
    12  
    13  func TestWriteDiskCache(t *testing.T) {
    14  	tmpdir, err := os.MkdirTemp("", "go-writeCache-test-")
    15  	if err != nil {
    16  		t.Fatal(err)
    17  	}
    18  	defer os.RemoveAll(tmpdir)
    19  
    20  	err = writeDiskCache(filepath.Join(tmpdir, "file"), []byte("data"))
    21  	if err != nil {
    22  		t.Fatal(err)
    23  	}
    24  }
    25  

View as plain text