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

     1  env GO111MODULE=on
     2  [short] skip
     3  
     4  # @commit should resolve
     5  
     6  # golang.org/x/text/language@commit should resolve.
     7  # Because of -d, the compiler should not run.
     8  go get -x golang.org/x/text/language@14c0d48
     9  ! stderr 'compile|cp|gccgo .*language\.a$'
    10  
    11  # go get should skip build with no Go files in root
    12  go get golang.org/x/text@14c0d48
    13  
    14  # dropping -d, we should see a build.
    15  [short] skip
    16  
    17  env GOCACHE=$WORK/gocache  # Looking for compile commands, so need a clean cache.
    18  
    19  go build -x golang.org/x/text/language
    20  stderr 'compile|cp|gccgo .*language\.a$'
    21  
    22  go list -f '{{.Stale}}' golang.org/x/text/language
    23  stdout ^false
    24  
    25  # install after build should not run the compiler again.
    26  go install -x golang.org/x/text/language
    27  ! stderr 'compile|cp|gccgo .*language\.a$'
    28  
    29  # we should see an error for unknown packages.
    30  ! go get -x golang.org/x/text/foo@14c0d48
    31  stderr '^go: module golang.org/x/text@14c0d48 found \(v0.3.0\), but does not contain package golang.org/x/text/foo$'
    32  
    33  # get pseudo-version should record that version
    34  go get rsc.io/quote@v0.0.0-20180214005840-23179ee8a569
    35  grep 'rsc.io/quote v0.0.0-20180214005840-23179ee8a569' go.mod
    36  
    37  # but as commit should record as v1.5.1
    38  go get rsc.io/quote@23179ee8
    39  grep 'rsc.io/quote v1.5.1' go.mod
    40  
    41  # go mod edit -require does not interpret commits
    42  go mod edit -require rsc.io/quote@23179ee
    43  grep 'rsc.io/quote 23179ee' go.mod
    44  
    45  # but other commands fix them
    46  go list -m -mod=mod all
    47  grep 'rsc.io/quote v1.5.1' go.mod
    48  
    49  -- go.mod --
    50  module x
    51  

View as plain text