Skip to content

Importing targets from magefiles dir or main #418

Answered by natefinch
anacrolix asked this question in Q&A
Discussion options

You must be logged in to vote

We plan to make the magefiles directory not require that it be package main but haven't gotten that code written yet.

For now, your best bet is to put the code that isn't mage targets into a different package (i.e. a different directory) and just import it like normal code.

If you really need both the targets and these other functions in the same package, you can use mage:import to import the targets, and then import and use the other functions normally.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by anacrolix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants