github.com/zxy12/go_duplicate_112_new@v0.0.0-20200807091221-747231827200/src/cmd/go/testdata/script/cache_unix.txt (about)

     1  # Integration test for cache directory calculation (cmd/go/internal/cache).
     2  
     3  [windows] skip
     4  [darwin] skip
     5  [plan9] skip
     6  
     7  mkdir $WORK/gocache
     8  mkdir $WORK/xdg
     9  mkdir $WORK/home
    10  
    11  # Set GOCACHE, XDG_CACHE_HOME, and HOME.
    12  env GOCACHE=$WORK/gocache
    13  env XDG_CACHE_HOME=$WORK/xdg
    14  env HOME=$WORK/home
    15  
    16  # With all three set, we should prefer GOCACHE.
    17  go env GOCACHE
    18  stdout '\$WORK/gocache$'
    19  
    20  # Without GOCACHE, we should prefer XDG_CACHE_HOME over HOME.
    21  env GOCACHE=
    22  go env GOCACHE
    23  stdout '\$WORK/xdg/go-build$$'
    24  
    25  # With only HOME set, we should use $HOME/.cache.
    26  env XDG_CACHE_HOME=
    27  go env GOCACHE
    28  stdout '\$WORK/home/.cache/go-build$'
    29  
    30  # With no guidance from the environment, we must disable the cache, but that
    31  # should not cause commands that do not write to the cache to fail.
    32  env HOME=
    33  go env GOCACHE
    34  stdout 'off'