提交 b73f5f18 编写于 作者: M Mislav Marohnić

Merge branch 'go-113'

......@@ -5,6 +5,7 @@ before_install:
- export PATH=~/bin:"$PATH"
language: go
go:
- 1.13.x
- 1.12.x
- 1.11.x
- 1.10.x
......
......@@ -3,12 +3,12 @@ SOURCE_DATE_EPOCH ?= $(shell date +%s)
BUILD_DATE = $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" '+%d %b %Y' 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" '+%d %b %Y')
HUB_VERSION = $(shell bin/hub version | tail -1)
FLAGS_ALL = $(shell go version | grep -q 'go1.[89]' || echo 'all=')
export MOD_VENDOR_ARG := $(shell go version | grep -q 'go1.1[^01]' && echo '-mod=vendor')
export GOFLAGS := $(shell go version | grep -q 'go1.1[^0]' && echo '-mod=vendor')
export LDFLAGS := -extldflags '$(LDFLAGS)'
export GCFLAGS := $(FLAGS_ALL)-trimpath '$(PWD)'
export ASMFLAGS := $(FLAGS_ALL)-trimpath '$(PWD)'
ifneq ($(MOD_VENDOR_ARG),)
ifneq ($(GOFLAGS),)
export GO111MODULE=on
unexport GOPATH
endif
......@@ -52,7 +52,7 @@ bin/hub: $(SOURCES)
script/build -o $@
bin/md2roff: $(SOURCES)
go build $(MOD_VENDOR_ARG) -o $@ github.com/github/hub/md2roff-bin
go build -o $@ github.com/github/hub/md2roff-bin
test:
go test ./...
......
......@@ -14,7 +14,6 @@ find_source_files() {
build_hub() {
mkdir -p "$(dirname "$1")"
go build \
$MOD_VENDOR_ARG \
-ldflags "-X github.com/github/hub/version.Version=`./script/version` $LDFLAGS" \
-gcflags "$GCFLAGS" \
-asmflags "$ASMFLAGS" \
......
......@@ -33,7 +33,8 @@ trap "exit 1" INT
check_formatting() {
[[ "$(go version)" != *" go1.8."* ]] || return 0
make fmt >/dev/null
gofmt -l -w . >/dev/null
git checkout -- vendor
if ! git diff -U1 --exit-code; then
echo
echo "Some go code was not formatted properly." >&2
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册