mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
Fixed latest linting issues
This commit is contained in:
parent
e6660e2460
commit
7a6689eb40
13
README.md
13
README.md
@ -84,12 +84,13 @@ Use "yq [command] --help" for more information about a command.
|
||||
```
|
||||
|
||||
## Contribute
|
||||
1. `make [local] vendor`
|
||||
2. add unit tests
|
||||
3. apply changes (use govendor with a preference to [gopkg](https://gopkg.in/) for package dependencies)
|
||||
4. `make [local] build`
|
||||
5. If required, update the user documentation
|
||||
1. `scripts/devtools.sh`
|
||||
2. `make [local] vendor`
|
||||
3. add unit tests
|
||||
4. apply changes (use govendor with a preference to [gopkg](https://gopkg.in/) for package dependencies)
|
||||
5. `make [local] build`
|
||||
6. If required, update the user documentation
|
||||
- Update README.md and/or documentation under the mkdocs folder
|
||||
- `make [local] build-docs`
|
||||
- browse to docs/index.html and check your changes
|
||||
6. profit
|
||||
7. profit
|
||||
|
@ -96,13 +96,11 @@ func writeArray(context interface{}, paths []string, value interface{}) []interf
|
||||
if rawIndex == "+" {
|
||||
index = int64(len(array))
|
||||
} else {
|
||||
index, _ = strconv.ParseInt(rawIndex, 10, 64)
|
||||
index, _ = strconv.ParseInt(rawIndex, 10, 64) // nolint
|
||||
// writeArray is only called by updatedChildValue which handles parsing the
|
||||
// index, as such this renders this dead code.
|
||||
}
|
||||
// writeArray is only called by updatedChildValue which handles parsing the
|
||||
// index, as such this renders this dead code.
|
||||
// if err != nil {
|
||||
// return array, fmt.Errorf("Error accessing array: %v", err)
|
||||
// }
|
||||
|
||||
for index >= int64(len(array)) {
|
||||
array = append(array, nil)
|
||||
}
|
||||
|
4
yq.go
4
yq.go
@ -564,7 +564,7 @@ func safelyRenameFile(from string, to string) {
|
||||
|
||||
// thanks https://stackoverflow.com/questions/21060945/simple-way-to-copy-a-file-in-golang
|
||||
func copyFileContents(src, dst string) (err error) {
|
||||
in, err := os.Open(src)
|
||||
in, err := os.Open(src) // nolint gosec
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -606,7 +606,7 @@ func readStream(filename string, yamlDecoder yamlDecoderFn) error {
|
||||
if filename == "-" {
|
||||
stream = bufio.NewReader(os.Stdin)
|
||||
} else {
|
||||
file, err := os.Open(filename)
|
||||
file, err := os.Open(filename) // nolint gosec
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user