mirror of https://github.com/status-im/consul.git
ci: Add ineffsign linter
And fix an additional ineffective assignment that was not caught by staticcheck
This commit is contained in:
parent
cb050b280c
commit
d345cd8d30
|
@ -5,6 +5,7 @@ linters:
|
||||||
- govet
|
- govet
|
||||||
- unconvert
|
- unconvert
|
||||||
- staticcheck
|
- staticcheck
|
||||||
|
- ineffassign
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
# Disable the default exclude list so that all excludes are explicitly
|
# Disable the default exclude list so that all excludes are explicitly
|
||||||
|
|
|
@ -706,8 +706,6 @@ func (a *Agent) setupClientAutoEncryptWatching(rootsReq *structs.DCSpecificReque
|
||||||
// in time. The agent would be stuck in that case because the watches
|
// in time. The agent would be stuck in that case because the watches
|
||||||
// never use the AutoEncrypt.Sign endpoint.
|
// never use the AutoEncrypt.Sign endpoint.
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
|
||||||
|
|
||||||
// Check 10sec after cert expires. The agent cache
|
// Check 10sec after cert expires. The agent cache
|
||||||
// should be handling the expiration and renew before
|
// should be handling the expiration and renew before
|
||||||
// it.
|
// it.
|
||||||
|
@ -716,8 +714,9 @@ func (a *Agent) setupClientAutoEncryptWatching(rootsReq *structs.DCSpecificReque
|
||||||
// renew, but this case shouldn't happen because at
|
// renew, but this case shouldn't happen because at
|
||||||
// this point, auto_encrypt was just being setup
|
// this point, auto_encrypt was just being setup
|
||||||
// successfully.
|
// successfully.
|
||||||
autoLogger := a.logger.Named(logging.AutoEncrypt)
|
|
||||||
interval := a.tlsConfigurator.AutoEncryptCertNotAfter().Sub(time.Now().Add(10 * time.Second))
|
interval := a.tlsConfigurator.AutoEncryptCertNotAfter().Sub(time.Now().Add(10 * time.Second))
|
||||||
|
autoLogger := a.logger.Named(logging.AutoEncrypt)
|
||||||
|
for {
|
||||||
a.logger.Debug("setting up client certificate expiration check on interval", "interval", interval)
|
a.logger.Debug("setting up client certificate expiration check on interval", "interval", interval)
|
||||||
select {
|
select {
|
||||||
case <-a.shutdownCh:
|
case <-a.shutdownCh:
|
||||||
|
|
|
@ -4400,6 +4400,7 @@ func TestACLEndpoint_Login(t *testing.T) {
|
||||||
structs.BindingRuleBindTypeNode,
|
structs.BindingRuleBindTypeNode,
|
||||||
"${serviceaccount.name}",
|
"${serviceaccount.name}",
|
||||||
)
|
)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
t.Run("do not provide a token", func(t *testing.T) {
|
t.Run("do not provide a token", func(t *testing.T) {
|
||||||
req := structs.ACLLoginRequest{
|
req := structs.ACLLoginRequest{
|
||||||
|
|
|
@ -282,6 +282,9 @@ func decodeHCLToMapStructure(source string, target interface{}) error {
|
||||||
Metadata: md,
|
Metadata: md,
|
||||||
Result: target,
|
Result: target,
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return decoder.Decode(&raw)
|
return decoder.Decode(&raw)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,6 +308,7 @@ func TestHookWeakDecodeFromSlice_DoesNotModifySliceTargetsFromSliceInterface(t *
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
err = decoder.Decode(&raw)
|
err = decoder.Decode(&raw)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
expected := &nested{
|
expected := &nested{
|
||||||
Slice: []Item{{Name: "first"}},
|
Slice: []Item{{Name: "first"}},
|
||||||
|
|
Loading…
Reference in New Issue