mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
*: over 20 staticcheck fixes
This commit is contained in:
@@ -120,8 +120,8 @@ func (ep *ExpectProcess) ExpectFunc(f func(string) bool) (string, error) {
|
||||
}
|
||||
}
|
||||
ep.mu.Unlock()
|
||||
return "", fmt.Errorf("Match not found."+
|
||||
" Set EXPECT_DEBUG for more info Err: %v, last lines:\n%s\n\n",
|
||||
return "", fmt.Errorf("match not found."+
|
||||
" Set EXPECT_DEBUG for more info Err: %v, last lines:\n%s",
|
||||
ep.err, strings.Join(lastLinesBuffer, ""))
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ func (lo *ListenerOptions) IsSocketOpts() bool {
|
||||
if lo.socketOpts == nil {
|
||||
return false
|
||||
}
|
||||
return lo.socketOpts.ReusePort == true || lo.socketOpts.ReuseAddress == true
|
||||
return lo.socketOpts.ReusePort || lo.socketOpts.ReuseAddress
|
||||
}
|
||||
|
||||
// IsTLS returns true if listner options includes TLSInfo.
|
||||
@@ -44,7 +44,7 @@ func (lo *ListenerOptions) IsTLS() bool {
|
||||
if lo.tlsInfo == nil {
|
||||
return false
|
||||
}
|
||||
return lo.tlsInfo.Empty() == false
|
||||
return !lo.tlsInfo.Empty()
|
||||
}
|
||||
|
||||
// ListenerOption are options which can be applied to the listener.
|
||||
|
||||
@@ -41,5 +41,5 @@ func getControls(sopts *SocketOpts) Controls {
|
||||
}
|
||||
|
||||
func (sopts *SocketOpts) Empty() bool {
|
||||
return sopts.ReuseAddress == false && sopts.ReusePort == false
|
||||
return !sopts.ReuseAddress && !sopts.ReusePort
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user