Skip to content

Commit b16e7ef

Browse files
authored
style(fmt): fixed imports-check directive (#1349)
Signed-off-by: Salim Afiune Maya <[email protected]>
1 parent 2910edf commit b16e7ef

17 files changed

+189
-189
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ fmt-check: ## Lists formatting issues
146146

147147
.PHONY: imports-check
148148
imports-check: ## Lists imports issues
149-
@test -z $(shell goimports -l $(shell go list -f {{.Dir}} ./...) | grep -v proto)
149+
@test -z $(shell goimports -l $(shell go list -f {{.Dir}} ./... | grep -v proto))
150150

151151
.PHONY: run-api-example
152152
run-api-example: ## Run an API example like 'make run-api-example example=api/_examples/active-containers/main.go'

api/alert_channels.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,24 @@ type AlertChannelsService struct {
3636
// NOTE: This function must be used by any Alert Channel type.
3737
//
3838
// Basic usage: Initialize a new EmailUserAlertChannel struct, then
39-
// use the new instance to do CRUD operations
4039
//
41-
// client, err := api.NewClient("account")
42-
// if err != nil {
43-
// return err
44-
// }
40+
// use the new instance to do CRUD operations
4541
//
46-
// emailAlertChan := api.NewAlertChannel("foo",
47-
// api.EmailUserAlertChannelType,
48-
// api.EmailUserData{
49-
// ChannelProps: api.EmailUserChannelProps{
50-
// Recipients: []string{"[email protected]"},
51-
// },
52-
// },
53-
// )
42+
// client, err := api.NewClient("account")
43+
// if err != nil {
44+
// return err
45+
// }
5446
//
55-
// client.V2.AlertChannels.Create(emailAlertChan)
47+
// emailAlertChan := api.NewAlertChannel("foo",
48+
// api.EmailUserAlertChannelType,
49+
// api.EmailUserData{
50+
// ChannelProps: api.EmailUserChannelProps{
51+
// Recipients: []string{"[email protected]"},
52+
// },
53+
// },
54+
// )
5655
//
56+
// client.V2.AlertChannels.Create(emailAlertChan)
5757
func NewAlertChannel(name string, iType alertChannelType, data interface{}) AlertChannelRaw {
5858
return AlertChannelRaw{
5959
v2CommonIntegrationData: v2CommonIntegrationData{
@@ -179,9 +179,9 @@ func (svc *AlertChannelsService) Test(guid string) error {
179179
// To return a more specific Go struct of a Alert Channel integration, use the proper
180180
// method such as GetEmailUser() where the function name is composed by:
181181
//
182-
// Get<Type>(guid)
182+
// Get<Type>(guid)
183183
//
184-
// Where <Type> is the Alert Channel integration type.
184+
// Where <Type> is the Alert Channel integration type.
185185
func (svc *AlertChannelsService) Get(guid string, response interface{}) error {
186186
return svc.get(guid, &response)
187187
}

api/alert_profiles.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,24 @@ type alertProfilesService struct {
4646
// NewAlertProfile returns an instance of the AlertProfileConfig struct
4747
//
4848
// Basic usage: Initialize a new AlertProfileConfig struct, then
49-
// use the new instance to do CRUD operations
5049
//
51-
// client, err := api.NewClient("account")
52-
// if err != nil {
53-
// return err
54-
// }
50+
// use the new instance to do CRUD operations
5551
//
56-
// alertProfile := api.NewAlertProfile(
57-
// "CUSTOM_PROFILE_NAME",
58-
// "LW_HE_FILES_DEFAULT_PROFILE"
59-
// []api.AlertTemplate{{
60-
// ...
61-
// }
62-
// },
63-
// )
52+
// client, err := api.NewClient("account")
53+
// if err != nil {
54+
// return err
55+
// }
6456
//
65-
// client.V2.Alert.Profiles.Create(AlertProfile)
57+
// alertProfile := api.NewAlertProfile(
58+
// "CUSTOM_PROFILE_NAME",
59+
// "LW_HE_FILES_DEFAULT_PROFILE"
60+
// []api.AlertTemplate{{
61+
// ...
62+
// }
63+
// },
64+
// )
6665
//
66+
// client.V2.Alert.Profiles.Create(AlertProfile)
6767
func NewAlertProfile(id string, extends string, alerts []AlertTemplate) AlertProfileConfig {
6868
profile := AlertProfileConfig{
6969
Guid: id,

api/compliance_evaluations.go

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,20 @@ const AwsComplianceEvaluationDataset complianceEvaluationDataset = "AwsComplianc
3232
//
3333
// e.g.
3434
//
35-
// var (
36-
// awsComplianceEvaluationSearchResponse api.ComplianceEvaluationAwsResponse
37-
// filter = api.ComplianceEvaluationSearch{
38-
// SearchFilter: api.SearchFilter{
39-
// Filters: []api.Filter{{
40-
// Expression: "eq",
41-
// Field: "resource",
42-
// Value: arn:aws:s3:::my-bucket,
43-
// }},
44-
// },
45-
// Dataset: api.AwsComplianceEvaluationDataset,
46-
// }
47-
// )
48-
// lacework.V2.ComplianceEvaluation.Search(&awsComplianceEvaluationSearchResponse, filters)
49-
//
35+
// var (
36+
// awsComplianceEvaluationSearchResponse api.ComplianceEvaluationAwsResponse
37+
// filter = api.ComplianceEvaluationSearch{
38+
// SearchFilter: api.SearchFilter{
39+
// Filters: []api.Filter{{
40+
// Expression: "eq",
41+
// Field: "resource",
42+
// Value: arn:aws:s3:::my-bucket,
43+
// }},
44+
// },
45+
// Dataset: api.AwsComplianceEvaluationDataset,
46+
// }
47+
// )
48+
// lacework.V2.ComplianceEvaluation.Search(&awsComplianceEvaluationSearchResponse, filters)
5049
func (svc *ComplianceEvaluationService) Search(response interface{}, filters SearchableFilter) error {
5150
return svc.client.RequestEncoderDecoder("POST", apiV2ComplianceEvaluationsSearch, filters, response)
5251
}

api/container_registries.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,26 @@ type ContainerRegistriesService struct {
3737
// NOTE: This function must be used by any Container Registry type.
3838
//
3939
// Basic usage: Initialize a new GhcrContainerRegistry integration struct, then
40-
// use the new instance to do CRUD operations
4140
//
42-
// client, err := api.NewClient("account")
43-
// if err != nil {
44-
// return err
45-
// }
41+
// use the new instance to do CRUD operations
4642
//
47-
// ghcr := api.NewContainerRegistry("foo",
48-
// api.GhcrContainerRegistry,
49-
// api.GhcrData{
50-
// Credentials: api.GhcrCredentials {
51-
// Username: "bubu",
52-
// Password: "supers3cret",
53-
// Ssl: true,
54-
// },
55-
// },
56-
// )
43+
// client, err := api.NewClient("account")
44+
// if err != nil {
45+
// return err
46+
// }
5747
//
58-
// client.V2.ContainerRegistries.Create(ghcr)
48+
// ghcr := api.NewContainerRegistry("foo",
49+
// api.GhcrContainerRegistry,
50+
// api.GhcrData{
51+
// Credentials: api.GhcrCredentials {
52+
// Username: "bubu",
53+
// Password: "supers3cret",
54+
// Ssl: true,
55+
// },
56+
// },
57+
// )
5958
//
59+
// client.V2.ContainerRegistries.Create(ghcr)
6060
func NewContainerRegistry(name string, regType containerRegistryType, data interface{}) ContainerRegistryRaw {
6161
reg := ContainerRegistryRaw{
6262
v2CommonIntegrationData: v2CommonIntegrationData{
@@ -178,9 +178,9 @@ func (svc *ContainerRegistriesService) Delete(guid string) error {
178178
// To return a more specific Go struct of a Container Registry integration, use the proper
179179
// method such as GetGhcr() where the function name is composed by:
180180
//
181-
// Get<Type>(guid)
181+
// Get<Type>(guid)
182182
//
183-
// Where <Type> is the Container Registry integration type.
183+
// Where <Type> is the Container Registry integration type.
184184
func (svc *ContainerRegistriesService) Get(guid string, response interface{}) error {
185185
return svc.get(guid, &response)
186186
}

api/inventory.go

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,20 @@ const AwsInventoryDataset inventoryDataset = "AwsCompliance"
3939
//
4040
// e.g.
4141
//
42-
// var (
43-
// awsInventorySearchResponse api.InventoryAwsResponse
44-
// filter = api.InventorySearch{
45-
// SearchFilter: api.SearchFilter{
46-
// Filters: []api.Filter{{
47-
// Expression: "eq",
48-
// Field: "urn",
49-
// Value: arn:aws:s3:::my-bucket,
50-
// }},
51-
// },
52-
// Dataset: api.AwsComplianceEvaluationDataset,
53-
// }
54-
// )
55-
// lacework.V2.Inventory.Search(&awsInventorySearchResponse, filters)
56-
//
42+
// var (
43+
// awsInventorySearchResponse api.InventoryAwsResponse
44+
// filter = api.InventorySearch{
45+
// SearchFilter: api.SearchFilter{
46+
// Filters: []api.Filter{{
47+
// Expression: "eq",
48+
// Field: "urn",
49+
// Value: arn:aws:s3:::my-bucket,
50+
// }},
51+
// },
52+
// Dataset: api.AwsComplianceEvaluationDataset,
53+
// }
54+
// )
55+
// lacework.V2.Inventory.Search(&awsInventorySearchResponse, filters)
5756
func (svc *InventoryService) Search(response interface{}, filters SearchableFilter) error {
5857
return svc.client.RequestEncoderDecoder("POST", apiV2InventorySearch, filters, response)
5958
}

api/policy.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ func ParseNewPolicy(s string) (NewPolicy, error) {
118118
return policy, errors.New("policy must be valid JSON or YAML")
119119
}
120120

121-
/* In order to properly PATCH we need to omit items that aren't specified.
121+
/*
122+
In order to properly PATCH we need to omit items that aren't specified.
123+
122124
For booleans and integers Golang will omit zero values false and 0 respectively.
123125
This would prevent someone from toggling something to disabled or 0 respectively.
124126
As such we are using pointers instead of primitives for booleans and integers in this struct

api/report_rules.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -134,27 +134,27 @@ const (
134134
// NewReportRule returns an instance of the ReportRule struct
135135
//
136136
// Basic usage: Initialize a new ReportRule struct, then
137-
// use the new instance to do CRUD operations
138137
//
139-
// client, err := api.NewClient("account")
140-
// if err != nil {
141-
// return err
142-
// }
138+
// use the new instance to do CRUD operations
143139
//
144-
// reportRule := api.NewReportRule(
145-
// "Foo",
146-
// api.ReportRuleConfig{
147-
// Description: "My Report Rule"
148-
// Severities: api.ReportRuleSeverities{api.ReportRuleSeverityHigh,
149-
// EmailAlertChannels: []string{"TECHALLY_000000000000AAAAAAAAAAAAAAAAAAAA"},
150-
// ResourceGroups: []string{"TECHALLY_111111111111AAAAAAAAAAAAAAAAAAAA"}
151-
// ReportNotificationTypes: api.WeeklyEventsReportRuleNotifications{TrendReport: true},
152-
// },
153-
// },
154-
// )
140+
// client, err := api.NewClient("account")
141+
// if err != nil {
142+
// return err
143+
// }
155144
//
156-
// client.V2.ReportRules.Create(reportRule)
145+
// reportRule := api.NewReportRule(
146+
// "Foo",
147+
// api.ReportRuleConfig{
148+
// Description: "My Report Rule"
149+
// Severities: api.ReportRuleSeverities{api.ReportRuleSeverityHigh,
150+
// EmailAlertChannels: []string{"TECHALLY_000000000000AAAAAAAAAAAAAAAAAAAA"},
151+
// ResourceGroups: []string{"TECHALLY_111111111111AAAAAAAAAAAAAAAAAAAA"}
152+
// ReportNotificationTypes: api.WeeklyEventsReportRuleNotifications{TrendReport: true},
153+
// },
154+
// },
155+
// )
157156
//
157+
// client.V2.ReportRules.Create(reportRule)
158158
func NewReportRule(name string, rule ReportRuleConfig) (ReportRule, error) {
159159
notifications, err := NewReportRuleNotificationTypes(rule.NotificationTypes)
160160
if err != nil {

api/resource_groups.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,26 +87,26 @@ func (i ResourceGroupType) String() string {
8787
// NOTE: This function must be used by any ResourceGroup type.
8888
//
8989
// Basic usage: Initialize a new ContainerResourceGroup struct, then
90-
// use the new instance to do CRUD operations
9190
//
92-
// client, err := api.NewClient("account")
93-
// if err != nil {
94-
// return err
95-
// }
91+
// use the new instance to do CRUD operations
9692
//
97-
// group := api.NewResourceGroup("container resource group",
98-
// api.ContainerResourceGroup,
99-
// api.ContainerResourceGroupData{
100-
// Props: api.ContainerResourceGroupProps{
101-
// Description: "all containers,
102-
// ContainerLabels: ContainerResourceGroupAllLabels,
103-
// ContainerTags: ContainerResourceGroupAllTags,
104-
// },
105-
// },
106-
// )
93+
// client, err := api.NewClient("account")
94+
// if err != nil {
95+
// return err
96+
// }
10797
//
108-
// client.V2.ResourceGroups.Create(group)
98+
// group := api.NewResourceGroup("container resource group",
99+
// api.ContainerResourceGroup,
100+
// api.ContainerResourceGroupData{
101+
// Props: api.ContainerResourceGroupProps{
102+
// Description: "all containers,
103+
// ContainerLabels: ContainerResourceGroupAllLabels,
104+
// ContainerTags: ContainerResourceGroupAllTags,
105+
// },
106+
// },
107+
// )
109108
//
109+
// client.V2.ResourceGroups.Create(group)
110110
func NewResourceGroup(name string, iType ResourceGroupType, props interface{}) ResourceGroupData {
111111
return ResourceGroupData{
112112
Name: name,
@@ -250,9 +250,9 @@ func (svc *ResourceGroupsService) Delete(guid string) error {
250250
// To return a more specific Go struct of a Resource Group, use the proper
251251
// method such as GetContainerResourceGroup() where the function name is composed by:
252252
//
253-
// Get<Type>(guid)
253+
// Get<Type>(guid)
254254
//
255-
// Where <Type> is the Resource Group type.
255+
// Where <Type> is the Resource Group type.
256256
func (svc *ResourceGroupsService) Get(guid string, response interface{}) error {
257257
var rawResponse resourceGroupWorkaroundResponse
258258
err := svc.get(guid, &rawResponse)

0 commit comments

Comments
 (0)