This repository has been archived by the owner on Mar 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Strip out an directory-based replacements from main pkg's module (#78)
Per much previous discussion, we do apply replace directives in the main package's module. But for directory replacements this is not guaranteed to make sense. Indeed it almost certainly doesn't make sense most of the time. Therefore, strip out these replace directives, leaving behind the versioned, non-directory replaces.
- Loading branch information
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
testdata/mod/github.com_gobin-testrepos_simple-main-directory-replace_v1.0.0.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- .mod -- | ||
module github.com/gobin-testrepos/simple-main-directory-replace | ||
|
||
require github.com/gobin-testrepos/food v1.0.0 | ||
|
||
replace github.com/gobin-testrepos/food => /road/to/nowhere | ||
-- .info -- | ||
{"Version":"v1.0.0","Time":"2018-10-22T18:45:39Z"} | ||
|
||
-- go.mod -- | ||
module github.com/gobin-testrepos/simple-main-directory-replace | ||
|
||
require github.com/gobin-testrepos/food v1.0.0 | ||
|
||
replace github.com/gobin-testrepos/food => /road/to/nowhere | ||
|
||
-- main.go -- | ||
package main | ||
|
||
import "fmt" | ||
|
||
import "github.com/gobin-testrepos/food" | ||
|
||
func main() { | ||
fmt.Println("Simple module-based main v1.0.0") | ||
fmt.Printf("Today we will eat %v\n", food.MainCourse) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Verify that directory-target replace statements in the main package's module | ||
# are ignored. | ||
|
||
env HOME=$WORK/home | ||
gobin -run github.com/gobin-testrepos/simple-main-directory-replace@v1.0.0 | ||
stdout '^Simple module-based main v1.0.0$' | ||
stdout '^Today we will eat fish$' |