Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaElastic committed Nov 3, 2023
1 parent 255c28b commit 108fe47
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions internal/pkg/server/remote_es_output_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ func Checkin(t *testing.T, ctx context.Context, srv *tserver, agentID, key strin
require.Greater(t, len(actions), 0, "expected at least 1 action")
action, ok := actions[0].(map[string]interface{})
require.True(t, ok, "expected action to be an object")
typeRaw, _ := action["type"]
typeRaw := action["type"]
require.Equal(t, "POLICY_CHANGE", typeRaw)
dataRaw, _ := action["data"]
data, _ := dataRaw.(map[string]interface{})
policy, _ := data["policy"].(map[string]interface{})
outputs, _ := policy["outputs"].(map[string]interface{})
remoteES, _ := outputs["remoteES"].(map[string]interface{})
oType, _ := remoteES["type"].(string)
dataRaw := action["data"]
data := dataRaw.(map[string]interface{})

Check failure on line 55 in internal/pkg/server/remote_es_output_integration_test.go

View workflow job for this annotation

GitHub Actions / lint (linux)

Error return value is not checked (errcheck)
policy := data["policy"].(map[string]interface{})

Check failure on line 56 in internal/pkg/server/remote_es_output_integration_test.go

View workflow job for this annotation

GitHub Actions / lint (linux)

Error return value is not checked (errcheck)
outputs := policy["outputs"].(map[string]interface{})

Check failure on line 57 in internal/pkg/server/remote_es_output_integration_test.go

View workflow job for this annotation

GitHub Actions / lint (linux)

Error return value is not checked (errcheck)
remoteES := outputs["remoteES"].(map[string]interface{})

Check failure on line 58 in internal/pkg/server/remote_es_output_integration_test.go

View workflow job for this annotation

GitHub Actions / lint (linux)

Error return value is not checked (errcheck)
oType := remoteES["type"].(string)

Check failure on line 59 in internal/pkg/server/remote_es_output_integration_test.go

View workflow job for this annotation

GitHub Actions / lint (linux)

Error return value is not checked (errcheck)
require.Equal(t, "elasticsearch", oType)
serviceToken, _ := remoteES["service_token"]
serviceToken := remoteES["service_token"]
require.Equal(t, nil, serviceToken)
remoteAPIKey, _ := remoteES["api_key"]
defaultOutput, _ := outputs["default"].(map[string]interface{})
defaultAPIKey, _ := defaultOutput["api_key"]
remoteAPIKey := remoteES["api_key"]
defaultOutput := outputs["default"].(map[string]interface{})

Check failure on line 64 in internal/pkg/server/remote_es_output_integration_test.go

View workflow job for this annotation

GitHub Actions / lint (linux)

Error return value is not checked (errcheck)
defaultAPIKey := defaultOutput["api_key"]
require.False(t, remoteAPIKey == defaultAPIKey, "expected remote api key to be different than default")

}
Expand Down

0 comments on commit 108fe47

Please sign in to comment.