Skip to content

Commit 1bc10be

Browse files
committed
chore: remove ErrorArray class
1 parent 275fe9d commit 1bc10be

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ Desktop.ini
5656

5757
mirroring.json
5858
go.sum
59+
republisher.sh
60+
61+
# Reports files
5962
sonar-project.properties
6063
unit-tests.xml
6164
coverage.out
62-
republisher.sh
65+
.scannerwork/

cmd/main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88

99
"gitlab-sync/internal/mirroring"
1010
"gitlab-sync/internal/utils"
11-
"gitlab-sync/pkg/helpers"
1211

1312
"github.com/spf13/cobra"
1413
"go.uber.org/zap"
@@ -59,14 +58,14 @@ func main() {
5958
zap.L().Debug("Parsing mirror mapping file")
6059
mapping, mappingErrors := utils.OpenMirrorMapping(mirrorMappingPath)
6160
if mappingErrors != nil {
62-
zap.L().Fatal("Error opening mirror mapping file", zap.Array("errors", helpers.ErrorArray(mappingErrors)))
61+
zap.L().Fatal("Error opening mirror mapping file", zap.Errors("errors", mappingErrors))
6362
}
6463
zap.L().Debug("Mirror mapping file parsed successfully")
6564
args.MirrorMapping = mapping
6665

6766
mirroringErrors := mirroring.MirrorGitlabs(&args)
6867
if mirroringErrors != nil {
69-
zap.L().Error("Error during mirroring process", zap.Array("errors", helpers.ErrorArray(mirroringErrors)))
68+
zap.L().Error("Error during mirroring process", zap.Errors("errors", mirroringErrors))
7069
}
7170
zap.L().Info("Mirroring completed")
7271
},

pkg/helpers/concurrency_manager.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package helpers
22

33
import (
44
"fmt"
5-
6-
"go.uber.org/zap/zapcore"
75
)
86

97
// MergeErrors collects any number of errors from various inputs:
@@ -74,14 +72,3 @@ func MergeErrors(input any) []error {
7472
}
7573
return merged
7674
}
77-
78-
type ErrorArray []error
79-
80-
func (ea ErrorArray) MarshalLogArray(enc zapcore.ArrayEncoder) error {
81-
for _, err := range ea {
82-
if err != nil {
83-
enc.AppendString(err.Error())
84-
}
85-
}
86-
return nil
87-
}

0 commit comments

Comments
 (0)