linting
This commit is contained in:
@@ -15,6 +15,7 @@ func CloseFile(logger mlogger.Logger, file *os.File) {
|
||||
}
|
||||
|
||||
func ReadFile(logger mlogger.Logger, filePath string) ([]byte, error) {
|
||||
//nolint:gosec // Read path is provided by trusted caller configuration.
|
||||
file, err := os.Open(filePath)
|
||||
if err != nil {
|
||||
logger.Warn("Failed to open file", zap.String("path", filePath), zap.Error(err))
|
||||
|
||||
@@ -49,7 +49,11 @@ func SendAPIRequest(ctx context.Context, logger mlogger.Logger, httpMethod api.H
|
||||
logger.Warn("Failed to execute request", zap.Error(err), zap.String("method", method), zap.String("url", url), zap.Any("payload", payload))
|
||||
return err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer func() {
|
||||
if closeErr := resp.Body.Close(); closeErr != nil {
|
||||
logger.Warn("Failed to close response body", zap.Error(closeErr), zap.String("method", method), zap.String("url", url))
|
||||
}
|
||||
}()
|
||||
|
||||
// Read the sresponse body
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
// Returns the reordered slice with updated indices, or an error if indices are invalid
|
||||
func IndexableRefs(items []model.IndexableRef, oldIndex, newIndex int) ([]model.IndexableRef, error) {
|
||||
// Find the item to reorder
|
||||
var targetIndex int = -1
|
||||
targetIndex := -1
|
||||
for i, item := range items {
|
||||
if item.Index == oldIndex {
|
||||
targetIndex = i
|
||||
|
||||
Reference in New Issue
Block a user