Skip to content

Releases: uselibrary/gocar

v0.2.20260303

03 Mar 11:20

Choose a tag to compare

重构并提升性能

  • embeddedSentinel 替代硬编码字符串判断
  • newProcStats() 构造函数
  • writeFileAtomic 拆分 + defer 清理 tmp
  • io.Writer 注入解耦输出
  • Close 错误不再被全部忽略

更换编号
版本信息由x.y.z改为x.y.yyyymmdd以适配频繁的字库更新

v0.2.2

25 Feb 03:16

Choose a tag to compare

upgrade to go 1.26.0, using Green Tea GC

v0.2.1

23 Dec 08:34

Choose a tag to compare

fix bugs

v0.2.0

22 Dec 05:49

Choose a tag to compare

功能更新

新增项目配置功能

  • 覆盖内嵌命令
  • 添加自定义命令

v0.1.3

16 Dec 06:23

Choose a tag to compare

新增功能

编译时使用--with-cgo强制开启CGO_ENABLED=1避免强制依赖C的程序无法使用release模式。

gocar build --release --with-cgo # 强制使用C,即`CGO_ENABLED=1`

优化输入输出

使用CombinedOutput替代stdout/stderr,现在完全捕获go的输出内容,以便检查信息。

v0.1.2

16 Dec 05:18

Choose a tag to compare

修复

  • 修复多源文件场景下的路径冲突 #1

v0.1.1

15 Dec 10:19

Choose a tag to compare

新增功能

编译

gocar build --help

显示 build 命令的详细帮助信息,包括所有选项和常用目标平台列表。

gocar build - Build the project

USAGE:
    gocar build [OPTIONS]

OPTIONS:
    --release              Build in release mode (optimized binary)
    --target <os>/<arch>   Cross-compile for target platform
    --help                 Show this help message

EXAMPLES:
    gocar build                                  Build for current platform (debug)
    gocar build --release                        Build for current platform (release)
    gocar build --target linux/amd64             Cross-compile for Linux AMD64
    gocar build --target windows/amd64           Cross-compile for Windows AMD64
    gocar build --release --target linux/arm64   Cross-compile for Linux ARM (release)

COMMON TARGETS:
    linux/amd64     Linux 64-bit
    linux/arm64     Linux ARM 64-bit
    linux/arm       Linux ARM 32-bit
    darwin/amd64    macOS Intel
    darwin/arm64    macOS Apple Silicon
    windows/amd64   Windows 64-bit
    windows/386     Windows 32-bit

gocar build --target /

支持交叉编译到指定平台,例如 gocar build --target linux/arm64

  • 自动设置 GOOSGOARCH 环境变量
  • 输出文件及路径格式:bin/debug/linux/arm64/<appName>,Windows 平台自动添加 .exe 后缀

组合使用 --release --target

可以同时使用两个参数进行优化的交叉编译,例如 gocar build --release --target linux/arm64

  • 自动设置 GOOSGOARCH 环境变量
  • 自动设置 CGO_ENABLED=0 -ldflags="-s -w" -trimpath 标签
  • 输出文件及路径格式:bin/release/linux/arm64/<appName>,Windows 平台自动添加 .exe 后缀

依赖

gocar add

  • 添加一个或多个依赖包
  • 自动执行 go get <package> 并运行 go mod tidy 整理
  • 示例:gocar add github.com/gin-gonic/gin

gocar update

  • 不带参数时更新所有依赖:go get -u
  • 带参数时更新指定依赖:go get -u <package>
  • 自动运行 go mod tidy 清理
  • 示例:gocar updategocar update github.com/gin-gonic/gin

gocar tidy

  • 整理 go.modgo.sum 文件
  • 移除未使用的依赖
  • 示例:gocar tidy

v0.1.0

15 Dec 05:31

Choose a tag to compare

go version