PROJECT_NAME := "test-go"
PKG := "github.com/test-go"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
.DEFAULT_GOAL := default
.PHONY: all dep build clean test lint fmt
all: build
fmt: ## Format the files
@gofmt -l -w $(GO_FILES)
fmtcheck: ## Check and format the files
@gofmt -l -s $(GO_FILES) | read; if [ $$? == 0 ]; then echo "gofmt check failed for:"; gofmt -l -s $(GO_FILES); fi
lint: ## Lint the files
@golint -set_exit_status ${PKG_LIST}
test: ## Run unittests
@go test -short ${PKG_LIST}
race: dep ## Run data race detector
@go test -race -short ${PKG_LIST}
msan: dep ## Run memory sanitizer
@go test -msan -short ${PKG_LIST}
dep: ## Get the dependencies
@go get -v -d ./...
build: dep ## Build the binary file
@go build -i -v $(PKG)
clean: ## Remove previous build
@go mod tidy
@rm -f $(PROJECT_NAME)
version: ## Print git revision info
@echo $(expr substr $(git -rev-parse HEAD) 1 8)
run: ## Build and run the application, eg: make run local => go run main.go --config=config/config-local.toml
@MODE=customer
@ARGs=$(filter-out $@,$(MAKECMDGOALS))
@echo use config/config-"$$MODE".toml
@if [ "$(ARGs)" != "" ]; then \
go run main.go --config=config/config-"$$ARGs".local.toml; \
fi
help: ## Display this help screen
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
default:
@echo default target
相关推荐
Go常用命令.md
ORACLE常用命令 一、ORACLE的启动和关闭 1、在单机环境下 要想启动或关闭ORACLE系统必须首先切换到ORACLE用户,如下 su - oracle a、启动ORACLE系统 oracle>svrmgrl SVRMGR>connect internal SVRMGR>startup ...
AS脚本常用命令 Flash的一些命令 <P>Flash5的Action Script详解 + Basic Actions 能加入到程序中的基本Action - Go to 跳转到指定的帧 - Play 播放 - Stop 停止 - Toggle High Quality 在高画质和低...
HDFS_HBaseShell的常用命令.docx
Appfuse常用命令,方便你快速查阅,let's go.
Xshell的安装下载和常用的命令
Debug常用命令集 名称 解释 格式 a (Assemble) 逐行汇编 a [address] c (Compare) 比较两内存块 c range address d (Dump) 内存16进制显示 d [address]或 d [range] e (Enter) 修改内存字节 e address ...
Go语言自带有一套完整的命令操作工具,你可以通过在命令行中执行go来查看它们: 图1.3 Go命令显示详细的信息 这些命令对于我们平时编写的代码非常有用,接下来就让我们了解一些常用的命令。 go build 这个命令主要...
Docker使用Go语言编写,源代码托管在Docker的GitHub仓库中,但是为了保护版权和隐私,并非所有代码都是公开的。 然而,如果你想要理解Docker命令的工作原理,你可以查看Docker的官方文档、源代码中的注释以及开源...
远程执行命令最常用的方法就是利用SSH协议,将命令发送到远程机器上执行,并获取返回结果。本文将介绍如何使用Go语言实现远程执行命令。下面一起来看看。
go - start application at address 'addr' help - print online help iminfo - print header information for application image imls - list all images found in flash itest - return true/false on integer ...
1.X及以后版本将使用go语言编写 如需要自己编译,可clone本仓库并运行build.sh脚本 安装方法 Mac使用wget https://raw.githubusercontent.com/iuv/xx/master/build/mac/xx下载xx文件 linux使用wget ...
一、数据库常用命令1、Help查看命令提示 代码如下:helpdb.help();db.yourColl.help();db.youColl.find().help();rs.help();2、切换/创建数据库 代码如下:use yourDB; 当创建一个集合(table)的时候会自动创建当前...
目录操作:rm -rf mydir /*删除mydir目录*/cd mydir /*进入mydir目录*/cd – /*回上一级目录*/ cd .. /*回父目录,中间有空格*/cd ~ /*回根目录*/mv tools tool /*把...文件操作:rm go.tar /* 删除go.tar文件 */
入门学习Linux常用必会60个命令实例详解 Linux必学的60个命令 Linux提供了大量的命令,利用它可以有效地完成大量的工作,如磁盘操作、文件存取、目录操作、进程管理、文件权限设定等。所以,在Linux系统上工作离不...
二 常用命令 查看当前的数据库:db 查看所有的数据库:show dbs /show databases 切换数据库:use db_name 删除当前的数据库:db.dropDatabase() 创建集合: 向不存在的集合中第⼀次加⼊数据时, 集合会被创建...
直白的演示go pprof 常用命令以及分析说明,和常见的linux性能分析命令
一、MongoDB 数据库常用操作命令 1、Help查看命令提示 help db.help(); db.yourColl.help(); 2、切换/创建数据库 use raykaeso; 当创建一个集合(table)的时候会自动创建当前数据库 3、查询所有数据库 show dbs; 4...
安装配置go环境window系统使用scoop安装scoop install golang参考 更改go module代理go module常用命令go mod init # 初始化 go.modgo mod tidy # 更新依赖文件go mod download # 下载依赖文件go mod vendor # 将...