backend icon indicating copy to clipboard operation
backend copied to clipboard

Import as library

Open hz61p1 opened this issue 3 years ago • 5 comments

I just can't take and import your backend into the project because of the used replaced package. I have to clone the repository and push it up the level of the project

hz61p1 avatar Jan 08 '22 07:01 hz61p1

This project isn't really intended to be used as a library. May I ask what pieces of it you are trying to use?

maebeam avatar Jan 10 '22 17:01 maebeam

To reuse api request and response structures

hz61p1 avatar Jan 10 '22 22:01 hz61p1

Gotcha. I looked into this and it seems like a hard problem to solve. Open to suggestions on how to remove the replace while still making it easy for devs to use a local version of core

maebeam avatar Jan 11 '22 18:01 maebeam

In GO 1.18, a workspace mode will be added, perhaps this is something that will be able to solve this issue out of the box, but it will also require updating everything to GO 1.18 I haven't tried it, if I have time, I'll try and unsubscribe

https://go.googlesource.com/proposal/+/master/design/45713-workspace.md

hz61p1 avatar Jan 30 '22 23:01 hz61p1

I have tested and it works successfully, what will be required for this in general

  1. consider PR https://github.com/deso-protocol/core/pull/210 which fixes the import of the core as a library and update imports accordingly in other projects
  2. updated to go 1.18
  3. create a go.work file
  4. update the dockerfile assembly
  5. update docs
  6. update other repositories where the core is used

Тhe result is a profit in the form of simplified assembly and development for other developers))

hz61p1 avatar Feb 03 '22 21:02 hz61p1