mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
pkg: address golangci var-naming issues
Signed-off-by: Ivan Valdes <ivan@vald.es>
This commit is contained in:
@@ -32,7 +32,7 @@ import (
|
||||
"github.com/creack/pty"
|
||||
)
|
||||
|
||||
const DEBUG_LINES_TAIL = 40
|
||||
const debugLinesTail = 40
|
||||
|
||||
var (
|
||||
ErrProcessRunning = fmt.Errorf("process is still running")
|
||||
@@ -218,7 +218,7 @@ func (ep *ExpectProcess) ExpectFunc(ctx context.Context, f func(string) bool) (s
|
||||
}
|
||||
}
|
||||
|
||||
lastLinesIndex := len(ep.lines) - DEBUG_LINES_TAIL
|
||||
lastLinesIndex := len(ep.lines) - debugLinesTail
|
||||
if lastLinesIndex < 0 {
|
||||
lastLinesIndex = 0
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package grpc_testing
|
||||
package grpctesting
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"google.golang.org/grpc/metadata"
|
||||
)
|
||||
|
||||
type GrpcRecorder struct {
|
||||
type GRPCRecorder struct {
|
||||
mux sync.RWMutex
|
||||
requests []RequestInfo
|
||||
}
|
||||
@@ -32,7 +32,7 @@ type RequestInfo struct {
|
||||
Authority string
|
||||
}
|
||||
|
||||
func (ri *GrpcRecorder) UnaryInterceptor() grpc.UnaryServerInterceptor {
|
||||
func (ri *GRPCRecorder) UnaryInterceptor() grpc.UnaryServerInterceptor {
|
||||
return func(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) {
|
||||
ri.record(toRequestInfo(ctx, info))
|
||||
resp, err := handler(ctx, req)
|
||||
@@ -40,7 +40,7 @@ func (ri *GrpcRecorder) UnaryInterceptor() grpc.UnaryServerInterceptor {
|
||||
}
|
||||
}
|
||||
|
||||
func (ri *GrpcRecorder) RecordedRequests() []RequestInfo {
|
||||
func (ri *GRPCRecorder) RecordedRequests() []RequestInfo {
|
||||
ri.mux.RLock()
|
||||
defer ri.mux.RUnlock()
|
||||
reqs := make([]RequestInfo, len(ri.requests))
|
||||
@@ -62,7 +62,7 @@ func toRequestInfo(ctx context.Context, info *grpc.UnaryServerInfo) RequestInfo
|
||||
return req
|
||||
}
|
||||
|
||||
func (ri *GrpcRecorder) record(r RequestInfo) {
|
||||
func (ri *GRPCRecorder) record(r RequestInfo) {
|
||||
ri.mux.Lock()
|
||||
defer ri.mux.Unlock()
|
||||
ri.requests = append(ri.requests, r)
|
||||
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package grpc_testing
|
||||
package grpctesting
|
||||
|
||||
import (
|
||||
"context"
|
||||
Reference in New Issue
Block a user