Text file src/cmd/go/testdata/script/clean_cache_n.txt

     1  # We're testing cache behavior, so start with a clean GOCACHE.
     2  env GOCACHE=$WORK/cache
     3  
     4  # Build something so that the cache gets populates
     5  go build main.go
     6  
     7  # Check that cache contains directories before running
     8  exists $GOCACHE/00
     9  
    10  # Run go clean -cache -n and ensure that directories weren't deleted
    11  go clean -cache -n
    12  exists $GOCACHE/00
    13  
    14  # Re-run go clean cache without the -n flag go ensure that directories were properly removed
    15  go clean -cache
    16  ! exists $GOCACHE/00
    17  
    18  -- main.go --
    19  package main
    20  
    21  import "fmt"
    22  
    23  func main() {
    24  	fmt.Println("hello!")
    25  }
    26  

View as plain text