Skip to content

Commit 0508282

Browse files
committed
chore: format code about whitespace
Signed-off-by: warjiang <[email protected]>
1 parent ef734e5 commit 0508282

File tree

17 files changed

+1
-29
lines changed

17 files changed

+1
-29
lines changed

cmd/metrics-scraper/app/scrape/other.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ func saveToDBWithConnection(db *sql.DB, appName, podName string, data *db.Parsed
122122

123123
// Insert metrics and values
124124
for metricName, metricData := range data.Metrics {
125-
126125
result, err := tx.Exec(fmt.Sprintf(insertMainSQL, sanitizedPodName), metricName, metricData.Help, metricData.Type, data.CurrentTime)
127126
if err != nil {
128127
log.Printf("Error inserting data for metric %s: %v", metricName, err)
@@ -272,5 +271,4 @@ func parseMetricsToJSON(metricsOutput string) (*db.ParsedData, error) {
272271
Metrics: metrics,
273272
}
274273
return parsedData, nil
275-
276274
}

hack/verify-staticcheck.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ else
3232
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VER}
3333
fi
3434

35-
if golangci-lint run --enable-only goimports,gci; then
35+
if golangci-lint run --enable-only goimports,gci,whitespace; then
3636
echo 'Congratulations! All Go source files have passed staticcheck.'
3737
else
3838
echo # print one empty line, separate from warning messages.

pkg/client/init.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ func InitKubeConfig(options ...Option) {
155155
}
156156
kubernetesApiConfig = apiConfig
157157
}
158-
159158
}
160159

161160
func InClusterClient() kubeclient.Interface {

pkg/dataselect/dataselect_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ func TestSort(t *testing.T) {
152152
testCase.Info, testCase.SortQuery, order, testCase.ExpectedOrder)
153153
}
154154
}
155-
156155
}
157156

158157
func TestPagination(t *testing.T) {
@@ -220,5 +219,4 @@ func TestPagination(t *testing.T) {
220219
testCase.Info, testCase.PaginationQuery, order, testCase.ExpectedOrder)
221220
}
222221
}
223-
224222
}

pkg/resource/common/resourcechannels.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ type DeploymentListChannel struct {
183183
// that both must be read numReads times.
184184
func GetDeploymentListChannel(client client.Interface,
185185
nsQuery *NamespaceQuery, numReads int) DeploymentListChannel {
186-
187186
channel := DeploymentListChannel{
188187
List: make(chan *apps.DeploymentList, numReads),
189188
Error: make(chan error, numReads),
@@ -313,7 +312,6 @@ type ServiceListChannel struct {
313312
// must be read numReads times.
314313
func GetServiceListChannel(client client.Interface, nsQuery *NamespaceQuery,
315314
numReads int) ServiceListChannel {
316-
317315
channel := ServiceListChannel{
318316
List: make(chan *v1.ServiceList, numReads),
319317
Error: make(chan error, numReads),
@@ -384,7 +382,6 @@ func GetPodListChannel(client client.Interface,
384382
// GetPodListChannelWithOptions is GetPodListChannel plus listing options.
385383
func GetPodListChannelWithOptions(client client.Interface, nsQuery *NamespaceQuery,
386384
options metaV1.ListOptions, numReads int) PodListChannel {
387-
388385
channel := PodListChannel{
389386
List: make(chan *v1.PodList, numReads),
390387
Error: make(chan error, numReads),
@@ -462,7 +459,6 @@ type NodeListChannel struct {
462459
// GetNodeListChannel returns a pair of channels to a Node list and errors that both must be read
463460
// numReads times.
464461
func GetNodeListChannel(client client.Interface, numReads int) NodeListChannel {
465-
466462
channel := NodeListChannel{
467463
List: make(chan *v1.NodeList, numReads),
468464
Error: make(chan error, numReads),
@@ -528,7 +524,6 @@ type ConfigMapListChannel struct {
528524
// numReads times.
529525
func GetConfigMapListChannel(client client.Interface, nsQuery *NamespaceQuery,
530526
numReads int) ConfigMapListChannel {
531-
532527
channel := ConfigMapListChannel{
533528
List: make(chan *v1.ConfigMapList, numReads),
534529
Error: make(chan error, numReads),

pkg/resource/cronjob/detail.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ type CronJobDetail struct {
3838

3939
// GetCronJobDetail gets Cron Job details.
4040
func GetCronJobDetail(client k8sClient.Interface, namespace, name string) (*CronJobDetail, error) {
41-
4241
rawObject, err := client.BatchV1().CronJobs(namespace).Get(context.TODO(), name, metaV1.GetOptions{})
4342
if err != nil {
4443
return nil, err

pkg/resource/cronjob/events.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
// GetCronJobEvents gets events associated to cron job.
2828
func GetCronJobEvents(client client.Interface, dsQuery *dataselect.DataSelectQuery, namespace, name string) (
2929
*common.EventList, error) {
30-
3130
raw, err := event.GetEvents(client, namespace, name)
3231
if err != nil {
3332
return event.EmptyEventList, err

pkg/resource/cronjob/jobs.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ var emptyJobList = &job.JobList{
4848
// GetCronJobJobs returns list of jobs owned by cron job.
4949
func GetCronJobJobs(client client.Interface,
5050
dsQuery *dataselect.DataSelectQuery, namespace, name string, active bool) (*job.JobList, error) {
51-
5251
cronJob, err := client.BatchV1().CronJobs(namespace).Get(context.TODO(), name, meta.GetOptions{})
5352
if err != nil {
5453
return emptyJobList, err
@@ -90,7 +89,6 @@ func GetCronJobJobs(client client.Interface,
9089
// TriggerCronJob manually triggers a cron job and creates a new job.
9190
func TriggerCronJob(client client.Interface,
9291
namespace, name string) error {
93-
9492
cronJob, err := client.BatchV1().CronJobs(namespace).Get(context.TODO(), name, meta.GetOptions{})
9593

9694
if err != nil {

pkg/resource/cronjob/list.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ func GetCronJobList(client client.Interface, nsQuery *common.NamespaceQuery,
6969
// GetCronJobListFromChannels returns a list of all CronJobs in the cluster reading required resource
7070
// list once from the channels.
7171
func GetCronJobListFromChannels(channels *common.ResourceChannels, dsQuery *dataselect.DataSelectQuery) (*CronJobList, error) {
72-
7372
cronJobs := <-channels.CronJobList.List
7473
err := <-channels.CronJobList.Error
7574
nonCriticalErrors, criticalError := errors.ExtractErrors(err)
@@ -83,7 +82,6 @@ func GetCronJobListFromChannels(channels *common.ResourceChannels, dsQuery *data
8382
}
8483

8584
func toCronJobList(cronJobs []batch.CronJob, nonCriticalErrors []error, dsQuery *dataselect.DataSelectQuery) *CronJobList {
86-
8785
list := &CronJobList{
8886
Items: make([]CronJob, 0),
8987
ListMeta: types.ListMeta{TotalItems: len(cronJobs)},

pkg/resource/daemonset/common.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
// label selector is targeting only 1 daemon set.
3737
func GetServicesForDSDeletion(client client.Interface, labelSelector labels.Selector,
3838
namespace string) ([]v1.Service, error) {
39-
4039
daemonSet, err := client.AppsV1().DaemonSets(namespace).List(context.TODO(), metaV1.ListOptions{
4140
LabelSelector: labelSelector.String(),
4241
FieldSelector: fields.Everything().String(),

0 commit comments

Comments
 (0)