magefile/mage

GitHub: magefile/mage

Mage 是一个用 Go 编写的类 Make 构建工具,将普通 Go 函数自动转化为可执行的构建目标,解决了 Makefile 难读难写且跨平台支持差的问题。

Stars: 4682 | Forks: 278

[![使用 Mage 构建](https://magefile.org/badge.svg)](https://magefile.org) [![构建状态](https://travis-ci.org/magefile/mage.svg?branch=master)](https://travis-ci.org/magefile/mage) [![构建状态](https://ci.appveyor.com/api/projects/status/n6h146y79xgxkidl/branch/master?svg=true)](https://ci.appveyor.com/project/natefinch/mage/branch/master)

## 关于 Mage 是一个使用 Go 编写的类似 make 的构建工具。你只需编写普通的 go 函数, Mage 就会自动将它们用作类似 Makefile 的可运行目标。 ## 安装说明 Mage 除了 Go 标准库之外没有其他依赖,并且可以在 Go 1.7 及更高版本上构建(更低版本可能也可以,但我们没有进行定期测试)。 **在 go version < 1.17 中使用 GOPATH** ``` go get -u -d github.com/magefile/mage cd $GOPATH/src/github.com/magefile/mage go run bootstrap.go ``` **在 go version >= 1.18 中使用 Go Install** ``` go install github.com/magefile/mage@latest mage -init ``` 你可以指定所需的版本,而不是使用 @latest 标签,例如: ``` go install github.com/magefile/mage@v1.15.0 ``` **使用 Go Modules** ``` git clone https://github.com/magefile/mage cd mage go run bootstrap.go ``` 这将下载代码,然后运行引导脚本来构建嵌入了 版本信息的 mage。普通的 `go get`(不带 -d)或 `go install` 也能正确构建二进制文件,但不会嵌入版本信息。 如果你已经这样做了,也不必担心,只需进入 `$GOPATH/src/github.com/magefile/mage` 并运行 `mage install` 或 `go run bootstrap.go`,就会生成一个 包含正确版本信息的新二进制文件。 mage 二进制文件将被创建在你的 $GOPATH/bin 目录中。 你也可以从我们的 [发布](https://github.com/magefile/mage/releases)页面安装二进制发行版。 ## 演示 [![Mage 演示](https://img.youtube.com/vi/GOqbD0lF-iA/maxresdefault.jpg)](https://www.youtube.com/watch?v=GOqbD0lF-iA) ## 讨论 加入 [gophers slack](https://gophers.slack.com/messages/general/) 上的 `#mage` 频道 或在 [magefile google group](https://groups.google.com/forum/#!forum/magefile) 上发帖, 讨论用法、开发等内容。 # 文档 请访问 [magefile.org](https://magefile.org) 查看完整文档。 请访问 [pkg.go.dev/github.com/magefile/mage/mage](https://pkg.go.dev/github.com/magefile/mage/mage) 了解如何将 Mage 作为库使用的说明。 # 为什么? Makefile 难以阅读也难以编写。主要是因为 makefile 本质上是带有严格空格限制和额外 make 相关语法的复杂 bash 脚本。 Mage 允许你拥有多个 magefile,以你想要的任何方式为它们命名, 并且它们很容易针对多种操作系统进行自定义。Mage 没有 依赖(除了 go),并且在所有主流操作系统上都能正常运行, 而 make 通常使用在 Windows 上支持不佳的 bash。对于任何涉及分支、循环以及任何 不仅仅是直线执行命令的重要任务,Go 都 比 bash 更具优势。而且,如果你的项目是 用 Go 编写的,为什么要引入像 bash 这样特立独行的语言呢?为什么不 使用你的贡献者已经熟悉的语言呢? # 感谢
标签:EVTX分析, 日志审计