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

     1  # Test that go work sync writes a complete and tidy go.work.sum.
     2  
     3  cp a/go.mod a/go.mod.orig
     4  cp a/go.sum a/go.sum.orig
     5  go work sync
     6  cmp a/go.mod a/go.mod.orig
     7  cmp a/go.sum a/go.sum.orig
     8  cmp go.work.sum want.sum
     9  
    10  # go list -m all should not add checksums that go work sync omitted.
    11  go list -m all
    12  cmp go.work.sum want.sum
    13  
    14  # Removing go.work.sum and regenerating it should produce the same file,
    15  # even though the module zip files are now cached.
    16  rm go.work.sum
    17  go work sync
    18  cmp a/go.mod a/go.mod.orig
    19  cmp a/go.sum a/go.sum.orig
    20  cmp go.work.sum want.sum
    21  
    22  -- go.work --
    23  go 1.18
    24  
    25  use (
    26  	./a
    27  	./b
    28  )
    29  -- go.work.sum --
    30  rsc.io/quote v1.0.0/go.mod h1:v83Ri/njykPcgJltBc/gEkJTmjTsNgtO1Y7vyIK1CQA=
    31  -- want.sum --
    32  golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c h1:pvCbr/wm8HzDD3fVywevekufpn6tCGPY3spdHeZJEsw=
    33  golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
    34  rsc.io/quote v1.5.2 h1:3fEykkD9k7lYzXqCYrwGAf7iNhbk4yCjHmKBN9td4L0=
    35  rsc.io/quote v1.5.2/go.mod h1:LzX7hefJvL54yjefDEDHNONDjII0t9xZLPXsUe+TKr0=
    36  -- a/go.mod --
    37  module example.com/a
    38  
    39  go 1.18
    40  
    41  require rsc.io/quote v1.5.2
    42  
    43  require (
    44  	golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c // indirect
    45  	rsc.io/sampler v1.3.0 // indirect
    46  )
    47  -- a/go.sum --
    48  rsc.io/sampler v1.3.0 h1:HLGR/BgEtI3r0uymSP/nl2uPLsUnNJX8toRyhfpBTII=
    49  rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
    50  -- a/a.go --
    51  package a
    52  
    53  import _ "rsc.io/quote"
    54  -- b/go.mod --
    55  module example.com/b
    56  
    57  go 1.18
    58  -- b/b.go --
    59  package b
    60  

View as plain text