...

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

Documentation: cmd/go/testdata/script

     1# When we attempt to resolve an import that doesn't exist, we should not save
     2# hashes for downloaded modules.
     3# Verifies golang.org/issue/36260.
     4# TODO(golang.org/issue/26603): use 'go mod tidy -e' when implemented.
     5go list -e -mod=mod -tags=ignore ./noexist
     6! exists go.sum
     7
     8# When an import is resolved successfully, we should only save hashes for
     9# the module that provides the package, not for other modules looked up.
    10# Verifies golang.org/issue/31580.
    11go get ./exist
    12grep '^example.com/join v1.1.0 h1:' go.sum
    13! grep '^example.com/join/subpkg' go.sum
    14cp go.sum go.list.sum
    15go mod tidy
    16cmp go.sum go.list.sum
    17
    18-- go.mod --
    19module m
    20
    21go 1.15
    22
    23-- noexist/use.go --
    24// ignore tags prevents errors in 'go mod tidy'
    25// +build ignore
    26
    27package use
    28
    29import _ "example.com/join/subpkg/noexist"
    30
    31-- exist/use.go --
    32package use
    33
    34import _ "example.com/join/subpkg"

View as plain text