1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-02-03 13:11:53 +02:00

run golangci-lint in all directories with go.mod (#138)

* Run golangci-lint in all directories with go.mod

* Imports fix by golangci-lint

* Propagate failures from commands running in loops
This commit is contained in:
Krzesimir Nowak 2019-09-25 18:38:55 +02:00 committed by rghetia
parent 339ca2d974
commit 908b73d792
2 changed files with 8 additions and 4 deletions

View File

@ -32,9 +32,13 @@ $(TOOLS_DIR)/stringer: go.mod go.sum tools.go
precommit: $(TOOLS_DIR)/golangci-lint $(TOOLS_DIR)/misspell $(TOOLS_DIR)/stringer
PATH="$(abspath $(TOOLS_DIR)):$${PATH}" go generate ./...
$(TOOLS_DIR)/golangci-lint run --fix # TODO: Fix this on windows.
# TODO: Fix this on windows.
set -e; for dir in $(ALL_GO_MOD_DIRS); do \
echo "golangci-lint in $${dir}"; \
(cd "$${dir}" && $(abspath $(TOOLS_DIR))/golangci-lint run --fix); \
done
$(TOOLS_DIR)/misspell -w $(ALL_DOCS)
for dir in $(ALL_GO_MOD_DIRS); do \
set -e; for dir in $(ALL_GO_MOD_DIRS); do \
echo "go mod tidy in $${dir}"; \
(cd "$${dir}" && go mod tidy); \
done
@ -67,7 +71,7 @@ test-386:
.PHONY: examples
examples:
@for ex in $(EXAMPLES); do \
@set -e; for ex in $(EXAMPLES); do \
echo "Building $${ex}"; \
(cd "$${ex}" && go build .); \
done

View File

@ -17,7 +17,6 @@ package main
import (
"context"
"fmt"
"go.opentelemetry.io/plugin/httptrace"
"io/ioutil"
"net/http"
@ -26,6 +25,7 @@ import (
"go.opentelemetry.io/api/key"
"go.opentelemetry.io/api/tag"
"go.opentelemetry.io/api/trace"
"go.opentelemetry.io/plugin/httptrace"
)
var (