Skip to content

Commit

Permalink
remove more lingering linter issues - this is bizzarre, i didnt see t…
Browse files Browse the repository at this point in the history
…hem the last time i pushed
  • Loading branch information
arvindbr8 committed Aug 30, 2024
1 parent 25ade27 commit 278b5a4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
6 changes: 5 additions & 1 deletion balancer/grpclb/grpclb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1640,8 +1640,12 @@ func (s) TestGRPCLBStatsQuashEmpty(t *testing.T) {
// Success.
}
go func() {
for range ch {
for {
// Drain statsChan until it is closed.
_, ok := <-ch
if !ok {
break
}
}
}()
}, &rpcStats{
Expand Down
5 changes: 4 additions & 1 deletion clientconn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,10 @@ func (ccw *stateRecordingCCWrapper) NewSubConn(addrs []resolver.Address, opts ba
// accepted in a timely fashion.
func keepReading(conn net.Conn) {
buf := make([]byte, 1024)
for _, err := conn.Read(buf); err == nil; _, err = conn.Read(buf) {
for _, err := conn.Read(buf); ; _, err = conn.Read(buf) {
if err != nil {
break
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions internal/channelz/socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,13 @@ type EphemeralSocketMetrics struct {
type SocketType string

const (
// SocketTypeNormal is used to connect to a remote server.
SocketTypeNormal = "NormalSocket"
// SocketTypeListen is used to accept connections from remote servers.
SocketTypeListen = "ListenSocket"
)

// Socket is a channelz entry representing a socket.
type Socket struct {
Entity
SocketType SocketType
Expand Down
5 changes: 4 additions & 1 deletion test/clientconn_state_transition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,10 @@ func (ccw *stateRecordingCCWrapper) NewSubConn(addrs []resolver.Address, opts ba
// accepted in a timely fashion.
func keepReading(conn net.Conn) {
buf := make([]byte, 1024)
for _, err := conn.Read(buf); err == nil; _, err = conn.Read(buf) {
for _, err := conn.Read(buf); ; _, err = conn.Read(buf) {
if err != nil {
break
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions xds/internal/httpfilter/rbac/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ func (builder) ParseFilterConfigOverride(override proto.Message) (httpfilter.Fil
if override == nil {
return nil, fmt.Errorf("rbac: nil configuration message provided")
}
any, ok := override.(*anypb.Any)
om, ok := override.(*anypb.Any)
if !ok {
return nil, fmt.Errorf("rbac: error parsing override config %v: unknown type %T", override, override)
}
msg := new(rpb.RBACPerRoute)
if err := any.UnmarshalTo(msg); err != nil {
if err := om.UnmarshalTo(msg); err != nil {
return nil, fmt.Errorf("rbac: error parsing override config %v: %v", override, err)
}
return parseConfig(msg.Rbac)
Expand Down

0 comments on commit 278b5a4

Please sign in to comment.