go-askme icon indicating copy to clipboard operation
go-askme copied to clipboard

Remove the absolute path of local references

Open enkhalifapro opened this issue 7 years ago • 5 comments

Example : github.com/bashmohandes/go-askme/answer/db should be just go-askme/answer/db

enkhalifapro avatar Nov 15 '18 00:11 enkhalifapro

I am not sure about this one, I think relative paths imports are considered a bad practice

bashmohandes avatar Nov 15 '18 07:11 bashmohandes

It's Ok if you are writing a package but when writing an app this will lead to tight coupling with Git path so it will be very hard to migrate to another Git server gitlab for example

it's an opinion I have no proof if it bad or good practice

enkhalifapro avatar Nov 15 '18 14:11 enkhalifapro

I think I can use this blog post as a guide, what do you think? https://jve.linuxwall.info/blog/index.php?post/2015/08/26/Hosting_Go_code_on_Github_with_custom_import_path

mohamedelsherif-okta avatar Nov 15 '18 17:11 mohamedelsherif-okta

I think I can use this blog post as a guide, what do you think? https://jve.linuxwall.info/blog/index.php?post/2015/08/26/Hosting_Go_code_on_Github_with_custom_import_path

Excuse me I'm not following

Why do you want to use it ?

they try to have a custom host for packages I think

Anyway, you need just to decide yes or no

if you are not conceived with removing the absolute path it's fine you can close this issue

enkhalifapro avatar Nov 15 '18 17:11 enkhalifapro

I have been trying few ideas to use relative paths instead of absolutes, but making this work while not breaking docker, and windows support is not easy, there seems to be some subtleties in using relative paths that I don't yet understand, as it works fine sometimes, but on random environments it just throws "cannot find module for path" on relative packages. I will stage this issue for a while, as it is valid but not necessarily high priority, please feel free to fix it if you want and send a PR.

bashmohandes avatar Nov 19 '18 06:11 bashmohandes