From 8d69215912f9261628d0dc002946c17928624ff7 Mon Sep 17 00:00:00 2001 From: bala_ceg Date: Thu, 29 Jun 2023 22:19:49 +0530 Subject: [PATCH] fixing the Lint errors --- plugins/binance/api_key.go | 9 ++++----- plugins/binance/api_key_test.go | 17 ++++++++--------- plugins/binance/binance_cli.go | 6 +++--- plugins/binance/plugin.go | 2 +- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/plugins/binance/api_key.go b/plugins/binance/api_key.go index 3dc32a812..429f24fbd 100644 --- a/plugins/binance/api_key.go +++ b/plugins/binance/api_key.go @@ -12,8 +12,8 @@ import ( func APIKey() schema.CredentialType { return schema.CredentialType{ Name: credname.APIKey, - DocsURL: sdk.URL("https://github.com/binance/binance-cli"), - ManagementURL: sdk.URL("https://www.binance.com/en/my/settings/api-management"), + DocsURL: sdk.URL("https://github.com/binance/binance-cli"), + ManagementURL: sdk.URL("https://www.binance.com/en/my/settings/api-management"), Fields: []schema.CredentialField{ { Name: fieldname.APIKey, @@ -49,7 +49,6 @@ func APIKey() schema.CredentialType { } var defaultEnvVarMapping = map[string]sdk.FieldName{ - "BINANCE_API_KEY": fieldname.APIKey, - "BINANCE_API_SECRET": fieldname.APISecret, + "BINANCE_API_KEY": fieldname.APIKey, + "BINANCE_API_SECRET": fieldname.APISecret, } - diff --git a/plugins/binance/api_key_test.go b/plugins/binance/api_key_test.go index ec2155035..37eff5d6d 100644 --- a/plugins/binance/api_key_test.go +++ b/plugins/binance/api_key_test.go @@ -2,24 +2,23 @@ package binance import ( "testing" - + "github.com/1Password/shell-plugins/sdk" "github.com/1Password/shell-plugins/sdk/plugintest" "github.com/1Password/shell-plugins/sdk/schema/fieldname" ) - + func TestAPIKeyProvisioner(t *testing.T) { plugintest.TestProvisioner(t, APIKey().DefaultProvisioner, map[string]plugintest.ProvisionCase{ "default": { - ItemFields: map[sdk.FieldName]string{ - fieldname.APIKey: "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE", + ItemFields: map[sdk.FieldName]string{ + fieldname.APIKey: "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE", fieldname.APISecret: "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE", }, ExpectedOutput: sdk.ProvisionOutput{ Environment: map[string]string{ - "BINANCE_API_KEY": "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE", + "BINANCE_API_KEY": "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE", "BINANCE_API_SECRET": "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE", - }, }, }, @@ -29,14 +28,14 @@ func TestAPIKeyProvisioner(t *testing.T) { func TestAPIKeyImporter(t *testing.T) { plugintest.TestImporter(t, APIKey().Importer, map[string]plugintest.ImportCase{ "environment": { - Environment: map[string]string{ - "BINANCE_API_KEY": "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE", + Environment: map[string]string{ + "BINANCE_API_KEY": "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE", "BINANCE_API_SECRET": "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE", }, ExpectedCandidates: []sdk.ImportCandidate{ { Fields: map[sdk.FieldName]string{ - fieldname.APIKey: "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE", + fieldname.APIKey: "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE", fieldname.APISecret: "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE", }, }, diff --git a/plugins/binance/binance_cli.go b/plugins/binance/binance_cli.go index 70fb9cd79..f07aeb36c 100644 --- a/plugins/binance/binance_cli.go +++ b/plugins/binance/binance_cli.go @@ -9,9 +9,9 @@ import ( func BinanceCLI() schema.Executable { return schema.Executable{ - Name: "Binance CLI", - Runs: []string{"binance-cli"}, - DocsURL: sdk.URL("https://github.com/binance/binance-cli"), + Name: "Binance CLI", + Runs: []string{"binance-cli"}, + DocsURL: sdk.URL("https://github.com/binance/binance-cli"), NeedsAuth: needsauth.IfAll( needsauth.NotForHelpOrVersion(), needsauth.NotWithoutArgs(), diff --git a/plugins/binance/plugin.go b/plugins/binance/plugin.go index c1020fedc..7860bb0d5 100644 --- a/plugins/binance/plugin.go +++ b/plugins/binance/plugin.go @@ -10,7 +10,7 @@ func New() schema.Plugin { Name: "binance", Platform: schema.PlatformInfo{ Name: "Binance", - Homepage: sdk.URL("https://binance.com"), + Homepage: sdk.URL("https://binance.com"), }, Credentials: []schema.CredentialType{ APIKey(),