Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade go 1.10 #46

Merged
merged 1 commit into from
Jun 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .gometalinter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"Vendor": true,
"MinConfidence": 0.3,
"DuplThreshold": 100,
"Deadline": "5m",
"LineLength": 150,
"Enable": [
"deadcode",
"dupl",
"errcheck",
"gas",
"goconst",
"gocyclo",
"goimports",
"gofmt",
"golint",
"gotype",
"gotypex",
"ineffassign",
"interfacer",
"lll",
"maligned",
"megacheck",
"misspell",
"nakedret",
"safesql",
"structcheck",
"testify",
"unconvert",
"unparam",
"varcheck",
"vet",
"vetshadow"
]
}
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ language: go
sudo: false

env:
- DEP_VERSION="0.3.2"
- DEP_VERSION="0.4.1"


# Version 1.8 messes up the lint checks for travis
go:
- 1.9
- "1.10"

cache:
directories:
Expand All @@ -18,5 +18,6 @@ install:
- make setup_ci redep

script:
- make build
- make test
- make lint
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
PROFILE_RUN ?= BenchmarkCiruits/Hystrix/Minimal/failing/75
BENCH_RUN ?= .

build:
go build ./...

# Run unit tests
test:
env "GORACE=halt_on_error=1" go test -v -race ./...

build:
go build -t ./...

# Format the code
fix:
find . -iname '*.go' -not -path '*/vendor/*' -print0 | xargs -0 gofmt -s -w
Expand Down Expand Up @@ -36,7 +37,7 @@ profile_blocking:

# Lint the code
lint:
gometalinter --vendor --deadline=5m --enable-all -D lll --dupl-threshold=100 ./...
gometalinter ./...

# Run the example
run:
Expand Down
3 changes: 3 additions & 0 deletions benchmarking/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package benchmarking does not contain used code. Instead, it contains only the
// files required to run benchmarking against other circuits
package benchmarking
2 changes: 1 addition & 1 deletion closers/hystrix/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func ExampleFactory() {
},
// Hystrix close logic is to sleep then check
ConfigureCloser: hystrix.ConfigureCloser{
// The default values match what hystrix does by default
// The default values match what hystrix does by default
},
}
h := circuit.Manager{
Expand Down
1 change: 1 addition & 0 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/cep21/circuit/metrics/rolling"
)

// nolint:lll
const exampleURL = "http://localhost:7979/hystrix-dashboard/monitor/monitor.html?streams=%5B%7B%22name%22%3A%22%22%2C%22stream%22%3A%22http%3A%2F%2Flocalhost%3A8123%2Fhystrix.stream%22%2C%22auth%22%3A%22%22%2C%22delay%22%3A%22%22%7D%5D"

func main() {
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func ExampleConfig_custommetrics() {
config := circuit.Config{
Metrics: circuit.MetricsCollectors{
Run: []circuit.RunMetrics{
// Here is where I would insert my custom metric collector
// Here is where I would insert my custom metric collector
},
},
}
Expand Down
1 change: 1 addition & 0 deletions metriceventstream/metriceventstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ func collectCommandMetrics(cb *circuit.Circuit) *streamCmdMetric {
RollingCountTimeout: builtInRollingCmdMetricCollector.ErrTimeouts.RollingSumAt(now),
// Note: There is no errInterrupt field inside the dashboard, but i still want to expose these metrics there,
// so I just roll them into BadRequests
// nolint: lll
RollingCountBadRequests: builtInRollingCmdMetricCollector.ErrBadRequests.RollingSumAt(now) + builtInRollingCmdMetricCollector.ErrInterrupts.RollingSumAt(now),

TotalCountFallbackSuccess: builtInRollingFallbackMetricCollector.Successes.TotalSum(),
Expand Down