-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.gocar.toml
More file actions
81 lines (66 loc) · 2.13 KB
/
Copy pathexample.gocar.toml
File metadata and controls
81 lines (66 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# gocar 项目配置文件
# 文档: https://github.com/uselibrary/gocar
# 项目配置
[project]
# 项目名称,留空则使用目录名
name = "gocar"
# 项目版本号
version = "0.2.0"
# 构建配置
[build]
# 构建入口路径 (相对于项目根目录)
# standard 布局默认为 "cmd/<appName>"
entry = "cmd/gocar"
# 输出目录
output = "bin"
# 额外的 ldflags,会追加到 profile 的 ldflags 之后
# 例如: "-X main.version=1.0.0"
# ldflags = ""
# 构建标签
# tags = ["jsoniter", "sonic"]
# 额外的环境变量
# extra_env = ["GOPROXY=https://goproxy.cn"]
# 运行配置
[run]
# 运行入口路径,留空则使用 build.entry
entry = ""
# 默认运行参数
# args = ["-config", "config.yaml"]
# Debug 构建配置
# 使用: gocar build (默认)
[profile.debug]
# ldflags = "" # Debug 默认无 ldflags
# gcflags = "all=-N -l" # 禁用优化,方便调试
# trimpath = false # 保留路径信息
# cgo_enabled = true # 跟随系统默认
# race = false # 竞态检测 (会显著降低性能)
# Release 构建配置
# 使用: gocar build --release
[profile.release]
ldflags = "-s -w" # 裁剪符号表和调试信息
# gcflags = "" # 编译器参数
trimpath = true # 移除编译路径信息
cgo_enabled = false # 禁用 CGO 以生成静态二进制
# race = false # 竞态检测
# 自定义构建配置
# 使用: gocar build --profile ci
# [profile.ci]
# trimpath = true
# race = true
# 自定义命令
# 格式: 命令名 = "要执行的 shell 命令"
# 使用: gocar <命令名>
# 命令会在项目根目录下执行
#
# 自定义命令可以覆盖以下内置命令: build, run, clean, fmt, vet, add, update, tidy, test, check, commands, doctor
# 保护命令 (new, init) 不可被覆盖
[commands]
# lint = "golangci-lint run"
# doc = "godoc -http=:6060"
# proto = "protoc --go_out=. --go-grpc_out=. ./proto/*.proto"
# 覆盖内置命令示例 (取消注释以启用):
# build = "make build"
# run = "docker-compose up"
# clean = "make clean && rm -rf dist/"
# 自定义测试命令
hello = "echo 'Hello from gocar custom command!'"