Browse Source

all: revert "all: prefer strings.LastIndexByte over strings.LastIndex"

This reverts https://golang.org/cl/66372.

Updates #22148

Change-Id: I3e94af3dfc11a2883bf28e1d5e1f32f98760b3ee
Reviewed-on: https://go-review.googlesource.com/68431
Reviewed-by: Ian Lance Taylor <iant@golang.org>
tls13
Marvin Stenger 7 years ago
committed by Ian Lance Taylor
parent
commit
8251c0f791
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      handshake_client.go
  2. +1
    -1
      tls.go

+ 1
- 1
handshake_client.go View File

@@ -848,7 +848,7 @@ func hostnameInSNI(name string) string {
if len(host) > 0 && host[0] == '[' && host[len(host)-1] == ']' { if len(host) > 0 && host[0] == '[' && host[len(host)-1] == ']' {
host = host[1 : len(host)-1] host = host[1 : len(host)-1]
} }
if i := strings.LastIndexByte(host, '%'); i > 0 {
if i := strings.LastIndex(host, "%"); i > 0 {
host = host[:i] host = host[:i]
} }
if net.ParseIP(host) != nil { if net.ParseIP(host) != nil {


+ 1
- 1
tls.go View File

@@ -122,7 +122,7 @@ func DialWithDialer(dialer *net.Dialer, network, addr string, config *Config) (*
return nil, err return nil, err
} }


colonPos := strings.LastIndexByte(addr, ':')
colonPos := strings.LastIndex(addr, ":")
if colonPos == -1 { if colonPos == -1 {
colonPos = len(addr) colonPos = len(addr)
} }


Loading…
Cancel
Save