Skip to content

Commit f7d11ff

Browse files
author
anahan
committed
Replace go-multierror with multierr to reduce deps count
1 parent c201805 commit f7d11ff

4 files changed

Lines changed: 7 additions & 14 deletions

File tree

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ go 1.20
44

55
require (
66
github.com/FZambia/viper-lite v0.0.0-20220110144934-1899f66c7d0e
7-
github.com/hashicorp/go-multierror v1.1.1
87
github.com/joho/godotenv v1.5.1
98
github.com/mattn/go-isatty v0.0.18
109
github.com/otiai10/copy v1.7.0
@@ -13,6 +12,7 @@ require (
1312
github.com/spf13/pflag v1.0.5
1413
github.com/stretchr/testify v1.8.0
1514
github.com/tomasen/fcgi_client v0.0.0-20180423082037-2bb3d819fd19
15+
go.uber.org/multierr v1.6.0
1616
go.uber.org/zap v1.24.0
1717
golang.org/x/sys v0.6.0
1818
gopkg.in/ini.v1 v1.67.0
@@ -23,7 +23,6 @@ require (
2323
github.com/cespare/xxhash/v2 v2.2.0 // indirect
2424
github.com/davecgh/go-spew v1.1.1 // indirect
2525
github.com/golang/protobuf v1.5.3 // indirect
26-
github.com/hashicorp/errwrap v1.1.0 // indirect
2726
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
2827
github.com/mitchellh/mapstructure v1.5.0 // indirect
2928
github.com/pelletier/go-toml v1.9.5 // indirect
@@ -33,7 +32,6 @@ require (
3332
github.com/spf13/cast v1.5.0 // indirect
3433
github.com/spf13/jwalterweatherman v1.1.0 // indirect
3534
go.uber.org/atomic v1.7.0 // indirect
36-
go.uber.org/multierr v1.6.0 // indirect
3735
google.golang.org/protobuf v1.30.0 // indirect
3836
gopkg.in/yaml.v2 v2.4.0 // indirect
3937
gopkg.in/yaml.v3 v3.0.1 // indirect

go.sum

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg
1616
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
1717
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
1818
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
19-
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
20-
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
21-
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
22-
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
23-
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
2419
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
2520
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
2621
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=

internal/session/cleaner.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"strings"
1111
"time"
1212

13-
"github.com/hashicorp/go-multierror"
1413
"github.com/prometheus/procfs"
14+
"go.uber.org/multierr"
1515
)
1616

1717
/*
@@ -175,11 +175,11 @@ func (c *Cleaner) cleanupForPhpAnsSapi(phpVersion string, sapi sapiInfo) error {
175175

176176
var result error
177177
if err := c.touchOpenFiles(sapi.GetProcName(phpVersion), sessConfig.SavePath); err != nil {
178-
result = multierror.Append(result, err)
178+
result = multierr.Append(result, err)
179179
}
180180

181181
if err := c.removeSessionFiles(sessConfig.SavePath, sessConfig.GcMaxLifetime); err != nil {
182-
result = multierror.Append(result, err)
182+
result = multierr.Append(result, err)
183183
}
184184

185185
return result
@@ -195,7 +195,7 @@ func (c *Cleaner) Cleanup() error {
195195
for _, phpVersion := range phpVersions {
196196
for _, sapi := range sapis {
197197
if err := c.cleanupForPhpAnsSapi(phpVersion, sapi); err != nil {
198-
result = multierror.Append(result, err)
198+
result = multierr.Append(result, err)
199199
}
200200
}
201201
}

pkg/phpfpm/prometeus.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"sync"
55
"time"
66

7-
"github.com/hashicorp/go-multierror"
87
"github.com/prometheus/client_golang/prometheus"
8+
"go.uber.org/multierr"
99
)
1010

1111
const namespace = "phpfpm"
@@ -67,7 +67,7 @@ func (s *stat) UpdateStatuses() error {
6767
for i := range s.statuses {
6868
select {
6969
case err := <-errCh:
70-
result = multierror.Append(result, err)
70+
result = multierr.Append(result, err)
7171
case s.statuses[i] = <-statusCh:
7272
}
7373
}

0 commit comments

Comments
 (0)