Skip to content

Commit a7655ff

Browse files
author
1911860538
committed
net/http: use reflect.TypeAssert
1 parent 45eee55 commit a7655ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net/http/transport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ func (t *Transport) onceSetNextProtoDefaults() {
413413
altProto, _ := t.altProto.Load().(map[string]RoundTripper)
414414
if rv := reflect.ValueOf(altProto["https"]); rv.IsValid() && rv.Type().Kind() == reflect.Struct && rv.Type().NumField() == 1 {
415415
if v := rv.Field(0); v.CanInterface() {
416-
if h2i, ok := v.Interface().(h2Transport); ok {
416+
if h2i, ok := reflect.TypeAssert[h2Transport](v); ok {
417417
t.h2transport = h2i
418418
return
419419
}

0 commit comments

Comments
 (0)