代码拉取完成,页面将自动刷新
同步操作将从 hyperbench/hyperbench 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# Go parameters
GOCMD=go
PACKR=packr
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGEN=$(GOCMD) generate
GOGET=$(GOCMD) get
GOLIST=$(GOCMD) list
BINARY_NAME=hyperbench
SKIP_DIR=benchmark
# version info
branch=$(shell git rev-parse --abbrev-ref HEAD)
commitID=$(shell git log --pretty=format:"%h" -1)
date=$(shell date +%Y%m%d)
importpath=github.com/hyperbench/hyperbench/cmd
ldflags=-X ${importpath}.branch=${branch} -X ${importpath}.commitID=${commitID} -X ${importpath}.date=${date}
# path
ASSETS=filesystem/assets
DIRS=benchmark
GET=github.com/gobuffalo/packr/v2/... github.com/gobuffalo/packr/v2/packr2
FAILPOINT=github.com/pingcap/failpoint/failpoint-ctl
# export gomodule
export GO111MODULE=on
all: build
## build: build the binary with pre-packed static resource
build: dep assets
@export GOPROXY=https://goproxy.cn,direct
@packr2 build -o $(BINARY_NAME) -trimpath -ldflags "${ldflags}"
@-rm -rf $(ASSETS)
## pack: build the binary with local static resource
pack: assets
@packr2 build -o $(BINARY_NAME) -ldflags "${ldflags}"
@-rm -rf $(ASSETS)
## test: run all test
test:
@go get $(FAILPOINT)
@failpoint-ctl enable
@$(GOTEST) `go list ./... | grep -v $(SKIP_DIR)`
@failpoint-ctl disable
## clean: clean all file generated by make
clean:
@packr2 clean
@-rm -rf $(BINARY_NAME)
@-rm -rf $(ASSETS)
.PHONY: assets
## assets: prepare asserts
assets:
@-rm -rf $(ASSETS)
@mkdir $(ASSETS)
@cp -r $(DIRS) $(ASSETS)
.PHONY: dep
## dep: install the dependencies outside (may need to use proxy to download some packages)
dep:
@go get -u $(GET)
help: Makefile
@echo " Choose a command run in "$(PROJECTNAME)":"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。