Skip to content

Commit 6ca3b70

Browse files
andrasbacsaiclaude
andcommitted
fix: resolve lint errors for stuttering type names
Move ServiceBulkUpdateEnvsRequest and ServiceBulkUpdateEnvsResponse to models package as ServiceEnvBulkUpdateRequest/Response to avoid the "type name stutters" lint error from revive. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8cf0b71 commit 6ca3b70

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

cmd/service/env/sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Example: coolify service env sync abc123 --file .env.production`,
108108
// Perform bulk update if there are vars to update
109109
if len(toUpdate) > 0 {
110110
fmt.Printf("Updating %d existing variables...\n", len(toUpdate))
111-
bulkReq := &service.ServiceBulkUpdateEnvsRequest{
111+
bulkReq := &models.ServiceEnvBulkUpdateRequest{
112112
Data: toUpdate,
113113
}
114114
_, err := serviceSvc.BulkUpdateEnvs(ctx, uuid, bulkReq)

internal/models/service.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,13 @@ type ServiceEnvironmentVariableUpdateRequest struct {
107107
IsMultiline *bool `json:"is_multiline,omitempty"`
108108
IsRuntime *bool `json:"is_runtime,omitempty"`
109109
}
110+
111+
// ServiceEnvBulkUpdateRequest represents the request to bulk update service environment variables
112+
type ServiceEnvBulkUpdateRequest struct {
113+
Data []ServiceEnvironmentVariableCreateRequest `json:"data"`
114+
}
115+
116+
// ServiceEnvBulkUpdateResponse represents the response from service bulk update
117+
type ServiceEnvBulkUpdateResponse struct {
118+
Message string `json:"message,omitempty"`
119+
}

internal/service/service.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,9 @@ func (s *Service) DeleteEnv(ctx context.Context, serviceUUID, envUUID string) er
156156
return nil
157157
}
158158

159-
// ServiceBulkUpdateEnvsRequest represents the request to bulk update service environment variables
160-
type ServiceBulkUpdateEnvsRequest struct {
161-
Data []models.ServiceEnvironmentVariableCreateRequest `json:"data"`
162-
}
163-
164-
// ServiceBulkUpdateEnvsResponse represents the response from service bulk update
165-
type ServiceBulkUpdateEnvsResponse struct {
166-
Message string `json:"message,omitempty"`
167-
}
168-
169159
// BulkUpdateEnvs updates multiple environment variables in a single request
170-
func (s *Service) BulkUpdateEnvs(ctx context.Context, serviceUUID string, req *ServiceBulkUpdateEnvsRequest) (*ServiceBulkUpdateEnvsResponse, error) {
171-
var response ServiceBulkUpdateEnvsResponse
160+
func (s *Service) BulkUpdateEnvs(ctx context.Context, serviceUUID string, req *models.ServiceEnvBulkUpdateRequest) (*models.ServiceEnvBulkUpdateResponse, error) {
161+
var response models.ServiceEnvBulkUpdateResponse
172162
err := s.client.Patch(ctx, fmt.Sprintf("services/%s/envs/bulk", serviceUUID), req, &response)
173163
if err != nil {
174164
return nil, fmt.Errorf("failed to bulk update environment variables for service %s: %w", serviceUUID, err)

0 commit comments

Comments
 (0)