You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module gitlab.my-work.int/some-long-path/some-project-name/some-project-part
go 1.15
add go files to module. Add internal imports to each other. Use some short notation for internal references.
./tools/plus.go
package tools
funcPlus(a,bint) int { returna+b }
./one.go
package main
// import gitlab.my-work.int/some-long-path/some-project-name/some-project-part/tools. // currently working scenarioimportLOCAL/tools. // works according this proposal. "LOCAL" - is an example label for current modulefuncmain(){
fmt.Println(tools.Plus(1,2))
}
What did you expect to see?
LOCAL imports works.
What did you see instead?
LOCAL/tools not found.
go build/get even try to download it.
Some motivation details
Clones
Can't make go-gettable fork of golang module without changing every file in it.
In order to make fork to be a valid module you should change it's module name according repo name. And all imports in all files as consequence.
Of course, there will be troubles in sync process later.
IDE
Currently on any typo in internal imports, "go get" will try to download internal package. And error will not be "hey, there is typo in your import", but "some server returned 404" or even "invalid credentials" for non-public repos.
Import ordering
Clear way to order internal imports into separate block. Currently its a complex task for code analyze systems.
Just shorter and more clear
Yes, just shorter and more clear
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
This is proposal. So, yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go.mod
./tools/plus.go
./one.go
What did you expect to see?
LOCAL imports works.
What did you see instead?
LOCAL/tools not found.
go build/get even try to download it.
Some motivation details
Clones
Can't make go-gettable fork of golang module without changing every file in it.
In order to make fork to be a valid module you should change it's module name according repo name. And all imports in all files as consequence.
Of course, there will be troubles in sync process later.
IDE
Currently on any typo in internal imports, "go get" will try to download internal package. And error will not be "hey, there is typo in your import", but "some server returned 404" or even "invalid credentials" for non-public repos.
Import ordering
Clear way to order internal imports into separate block. Currently its a complex task for code analyze systems.
Just shorter and more clear
Yes, just shorter and more clear
The text was updated successfully, but these errors were encountered: