...

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

Documentation: cmd/go/testdata/script

     1# Test that the sum file data state is properly reset between modules in
     2# go work sync so that the sum file that's written is correct.
     3# Exercises the fix to #50038.
     4
     5cp b/go.sum b/go.sum.want
     6
     7# As a sanity check, verify b/go.sum is tidy.
     8cd b
     9go mod tidy
    10cd ..
    11cmp b/go.sum b/go.sum.want
    12
    13# Run go work sync and verify it doesn't change b/go.sum.
    14go work sync
    15cmp b/go.sum b/go.sum.want
    16
    17-- b/go.sum --
    18rsc.io/quote v1.0.0 h1:kQ3IZQzPTiDJxSZI98YaWgxFEhlNdYASHvh+MplbViw=
    19rsc.io/quote v1.0.0/go.mod h1:v83Ri/njykPcgJltBc/gEkJTmjTsNgtO1Y7vyIK1CQA=
    20-- go.work --
    21go 1.18
    22use (
    23    ./a
    24    ./b
    25)
    26replace example.com/c => ./c
    27-- a/go.mod --
    28module example.com/a
    29go 1.18
    30require rsc.io/fortune v1.0.0
    31-- a/a.go --
    32package a
    33import "rsc.io/fortune"
    34-- b/go.mod --
    35module example.com/b
    36go 1.18
    37require rsc.io/quote v1.0.0
    38-- b/b.go --
    39package b
    40import _ "rsc.io/quote"

View as plain text