Skip to content

Commit

Permalink
run golangci-lint in all directories with go.mod (open-telemetry#138)
Browse files Browse the repository at this point in the history
* Run golangci-lint in all directories with go.mod

* Imports fix by golangci-lint

* Propagate failures from commands running in loops
  • Loading branch information
krnowak authored and rghetia committed Sep 25, 2019
1 parent 339ca2d commit 908b73d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/http/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package main
import (
"context"
"fmt"
"go.opentelemetry.io/plugin/httptrace"
"io/ioutil"
"net/http"

Expand All @@ -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 (
Expand Down

0 comments on commit 908b73d

Please sign in to comment.