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

proposal: Import local packages using relative paths. #40388

Closed
AtharvaThorve opened this issue Jul 24, 2020 · 2 comments
Closed

proposal: Import local packages using relative paths. #40388

AtharvaThorve opened this issue Jul 24, 2020 · 2 comments
Labels
Milestone

Comments

@AtharvaThorve
Copy link

@AtharvaThorve AtharvaThorve commented Jul 24, 2020

description:
Add support to import go modules using relative paths.
For example:
File 1: urlshort.go:

package urlshort

// ShortenURL function shortens the provided URL string
func ShortenURL(url string) string {...} 

File 2: main.go:

package main
import "./urlshort"

func main() {...}

The above feature shows us importing urlshort package in the main.go file and then all the exported function are made available in the main.go file.

This would be a great feature for large scale applications.

Thanks for your consideration.

@gopherbot gopherbot added this to the Proposal milestone Jul 24, 2020
@gopherbot gopherbot added the Proposal label Jul 24, 2020
@martisch
Copy link
Contributor

@martisch martisch commented Jul 24, 2020

A proposal for relative import paths already exists (the specific syntax is open for debate but the semantic seems matching) at #20883. Closing this proposal as duplicate. Discussion can continue on the earlier proposal.

@martisch martisch closed this Jul 24, 2020
@AtharvaThorve
Copy link
Author

@AtharvaThorve AtharvaThorve commented Jul 24, 2020

Ohh okay, thank you very much and sorry for the duplicate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.