From ad972531fea1cc19b2e04a18f05136dc4d729aec Mon Sep 17 00:00:00 2001 From: Kamil Samigullin Date: Sat, 17 Aug 2019 23:06:31 +0300 Subject: [PATCH] update ci config --- .travis.yml | 1 + Makefile | 18 +++++------------- caller.go | 8 ++++---- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4a4c4b4..1870b60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ env: global: - CODECLIMATE=https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 - GO111MODULE=on + - GOFLAGS=-mod=vendor go: - master diff --git a/Makefile b/Makefile index 465197f..8ce9827 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ SHELL = /bin/bash -euo pipefail -PKGS = go list ./... | grep -v vendor +PKGS = $(shell go list ./... | grep -v vendor) GO111MODULE = on GOFLAGS = -mod=vendor TIMEOUT = 1s @@ -23,7 +23,7 @@ format: .PHONY: generate generate: - @go generate ./... + @go generate $(PKGS) .PHONY: refresh refresh: generate format @@ -31,20 +31,12 @@ refresh: generate format .PHONY: test test: - @go test -race -timeout $(TIMEOUT) ./... + @go test -race -timeout $(TIMEOUT) $(PKGS) .PHONY: test-with-coverage test-with-coverage: - @go test -cover -timeout $(TIMEOUT) ./... | column -t | sort -r + @go test -cover -timeout $(TIMEOUT) $(PKGS) | column -t | sort -r .PHONY: test-with-coverage-profile test-with-coverage-profile: - @go test -cover -covermode count -coverprofile c.out -timeout $(TIMEOUT) ./... - - -.PHONY: sync -sync: - @git stash && git pull --rebase && git stash pop || true - -.PHONY: upgrade -upgrade: sync update deps refresh test-with-coverage + @go test -cover -covermode count -coverprofile c.out -timeout $(TIMEOUT) $(PKGS) diff --git a/caller.go b/caller.go index ac2b0fe..d44b882 100644 --- a/caller.go +++ b/caller.go @@ -20,8 +20,8 @@ func Caller(skip int) CallerInfo { // CallerInfo holds information about a caller. type CallerInfo struct { - Entry uintptr - Name string - File string - Line int + Entry uintptr // the entry address of the function + Name string // the name of the function + File string // the file name and + Line int // line number of the source code of the function }