diff options
Diffstat (limited to 'src/cmd/go/internal/modfetch/cache_test.go')
-rw-r--r-- | src/cmd/go/internal/modfetch/cache_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/cmd/go/internal/modfetch/cache_test.go b/src/cmd/go/internal/modfetch/cache_test.go new file mode 100644 index 0000000..722c984 --- /dev/null +++ b/src/cmd/go/internal/modfetch/cache_test.go @@ -0,0 +1,24 @@ +// Copyright 2018 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. + +package modfetch + +import ( + "os" + "path/filepath" + "testing" +) + +func TestWriteDiskCache(t *testing.T) { + tmpdir, err := os.MkdirTemp("", "go-writeCache-test-") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tmpdir) + + err = writeDiskCache(filepath.Join(tmpdir, "file"), []byte("data")) + if err != nil { + t.Fatal(err) + } +} |