# 'go mod download' can download specific versions of the main module.
go mod download rsc.io/quote@5d9f230b
go mod download rsc.io/quote@v1.5.2
go mod download rsc.io/quote@latest

# 'go mod download' will not download @upgrade or @patch, since they always
# resolve to the main module.
go mod download rsc.io/quote@upgrade
stderr '^go mod download: skipping argument rsc.io/quote@upgrade that resolves to the main module$'
go mod download rsc.io/quote@patch
stderr '^go mod download: skipping argument rsc.io/quote@patch that resolves to the main module$'

# 'go list -m' can show a version of the main module.
go list -m rsc.io/quote@5d9f230b
stdout '^rsc.io/quote v0.0.0-20180710144737-5d9f230bcfba$'
go list -m rsc.io/quote@v1.5.2
stdout '^rsc.io/quote v1.5.2$'
go list -m rsc.io/quote@latest
stdout '^rsc.io/quote v1.5.2$'

# 'go list -m -versions' shows available versions.
go list -m -versions rsc.io/quote
stdout '^rsc.io/quote.*v1.5.2'

# 'go list -m' resolves @upgrade and @patch to the main module.
go list -m rsc.io/quote@upgrade
stdout '^rsc.io/quote$'
go list -m rsc.io/quote@patch
stdout '^rsc.io/quote$'

# 'go get' will not attempt to upgrade the main module to any specific version.
# See also: mod_get_main.txt.
! go get rsc.io/quote@5d9f230b
stderr '^go get: can''t request version "5d9f230b" of the main module \(rsc.io/quote\)$'
! go get rsc.io/quote@v1.5.2
stderr '^go get: can''t request version "v1.5.2" of the main module \(rsc.io/quote\)$'
! go get rsc.io/quote@latest
stderr '^go get: can''t request version "latest" of the main module \(rsc.io/quote\)$'

-- go.mod --
module rsc.io/quote

go 1.16
