Skip to content

Commit

Permalink
chore: adjust package style
Browse files Browse the repository at this point in the history
Signed-off-by: mlycore <[email protected]>
  • Loading branch information
mlycore committed Sep 24, 2023
1 parent 0100137 commit 5dd5db7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions pitr/agent/internal/handler/handler_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/apache/shardingsphere-on-cloud/pitr/agent/internal/handler"
"github.com/apache/shardingsphere-on-cloud/pitr/agent/pkg/logging"
"github.com/apache/shardingsphere-on-cloud/pitr/agent/pkg/responder"

"github.com/gofiber/fiber/v2"
"github.com/golang/mock/gomock"
. "github.com/onsi/ginkgo/v2"
Expand Down
7 changes: 4 additions & 3 deletions pitr/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/apache/shardingsphere-on-cloud/pitr/agent/internal/pkg"
"github.com/apache/shardingsphere-on-cloud/pitr/agent/pkg/logging"
"github.com/apache/shardingsphere-on-cloud/pitr/agent/pkg/responder"

"github.com/gofiber/fiber/v2"
"github.com/joho/godotenv"
"go.uber.org/zap/zapcore"
Expand Down Expand Up @@ -72,7 +73,7 @@ func main() {
if envSourceFile != "" {
err := godotenv.Load(envSourceFile)
if err != nil {
panic(fmt.Errorf("load env source file error:%s", err.Error()))
panic(fmt.Errorf("load env source file error: %s", err))
}
}

Expand All @@ -84,12 +85,12 @@ func main() {
if pgData == "" {
pgData = os.Getenv("PGDATA")
if pgData == "" {
panic(fmt.Errorf("PGDATA:no database directory specified and environment variable PGDATA unset"))
panic(fmt.Errorf("PGDATA: no database directory specified and environment variable PGDATA unset"))
}
}

if _, err := os.Stat(pgData); os.IsNotExist(err) {
panic(fmt.Errorf("PGDATA:%s the database directory does not exist", pgData))
panic(fmt.Errorf("PGDATA: %s the database directory does not exist", pgData))
}

pgData = strings.Trim(pgData, " ")
Expand Down

0 comments on commit 5dd5db7

Please sign in to comment.