Skip to content

Commit ed3edff

Browse files
henrybarretogustavosbarreto
authored andcommitted
chore: run gofumpt on project
1 parent 0ea65fa commit ed3edff

File tree

5 files changed

+23
-26
lines changed

5 files changed

+23
-26
lines changed

api/routes/api-key_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ func TestListAPIKey(t *testing.T) {
321321
CreatedBy: "507f1f77bcf86cd799439011",
322322
TenantID: "00000000-0000-4000-0000-000000000000",
323323
Role: "admin",
324-
CreatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
325-
UpdatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
324+
CreatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
325+
UpdatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
326326
ExpiresIn: 0,
327327
},
328328
},
@@ -338,8 +338,8 @@ func TestListAPIKey(t *testing.T) {
338338
CreatedBy: "507f1f77bcf86cd799439011",
339339
TenantID: "00000000-0000-4000-0000-000000000000",
340340
Role: "admin",
341-
CreatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
342-
UpdatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
341+
CreatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
342+
UpdatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
343343
ExpiresIn: 0,
344344
},
345345
},
@@ -379,8 +379,8 @@ func TestListAPIKey(t *testing.T) {
379379
CreatedBy: "507f1f77bcf86cd799439011",
380380
TenantID: "00000000-0000-4000-0000-000000000000",
381381
Role: "admin",
382-
CreatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
383-
UpdatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
382+
CreatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
383+
UpdatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
384384
ExpiresIn: 0,
385385
},
386386
},
@@ -396,8 +396,8 @@ func TestListAPIKey(t *testing.T) {
396396
CreatedBy: "507f1f77bcf86cd799439011",
397397
TenantID: "00000000-0000-4000-0000-000000000000",
398398
Role: "admin",
399-
CreatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
400-
UpdatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
399+
CreatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
400+
UpdatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
401401
ExpiresIn: 0,
402402
},
403403
},
@@ -435,8 +435,8 @@ func TestListAPIKey(t *testing.T) {
435435
CreatedBy: "507f1f77bcf86cd799439011",
436436
TenantID: "00000000-0000-4000-0000-000000000000",
437437
Role: "admin",
438-
CreatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
439-
UpdatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
438+
CreatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
439+
UpdatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
440440
ExpiresIn: 0,
441441
},
442442
},
@@ -452,8 +452,8 @@ func TestListAPIKey(t *testing.T) {
452452
CreatedBy: "507f1f77bcf86cd799439011",
453453
TenantID: "00000000-0000-4000-0000-000000000000",
454454
Role: "admin",
455-
CreatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
456-
UpdatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
455+
CreatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
456+
UpdatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
457457
ExpiresIn: 0,
458458
},
459459
},
@@ -492,8 +492,8 @@ func TestListAPIKey(t *testing.T) {
492492
CreatedBy: "507f1f77bcf86cd799439011",
493493
TenantID: "00000000-0000-4000-0000-000000000000",
494494
Role: "admin",
495-
CreatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
496-
UpdatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
495+
CreatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
496+
UpdatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
497497
ExpiresIn: 0,
498498
},
499499
},
@@ -509,8 +509,8 @@ func TestListAPIKey(t *testing.T) {
509509
CreatedBy: "507f1f77bcf86cd799439011",
510510
TenantID: "00000000-0000-4000-0000-000000000000",
511511
Role: "admin",
512-
CreatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
513-
UpdatedAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
512+
CreatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
513+
UpdatedAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
514514
ExpiresIn: 0,
515515
},
516516
},

api/services/member_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ func TestAddNamespaceMember(t *testing.T) {
435435
ID: "000000000000000000000001",
436436
Role: authorizer.RoleAdministrator,
437437
Status: models.MemberStatusPending,
438-
ExpiresAt: time.Date(2023, 01, 01, 12, 00, 00, 00, time.UTC),
438+
ExpiresAt: time.Date(2023, 0o1, 0o1, 12, 0o0, 0o0, 0o0, time.UTC),
439439
},
440440
},
441441
}, nil).

api/store/mongo/migrations/migration_69.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ var migration69 = migrate.Migration{
8383

8484
return nil, err
8585
})
86-
8786
if err != nil {
8887
return err
8988
}

api/store/transaction.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import (
55
"errors"
66
)
77

8-
var (
9-
ErrStartTransactionFailed = errors.New("start transaction failed")
10-
)
8+
var ErrStartTransactionFailed = errors.New("start transaction failed")
119

1210
// TransactionCb defines the function signature expected for transaction operations.
1311
// It typically encompasses a series of store method calls that must be executed within a transaction.

gateway/nginx.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bytes"
55
"errors"
66
"fmt"
7-
"github.com/fsnotify/fsnotify"
87
"io/fs"
98
"log"
109
"os"
@@ -14,6 +13,8 @@ import (
1413
"strings"
1514
"syscall"
1615
"text/template"
16+
17+
"github.com/fsnotify/fsnotify"
1718
)
1819

1920
// NginxController manages the configuration and operation of NGINX.
@@ -26,7 +27,7 @@ type NginxController struct {
2627

2728
// generateConfigs generates the NGINX configuration files.
2829
func (nc *NginxController) generateConfigs() {
29-
if err := os.MkdirAll("/etc/nginx", 0755); err != nil {
30+
if err := os.MkdirAll("/etc/nginx", 0o755); err != nil {
3031
log.Fatalf("Failed to create nginx directory: %v", err)
3132
}
3233

@@ -48,15 +49,14 @@ func (nc *NginxController) generateConfigs() {
4849
destPath := filepath.Join(nc.rootDir, relativePath)
4950

5051
if info.IsDir() {
51-
if err := os.MkdirAll(destPath, 0755); err != nil {
52+
if err := os.MkdirAll(destPath, 0o755); err != nil {
5253
return fmt.Errorf("failed to create directory %s: %w", destPath, err)
5354
}
5455
} else {
5556
nc.generateConfig(path, destPath)
5657
}
5758
return nil
5859
})
59-
6060
if err != nil {
6161
log.Fatalf("Failed to process templates: %v", err)
6262
}
@@ -84,7 +84,7 @@ func (nc *NginxController) generateConfig(src, dst string) {
8484
log.Fatalf("Failed to execute template %s: %v", src, err)
8585
}
8686

87-
err = os.WriteFile(dst, output.Bytes(), 0644)
87+
err = os.WriteFile(dst, output.Bytes(), 0o644)
8888
if err != nil {
8989
log.Fatalf("Failed to write config file %s: %v", dst, err)
9090
}

0 commit comments

Comments
 (0)