Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kamilsk/retry
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.0.1
Choose a base ref
...
head repository: kamilsk/retry
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5
Choose a head ref
Loading
Showing with 1,896 additions and 3,762 deletions.
  1. +4 −6 .gitattributes
  2. +0 −5 .github/CODE_OF_CONDUCT.md
  3. +0 −28 .github/CONTRIBUTING.md
  4. 0 .github/ISSUE_TEMPLATE.md
  5. 0 .github/PULL_REQUEST_TEMPLATE.md
  6. +1 −7 .gitignore
  7. +83 −0 .golangci.yml
  8. +0 −49 .goreleaser.yml
  9. +0 −21 .scrutinizer.yml
  10. +45 −38 .travis.yml
  11. +1 −1 LICENSE
  12. +331 −42 Makefile
  13. +68 −156 README.md
  14. +26 −30 backoff/backoff.go
  15. +25 −6 backoff/backoff_test.go
  16. +0 −77 channel.go
  17. +0 −52 channel_test.go
  18. +0 −24 classifier/blacklist.go
  19. +0 −28 classifier/blacklist_test.go
  20. +0 −46 classifier/classifier.go
  21. +0 −20 classifier/classifier_test.go
  22. +0 −37 classifier/functional.go
  23. +0 −64 classifier/functional_test.go
  24. +0 −24 classifier/whitelist.go
  25. +0 −28 classifier/whitelist_test.go
  26. 0 cmd/generate/.gitkeep
  27. +0 −63 cmd/retry/Gopkg.lock
  28. +0 −15 cmd/retry/Gopkg.toml
  29. +0 −64 cmd/retry/Makefile
  30. +0 −242 cmd/retry/README.md
  31. +0 −7 cmd/retry/build.go
  32. +0 −94 cmd/retry/fixtures/usage.golden
  33. +0 −133 cmd/retry/main.go
  34. +0 −19 cmd/retry/main_test.go
  35. +0 −143 cmd/retry/parser.go
  36. +0 −296 cmd/retry/parser_gen.go
  37. +0 −343 cmd/retry/parser_gen_test.go
  38. +0 −215 cmd/retry/parser_test.go
  39. +13 −12 context.go
  40. +145 −13 context_test.go
  41. +7 −0 docs.go
  42. +39 −0 errors.go
  43. +35 −0 errors_test.go
  44. +0 −86 example_db_test.go
  45. +0 −64 example_http_client_test.go
  46. +0 −44 example_retry_with_context_test.go
  47. +0 −86 example_test.go
  48. +91 −0 examples/compare_test.go
  49. +6 −0 examples/docs.go
  50. +7 −0 examples/go.mod
  51. +1 −0 examples/http_test.go
  52. +3 −0 go.mod
  53. +6 −36 jitter/jitter.go
  54. +5 −37 jitter/jitter_test.go
  55. +0 −21 makes/Makefile
  56. +0 −23 makes/README.md
  57. +0 −25 makes/docker.mk
  58. +0 −68 makes/docker/alpine.mk
  59. +0 −149 makes/docker/base.mk
  60. +0 −45 makes/docker/clean.mk
  61. +0 −61 makes/docker/experimental-tools.mk
  62. +0 −97 makes/docker/hugo.mk
  63. +0 −55 makes/docker/tools.mk
  64. +0 −19 makes/env.mk
  65. +0 −120 makes/local.mk
  66. +77 −49 retry.go
  67. +138 −47 retry_test.go
  68. +3 −0 sandbox/docs.go
  69. +76 −0 sandbox/example_test.go
  70. +7 −0 sandbox/go.mod
  71. +64 −0 sandbox/strategy.go
  72. +93 −0 sandbox/strategy_test.go
  73. +72 −55 strategy/strategy.go
  74. +424 −127 strategy/strategy_test.go
10 changes: 4 additions & 6 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
.github export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.goreleaser.yml export-ignore
.golangci.yml export-ignore
.travis.yml export-ignore

/makes/ export-ignore
/Makefile export-ignore

Makefile export-ignore
*.md export-ignore

*_test.go export-ignore
testdata/ export-ignore
5 changes: 0 additions & 5 deletions .github/CODE_OF_CONDUCT.md

This file was deleted.

28 changes: 0 additions & 28 deletions .github/CONTRIBUTING.md

This file was deleted.

Empty file removed .github/ISSUE_TEMPLATE.md
Empty file.
Empty file removed .github/PULL_REQUEST_TEMPLATE.md
Empty file.
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
# dep
vendor/

