mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Fixed bug risk and antipattern using deepsource (#904)
## Description Hi 👋 I ran the [DeepSource](https://deepsource.io/) static analyzer on the forked copy of this repo and found some [interesting code quality issues](https://deepsource.io/gh/ankitdobhal/goreplay/issues/). This PR fixes a few of them. ## Summary of Fixes - Added .deepsource.toml to fix bug risks - Empty string test can be improved - Nested if can be replaced with else-if ## Type of change - [✔] Antipattern - [ ] New feature (non-breaking change which adds functionality) ## Checklist: - [✔] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation
This commit is contained in:
+2
-3
@@ -162,11 +162,10 @@ func (i *FileInput) init() (err error) {
|
||||
for _, c := range resp.Contents {
|
||||
matches = append(matches, "s3://"+bucket+"/"+(*c.Key))
|
||||
}
|
||||
} else {
|
||||
if matches, err = filepath.Glob(i.path); err != nil {
|
||||
} else if matches, err = filepath.Glob(i.path); err != nil{
|
||||
Debug(0, "[INPUT-FILE] Wrong file pattern", i.path, err)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(matches) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user