MCPcopy Create free account
hub / github.com/coder/coder / Validate

Method Validate

scaletest/createworkspaces/config.go:68–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66}
67
68func (c Config) Validate() error {
69 if err := c.User.Validate(); err != nil {
70 return xerrors.Errorf("validate user: %w", err)
71 }
72 c.Workspace.OrganizationID = c.User.OrganizationID
73 // This value will be overwritten during the test.
74 c.Workspace.UserID = codersdk.Me
75 if err := c.Workspace.Validate(); err != nil {
76 return xerrors.Errorf("validate workspace: %w", err)
77 }
78 if c.ReconnectingPTY != nil {
79 // This value will be overwritten during the test.
80 c.ReconnectingPTY.AgentID = uuid.New()
81 if err := c.ReconnectingPTY.Validate(); err != nil {
82 return xerrors.Errorf("validate reconnecting pty: %w", err)
83 }
84 }
85 if c.AgentConn != nil {
86 // This value will be overwritten during the test.
87 c.AgentConn.AgentID = uuid.New()
88 if err := c.AgentConn.Validate(); err != nil {
89 return xerrors.Errorf("validate agent conn: %w", err)
90 }
91 }
92
93 return nil
94}

Callers 1

RunMethod · 0.95

Calls 3

ValidateMethod · 0.65
NewMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected