Repository: clouditor/clouditor
Pull request #837 (2022-10-27 19:22:32)

Applying suggestions from deepsource.io review
This PR applies the first set of fixes for potential style/linting issues


codecov[bot]: # [Codecov](https://codecov.io/gh/clouditor/clouditor/pull/837?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor) Report
> Merging [#837](https://codecov.io/gh/clouditor/clouditor/pull/837?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor) (bf5b081) into [main](https://codecov.io/gh/clouditor/clouditor/commit/52dcc0149c1697b83affcb9a88bd93debdb2e48c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor) (52dcc01) will **decrease** coverage by `0.00%`.
> The diff coverage is `78.12%`.

```diff
@@            Coverage Diff             @@
##             main     #837      +/-   ##
==========================================
- Coverage   81.49%   81.49%   -0.01%     
==========================================
  Files          83       83              
  Lines        6831     6830       -1     
==========================================
- Hits         5567     5566       -1     
  Misses        978      978              
  Partials      286      286              
```

| Flag | Coverage Δ | |
|---|---|---|
| unittests | `81.49% <78.12%> (-0.01%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/clouditor/clouditor/pull/837?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor) | Coverage Δ | |
|---|---|---|
| [voc/at\_rest\_encryption.go](https://codecov.io/gh/clouditor/clouditor/pull/837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor#diff-dm9jL2F0X3Jlc3RfZW5jcnlwdGlvbi5nbw==) | `0.00% <0.00%> (ø)` | |
| [voc/certificate\_based\_authentication.go](https://codecov.io/gh/clouditor/clouditor/pull/837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor#diff-dm9jL2NlcnRpZmljYXRlX2Jhc2VkX2F1dGhlbnRpY2F0aW9uLmdv) | `0.00% <0.00%> (ø)` | |
| [voc/customer\_key\_encryption.go](https://codecov.io/gh/clouditor/clouditor/pull/837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor#diff-dm9jL2N1c3RvbWVyX2tleV9lbmNyeXB0aW9uLmdv) | `0.00% <0.00%> (ø)` | |
| [voc/managed\_key\_encryption.go](https://codecov.io/gh/clouditor/clouditor/pull/837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor#diff-dm9jL21hbmFnZWRfa2V5X2VuY3J5cHRpb24uZ28=) | `0.00% <0.00%> (ø)` | |
| [voc/voc.go](https://codecov.io/gh/clouditor/clouditor/pull/837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor#diff-dm9jL3ZvYy5nbw==) | `68.29% <0.00%> (ø)` | |
| [api/assessment/metric.go](https://codecov.io/gh/clouditor/clouditor/pull/837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor#diff-YXBpL2Fzc2Vzc21lbnQvbWV0cmljLmdv) | `87.05% <100.00%> (ø)` | |
| [internal/testutil/clitest/cli.go](https://codecov.io/gh/clouditor/clouditor/pull/837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor#diff-aW50ZXJuYWwvdGVzdHV0aWwvY2xpdGVzdC9jbGkuZ28=) | `75.90% <100.00%> (ø)` | |
| [persistence/gorm/gorm.go](https://codecov.io/gh/clouditor/clouditor/pull/837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor#diff-cGVyc2lzdGVuY2UvZ29ybS9nb3JtLmdv) | `88.15% <100.00%> (ø)` | |
| [service/assessment/assessment.go](https://codecov.io/gh/clouditor/clouditor/pull/837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor#diff-c2VydmljZS9hc3Nlc3NtZW50L2Fzc2Vzc21lbnQuZ28=) | `83.41% <100.00%> (ø)` | |
| [service/authz.go](https://codecov.io/gh/clouditor/clouditor/pull/837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor#diff-c2VydmljZS9hdXRoei5nbw==) | `100.00% <100.00%> (ø)` | |
| ... and [14 more](https://codecov.io/gh/clouditor/clouditor/pull/837/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor) | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=clouditor)


Patch:
diff --git a/api/assessment/metric.go b/api/assessment/metric.go
index 930e3f3c..07adacf1 100644
--- a/api/assessment/metric.go
+++ b/api/assessment/metric.go
@@ -104,7 +104,7 @@ func (r *Range) Scan(value interface{}) (err error) {
 
 // GormDataType implements GormDataTypeInterface to give an indication how
 // this struct will be serialized into a database using GORM.
-func (r *Range) GormDataType() string {
+func (*Range) GormDataType() string {
 	return "jsonb"
 }
 
diff --git a/api/pagination.go b/api/pagination.go
index 4e098211..1c4e9366 100644
--- a/api/pagination.go
+++ b/api/pagination.go
@@ -94,7 +94,7 @@ func ListAllPaginated[ResponseType PaginatedResponse, RequestType PaginatedReque
 
 	var (
 		res       ResponseType
-		pageToken string = ""
+		pageToken string
 	)
 
 	for {
diff --git a/cli/commands/login/login.go b/cli/commands/login/login.go
index 695cd5d9..343be091 100644
--- a/cli/commands/login/login.go
+++ b/cli/commands/login/login.go
@@ -30,6 +30,7 @@ import (
 	"fmt"
 	"net"
 	"net/http"
+	"time"
 
 	"clouditor.io/clouditor/cli"
 	oauth2 "github.com/oxisto/oauth2go"
@@ -164,8 +165,9 @@ func newCallbackServer(config *oauth2.Config) *callbackServer {
 
 	var srv = &callbackServer{
 		Server: http.Server{
-			Handler: mux,
-			Addr:    DefaultCallbackServerAddress,
+			Handler:           mux,
+			Addr:              DefaultCallbackServerAddress,
+			ReadHeaderTimeout: 2 * time.Second,
 		},
 		verifier: VerifierGenerator(),
 		config:   config,
diff --git a/cmd/engine/engine.go b/cmd/engine/engine.go
index a393ff5a..c41c6395 100644
--- a/cmd/engine/engine.go
+++ b/cmd/engine/engine.go
@@ -322,7 +322,7 @@ func doCmd(_ *cobra.Command, _ []string) (err error) {
 	// enable reflection, primary for testing in early stages
 	reflection.Register(server)
 
-	var opts []rest.ServerConfigOption = []rest.ServerConfigOption{
+	var opts = []rest.ServerConfigOption{
 		rest.WithAllowedOrigins(viper.GetStringSlice(APICORSAllowedOriginsFlags)),
 		rest.WithAllowedHeaders(viper.GetStringSlice(APICORSAllowedHeadersFlags)),
 		rest.WithAllowedMethods(viper.GetStringSlice(APICORSAllowedMethodsFlags)),
diff --git a/persistence/gorm/gorm.go b/persistence/gorm/gorm.go
index 952c77b4..ec833354 100644
--- a/persistence/gorm/gorm.go
+++ b/persistence/gorm/gorm.go
@@ -180,14 +180,16 @@ type preload struct {
 	args  []any
 }
 
+type QueryOption interface{}
+
 // WithPreload allows the customization of Gorm's preload feature with the specified query and arguments.
-func WithPreload(query string, args ...any) *preload {
+func WithPreload(query string, args ...any) QueryOption {
 	return &preload{query: query, args: args}
 }
 
 // WithoutPreload disables any kind of preloading of Gorm. This is necessary, if custom join tables are used, otherwise
 // Gorm will throws errors.
-func WithoutPreload() *preload {
+func WithoutPreload() QueryOption {
 	return &preload{query: ""}
 }
 
diff --git a/policies/policies.go b/policies/policies.go
index 04038cb9..ac7e590d 100644
--- a/policies/policies.go
+++ b/policies/policies.go
@@ -46,7 +46,7 @@ type metricsCache struct {
 	m map[string][]string
 }
 
-// TODO(oxisto): Rename to AssessmentEngine or something?
+// PolicyEval is an interface for the policy evaluation engine
 type PolicyEval interface {
 	Eval(evidence *evidence.Evidence, src MetricsSource) (data []*Result, err error)
 	HandleMetricEvent(event *orchestrator.MetricChangeEvent) (err error)
diff --git a/rest/rest.go b/rest/rest.go
index 60d5ddc2..b88f4c14 100644
--- a/rest/rest.go
+++ b/rest/rest.go
@@ -197,8 +197,9 @@ func RunServer(ctx context.Context, grpcPort uint16, httpPort uint16, serverOpts
 	}
 
 	srv = &http.Server{
-		Addr:    fmt.Sprintf(":%d", httpPort),
-		Handler: handleCORS(mux),
+		Addr:              fmt.Sprintf(":%d", httpPort),
+		Handler:           handleCORS(mux),
+		ReadHeaderTimeout: 2 * time.Second,
 	}
 
 	// graceful shutdown
diff --git a/service/assessment/assessment.go b/service/assessment/assessment.go
index ef9113b1..71555a9e 100644
--- a/service/assessment/assessment.go
+++ b/service/assessment/assessment.go
@@ -481,7 +481,7 @@ func (svc *Service) initEvidenceStoreStream(URL string, additionalOpts ...grpc.D
 }
 
 // initOrchestratorStream initializes the stream to the Orchestrator
-func (svc *Service) initOrchestratorStream(URL string, additionalOpts ...grpc.DialOption) (stream orchestrator.Orchestrator_StoreAssessmentResultsClient, err error) {
+func (svc *Service) initOrchestratorStream(_ string, _ ...grpc.DialOption) (stream orchestrator.Orchestrator_StoreAssessmentResultsClient, err error) {
 	log.Infof("Trying to establish a connection to orchestrator service @ %v", svc.orchestratorAddress.target)
 
 	// Establish connection to orchestrator gRPC service
diff --git a/service/authz.go b/service/authz.go
index 88501727..8cfd07e3 100644
--- a/service/authz.go
+++ b/service/authz.go
@@ -119,15 +119,15 @@ func (a *AuthorizationStrategyJWT) AllowedCloudServices(ctx context.Context) (al
 	return false, list
 }
 
-// AuthorizationStrategyJWT is an AuthorizationStrategy that allows all requests.
+// AuthorizationStrategyAllowAll is an AuthorizationStrategy that allows all requests.
 type AuthorizationStrategyAllowAll struct{}
 
 // CheckAccess checks whether the current request can be fulfilled using the current access strategy.
-func (a *AuthorizationStrategyAllowAll) CheckAccess(_ context.Context, _ RequestType, _ orchestrator.CloudServiceRequest) bool {
+func (*AuthorizationStrategyAllowAll) CheckAccess(_ context.Context, _ RequestType, _ orchestrator.CloudServiceRequest) bool {
 	return true
 }
 
 // AllowedCloudServices retrieves a list of allowed cloud service IDs according to the current access strategy.
-func (a *AuthorizationStrategyAllowAll) AllowedCloudServices(_ context.Context) (all bool, list []string) {
+func (*AuthorizationStrategyAllowAll) AllowedCloudServices(_ context.Context) (all bool, list []string) {
 	return true, nil
 }
diff --git a/service/discovery/aws/compute.go b/service/discovery/aws/compute.go
index 0d617151..a9715218 100644
--- a/service/discovery/aws/compute.go
+++ b/service/discovery/aws/compute.go
@@ -118,7 +118,7 @@ func (d computeDiscovery) List() (resources []voc.IsCloudResource, err error) {
 		return nil, fmt.Errorf("could not discover virtual machines: %w", err)
 	}
 	for _, machine := range listOfVMs {
-		resources = append(resources, &machine)
+		resources = append(resources, machine)
 	}
 
 	listOfFunctions, err := d.discoverFunctions()
@@ -126,7 +126,7 @@ func (d computeDiscovery) List() (resources []voc.IsCloudResource, err error) {
 		return nil, fmt.Errorf("could not discover functions: %w", err)
 	}
 	for _, function := range listOfFunctions {
-		resources = append(resources, &function)
+		resources = append(resources, function)
 	}
 
 	return
@@ -205,12 +205,12 @@ func (d *computeDiscovery) discoverNetworkInterfaces() ([]voc.NetworkInterface,
 }
 
 // discoverVirtualMachines discovers all VMs (in the current region)
-func (d *computeDiscovery) discoverVirtualMachines() ([]voc.VirtualMachine, error) {
+func (d *computeDiscovery) discoverVirtualMachines() ([]*voc.VirtualMachine, error) {
 	resp, err := d.virtualMachineAPI.DescribeInstances(context.TODO(), &ec2.DescribeInstancesInput{})
 	if err != nil {
 		return nil, prettyError(err)
 	}
-	var resources []voc.VirtualMachine
+	var resources []*voc.VirtualMachine
 	for _, reservation := range resp.Reservations {
 		for i := range reservation.Instances {
 			vm := &reservation.Instances[i]
@@ -229,7 +229,7 @@ func (d *computeDiscovery) discoverVirtualMachines() ([]voc.VirtualMachine, erro
 				NetworkInterface: d.getNetworkInterfacesOfVM(vm),
 			}
 
-			resources = append(resources, voc.VirtualMachine{
+			resources = append(resources, &voc.VirtualMachine{
 				Compute:      computeResource,
 				BlockStorage: d.mapBlockStorageIDsOfVM(vm),
 				BootLogging:  d.getBootLog(vm),
@@ -241,7 +241,7 @@ func (d *computeDiscovery) discoverVirtualMachines() ([]voc.VirtualMachine, erro
 }
 
 // discoverFunctions discovers all lambda functions
-func (d *computeDiscovery) discoverFunctions() (resources []voc.Function, err error) {
+func (d *computeDiscovery) discoverFunctions() (resources []*voc.Function, err error) {
 	// 'listFunctions' discovers up to 50 Lambda functions per execution -> loop through when response has nextMarker set
 	var resp *lambda.ListFunctionsOutput
 	var nextMarker *string
@@ -263,10 +263,10 @@ func (d *computeDiscovery) discoverFunctions() (resources []voc.Function, err er
 }
 
 // mapFunctionResources iterates functionConfigurations and returns a list of corresponding FunctionResources
-func (d *computeDiscovery) mapFunctionResources(functions []typesLambda.FunctionConfiguration) (resources []voc.Function) {
+func (d *computeDiscovery) mapFunctionResources(functions []typesLambda.FunctionConfiguration) (resources []*voc.Function) {
 	for i := range functions {
 		function := &functions[i]
-		resources = append(resources, voc.Function{
+		resources = append(resources, &voc.Function{
 			Compute: &voc.Compute{
 				Resource: &voc.Resource{
 					ID:           voc.ResourceID(aws.ToString(function.FunctionArn)),
diff --git a/service/discovery/aws/storage.go b/service/discovery/aws/storage.go
index 215b3188..f089787b 100644
--- a/service/discovery/aws/storage.go
+++ b/service/discovery/aws/storage.go
@@ -104,7 +104,7 @@ type Bool struct {
 }
 
 // Name is the method implementation defined in the discovery.Discoverer interface
-func (d *awsS3Discovery) Name() string {
+func (*awsS3Discovery) Name() string {
 	return "AWS Blob Storage"
 }
 
diff --git a/service/discovery/azure/azure.go b/service/discovery/azure/azure.go
index a9ce68c8..73d7c54c 100644
--- a/service/discovery/azure/azure.go
+++ b/service/discovery/azure/azure.go
@@ -154,7 +154,8 @@ func (a *azureDiscovery) authorize() (err error) {
 func NewAuthorizer() (*azidentity.DefaultAzureCredential, error) {
 	cred, err := azidentity.NewDefaultAzureCredential(nil)
 	if err != nil {
-		log.Fatalf("%s: %+v", ErrCouldNotAuthenticate, err)
+		log.Errorf("%s: %+v", ErrCouldNotAuthenticate, err)
+		return nil, fmt.Errorf("%s: %w", ErrCouldNotAuthenticate, err)
 	}
 
 	return cred, nil
diff --git a/service/discovery/azure/compute.go b/service/discovery/azure/compute.go
index 54605c0b..5390de36 100644
--- a/service/discovery/azure/compute.go
+++ b/service/discovery/azure/compute.go
@@ -195,7 +195,7 @@ func (d *azureComputeDiscovery) discoverVirtualMachines() ([]voc.IsCloudResource
 	return list, nil
 }
 
-func (d *azureComputeDiscovery) handleVirtualMachines(vm *armcompute.VirtualMachine) (voc.IsCompute, error) {
+func (*azureComputeDiscovery) handleVirtualMachines(vm *armcompute.VirtualMachine) (voc.IsCompute, error) {
 	var bootLogging = []voc.ResourceID{}
 	var osLogging = []voc.ResourceID{}
 
diff --git a/service/discovery/azure/network.go b/service/discovery/azure/network.go
index 61ace384..2384b32f 100644
--- a/service/discovery/azure/network.go
+++ b/service/discovery/azure/network.go
@@ -152,7 +152,7 @@ func (d *azureNetworkDiscovery) discoverLoadBalancer() ([]voc.IsCloudResource, e
 	return list, nil
 }
 
-func (d *azureNetworkDiscovery) handleLoadBalancer(lb *armnetwork.LoadBalancer) voc.IsNetwork {
+func (*azureNetworkDiscovery) handleLoadBalancer(lb *armnetwork.LoadBalancer) voc.IsNetwork {
 	return &voc.LoadBalancer{
 		NetworkService: &voc.NetworkService{
 			Networking: &voc.Networking{
@@ -168,7 +168,7 @@ func (d *azureNetworkDiscovery) handleLoadBalancer(lb *armnetwork.LoadBalancer)
 					Labels: labels(lb.Tags),
 				},
 			},
-			Ips:   d.publicIPAddressFromLoadBalancer(lb),
+			Ips:   publicIPAddressFromLoadBalancer(lb),
 			Ports: LoadBalancerPorts(lb),
 		},
 		// TODO(all): do we need the AccessRestriction for load balancers?
@@ -259,8 +259,7 @@ func LoadBalancerPorts(lb *armnetwork.LoadBalancer) (loadBalancerPorts []uint16)
 //     return list
 // }
 
-func (d *azureNetworkDiscovery) publicIPAddressFromLoadBalancer(lb *armnetwork.LoadBalancer) []string {
-
+func publicIPAddressFromLoadBalancer(lb *armnetwork.LoadBalancer) []string {
 	var publicIPAddresses = []string{}
 
 	if lb == nil || lb.Properties == nil || lb.Properties.FrontendIPConfigurations == nil {
diff --git a/service/orchestrator/catalogs.go b/service/orchestrator/catalogs.go
index c5a13378..d9bad3c1 100644
--- a/service/orchestrator/catalogs.go
+++ b/service/orchestrator/catalogs.go
@@ -121,7 +121,7 @@ func (svc *Service) RemoveCatalog(_ context.Context, req *orchestrator.RemoveCat
 	return &emptypb.Empty{}, nil
 }
 
-func (srv *Service) GetCategory(ctx context.Context, req *orchestrator.GetCategoryRequest) (res *orchestrator.Category, err error) {
+func (srv *Service) GetCategory(_ context.Context, req *orchestrator.GetCategoryRequest) (res *orchestrator.Category, err error) {
 	res = new(orchestrator.Category)
 	err = srv.storage.Get(&res, gorm.WithPreload("Controls", "parent_control_id IS NULL"), "name = ? AND catalog_id = ?", req.CategoryName, req.CatalogId)
 	if errors.Is(err, persistence.ErrRecordNotFound) {
@@ -133,7 +133,7 @@ func (srv *Service) GetCategory(ctx context.Context, req *orchestrator.GetCatego
 	return res, nil
 }
 
-func (srv *Service) GetControl(ctx context.Context, req *orchestrator.GetControlRequest) (res *orchestrator.Control, err error) {
+func (srv *Service) GetControl(_ context.Context, req *orchestrator.GetControlRequest) (res *orchestrator.Control, err error) {
 	res = new(orchestrator.Control)
 	err = srv.storage.Get(&res, "Id = ? AND category_name = ? AND category_catalog_id = ?", req.ControlId, req.CategoryName, req.CatalogId)
 	if errors.Is(err, persistence.ErrRecordNotFound) {
@@ -145,7 +145,7 @@ func (srv *Service) GetControl(ctx context.Context, req *orchestrator.GetControl
 	return res, nil
 }
 
-func (srv *Service) ListControls(ctx context.Context, req *orchestrator.ListControlsRequest) (res *orchestrator.ListControlsResponse, err error) {
+func (srv *Service) ListControls(_ context.Context, req *orchestrator.ListControlsRequest) (res *orchestrator.ListControlsResponse, err error) {
 	// Validate the request
 	if err = api.ValidateListRequest[*orchestrator.Control](req); err != nil {
 		err = fmt.Errorf("invalid request: %w", err)
diff --git a/service/orchestrator/metrics.go b/service/orchestrator/metrics.go
index 16505a78..c26ae914 100644
--- a/service/orchestrator/metrics.go
+++ b/service/orchestrator/metrics.go
@@ -77,7 +77,7 @@ func (svc *Service) loadMetrics() (err error) {
 			continue
 		}
 
-		err = svc.prepareMetric(m)
+		err = prepareMetric(m)
 		if err != nil {
 			log.Warnf("Could not prepare implementation or default configuration for metric %s: %v", m.Id, err)
 			continue
@@ -95,7 +95,7 @@ func (svc *Service) loadMetrics() (err error) {
 
 // prepareMetric takes care of the heavy lifting of loading the default implementation and configuration of a particular
 // metric and storing them into the service.
-func (svc *Service) prepareMetric(m *assessment.Metric) (err error) {
+func prepareMetric(m *assessment.Metric) (err error) {
 	var (
 		config *assessment.MetricConfiguration
 	)
diff --git a/service/orchestrator/toe.go b/service/orchestrator/toe.go
index a96c7fbb..c94c3bb9 100644
--- a/service/orchestrator/toe.go
+++ b/service/orchestrator/toe.go
@@ -40,7 +40,7 @@ import (
 	"google.golang.org/protobuf/types/known/emptypb"
 )
 
-func (svc *Service) CreateTargetOfEvaluation(ctx context.Context, req *orchestrator.CreateTargetOfEvaluationRequest) (res *orchestrator.TargetOfEvaluation, err error) {
+func (svc *Service) CreateTargetOfEvaluation(_ context.Context, req *orchestrator.CreateTargetOfEvaluationRequest) (res *orchestrator.TargetOfEvaluation, err error) {
 	err = svc.storage.Create(&req.Toe)
 	if err != nil {
 		return nil, status.Errorf(codes.Internal, "database error: %v", err)
@@ -70,7 +70,7 @@ func (svc *Service) GetTargetOfEvaluation(_ context.Context, req *orchestrator.G
 	return response, nil
 }
 
-// ListTargetOfEvaluation implements method for getting a TargetOfEvaluation
+// ListTargetsOfEvaluation implements method for getting a TargetOfEvaluation
 func (svc *Service) ListTargetsOfEvaluation(_ context.Context, req *orchestrator.ListTargetsOfEvaluationRequest) (res *orchestrator.ListTargetsOfEvaluationResponse, err error) {
 	// Validate the request
 	if err = api.ValidateListRequest[*orchestrator.TargetOfEvaluation](req); err != nil {
diff --git a/voc/abac.go b/voc/abac.go
index eae8fb98..aa2ad2d9 100644
--- a/voc/abac.go
+++ b/voc/abac.go
@@ -29,6 +29,6 @@ type ABAC struct {
 	*Authorization
 }
 
-func (a *ABAC) Type() string {
+func (*ABAC) Type() string {
 	return "ABAC"
 }
diff --git a/voc/access_restriction.go b/voc/access_restriction.go
index cdcc37b5..a9f55027 100644
--- a/voc/access_restriction.go
+++ b/voc/access_restriction.go
@@ -29,6 +29,6 @@ type AccessRestriction struct {
 	*Authorization
 }
 
-func (a *AccessRestriction) Type() string {
+func (*AccessRestriction) Type() string {
 	return "AccessRestriction"
 }
diff --git a/voc/at_rest_encryption.go b/voc/at_rest_encryption.go
index 966e64f5..0d610ca2 100644
--- a/voc/at_rest_encryption.go
+++ b/voc/at_rest_encryption.go
@@ -31,6 +31,6 @@ type AtRestEncryption struct {
 	Enabled   bool   `json:"enabled"`
 }
 
-func (a *AtRestEncryption) Type() string {
+func (*AtRestEncryption) Type() string {
 	return "AtRestEncryption"
 }
diff --git a/voc/certificate_based_authentication.go b/voc/certificate_based_authentication.go
index 2b1a1469..bc16f699 100644
--- a/voc/certificate_based_authentication.go
+++ b/voc/certificate_based_authentication.go
@@ -29,6 +29,6 @@ type CertificateBasedAuthentication struct {
 	*Authenticity
 }
 
-func (c *CertificateBasedAuthentication) Type() string {
+func (*CertificateBasedAuthentication) Type() string {
 	return "CertificateBasedAuthentication"
 }
diff --git a/voc/customer_key_encryption.go b/voc/customer_key_encryption.go
index 0891500d..a46d386e 100644
--- a/voc/customer_key_encryption.go
+++ b/voc/customer_key_encryption.go
@@ -30,6 +30,6 @@ type CustomerKeyEncryption struct {
 	KeyUrl string `json:"keyUrl"`
 }
 
-func (c *CustomerKeyEncryption) Type() string {
+func (*CustomerKeyEncryption) Type() string {
 	return "CustomerKeyEncryption"
 }
diff --git a/voc/managed_key_encryption.go b/voc/managed_key_encryption.go
index 1dfb1301..4a6a822e 100644
--- a/voc/managed_key_encryption.go
+++ b/voc/managed_key_encryption.go
@@ -29,6 +29,6 @@ type ManagedKeyEncryption struct {
 	*AtRestEncryption
 }
 
-func (m *ManagedKeyEncryption) Type() string {
+func (*ManagedKeyEncryption) Type() string {
 	return "ManagedKeyEncryption"
 }
diff --git a/voc/no_authentication.go b/voc/no_authentication.go
index d365eb9e..db7ff15c 100644
--- a/voc/no_authentication.go
+++ b/voc/no_authentication.go
@@ -29,6 +29,6 @@ type NoAuthentication struct {
 	*Authenticity
 }
 
-func (n *NoAuthentication) Type() string {
+func (*NoAuthentication) Type() string {
 	return "NoAuthentication"
 }
diff --git a/voc/otp_based_authentication.go b/voc/otp_based_authentication.go
index 8b10f3a6..1cbd1f12 100644
--- a/voc/otp_based_authentication.go
+++ b/voc/otp_based_authentication.go
@@ -30,6 +30,6 @@ type OTPBasedAuthentication struct {
 	Activated bool `json:"activated"`
 }
 
-func (o OTPBasedAuthentication) Type() string {
+func (*OTPBasedAuthentication) Type() string {
 	return "OTPBasedAuthentication"
 }
diff --git a/voc/password_based_authentication.go b/voc/password_based_authentication.go
index 4d35d2c1..1eb3def0 100644
--- a/voc/password_based_authentication.go
+++ b/voc/password_based_authentication.go
@@ -30,6 +30,6 @@ type PasswordBasedAuthentication struct {
 	Activated bool `json:"activated"`
 }
 
-func (o PasswordBasedAuthentication) Type() string {
+func (*PasswordBasedAuthentication) Type() string {
 	return "PasswordBasedAuthentication"
 }
diff --git a/voc/rbac.go b/voc/rbac.go
index 4fcb2df0..f48c3aa8 100644
--- a/voc/rbac.go
+++ b/voc/rbac.go
@@ -31,6 +31,6 @@ type RBAC struct {
 	BroadAssignments float32 `json:"broadAssignments"`
 }
 
-func (r *RBAC) Type() string {
+func (*RBAC) Type() string {
 	return "RBAC"
 }
diff --git a/voc/related.go b/voc/related.go
index 5ad1b2e9..3beefba0 100644
--- a/voc/related.go
+++ b/voc/related.go
@@ -40,7 +40,7 @@ func (v VirtualMachine) Related() []string {
 	return list
 }
 
-// LoggingService returns related resources for the logging service, e.g., its storage.
+// Related returns related resources for the logging service, e.g., its storage.
 func (l LoggingService) Related() []string {
 	list := make([]string, 0)
 
diff --git a/voc/single_sign_on.go b/voc/single_sign_on.go
index 84a23819..38cd9e48 100644
--- a/voc/single_sign_on.go
+++ b/voc/single_sign_on.go
@@ -31,6 +31,6 @@ type SingleSignOn struct {
 	Enabled bool `json:"enabled"`
 }
 
-func (s *SingleSignOn) Type() string {
+func (*SingleSignOn) Type() string {
 	return "SingleSignOn"
 }
diff --git a/voc/token_based_authentication.go b/voc/token_based_authentication.go
index 50641c08..84990568 100644
--- a/voc/token_based_authentication.go
+++ b/voc/token_based_authentication.go
@@ -31,6 +31,6 @@ type TokenBasedAuthentication struct {
 	Activated bool `json:"activated"`
 }
 
-func (j *TokenBasedAuthentication) Type() string {
+func (*TokenBasedAuthentication) Type() string {
 	return "TokenBasedAuthentication"
 }
diff --git a/voc/voc.go b/voc/voc.go
index 609fbc36..4a9d26d0 100644
--- a/voc/voc.go
+++ b/voc/voc.go
@@ -132,7 +132,7 @@ type IsAtRestEncryption interface {
 	IsEnabled() bool
 }
 
-func (a *AtRestEncryption) atRestEncryption() {}
+func (*AtRestEncryption) atRestEncryption() {}
 func (a *AtRestEncryption) IsEnabled() bool {
 	return a.Enabled
 }
@@ -142,14 +142,14 @@ type IsAuthorization interface {
 	authorization()
 }
 
-func (a *Authorization) authorization() {}
+func (*Authorization) authorization() {}
 
 type IsAuthenticity interface {
 	IsSecurityFeature
 	authenticity()
 }
 
-func (a *Authenticity) authenticity() {}
+func (*Authenticity) authenticity() {}
 
 type HasHttpEndpoint interface {
 	GetHttpEndpoint() *HttpEndpoint


Test patch:
diff --git a/api/streams_test.go b/api/streams_test.go
index 9ad827de..086f6f76 100644
--- a/api/streams_test.go
+++ b/api/streams_test.go
@@ -219,7 +219,7 @@ func (mockClientStream) CloseSend() error {
 	return nil
 }
 
-func (m *mockClientStream) Recv() (req *assessment.AssessEvidenceRequest, err error) {
+func (mockClientStream) Recv() (req *assessment.AssessEvidenceRequest, err error) {
 	return nil, nil
 }
 
diff --git a/cli/commands/login/login_test.go b/cli/commands/login/login_test.go
index 9b8b57e7..1f33d0be 100644
--- a/cli/commands/login/login_test.go
+++ b/cli/commands/login/login_test.go
@@ -27,7 +27,6 @@ package login
 
 import (
 	"fmt"
-	"io/ioutil"
 	"net"
 	"net/http"
 	"os"
@@ -76,7 +75,7 @@ func TestLogin(t *testing.T) {
 	defer sock.Close()
 	defer server.Stop()
 
-	dir, err = ioutil.TempDir(os.TempDir(), ".clouditor")
+	dir, err = os.MkdirTemp(os.TempDir(), ".clouditor")
 	assert.NoError(t, err)
 	assert.NotEmpty(t, dir)
 
diff --git a/cli/commands/metric/metric_test.go b/cli/commands/metric/metric_test.go
index 400f5afa..f89d2b26 100644
--- a/cli/commands/metric/metric_test.go
+++ b/cli/commands/metric/metric_test.go
@@ -57,7 +57,7 @@ func TestListMetrics(t *testing.T) {
 
 	assert.NoError(t, err)
 
-	var response *orchestrator.ListMetricsResponse = &orchestrator.ListMetricsResponse{}
+	var response = &orchestrator.ListMetricsResponse{}
 
 	err = protojson.Unmarshal(b.Bytes(), response)
 
diff --git a/internal/auth/key_loader_test.go b/internal/auth/key_loader_test.go
index eb1b2f24..445b9959 100644
--- a/internal/auth/key_loader_test.go
+++ b/internal/auth/key_loader_test.go
@@ -29,7 +29,7 @@ import (
 	"crypto/ecdsa"
 	"crypto/elliptic"
 	"crypto/rand"
-	"io/ioutil"
+	"io"
 	"os"
 	"reflect"
 	"testing"
@@ -38,7 +38,7 @@ import (
 )
 
 func Test_keyLoader_recoverFromLoadApiKeyError(t *testing.T) {
-	var tmpFile, _ = ioutil.TempFile("", "api.key")
+	var tmpFile, _ = os.CreateTemp("", "api.key")
 	// Close it immediately , since we want to write to it
 	tmpFile.Close()
 
@@ -100,7 +100,7 @@ func Test_keyLoader_recoverFromLoadApiKeyError(t *testing.T) {
 				}
 
 				// Our tmp file should also contain something now
-				data, err := ioutil.ReadAll(f)
+				data, err := io.ReadAll(f)
 				if !assert.ErrorIs(tt, err, nil) {
 					return false
 				}
@@ -127,7 +127,7 @@ func Test_keyLoader_recoverFromLoadApiKeyError(t *testing.T) {
 
 func TestService_loadKeyFromFile(t *testing.T) {
 	// Prepare a tmp file that contains a new temporary private key
-	var tmpFile, _ = ioutil.TempFile("", "api.key")
+	var tmpFile, _ = os.CreateTemp("", "api.key")
 	tmpFile.Close()
 
 	// Create a new temporary key
diff --git a/internal/testutil/clitest/cli.go b/internal/testutil/clitest/cli.go
index 8c1c0143..487b66a6 100644
--- a/internal/testutil/clitest/cli.go
+++ b/internal/testutil/clitest/cli.go
@@ -3,7 +3,6 @@ package clitest
 import (
 	"errors"
 	"fmt"
-	"io/ioutil"
 	"net"
 	"os"
 	"testing"
@@ -29,7 +28,7 @@ func PrepareSession(authPort uint16, authSrv *oauth2.AuthorizationServer, grpcUR
 	)
 
 	// Create a temporary folder
-	dir, err = ioutil.TempDir(os.TempDir(), ".clouditor")
+	dir, err = os.MkdirTemp(os.TempDir(), ".clouditor")
 	if err != nil {
 		return "", err
 	}
diff --git a/persistence/gorm/gorm_test.go b/persistence/gorm/gorm_test.go
index e98a1ea2..f239c33f 100644
--- a/persistence/gorm/gorm_test.go
+++ b/persistence/gorm/gorm_test.go
@@ -153,7 +153,7 @@ func Test_storage_Get(t *testing.T) {
 	assert.NoError(t, err)
 	assert.Equal(t, user, gotUser3)
 
-	var metric *assessment.Metric = &assessment.Metric{
+	var metric = &assessment.Metric{
 		Id:    MockMetricID,
 		Range: &assessment.Range{Range: &assessment.Range_MinMax{MinMax: &assessment.MinMax{Min: 1, Max: 2}}},
 	}
diff --git a/policies/policies_test.go b/policies/policies_test.go
index 50214b73..ae13d4aa 100644
--- a/policies/policies_test.go
+++ b/policies/policies_test.go
@@ -59,7 +59,7 @@ type mockMetricsSource struct {
 	t *testing.T
 }
 
-func (m *mockMetricsSource) Metrics() (metrics []*assessment.Metric, err error) {
+func (*mockMetricsSource) Metrics() (metrics []*assessment.Metric, err error) {
 	var (
 		b           []byte
 		metricsFile = "service/orchestrator/metrics.json"
diff --git a/rest/rest_test.go b/rest/rest_test.go
index 8f9563ec..e38226ff 100644
--- a/rest/rest_test.go
+++ b/rest/rest_test.go
@@ -30,7 +30,6 @@ import (
 	"errors"
 	"fmt"
 	"io"
-	"io/ioutil"
 	"net"
 	"net/http"
 	"os"
@@ -207,7 +206,7 @@ func TestREST(t *testing.T) {
 					return assert.True(tt, ok)
 				}
 
-				content, err := ioutil.ReadAll(resp.Body)
+				content, err := io.ReadAll(resp.Body)
 				if !assert.ErrorIs(tt, err, nil) {
 					return false
 				}
diff --git a/service/assessment/benchmark_test.go b/service/assessment/benchmark_test.go
index 4fdde8ba..ecd270fc 100644
--- a/service/assessment/benchmark_test.go
+++ b/service/assessment/benchmark_test.go
@@ -120,48 +120,48 @@ func BenchmarkAssessEvidence(b *testing.B) {
 	}
 }
 
-func benchmarkAssessEvidence(i int, m int, b *testing.B) {
+func benchmarkAssessEvidenceInternal(i int, m int, b *testing.B) {
 	for n := 0; n < b.N; n++ {
 		createEvidences(i, m, b)
 	}
 }
 
 func BenchmarkAssessEvidence1(b *testing.B) {
-	benchmarkAssessEvidence(1, 1, b)
+	benchmarkAssessEvidenceInternal(1, 1, b)
 }
 
 func BenchmarkAssessEvidence2(b *testing.B) {
-	benchmarkAssessEvidence(2, 1, b)
+	benchmarkAssessEvidenceInternal(2, 1, b)
 }
 
 func BenchmarkAssessEvidence10(b *testing.B) {
-	benchmarkAssessEvidence(10, 1, b)
+	benchmarkAssessEvidenceInternal(10, 1, b)
 }
 
 func BenchmarkAssessEvidence10x2(b *testing.B) {
-	benchmarkAssessEvidence(10, 2, b)
+	benchmarkAssessEvidenceInternal(10, 2, b)
 }
 
 func BenchmarkAssessEvidence100(b *testing.B) {
-	benchmarkAssessEvidence(100, 1, b)
+	benchmarkAssessEvidenceInternal(100, 1, b)
 }
 
 func BenchmarkAssessEvidence1000(b *testing.B) {
-	benchmarkAssessEvidence(1000, 1, b)
+	benchmarkAssessEvidenceInternal(1000, 1, b)
 }
 
 func BenchmarkAssessEvidence1000x2(b *testing.B) {
-	benchmarkAssessEvidence(1000, 2, b)
+	benchmarkAssessEvidenceInternal(1000, 2, b)
 }
 
 func BenchmarkAssessEvidence1000x10(b *testing.B) {
-	benchmarkAssessEvidence(1000, 10, b)
+	benchmarkAssessEvidenceInternal(1000, 10, b)
 }
 
 func BenchmarkAssessEvidence3000(b *testing.B) {
-	benchmarkAssessEvidence(3000, 1, b)
+	benchmarkAssessEvidenceInternal(3000, 1, b)
 }
 
 func BenchmarkAssessEvidence10000(b *testing.B) {
-	benchmarkAssessEvidence(10000, 1, b)
+	benchmarkAssessEvidenceInternal(10000, 1, b)
 }
diff --git a/service/discovery/aws/compute_test.go b/service/discovery/aws/compute_test.go
index 28dc3201..d31dc34e 100644
--- a/service/discovery/aws/compute_test.go
+++ b/service/discovery/aws/compute_test.go
@@ -392,7 +392,7 @@ func TestComputeDiscovery_discoverFunctions(t *testing.T) {
 	tests := []struct {
 		name    string
 		fields  fields
-		want    []voc.Function
+		want    []*voc.Function
 		wantErr bool
 	}{
 		// Test cases
@@ -403,7 +403,7 @@ func TestComputeDiscovery_discoverFunctions(t *testing.T) {
 				awsConfig:   mockClient,
 			},
 			//args: args{client: mockClient},
-			[]voc.Function{
+			[]*voc.Function{
 				{Compute: &voc.Compute{
 					Resource: &voc.Resource{
 						ID:           mockFunction1ID,
diff --git a/service/discovery/aws/storage_test.go b/service/discovery/aws/storage_test.go
index 06a1ec4f..4cdeb20a 100644
--- a/service/discovery/aws/storage_test.go
+++ b/service/discovery/aws/storage_test.go
@@ -58,7 +58,7 @@ const (
 
 type mockS3APINew struct{}
 
-func (m mockS3APINew) ListBuckets(_ context.Context,
+func (mockS3APINew) ListBuckets(_ context.Context,
 	_ *s3.ListBucketsInput,
 	_ ...func(*s3.Options)) (*s3.ListBucketsOutput, error) {
 	creationDate1, err := time.Parse(time.RFC3339, mockBucket1CreationTime)
@@ -80,7 +80,7 @@ func (m mockS3APINew) ListBuckets(_ context.Context,
 	return output, nil
 }
 
-func (m mockS3APINew) GetBucketEncryption(_ context.Context,
+func (mockS3APINew) GetBucketEncryption(_ context.Context,
 	params *s3.GetBucketEncryptionInput,
 	_ ...func(*s3.Options)) (*s3.GetBucketEncryptionOutput, error) {
 	switch aws.ToString(params.Bucket) {
@@ -123,7 +123,7 @@ func (m mockS3APINew) GetBucketEncryption(_ context.Context,
 	}
 }
 
-func (m mockS3APINew) GetBucketPolicy(_ context.Context,
+func (mockS3APINew) GetBucketPolicy(_ context.Context,
 	params *s3.GetBucketPolicyInput,
 	_ ...func(*s3.Options)) (output *s3.GetBucketPolicyOutput, err error) {
 	switch aws.ToString(params.Bucket) {
@@ -179,7 +179,7 @@ func (m mockS3APINew) GetBucketPolicy(_ context.Context,
 	return
 }
 
-func (m mockS3APINew) GetBucketLocation(_ context.Context,
+func (mockS3APINew) GetBucketLocation(_ context.Context,
 	params *s3.GetBucketLocationInput,
 	_ ...func(*s3.Options)) (output *s3.GetBucketLocationOutput, err error) {
 	switch aws.ToString(params.Bucket) {
@@ -204,19 +204,19 @@ func (m mockS3APINew) GetBucketLocation(_ context.Context,
 	return
 }
 
-func (m mockS3APINew) GetPublicAccessBlock(_ context.Context,
+func (mockS3APINew) GetPublicAccessBlock(_ context.Context,
 	_ *s3.GetPublicAccessBlockInput,
 	_ ...func(*s3.Options)) (*s3.GetPublicAccessBlockOutput, error) {
 	panic("implement me")
 }
 
-func (m mockS3APINew) GetBucketReplication(_ context.Context,
+func (mockS3APINew) GetBucketReplication(_ context.Context,
 	_ *s3.GetBucketReplicationInput,
 	_ ...func(*s3.Options)) (*s3.GetBucketReplicationOutput, error) {
 	panic("implement me")
 }
 
-func (m mockS3APINew) GetBucketLifecycleConfiguration(_ context.Context,
+func (mockS3APINew) GetBucketLifecycleConfiguration(_ context.Context,
 	_ *s3.GetBucketLifecycleConfigurationInput,
 	_ ...func(*s3.Options)) (*s3.GetBucketLifecycleConfigurationOutput, error) {
 	panic("implement me")
@@ -224,7 +224,7 @@ func (m mockS3APINew) GetBucketLifecycleConfiguration(_ context.Context,
 
 type mockS3APIWitHErrors struct{}
 
-func (m mockS3APIWitHErrors) ListBuckets(_ context.Context,
+func (mockS3APIWitHErrors) ListBuckets(_ context.Context,
 	_ *s3.ListBucketsInput,
 	_ ...func(*s3.Options)) (o *s3.ListBucketsOutput, e error) {
 	oe := &smithy.OperationError{
@@ -235,21 +235,21 @@ func (m mockS3APIWitHErrors) ListBuckets(_ context.Context,
 	return nil, oe
 }
 
-func (m mockS3APIWitHErrors) GetBucketEncryption(_ context.Context, _ *s3.GetBucketEncryptionInput, _ ...func(*s3.Options)) (*s3.GetBucketEncryptionOutput, error) {
+func (mockS3APIWitHErrors) GetBucketEncryption(_ context.Context, _ *s3.GetBucketEncryptionInput, _ ...func(*s3.Options)) (*s3.GetBucketEncryptionOutput, error) {
 	ae := &smithy.GenericAPIError{
 		Message: "failed to resolve service endpoint",
 	}
 	return nil, ae
 }
 
-func (m mockS3APIWitHErrors) GetBucketPolicy(_ context.Context, _ *s3.GetBucketPolicyInput, _ ...func(*s3.Options)) (*s3.GetBucketPolicyOutput, error) {
+func (mockS3APIWitHErrors) GetBucketPolicy(_ context.Context, _ *s3.GetBucketPolicyInput, _ ...func(*s3.Options)) (*s3.GetBucketPolicyOutput, error) {
 	ae := &smithy.GenericAPIError{
 		Message: "failed to resolve service endpoint",
 	}
 	return nil, ae
 }
 
-func (m mockS3APIWitHErrors) GetBucketLocation(_ context.Context, _ *s3.GetBucketLocationInput, _ ...func(*s3.Options)) (*s3.GetBucketLocationOutput, error) {
+func (mockS3APIWitHErrors) GetBucketLocation(_ context.Context, _ *s3.GetBucketLocationInput, _ ...func(*s3.Options)) (*s3.GetBucketLocationOutput, error) {
 	oe := &smithy.OperationError{
 		ServiceID:     "MockS3API",
 		OperationName: "GetBucketLocation",
@@ -258,7 +258,7 @@ func (m mockS3APIWitHErrors) GetBucketLocation(_ context.Context, _ *s3.GetBucke
 	return nil, oe
 }
 
-func (m mockS3APIWitHErrors) GetPublicAccessBlock(_ context.Context, _ *s3.GetPublicAccessBlockInput, _ ...func(*s3.Options)) (*s3.GetPublicAccessBlockOutput, error) {
+func (mockS3APIWitHErrors) GetPublicAccessBlock(_ context.Context, _ *s3.GetPublicAccessBlockInput, _ ...func(*s3.Options)) (*s3.GetPublicAccessBlockOutput, error) {
 	oe := &smithy.OperationError{
 		ServiceID:     "MockS3API",
 		OperationName: "GetPublicAccessBlock",
@@ -267,7 +267,7 @@ func (m mockS3APIWitHErrors) GetPublicAccessBlock(_ context.Context, _ *s3.GetPu
 	return nil, oe
 }
 
-func (m mockS3APIWitHErrors) GetBucketReplication(_ context.Context, _ *s3.GetBucketReplicationInput, _ ...func(*s3.Options)) (*s3.GetBucketReplicationOutput, error) {
+func (mockS3APIWitHErrors) GetBucketReplication(_ context.Context, _ *s3.GetBucketReplicationInput, _ ...func(*s3.Options)) (*s3.GetBucketReplicationOutput, error) {
 	oe := &smithy.OperationError{
 		ServiceID:     "MockS3API",
 		OperationName: "GetBucketReplication",
@@ -276,7 +276,7 @@ func (m mockS3APIWitHErrors) GetBucketReplication(_ context.Context, _ *s3.GetBu
 	return nil, oe
 }
 
-func (m mockS3APIWitHErrors) GetBucketLifecycleConfiguration(_ context.Context, _ *s3.GetBucketLifecycleConfigurationInput, _ ...func(*s3.Options)) (*s3.GetBucketLifecycleConfigurationOutput, error) {
+func (mockS3APIWitHErrors) GetBucketLifecycleConfiguration(_ context.Context, _ *s3.GetBucketLifecycleConfigurationInput, _ ...func(*s3.Options)) (*s3.GetBucketLifecycleConfigurationOutput, error) {
 	oe := &smithy.OperationError{
 		ServiceID:     "MockS3API",
 		OperationName: "GetBucketLifecycleConfiguration",
diff --git a/service/discovery/azure/azure_test.go b/service/discovery/azure/azure_test.go
index 18afdf1f..b6cf49fd 100644
--- a/service/discovery/azure/azure_test.go
+++ b/service/discovery/azure/azure_test.go
@@ -67,7 +67,7 @@ func (mockSender) Do(req *http.Request) (res *http.Response, err error) {
 
 type mockAuthorizer struct{}
 
-func (c *mockAuthorizer) GetToken(_ context.Context, _ policy.TokenRequestOptions) (azcore.AccessToken, error) {
+func (*mockAuthorizer) GetToken(_ context.Context, _ policy.TokenRequestOptions) (azcore.AccessToken, error) {
 	var token azcore.AccessToken
 
 	return token, nil
diff --git a/service/discovery/azure/network_test.go b/service/discovery/azure/network_test.go
index aa0c0076..8111b8ea 100644
--- a/service/discovery/azure/network_test.go
+++ b/service/discovery/azure/network_test.go
@@ -485,7 +485,7 @@ func Test_azureNetworkDiscovery_discoverLoadBalancer(t *testing.T) {
 	}
 }
 
-func Test_azureNetworkDiscovery_publicIPAddressFromLoadBalancer(t *testing.T) {
+func Test_publicIPAddressFromLoadBalancer(t *testing.T) {
 	id := "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res1/providers/Microsoft.Network/loadBalancers/lb3"
 	name := "lb3"
 	location := "eastus"
@@ -565,17 +565,13 @@ func Test_azureNetworkDiscovery_publicIPAddressFromLoadBalancer(t *testing.T) {
 		},
 	}
 
-	type fields struct {
-		azureDiscovery azureDiscovery
-	}
 	type args struct {
 		lb *armnetwork.LoadBalancer
 	}
 	tests := []struct {
-		name   string
-		fields fields
-		args   args
-		want   []string
+		name string
+		args args
+		want []string
 	}{
 
 		{
@@ -597,11 +593,6 @@ func Test_azureNetworkDiscovery_publicIPAddressFromLoadBalancer(t *testing.T) {
 					},
 				},
 			},
-			fields: fields{
-				azureDiscovery: azureDiscovery{
-					cred: &mockAuthorizer{},
-				},
-			},
 			want: []string{},
 		},
 		{
@@ -609,11 +600,6 @@ func Test_azureNetworkDiscovery_publicIPAddressFromLoadBalancer(t *testing.T) {
 			args: args{
 				lb: lbWithoutPublicIPAddress,
 			},
-			fields: fields{
-				azureDiscovery: azureDiscovery{
-					cred: &mockAuthorizer{},
-				},
-			},
 			want: []string{},
 		},
 		{
@@ -621,11 +607,6 @@ func Test_azureNetworkDiscovery_publicIPAddressFromLoadBalancer(t *testing.T) {
 			args: args{
 				lb: lbWithoutIPAddress,
 			},
-			fields: fields{
-				azureDiscovery: azureDiscovery{
-					cred: &mockAuthorizer{},
-				},
-			},
 			want: []string{},
 		},
 		{
@@ -633,11 +614,6 @@ func Test_azureNetworkDiscovery_publicIPAddressFromLoadBalancer(t *testing.T) {
 			args: args{
 				lb: lbWithEmptyIPAddress,
 			},
-			fields: fields{
-				azureDiscovery: azureDiscovery{
-					cred: &mockAuthorizer{},
-				},
-			},
 			want: []string{},
 		},
 		{
@@ -645,20 +621,12 @@ func Test_azureNetworkDiscovery_publicIPAddressFromLoadBalancer(t *testing.T) {
 			args: args{
 				lb: lbComplete,
 			},
-			fields: fields{
-				azureDiscovery: azureDiscovery{
-					cred: &mockAuthorizer{},
-				},
-			},
 			want: []string{publicIPAddress},
 		},
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
-			d := &azureNetworkDiscovery{
-				azureDiscovery: tt.fields.azureDiscovery,
-			}
-			assert.Equal(t, tt.want, d.publicIPAddressFromLoadBalancer(tt.args.lb))
+			assert.Equal(t, tt.want, publicIPAddressFromLoadBalancer(tt.args.lb))
 		})
 	}
 }