Skip to content

Commit

Permalink
quic: rename side type to connSide
Browse files Browse the repository at this point in the history
The clearest name for vars of this type is often "side",
so make the type name distinct to avoid conflicts.

For golang/go#58547

Change-Id: I35fda7ae70e54cd063bae7a83bcb2c8f5f76244f
Reviewed-on: https://go-review.googlesource.com/c/net/+/501375
Reviewed-by: Jonathan Amsterdam <[email protected]>
Run-TryBot: Damien Neil <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
neild committed Jun 21, 2023
1 parent 508a573 commit ab184e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/quic/quic.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ const (
// https://www.rfc-editor.org/rfc/rfc9002.html#section-6.1.2-6
const timerGranularity = 1 * time.Millisecond

// A side distinguishes between the client and server sides of a connection.
type side int8
// A connSide distinguishes between the client and server sides of a connection.
type connSide int8

const (
clientSide = side(iota)
clientSide = connSide(iota)
serverSide
)

func (s side) String() string {
func (s connSide) String() string {
switch s {
case clientSide:
return "client"
Expand Down Expand Up @@ -118,7 +118,7 @@ const (
dirStreamBitMask = 0x2
)

func newStreamID(initiator side, typ streamType, num int64) streamID {
func newStreamID(initiator connSide, typ streamType, num int64) streamID {
id := streamID(num << 2)
if typ == uniStream {
id |= uniStreamBit
Expand All @@ -129,7 +129,7 @@ func newStreamID(initiator side, typ streamType, num int64) streamID {
return id
}

func (s streamID) initiator() side {
func (s streamID) initiator() connSide {
if s&initiatorStreamBitMask == serverInitiatedStreamBit {
return serverSide
}
Expand Down

0 comments on commit ab184e6

Please sign in to comment.