mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
Upgrade golangci-lint to 1.19.1
Fix whitespace error. Disable dogsled and godox.
This commit is contained in:
committed by
Sean DuBois
parent
961bcb4e7e
commit
b8eb3d4ec4
+5
-3
@@ -7,11 +7,13 @@ linters-settings:
|
||||
linters:
|
||||
enable-all: true
|
||||
disable:
|
||||
- dogsled
|
||||
- funlen
|
||||
- gochecknoglobals
|
||||
- godox
|
||||
- interfacer
|
||||
- lll
|
||||
- maligned
|
||||
- gochecknoglobals
|
||||
- interfacer
|
||||
- funlen
|
||||
|
||||
issues:
|
||||
exclude-use-default: false
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ env:
|
||||
- GO111MODULE=on
|
||||
|
||||
before_script:
|
||||
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.18.0
|
||||
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.19.1
|
||||
|
||||
script:
|
||||
- golangci-lint run ./...
|
||||
|
||||
@@ -537,7 +537,6 @@ func (a *Agent) initExtIPMapping(config *AgentConfig) error {
|
||||
if !candiHostEnabled {
|
||||
return ErrIneffectiveNAT1To1IPMappingHost
|
||||
}
|
||||
|
||||
} else if a.extIPMapper.candidateType == CandidateTypeServerReflexive {
|
||||
candiSrflxEnabled := false
|
||||
for _, candiType := range a.candidateTypes {
|
||||
@@ -656,7 +655,6 @@ func (a *Agent) setSelectedPair(p *candidatePair) {
|
||||
|
||||
func (a *Agent) pingAllCandidates() {
|
||||
for _, p := range a.checklist {
|
||||
|
||||
if p.state == CandidatePairStateWaiting {
|
||||
p.state = CandidatePairStateInProgress
|
||||
} else if p.state != CandidatePairStateInProgress {
|
||||
@@ -848,7 +846,6 @@ func (a *Agent) resolveAndAddMulticastCandidate(c *CandidateHost) {
|
||||
}); err != nil {
|
||||
a.log.Warnf("Failed to add mDNS candidate %s: %v", c.Address(), err)
|
||||
return
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -657,7 +657,6 @@ func TestInboundValidity(t *testing.T) {
|
||||
|
||||
assert.NoError(t, a.Close())
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
func TestInvalidAgentStarts(t *testing.T) {
|
||||
@@ -1236,7 +1235,6 @@ func TestBindingRequestTimeout(t *testing.T) {
|
||||
// TestAgentCredentials checks if local username fragments and passwords (if set) meet RFC standard
|
||||
// and ensure it's backwards compatible with previous versions of the pion/ice
|
||||
func TestAgentCredentials(t *testing.T) {
|
||||
|
||||
// Make sure to pass travis check by disabling the logs
|
||||
log := logging.NewDefaultLoggerFactory()
|
||||
log.DefaultLogLevel = logging.LogLevelDisabled
|
||||
|
||||
@@ -134,7 +134,6 @@ func handleInboundCandidateMsg(c Candidate, buffer []byte, srcAddr net.Addr, log
|
||||
if _, err := c.agent().buffer.Write(buffer); err != nil {
|
||||
log.Warnf("failed to write packet")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// close stops the recvLoop
|
||||
|
||||
@@ -58,7 +58,6 @@ func (a *Agent) localInterfaces(networkTypes []NetworkType) ([]net.IP, error) {
|
||||
ip = addr.IP
|
||||
case *net.IPAddr:
|
||||
ip = addr.IP
|
||||
|
||||
}
|
||||
if ip == nil || ip.IsLoopback() {
|
||||
continue
|
||||
@@ -363,7 +362,6 @@ func (a *Agent) gatherCandidatesSrflx(urls []*URL, networkTypes []NetworkType) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (a *Agent) gatherCandidatesRelay(urls []*URL) error {
|
||||
|
||||
@@ -117,7 +117,6 @@ func determineNetworkType(network string, ip net.IP) (NetworkType, error) {
|
||||
return NetworkTypeTCP4, nil
|
||||
}
|
||||
return NetworkTypeTCP6, nil
|
||||
|
||||
}
|
||||
|
||||
return NetworkType(0), fmt.Errorf("unable to determine networkType from %s %s", network, ip)
|
||||
|
||||
@@ -66,7 +66,6 @@ func (a *Agent) connect(ctx context.Context, isControlling bool, remoteUfrag, re
|
||||
return &Conn{
|
||||
agent: a,
|
||||
}, nil
|
||||
|
||||
}
|
||||
|
||||
// Read implements the Conn Read method.
|
||||
|
||||
@@ -55,7 +55,6 @@ func testTimeout(t *testing.T, c *Conn, timeout time.Duration) {
|
||||
}
|
||||
}
|
||||
t.Fatalf("Connection failed to time out in time.")
|
||||
|
||||
}
|
||||
|
||||
func TestTimeout(t *testing.T) {
|
||||
@@ -104,7 +103,6 @@ func TestReadClosed(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatalf("Reading from a closed channel should return an error")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func stressDuplex(t *testing.T) {
|
||||
@@ -440,5 +438,4 @@ func TestConnStats(t *testing.T) {
|
||||
// we should never get here.
|
||||
panic(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user