1

I have forked an open-source golang driver and made some changes. Now I am facing an issue while importing it on my application using the command --> go get "path to my go driver on my personal github account". What is the exact procedure, can anyone suggest?

I am expecting the exact steps to import the driver on my personal account.

Ravi
  • 11
  • 1
  • Use the `replace` directive. See this answer for an example: https://stackoverflow.com/a/76070432/1369400 – Zeke Lu Jul 14 '23 at 10:43
  • Tried, but my application is not able to detect. Could you please give me an example to import local package(it is a driver) in go application. – Ravi Jul 15 '23 at 14:45
  • To replace a module with the one in your local machine, use the `replace` directive like this: `replace module_path => /path/to/local/file/path/to/the/replacement/module/root/directory`. See https://go.dev/ref/mod#go-mod-file-replace – Zeke Lu Jul 15 '23 at 14:59
  • now it is going through the package files but in between it is failing because there is some dependency, if I download the dependency, then it is saying that the driver imported but not used, so the issue is with the internal dependency in the driver. – Ravi Jul 16 '23 at 13:28
  • Please provide a minimal reproducer. – Zeke Lu Jul 16 '23 at 13:58
  • so actually I tried to import the package locally( I copied it in GoRoot path and my application was able to access the package but, there was a file inside that package which imports the sub-package from same ealier package which I tried to import locally, so what I can do now, it is unable to identify that inner package folder even though the parent package folder has been identified by the go application. – Ravi Jul 17 '23 at 14:29
  • what to do if a package is locally imported and there is sub-package inside the package which is imported remotely, how to handle this situation. So basically the parent package is same. – Ravi Jul 18 '23 at 06:09

0 Answers0