prefer-make

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Build with Make

使用Make构建

This project uses a Makefile. Always prefer
make
targets over running
go
commands directly.
本项目使用Makefile。请始终优先使用
make
目标,而非直接运行
go
命令。

Rules

规则

  1. Before running any
    go build
    ,
    go test
    ,
    go run
    ,
    go vet
    ,
    go fmt
    , or
    golangci-lint
    command, check the Makefile for a corresponding target.
  2. Use the Makefile target instead of the raw
    go
    command. For example:
    • make build
      instead of
      go build ./...
    • make test
      instead of
      go test ./...
    • make lint
      instead of
      golangci-lint run
    • make run
      instead of
      go run main.go
    • make fmt
      instead of
      go fmt ./...
  3. If you need to discover available targets, run
    make help
    first. If that fails, read the Makefile directly.
  4. Only fall back to raw
    go
    commands if no relevant Makefile target exists for the task.
  1. 在运行任何
    go build
    go test
    go run
    go vet
    go fmt
    golangci-lint
    命令之前,请先检查Makefile中是否有对应的目标。
  2. 使用Makefile目标替代原生
    go
    命令。例如:
    • make build
      替代
      go build ./...
    • make test
      替代
      go test ./...
    • make lint
      替代
      golangci-lint run
    • make run
      替代
      go run main.go
    • make fmt
      替代
      go fmt ./...
  3. 若需要查看可用目标,请先运行
    make help
    。如果该命令无效,请直接阅读Makefile。
  4. 仅当Makefile中没有对应任务的相关目标时,才退而使用原生
    go
    命令。