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

chore: Use error equals instead of strings.Contains #2636

Merged
merged 1 commit into from
Apr 9, 2020
Merged

chore: Use error equals instead of strings.Contains #2636

merged 1 commit into from
Apr 9, 2020

Conversation

juchaosong
Copy link
Contributor

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I have written unit and/or e2e tests for my change. PRs without these are unlike to be merged.
  • Optional. I've added My organization is added to the USERS.md.
  • I've signed the CLA and required builds are green.

@CLAassistant
Copy link

CLAassistant commented Apr 8, 2020

CLA assistant check)
All committers have signed the CLA.

@juchaosong juchaosong changed the title chor: Use error equals instead of strings.Contains chore: Use error equals instead of strings.Contains Apr 8, 2020
@alexec
Copy link
Contributor

alexec commented Apr 8, 2020

Can I please ask what this fixes?

@juchaosong
Copy link
Contributor Author

I think it's more readable.
I do the same thing like argo archive. When I read argo source code, I wonder why it uses strings.Contains(err.Error(), "no more rows") to determine if there is no record that meets the conditions. And I find in db.v3 used in argo, when there's no records, it will raise db.ErrNoMoreRows. So in my code, I use db.ErrNoMoreRows instead of strings.Contains(). I think it's more readable for user who use and develop argo.

@codecov
Copy link

codecov bot commented Apr 9, 2020

Codecov Report

Merging #2636 into master will not change coverage by %.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2636   +/-   ##
=======================================
  Coverage   11.16%   11.16%           
=======================================
  Files          83       83           
  Lines       32673    32673           
=======================================
  Hits         3649     3649           
  Misses      28525    28525           
  Partials      499      499           
Impacted Files Coverage Δ
persist/sqldb/workflow_archive.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c29e05...57931b5. Read the comment docs.

@alexec alexec merged commit 0a3b159 into argoproj:master Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants