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

Comments

@AtharvaThorve
Copy link

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
@martisch
Copy link
Contributor

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.

@AtharvaThorve
Copy link
Author

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

@golang golang locked and limited conversation to collaborators Jul 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants