...

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

Documentation: cmd/go/testdata/script

     1go work sync
     2cmp a/go.mod a/want_go.mod
     3cmp b/go.mod b/want_go.mod
     4
     5-- go.work --
     6go 1.18
     7
     8use (
     9	./a
    10	./b
    11)
    12
    13-- a/go.mod --
    14go 1.18
    15
    16module example.com/a
    17
    18require (
    19	example.com/p v1.0.0
    20	example.com/q v1.1.0
    21	example.com/r v1.0.0
    22)
    23
    24replace (
    25	example.com/p => ../p
    26	example.com/q => ../q
    27	example.com/r => ../r
    28)
    29-- a/want_go.mod --
    30go 1.18
    31
    32module example.com/a
    33
    34require (
    35	example.com/p v1.1.0
    36	example.com/q v1.1.0
    37)
    38
    39replace (
    40	example.com/p => ../p
    41	example.com/q => ../q
    42	example.com/r => ../r
    43)
    44-- a/a.go --
    45package a
    46
    47import (
    48	"example.com/p"
    49	"example.com/q"
    50)
    51
    52func Foo() {
    53	p.P()
    54	q.Q()
    55}
    56-- b/go.mod --
    57go 1.18
    58
    59module example.com/b
    60
    61require (
    62	example.com/p v1.1.0
    63	example.com/q v1.0.0
    64)
    65
    66replace (
    67	example.com/p => ../p
    68	example.com/q => ../q
    69)
    70-- b/want_go.mod --
    71go 1.18
    72
    73module example.com/b
    74
    75require (
    76	example.com/p v1.1.0
    77	example.com/q v1.1.0
    78)
    79
    80replace (
    81	example.com/p => ../p
    82	example.com/q => ../q
    83)
    84-- b/b.go --
    85package b
    86
    87import (
    88	"example.com/p"
    89	"example.com/q"
    90)
    91
    92func Foo() {
    93	p.P()
    94	q.Q()
    95}
    96-- p/go.mod --
    97go 1.18
    98
    99module example.com/p
   100-- p/p.go --
   101package p
   102
   103func P() {}
   104-- q/go.mod --
   105go 1.18
   106
   107module example.com/q
   108-- q/q.go --
   109package q
   110
   111func Q() {}
   112-- r/go.mod --
   113go 1.18
   114
   115module example.com/r
   116-- r/q.go --
   117package r
   118
   119func R() {}

View as plain text