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

question: how to use mkVendorEnv in own buildGoModule #170

Open
gabyx opened this issue Sep 23, 2024 · 1 comment
Open

question: how to use mkVendorEnv in own buildGoModule #170

gabyx opened this issue Sep 23, 2024 · 1 comment

Comments

@gabyx
Copy link

gabyx commented Sep 23, 2024

Hi, I think this flake is great.
I would have liked to use mkVendorEnv in my own buildGoModule function which builds our Go package.
Can I use this function by importing this flake in my flake and then accessing mkVendorEnv before using my buildGoModule?

Would you mind giving some help on how this would look like?

Thanks a lot.

@gabyx
Copy link
Author

gabyx commented Sep 23, 2024

It would be cool to provide an external function mkVendorEnv which
provides the result here: https://github.com/nix-community/gomod2nix/blob/master/builder/default.nix#L250C7-L250C16

This would then be useful in composing your go.mod -> vendor dir - solution with other customized buildGoModule functions.

I reckon a function

mkVendorEnv =
    { go
    , modulesFile
    , goModFile
    , pwd
    }:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant