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  	"context"
     9  	"path/filepath"
    10  	"testing"
    11  )
    12  
    13  func TestWriteDiskCache(t *testing.T) {
    14  	ctx := context.Background()
    15  
    16  	tmpdir := t.TempDir()
    17  	err := writeDiskCache(ctx, filepath.Join(tmpdir, "file"), []byte("data"))
    18  	if err != nil {
    19  		t.Fatal(err)
    20  	}
    21  }
    22  

View as plain text