10000 Fix: gocritic linting prefers ReplaceAll by mattmc3 · Pull Request #374 · getantibody/antibody · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 27, 2022. It is now read-only.

Fix: gocritic linting prefers ReplaceAll #374

Merged
merged 1 commit into from
Sep 7, 2020
Merged

Fix: gocritic linting prefers ReplaceAll #374

merged 1 commit into from
Sep 7, 2020

Conversation

mattmc3
Copy link
Contributor
@mattmc3 mattmc3 commented Sep 7, 2020

If applied, this commit will...
Replace all calls to strings.Replace with strings.ReplaceAll when the the final parameter is -1, per the gocritic linter output:

bundle/bundle.go:48:11: wrapperFunc: use strings.ReplaceAll method in strings.Replace(part, "kind:", "", -1) (gocritic)
return strings.Replace(part, "kind:", "", -1)
^
project/git.go:53:14: wrapperFunc: use strings.ReplaceAll method in strings.Replace(part, branchMarker, "", -1) (gocritic)
version = strings.Replace(part, branchMarker, "", -1)
^
project/git.go:56:12: wrapperFunc: use strings.ReplaceAll method in strings.Replace(part, pathMarker, "", -1) (gocritic)
inner = strings.Replace(part, pathMarker, "", -1)
^
project/git.go:152:9: wrapperFunc: use strings.ReplaceAll method in strings.Replace(string(rev), "\n", "", -1) (gocritic)
return strings.Replace(string(rev), "\n", "", -1), err
^
project/git.go:160:9: wrapperFunc: use strings.ReplaceAll method in strings.Replace(string(branch), "\n", "", -1) (gocritic)
return strings.Replace(string(branch), "\n", "", -1), err
^
make: *** [lint] Error 1

Why is this change being made?

CI broke.

Provide links to any relevant tickets, URLs or other resources

go-critic/go-critic#872

@codecov-commenter
Copy link

Codecov Report

Merging #374 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #374   +/-   ##
=======================================
  Coverage   72.00%   72.00%           
=======================================
  Files          12       12           
  Lines         325      325           
=======================================
  Hits          234      234           
  Misses         80       80           
  Partials       11       11           
Impacted Files Coverage Δ
bundle/bundle.go 88.88% <100.00%> (ø)
bundle/clone.go 100.00% <100.00%> (ø)
project/git.go 92.55% <100.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 1bbc4db...ea69a0b. Read the comment docs.

@caarlos0 caarlos0 merged commit fb3728e into getantibody:master Sep 7, 2020
@caarlos0
Copy link
Member
caarlos0 commented Sep 7, 2020

Thannks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0