# goreleaser
/dist/

# go test and code quality report
# code coverage and quality reports
*.out
83 changes: 83 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
linters:
fast: true
fetch: >
curl -s https://golangci-lint.run/usage/linters/ \
| pup ':parent-of(#enabled-by-default-linters)' \
| pup 'ul li a json{}' \
| jq '.[] | (.text + " " + .href)' \
| sed 's/"//g' \
| column -t
enable:
- deadcode # https://github.com/remyoudompheng/go-misc/tree/master/deadcode
- errcheck # https://github.com/kisielk/errcheck
- gosimple # https://github.com/dominikh/go-tools/tree/master/simple
- govet # https://golang.org/cmd/vet/
- ineffassign # https://github.com/gordonklaus/ineffassign
- staticcheck # https://staticcheck.io/
- structcheck # https://github.com/opennota/check
- typecheck # -
- unused # https://github.com/dominikh/go-tools/tree/master/unused
- varcheck # https://github.com/opennota/check

- bodyclose # https://github.com/timakin/bodyclose
- exhaustive # https://github.com/nishanths/exhaustive
- exportloopref # https://github.com/kyoh86/exportloopref
- gocritic # https://github.com/go-critic/go-critic
- noctx # https://github.com/sonatard/noctx

# - asciicheck # https://github.com/tdakkota/asciicheck
# - cyclop # https://github.com/bkielbasa/cyclop
# - depguard # https://github.com/OpenPeeDeeP/depguard
# - dogsled # https://github.com/alexkohler/dogsled
# - dupl # https://github.com/mibk/dupl
# - durationcheck # https://github.com/charithe/durationcheck
# - errorlint # https://github.com/polyfloyd/go-errorlint
# - exhaustivestruct # https://github.com/mbilski/exhaustivestruct
# - forbidigo # https://github.com/ashanbrown/forbidigo
# - funlen # https://github.com/ultraware/funlen
# - gci # https://github.com/daixiang0/gci
# - gochecknoglobals # https://github.com/leighmcculloch/gochecknoglobals
# - gochecknoinits # https://github.com/leighmcculloch/gochecknoinits
# - gocognit # https://github.com/uudashr/gocognit
# - goconst # https://github.com/jgautheron/goconst
# - gocyclo # https://github.com/fzipp/gocyclo
# - godot # https://github.com/tetafro/godot
# - godox # https://github.com/matoous/godox
# - goerr113 # https://github.com/Djarvur/go-err113
# - gofmt # https://golang.org/cmd/gofmt/
# - gofumpt # https://github.com/mvdan/gofumpt
# - goheader # https://github.com/denis-tingajkin/go-header
# - goimports # https://godoc.org/golang.org/x/tools/cmd/goimports
# - golint # https://github.com/golang/lint
# - gomnd # https://github.com/tommy-muehle/go-mnd
# - gomodguard # https://github.com/ryancurrah/gomodguard
# - goprintffuncname # https://github.com/jirfag/go-printf-func-name
# - gosec # https://github.com/securego/gosec
# - ifshort # https://github.com/esimonov/ifshort
# - interfacer # https://github.com/mvdan/interfacer
# - lll # https://github.com/walle/lll
# - makezero # https://github.com/ashanbrown/makezero
# - maligned # https://github.com/mdempsky/maligned
# - misspell # https://github.com/client9/misspell
# - nakedret # https://github.com/alexkohler/nakedret
# - nestif # https://github.com/nakabonne/nestif
# - nlreturn # https://github.com/ssgreg/nlreturn
# - nolintlint # https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint/README.md
# - paralleltest # https://github.com/kunwardeep/paralleltest
# - prealloc # https://github.com/alexkohler/prealloc
# - predeclared # https://github.com/nishanths/predeclared
# - revive # https://github.com/mgechev/revive
# - rowserrcheck # https://github.com/jingyugao/rowserrcheck
# - scopelint # https://github.com/kyoh86/scopelint
# - sqlclosecheck # https://github.com/ryanrolds/sqlclosecheck
# - stylecheck # https://github.com/dominikh/go-tools/tree/master/stylecheck
# - testpackage # https://github.com/maratori/testpackage
# - thelper # https://github.com/kulti/thelper
# - tparallel # https://github.com/moricho/tparallel
# - unconvert # https://github.com/mdempsky/unconvert
# - unparam # https://github.com/mvdan/unparam
# - whitespace # https://github.com/ultraware/whitespace
# - wrapcheck # https://github.com/tomarrell/wrapcheck
# - wsl # https://github.com/bombsimon/wsl

