Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of rename fix #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ go 1.16
// go get github.com/ChrisScotMartin/ait-c/pkgmodc

//Go get will always pull pkgmodc from a previous commit instead of the local more up-to-date version. Two solutions for that, I can either commit/push this as is and then do a go get now that the module is updated. Or I can fix it with a local replace like this:
require github.com/ChrisScotMartin/ait-c/pkgmodc v0.0.0-00010101000000-000000000000 // indirect

replace github.com/ChrisScotMartin/ait-c/pkgmodc => ./pkgmodc
replace github.com/ChrisScotMartin/ait-c/renamedpkgmodc => ./renamedpkgmodc

require github.com/ChrisScotMartin/ait-c/renamedpkgmodc v0.0.0-00010101000000-000000000000
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package main

import (
"fmt"
"github.com/ChrisScotMartin/ait-c/pkgmodc"
"github.com/ChrisScotMartin/ait-c/renamedpkgmodc"
)

func main() {
fmt.Println("Hello World")
pkgmodc.Hello()
renamedpkgmodc.Hello()
}

func SomeServerFunc() {
Expand Down
3 changes: 0 additions & 3 deletions pkgmodc/go.mod

This file was deleted.

3 changes: 3 additions & 0 deletions renamedpkgmodc/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/ChrisScotMartin/ait-c/renamedpkgmodc

go 1.16
2 changes: 1 addition & 1 deletion pkgmodc/pkgmodc.go → renamedpkgmodc/renamed-pkgmodc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pkgmodc
package renamedpkgmodc

import "fmt"

Expand Down
3 changes: 3 additions & 0 deletions vendor/github.com/ChrisScotMartin/ait-c/renamedpkgmodc/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# github.com/ChrisScotMartin/ait-c/renamedpkgmodc v0.0.0-00010101000000-000000000000 => ./renamedpkgmodc
## explicit
github.com/ChrisScotMartin/ait-c/renamedpkgmodc
# github.com/ChrisScotMartin/ait-c/renamedpkgmodc => ./renamedpkgmodc