Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 11c5e49

Browse files
committed
Merge branch 'bump-linter' into 'master'
refactor: bump the code linter to be an up-to-date See merge request postgres-ai/database-lab!255
2 parents 48a5cbe + cc154d0 commit 11c5e49

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ all: clean build
2929

3030
# Install the linter to $GOPATH/bin which is expected to be in $PATH
3131
install-lint:
32-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.30.0
32+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.35.2
3333

3434
run-lint:
3535
golangci-lint run

cmd/database-lab/main.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ func main() {
5151
log.Fatal(errors.WithMessage(err, "failed to parse config"))
5252
}
5353

54-
ctx, cancel := context.WithCancel(context.Background())
55-
defer cancel()
56-
5754
runner := runners.NewLocalRunner(cfg.Provision.UseSudo)
5855

5956
pm := pool.NewPoolManager(&cfg.PoolManager, runner)
@@ -66,10 +63,14 @@ func main() {
6663
log.Fatal("Failed to create a Docker client:", err)
6764
}
6865

66+
ctx, cancel := context.WithCancel(context.Background())
67+
defer cancel()
68+
6969
// Create a platform service to make requests to Platform.
7070
platformSvc, err := platform.New(ctx, cfg.Platform)
7171
if err != nil {
72-
log.Fatalf(errors.WithMessage(err, "failed to create a new platform service"))
72+
log.Errf(errors.WithMessage(err, "failed to create a new platform service").Error())
73+
return
7374
}
7475

7576
// Create a new retrieval service to prepare a data directory and start snapshotting.
@@ -80,7 +81,9 @@ func main() {
8081
log.Err("Failed to clean up service containers:", cleanUpErr)
8182
}
8283

83-
log.Fatal("Failed to run the data retrieval service:", err)
84+
log.Err("Failed to run the data retrieval service:", err)
85+
86+
return
8487
}
8588

8689
defer retrievalSvc.Stop()
@@ -93,12 +96,13 @@ func main() {
9396
// Create a cloning service to provision new clones.
9497
provisionSvc, err := provision.New(ctx, &cfg.Provision, dbCfg, dockerCLI, pm)
9598
if err != nil {
96-
log.Fatalf(errors.WithMessage(err, `error in the "provision" section of the config`))
99+
log.Errf(errors.WithMessage(err, `error in the "provision" section of the config`).Error())
97100
}
98101

99102
cloningSvc := cloning.New(&cfg.Cloning, provisionSvc)
100103
if err = cloningSvc.Run(ctx); err != nil {
101-
log.Fatal(err)
104+
log.Err(err)
105+
return
102106
}
103107

104108
obs := observer.NewObserver(dockerCLI, &cfg.Observer, platformSvc.Client, pm.Active().Pool())

pkg/services/provision/thinclones/zfs/zfs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ type ListEntry struct {
7676
// The amount of data that is accessible by this dataset, which may
7777
// or may not be shared with other datasets in the pool. When a snapshot
7878
// or clone is created, it initially references the same amount of space
79-
//as the file system or snapshot it was created from, since its contents
79+
// as the file system or snapshot it was created from, since its contents
8080
// are identical.
8181
Referenced uint64
8282

0 commit comments

Comments
 (0)