# - https://github.com/kyoh86/looppointer
49 changes: 0 additions & 49 deletions .goreleaser.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .scrutinizer.yml

This file was deleted.

83 changes: 45 additions & 38 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,54 @@
language: go
os: linux

go:
- master
- 1.x
- 1.5.x
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
- 1.10.x

matrix:
allow_failures:
- go: master
fast_finish: true

sudo: false
cache:
directories:
- "$HOME/.cache/go-build"
- "$HOME/gopath/pkg/mod"

before_install:
- export DEP_VERSION=0.4.1
- export GO_TEST_COVERAGE_FILENAME='coverage.out'
- export GO15VENDOREXPERIMENT=1
env:
global:
- CODECLIMATE=https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
- GO111MODULE=on

- wget -q -O dep https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64
- chmod +x dep && mv dep "${GOPATH}"/bin
- go get github.com/mattn/goveralls
go:
- master
- 1.x
- 1.11.x
- 1.12.x
- 1.13.x
- 1.14.x
- 1.15.x
- 1.16.x

jobs:
allow_failures:
- go: master

install:
- make cmd-deps-local
before_script:
- make env deps-fetch
- |
if [[ $TRAVIS_GO_VERSION == 1.16* ]]; then
curl -sL $CODECLIMATE > /home/travis/gopath/bin/cc-test-reporter
chmod +x /home/travis/gopath/bin/cc-test-reporter
cc-test-reporter before-build
fi
script:
- make test-with-coverage-profile ARGS='-timeout=1s'

after_success:
- goveralls -service=travis-ci -coverprofile="${GO_TEST_COVERAGE_FILENAME}"
- echo $TRAVIS_GO_VERSION ":" $TRAVIS_TAG
- if [[ $TRAVIS_GO_VERSION == 1.10* ]] && [ -n "$TRAVIS_TAG" ]; then curl -sL https://git.io/goreleaser | bash; fi
- |
if [[ $TRAVIS_GO_VERSION == 1.16* ]]; then
make test-with-coverage
else
make test
fi
after_script:
- |
if [[ $TRAVIS_GO_VERSION == 1.16* ]]; then
sed -i "s|$(go list -m)/||g" c.out # https://github.com/codeclimate/test-reporter/issues/378
cc-test-reporter after-build -t gocov -p $(go list -m) --exit-code $TRAVIS_TEST_RESULT
fi
notifications:
slack: octolab:1eMS7IqOArBipiu31jYVd0cN
webhooks:
urls:
- https://webhooks.gitter.im/e/63f69d732d88862909a2
on_success: change
on_failure: always
on_start: never
slack:
secure: AqvMXaBd3jFtnmIzZKYHfXkHTad5zeVilUhkPzAVURGLGXfTuR2daQnuAeMcHb9H2HXIoU32TIjDBmlB360FmSZz4HufWdy28l/pSyxyRckI60bihV+Kk4C8/JrT/LhrKr7+KdrCo7MuW1PhchhI5MdVi9ibzIbh/m7PVswS5ujBfx3SbmefQZqa6qbESBUFY9eCJxL/eLdGCjTyWCGdWACoCyIpEZswtaHXB4WYjR0k556agMCpA0d1aKeWb8j1yYEn26evGIEB7tpI725ktVbPRSbtreFO22ZGXjkzUNwkIb1W2cQI6cunY6eYtXtX6/VY3mN8VDPRypxOIvgkakqepVCQKjNrkOEva9J/uQ67HMc5oZ4xU2YuCZSq54q3wA5JXghQ7F+tQkziOB10JY5nScNqGGEz0fka8JdAniqBsUyYjKNGbMHi6ufWH6MYkZuwditTNyuJNIxAtoAdod6b0WGFqadijlIx+36H/Y5D7Mdf7hLDGE7E7qBLR/OwM9M9cQ3To647TPnexM/N8xGZEfVNtrXdRmWGIBe1n8E4SyMVVqsJiADai6DmloVxP09dGI4uFEdnSNFzWW3hpO1SUq83iN9NnQ8fcEaRcWiaj40yMThZn3A5StmyJp9LcH3zla05LoN4woeTZyp2TtJPZ6mKhYQG5y4zqsw9krQ=
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 OctoLab, https://www.octolab.org/ <feedback@octolab.org>
Copyright (c) 2021 OctoLab, https://www.octolab.org/ <copyright@octolab.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Loading