MCPcopy Index your code
hub / github.com/bytebase/bytebase / rootPreRun

Function rootPreRun

action/command/root.go:46–61  ·  view source on GitHub ↗
(w *world.World)

Source from the content-addressed store, hash-verified

44}
45
46func rootPreRun(w *world.World) func(cmd *cobra.Command, args []string) error {
47 return func(cmd *cobra.Command, _ []string) error {
48 w.Logger = slog.New(slog.NewTextHandler(cmd.ErrOrStderr(), nil))
49
50 if w.CustomHeaderError != nil {
51 return w.CustomHeaderError
52 }
53
54 // Validate all flags and environment variables
55 if err := validation.ValidateFlags(w); err != nil {
56 return errors.Wrapf(err, "failed to validate flags")
57 }
58
59 return nil
60 }
61}
62
63// newClientFromWorld creates a client using the authentication configured in World.
64func newClientFromWorld(w *world.World) (*client, error) {

Callers 1

NewRootCommandFunction · 0.85

Calls 1

ValidateFlagsFunction · 0.92

Tested by

no test coverage detected