...

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

Documentation: cmd/go/testdata/script

     1# Test go get with the work pattern.
     2
     3# go get work gets dependencies to satisfy missing imports in the
     4# main modules' package graph. Before the 'work' pattern existed, users
     5# would have to run './...' in the root of the work (main) module.
     6cp go.mod go.mod.orig
     7go get work
     8cmp go.mod go.mod.want
     9
    10# 'go get work' and 'go get all' behave very differently. Because
    11# 'all' evaluates to work packages but also to their dependencies,
    12# 'go get all' will run the 'get' logic on all the dependency module
    13# packages, bumping all their modules to the latest versions.
    14cp go.mod.orig go.mod
    15go get all
    16cmp go.mod go.mod.all.want
    17-- go.mod --
    18module example.com/a
    19
    20go 1.25
    21-- go.mod.want --
    22module example.com/a
    23
    24go 1.25
    25
    26require rsc.io/quote v1.5.2
    27
    28require (
    29	golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c // indirect
    30	rsc.io/sampler v1.3.0 // indirect
    31)
    32-- go.mod.all.want --
    33module example.com/a
    34
    35go 1.25
    36
    37require rsc.io/quote v1.5.2
    38
    39require (
    40	golang.org/x/text v0.3.0 // indirect
    41	rsc.io/sampler v1.99.99 // indirect
    42)
    43-- a.go --
    44package a
    45
    46import _ "rsc.io/quote"

View as plain text