Skip to content

Commit 3018730

Browse files
authored
Merge pull request #57 from theBeginner86/thebeginner86/chore/lint
[chore] Fix failing lint
2 parents 9d4a3db + ad63130 commit 3018730

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

cmd/kanvas-snapshot/cmd.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121

2222
var (
2323
ProviderToken string
24-
MesheryApiBaseUrl string
25-
MesheryCloudApiBaseUrl string
24+
MesheryAPIBaseURL string
25+
MesheryCloudAPIBaseURL string
2626
Log logger.Handler
2727
)
2828

@@ -51,7 +51,7 @@ var generateKanvasSnapshotCmd = &cobra.Command{
5151
-e, --email string email address to notify when snapshot is ready (required)
5252
-h Help for Helm Kanvas Snapshot plugin`,
5353

54-
RunE: func(cmd *cobra.Command, args []string) error {
54+
RunE: func(_ *cobra.Command, _ []string) error {
5555
// Use the extracted name from URI if not provided
5656
if designName == "" {
5757
designName = ExtractNameFromURI(chartURI)
@@ -156,7 +156,7 @@ func CreateMesheryDesign(uri, name, email string) (string, error) {
156156

157157
sourceType := "Helm Chart"
158158
encodedChartType := url.PathEscape(sourceType)
159-
fullURL := fmt.Sprintf("%s/api/pattern/%s", MesheryApiBaseUrl, encodedChartType)
159+
fullURL := fmt.Sprintf("%s/api/pattern/%s", MesheryAPIBaseURL, encodedChartType)
160160

161161
// Create the request
162162
req, err := http.NewRequest("POST", fullURL, bytes.NewBuffer(payloadBytes))
@@ -167,8 +167,8 @@ func CreateMesheryDesign(uri, name, email string) (string, error) {
167167

168168
// Set headers and log them
169169
req.Header.Set("Cookie", ProviderToken)
170-
req.Header.Set("Origin", MesheryApiBaseUrl)
171-
req.Header.Set("Host", MesheryApiBaseUrl)
170+
req.Header.Set("Origin", MesheryAPIBaseURL)
171+
req.Header.Set("Host", MesheryAPIBaseURL)
172172
req.Header.Set("Content-Type", "text/plain;charset=UTF-8")
173173
req.Header.Set("Accept-Encoding", "gzip, deflate, br, zstd")
174174
req.Header.Set("Accept-Language", "en-GB,en-US;q=0.9,en;q=0.8")
@@ -205,7 +205,7 @@ func CreateMesheryDesign(uri, name, email string) (string, error) {
205205
return "", errors.ErrCreatingMesheryDesign(fmt.Errorf("failed to extract design ID from response"))
206206
}
207207

208-
func GenerateSnapshot(designID, chartURI, email, assetLocation string) error {
208+
func GenerateSnapshot(designID, _, email, assetLocation string) error {
209209
payload := map[string]interface{}{
210210
"Payload": map[string]string{
211211
"application_type": "Helm Chart",
@@ -224,7 +224,7 @@ func GenerateSnapshot(designID, chartURI, email, assetLocation string) error {
224224
// Create the POST request
225225
req, err := http.NewRequest(
226226
"POST",
227-
fmt.Sprintf("%s/api/integrations/trigger/workflow", MesheryCloudApiBaseUrl),
227+
fmt.Sprintf("%s/api/integrations/trigger/workflow", MesheryCloudAPIBaseURL),
228228
bytes.NewBuffer(payloadBytes),
229229
)
230230
if err != nil {
@@ -233,7 +233,7 @@ func GenerateSnapshot(designID, chartURI, email, assetLocation string) error {
233233

234234
req.Header.Set("Cookie", ProviderToken)
235235
req.Header.Set("Content-Type", "application/json")
236-
req.Header.Set("Referer", fmt.Sprintf("%s/dashboard", MesheryCloudApiBaseUrl))
236+
req.Header.Set("Referer", fmt.Sprintf("%s/dashboard", MesheryCloudAPIBaseURL))
237237

238238
client := &http.Client{}
239239

internal/errors/error.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ func ErrRequiredFieldNotProvided(err error, field string) error {
7575
return errors.New(ErrRequiredFieldNotProvidedCode, errors.Alert,
7676
[]string{"All required flags are not passed."},
7777
[]string{err.Error()},
78-
[]string{"Required flag \"%s\" is not passed."},
79-
[]string{"Ensure value for flag \"%s\" is correctly provided."},
78+
[]string{fmt.Sprintf("Required flag \"%s\" is not passed.", field)},
79+
[]string{fmt.Sprintf("Ensure value for flag \"%s\" is correctly provided.", field)},
8080
)
8181
}
8282

0 commit comments

Comments
 (0)