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  ! go clean -cache .
    19  stderr 'go: clean -cache cannot be used with package arguments'
    20  
    21  -- main.go --
    22  package main
    23  
    24  import "fmt"
    25  
    26  func main() {
    27  	fmt.Println("hello!")
    28  }
    29  

View as plain text