blob: 5894ed69f34178647a7dbf4e88ac851b05f0bf70 [file] [log] [blame]
env GO111MODULE=on
go build -o a1.exe .
exec ./a1.exe
stdout 'Don''t communicate by sharing memory'
# Modules can be replaced by local packages.
go mod edit
go build -o a2.exe .
exec ./a2.exe
stdout 'Concurrency is not parallelism.'
# The module path of the replacement doesn't need to match.
# (For example, it could be a long-running fork with its own import path.)
go mod edit
go build -o a3.exe .
exec ./a3.exe
stdout 'Clear is better than clever.'
# However, the same module can't be used as two different paths.
go mod edit
! go build -o a4.exe .
stderr ' used for two different module paths \( and\)'
-- go.mod --
module quoter
require v3.0.0
-- main.go --
package main
import (
func main() {
-- local/ --
require v1.3.0
-- local/ --
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package quote collects pithy sayings.
package quote
import ""
// Hello returns a greeting.
func HelloV3() string {
return sampler.Hello()
// Glass returns a useful phrase for world travelers.
func GlassV3() string {
// See
return "I can eat glass and it doesn't hurt me."
// Go returns a REPLACED Go proverb.
func GoV3() string {
return "Concurrency is not parallelism."
// Opt returns a optimization truth.
func OptV3() string {
// Wisdom from ken.
return "If a program is too slow, it must have a loop."
-- local/ --
-- local/ --
package quote
func GoV3() string {
return "Clear is better than clever."