Magefiles in their own nested Go module #464
-
Hello, I’m trying to put my Magefiles in their own Go module to not mix my application dependencies and my Magefiles dependencies. Here is what it looks like:
However, I can’t use the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
It's not a good idea to have two modules in the same repo. It causes a lot of problems with go in general. You can do it, but it's kind of a pain. This might be fixable, but I'm not 100% sure yet. Can you show me what kind of output mage produces in this case? |
Beta Was this translation helpful? Give feedback.
Yeah, I think this is because mage is actually running in the root directory, so it's using the go.mod of the root directory. It probably shouldn't do that if you have a
magefiles
directory, instead it should change the current working directory to that directory to build the magefiles.I think this is fixable, but I'm a little worried it may break other people. I'll have to look at it and do some testing.