Skip to content

Commit f73932f

Browse files
authored
style(lint): enable line length check (#1123)
Closes #941 Signed-off-by: Salim Afiune Maya <[email protected]>
1 parent ec2a7d3 commit f73932f

File tree

130 files changed

+1092
-604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+1092
-604
lines changed

.golangci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,11 @@ run:
22
deadline: 5m
33
tests: false
44
modules-download-mode: vendor
5+
6+
linters-settings:
7+
lll:
8+
line-length: 120
9+
10+
linters:
11+
enable:
12+
- lll

api/agent_access_tokens.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func (svc *AgentAccessTokensService) SearchAlias(alias string) (
119119
apiV2AgentAccessTokensSearch,
120120
SearchFilter{
121121
Filters: []Filter{
122-
Filter{
122+
{
123123
Field: "tokenAlias",
124124
Expression: "eq",
125125
Value: alias,

api/alert_channels_aws_cloudwatch.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@ package api
2020

2121
// GetCloudwatchEb gets a single instance of an AWS Cloudwatch alert channel
2222
// with the corresponding integration guid
23-
func (svc *AlertChannelsService) GetCloudwatchEb(guid string) (response CloudwatchEbAlertChannelResponseV2, err error) {
23+
func (svc *AlertChannelsService) GetCloudwatchEb(guid string) (
24+
response CloudwatchEbAlertChannelResponseV2, err error,
25+
) {
2426
err = svc.get(guid, &response)
2527
return
2628
}
2729

28-
// UpdateCloudwatchEb Update AWSCloudWatch updates a single instance of an AWS cloudwatch integration on the Lacework server
29-
func (svc *AlertChannelsService) UpdateCloudwatchEb(data AlertChannel) (response CloudwatchEbAlertChannelResponseV2, err error) {
30+
// UpdateCloudwatchEb Update AWSCloudWatch updates a single instance of an AWS
31+
// cloudwatch integration on the Lacework server
32+
func (svc *AlertChannelsService) UpdateCloudwatchEb(data AlertChannel) (
33+
response CloudwatchEbAlertChannelResponseV2, err error,
34+
) {
3035
err = svc.update(data.ID(), data, &response)
3136
return
3237
}

api/alert_channels_cisco_spark_webhook.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ package api
2020

2121
// GetCiscoSparkWebhook gets a single instance of a Cisco Spark webhook alert channel
2222
// with the corresponding integration guid
23-
func (svc *AlertChannelsService) GetCiscoSparkWebhook(guid string) (response CiscoSparkWebhookAlertChannelResponseV2, err error) {
23+
func (svc *AlertChannelsService) GetCiscoSparkWebhook(guid string) (
24+
response CiscoSparkWebhookAlertChannelResponseV2, err error,
25+
) {
2426
err = svc.get(guid, &response)
2527
return
2628
}
2729

2830
// UpdateCiscoSparkWebhook updates a single instance of Cisco Spark webhook integration on the Lacework server
29-
func (svc *AlertChannelsService) UpdateCiscoSparkWebhook(data AlertChannel) (response CiscoSparkWebhookAlertChannelResponseV2, err error) {
31+
func (svc *AlertChannelsService) UpdateCiscoSparkWebhook(data AlertChannel) (
32+
response CiscoSparkWebhookAlertChannelResponseV2, err error,
33+
) {
3034
err = svc.update(data.ID(), data, &response)
3135
return
3236
}

api/alert_channels_gcp_pub_sub.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ func (svc *AlertChannelsService) GetGcpPubSub(guid string) (response GcpPubSubAl
2525
}
2626

2727
// UpdateGcpPubSub updates a single instance of GCP Pub Sub integration on the Lacework server
28-
func (svc *AlertChannelsService) UpdateGcpPubSub(data AlertChannel) (response GcpPubSubAlertChannelResponseV2, err error) {
28+
func (svc *AlertChannelsService) UpdateGcpPubSub(data AlertChannel) (
29+
response GcpPubSubAlertChannelResponseV2, err error,
30+
) {
2931
err = svc.update(data.ID(), data, &response)
3032
return
3133
}

api/alert_channels_microsoft_teams.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ package api
2020

2121
// GetMicrosoftTeams gets a single instance of a MicrosoftTeams alert channel
2222
// with the corresponding integration guid
23-
func (svc *AlertChannelsService) GetMicrosoftTeams(guid string) (response MicrosoftTeamsAlertChannelResponseV2, err error) {
23+
func (svc *AlertChannelsService) GetMicrosoftTeams(guid string) (
24+
response MicrosoftTeamsAlertChannelResponseV2, err error,
25+
) {
2426
err = svc.get(guid, &response)
2527
return
2628
}
2729

2830
// UpdateMicrosoftTeams updates a single instance of a MicrosoftTeams integration on the Lacework server
29-
func (svc *AlertChannelsService) UpdateMicrosoftTeams(data AlertChannel) (response MicrosoftTeamsAlertChannelResponseV2, err error) {
31+
func (svc *AlertChannelsService) UpdateMicrosoftTeams(data AlertChannel) (
32+
response MicrosoftTeamsAlertChannelResponseV2, err error,
33+
) {
3034
err = svc.update(data.ID(), data, &response)
3135
return
3236
}

api/component_data.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ func (svc *ComponentDataService) UploadFiles(name string, tags []string, paths [
6060
}
6161
var initialResponse ComponentDataInitialResponseRaw
6262
err = doWithExponentialBackoffWaiting(func() error {
63-
return svc.client.RequestEncoderDecoder(http.MethodPost, apiV2ComponentDataRequest, initialRequest, &initialResponse)
63+
return svc.client.RequestEncoderDecoder(http.MethodPost,
64+
apiV2ComponentDataRequest,
65+
initialRequest,
66+
&initialResponse,
67+
)
6468
})
6569
if err != nil {
6670
return "", err
@@ -87,7 +91,11 @@ func (svc *ComponentDataService) UploadFiles(name string, tags []string, paths [
8791
}
8892
var completeResponse ComponentDataCompleteResponseRaw
8993
err = doWithExponentialBackoffWaiting(func() error {
90-
return svc.client.RequestEncoderDecoder(http.MethodPost, apiV2ComponentDataComplete, completeRequest, &completeResponse)
94+
return svc.client.RequestEncoderDecoder(http.MethodPost,
95+
apiV2ComponentDataComplete,
96+
completeRequest,
97+
&completeResponse,
98+
)
9199
})
92100
if err != nil {
93101
return "", err
@@ -98,7 +106,9 @@ func (svc *ComponentDataService) UploadFiles(name string, tags []string, paths [
98106
return initialResponse.Data.Guid, nil
99107
}
100108

101-
func buildComponentDataInitialRequest(name string, tags []string, paths []string) (*ComponentDataInitialRequest, error) {
109+
func buildComponentDataInitialRequest(
110+
name string, tags []string, paths []string,
111+
) (*ComponentDataInitialRequest, error) {
102112
documents := make([]*DocumentSpec, 0, len(paths))
103113
for _, path := range paths {
104114
info, err := os.Lstat(path)

api/entities_containers.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ func (svc *EntitiesService) ListContainers() (response ContainersEntityResponse,
4040
}
4141

4242
// ListContainersWithFilters returns a list of Active Containers based on a user defined filter
43-
func (svc *EntitiesService) ListContainersWithFilters(filters SearchFilter) (response ContainersEntityResponse, err error) {
43+
func (svc *EntitiesService) ListContainersWithFilters(filters SearchFilter) (
44+
response ContainersEntityResponse, err error,
45+
) {
4446
err = svc.Search(&response, filters)
4547
return
4648
}

api/entities_images.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ func (svc *EntitiesService) ListAllImages() (response ImagesEntityResponse, err
6767
return
6868
}
6969

70-
// ListAllImagesWithFilters iterates over all pages to return all images information at once based on a user defined filter
71-
func (svc *EntitiesService) ListAllImagesWithFilters(filters SearchFilter) (response ImagesEntityResponse, err error) {
70+
// ListAllImagesWithFilters iterates over all pages to return all images information
71+
// at once based on a user defined filter
72+
func (svc *EntitiesService) ListAllImagesWithFilters(filters SearchFilter) (
73+
response ImagesEntityResponse, err error,
74+
) {
7275
response, err = svc.ListImagesWithFilters(filters)
7376
if err != nil {
7477
return

api/entities_machine_details.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ func (svc *EntitiesService) ListMachineDetails() (response MachineDetailsEntityR
3838
}
3939

4040
// ListMachineDetailsWithFilters returns a list of UserEntity based on a user defined filter
41-
func (svc *EntitiesService) ListMachineDetailsWithFilters(filters SearchFilter) (response MachineDetailsEntityResponse, err error) {
41+
func (svc *EntitiesService) ListMachineDetailsWithFilters(filters SearchFilter) (
42+
response MachineDetailsEntityResponse, err error,
43+
) {
4244
err = svc.Search(&response, filters)
4345
return
4446
}
@@ -69,8 +71,11 @@ func (svc *EntitiesService) ListAllMachineDetails() (response MachineDetailsEnti
6971
return
7072
}
7173

72-
// ListAllMachineDetailsWithFilters iterates over all pages to return all machine details at once based on a user defined filter
73-
func (svc *EntitiesService) ListAllMachineDetailsWithFilters(filters SearchFilter) (response MachineDetailsEntityResponse, err error) {
74+
// ListAllMachineDetailsWithFilters iterates over all pages to return all machine details
75+
// at once based on a user defined filter
76+
func (svc *EntitiesService) ListAllMachineDetailsWithFilters(filters SearchFilter) (
77+
response MachineDetailsEntityResponse, err error,
78+
) {
7479
response, err = svc.ListMachineDetailsWithFilters(filters)
7580
if err != nil {
7681
return

0 commit comments

Comments
 (0)