View previous topic :: View next topic |
Author |
Message |
logrusx Advocate


Joined: 22 Feb 2018 Posts: 2784
|
Posted: Mon Mar 03, 2025 2:18 pm Post subject: [SOLVED][NVM]Help adding vendor files to a go project |
|
|
Hi, I'd like to fork the original repo and add the vendor files so I don't need to deal with packaging and hosting them. Unfortunately I don't know enough about how go projects work. Can anybody land a hand? I believe once I do it I'll be able to do it on my own from then on.
UPDATE: I'm trying to automate the generation of vendor files with GitHub CI actions, but no luck yet.
UPDATE2: I've been a victim of some self-deception that made me look for such a solution to the wrong problem, disregard that thread.
Best Regards,
Georgi
Last edited by logrusx on Mon Mar 03, 2025 3:57 pm; edited 3 times in total |
|
Back to top |
|
 |
spica Guru

Joined: 04 Jun 2021 Posts: 347
|
Posted: Mon Mar 03, 2025 2:44 pm Post subject: |
|
|
If some module can not be fetched from internet, I use a local copy and use a `replace` directive in go.mod Code: | module f.q.d.n/shop
go 1.22
replace f.q.d.n/image/proto/image/image_api_pb => ../image/proto/image/image_api_pb/
require (
f.q.d.n/image/proto/image/image_api_pb v1.0.0
***
)
|
And then in the code I like that I do not need to change imports:
Code: | import "f.q.d.n/image/proto/image/image_api_pb" |
|
|
Back to top |
|
 |
logrusx Advocate


Joined: 22 Feb 2018 Posts: 2784
|
Posted: Mon Mar 03, 2025 2:54 pm Post subject: |
|
|
Thanks, but I want to put that online for people to use. I have at least several tents of users and can't ask them to do that. For one release I used GitHub to host the vendor tarball, but they changed the scheme the URL is build and now it includes some weird random numbers which I can't predict in the ebuild. In the same time I don't want to go and update the URL for every new release. Of course that is an option too but I want to first try doing it properly. I'll also supervise upstream's actions and correct them if necessary as they are breaking my patches with stupid line swaps and such.
So far I've added vendor/modules.txt but go-module_live_vendor complains it's only allowed in live ebuilds.
Best Regards,
Georgi |
|
Back to top |
|
 |
|