Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
Put main function to the end
天舟465abfaf4e60
diff --git a/backend/cmd/server/bytebase.go b/backend/cmd/server/bytebase.goindex a79d47eebf..694b6e1f40 100644--- a/backend/cmd/server/bytebase.go+++ b/backend/cmd/server/bytebase.go@@ -26,32 +26,6 @@ type Main struct {db *sqlite.DB}-func main() {- // Setup signal handlers.- ctx, cancel := context.WithCancel(context.Background())- c := make(chan os.Signal, 1)- signal.Notify(c, os.Interrupt)- go func() { <-c; cancel() }()-- m := NewMain()-- // Execute program.- if err := m.Run(); err != nil {- m.Close()- fmt.Fprintln(os.Stderr, err)- os.Exit(1)- }-- // Wait for CTRL-C.- <-ctx.Done()-- // Clean up program.- if err := m.Close(); err != nil {- fmt.Fprintln(os.Stderr, err)- os.Exit(1)- }-}-type Server struct {DebugService api.DebugServiceAuthService api.AuthService@@ -164,3 +138,29 @@ func (server *Server) Close(ctx context.Context) {server.e.Logger.Fatal(err)}}++func main() {+ // Setup signal handlers.+ ctx, cancel := context.WithCancel(context.Background())+ c := make(chan os.Signal, 1)+ signal.Notify(c, os.Interrupt)+ go func() { <-c; cancel() }()++ m := NewMain()++ // Execute program.+ if err := m.Run(); err != nil {+ m.Close()+ fmt.Fprintln(os.Stderr, err)+ os.Exit(1)+ }++ // Wait for CTRL-C.+ <-ctx.Done()++ // Clean up program.+ if err := m.Close(); err != nil {+ fmt.Fprintln(os.Stderr, err)+ os.Exit(1)+ }+}