func Download() error {
	fmt.Println("⚙️ Go mod download...")
	if err := sh.RunWith(buildEnv, mg.GoCmd(), "mod", "download"); err != nil {
		return err
	}
	return nil
}
Download Run go mod download
package main
import (
	"bufio"
	"fmt"
	"os"
	"path"
	"path/filepath"
	"strings"
	"text/template"
	"github.com/magefile/mage/mg"
	"github.com/magefile/mage/sh"
)
var Default = Build
var (
	binPath   = path.Join("bin")
	buildPath = path.Join(binPath, "nodejs-portable.exe")
	buildEnv  = map[string]string{
		"GO111MODULE": "on",
		"GOOS":        "windows",
		"GOARCH":      "386",
		"CGO_ENABLED": "0",
	}
)
func Build() error {
	mg.Deps(Clean)
	mg.Deps(Generate)
	var args []string
	args = append(args, "build", "-o", buildPath, "-v")
	args = append(args, "-ldflags", flags())
	fmt.Println("⚙️ Go build...")
	if err := sh.RunWith(buildEnv, mg.GoCmd(), args...); err != nil {
		return err
	}
	return nil
}
func Clean() error {
	if err := createDir(binPath); err != nil {
		return err
	}
	if err := cleanDir(binPath); err != nil {
		return err
	}
	return nil
}