X Tutup
Skip to content

Commit 92609bd

Browse files
committed
Revert "use go-multierror to combine read/write close errors"
This reverts commit 456f438.
1 parent 3ca5cba commit 92609bd

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ require (
1717
github.com/google/go-cmp v0.5.6
1818
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
1919
github.com/gorilla/websocket v1.4.2
20-
github.com/hashicorp/go-multierror v1.0.0
2120
github.com/hashicorp/go-version v1.3.0
2221
github.com/henvic/httpretty v0.0.6
2322
github.com/itchyny/gojq v0.12.6

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,10 @@ github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad
192192
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
193193
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
194194
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
195-
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
196195
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
197196
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
198197
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
199198
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
200-
github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=
201199
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
202200
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
203201
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=

pkg/cmd/codespace/ssh.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"github.com/cli/cli/v2/internal/codespaces/api"
2020
"github.com/cli/cli/v2/pkg/cmdutil"
2121
"github.com/cli/cli/v2/pkg/liveshare"
22-
"github.com/hashicorp/go-multierror"
2322
"github.com/spf13/cobra"
2423
)
2524

@@ -462,12 +461,10 @@ func (crwc *combinedReadWriteCloser) Write(p []byte) (n int, err error) {
462461
}
463462

464463
func (crwc *combinedReadWriteCloser) Close() error {
465-
var errs error
466-
if err := crwc.writer.Close(); err != nil {
467-
errs = multierror.Append(errs, err)
464+
werr := crwc.writer.Close()
465+
rerr := crwc.reader.Close()
466+
if werr != nil {
467+
return werr
468468
}
469-
if err := crwc.reader.Close(); err != nil {
470-
errs = multierror.Append(errs, err)
471-
}
472-
return errs
469+
return rerr
473470
}

0 commit comments

Comments
 (0)
X Tutup