chore: format Go more aggressively

This commit is contained in:
Ammar Bandukwala
2023-02-18 18:32:09 -06:00
committed by GitHub
parent 19ae411f05
commit f05609b4da
97 changed files with 411 additions and 413 deletions

View File

@ -96,7 +96,7 @@ func (c *Client) Tokens(ctx context.Context, userID string) ([]APIKey, error) {
if res.StatusCode > http.StatusOK {
return nil, ReadBodyAsError(res)
}
var apiKey = []APIKey{}
apiKey := []APIKey{}
return apiKey, json.NewDecoder(res.Body).Decode(&apiKey)
}

View File

@ -432,13 +432,11 @@ const (
// ExperimentExample Experiment = "example"
)
var (
// ExperimentsAll should include all experiments that are safe for
// users to opt-in to via --experimental='*'.
// Experiments that are not ready for consumption by all users should
// not be included here and will be essentially hidden.
ExperimentsAll = Experiments{ExperimentTemplateEditor}
)
// ExperimentsAll should include all experiments that are safe for
// users to opt-in to via --experimental='*'.
// Experiments that are not ready for consumption by all users should
// not be included here and will be essentially hidden.
var ExperimentsAll = Experiments{ExperimentTemplateEditor}
// Experiments is a list of experiments that are enabled for the deployment.
// Multiple experiments may be enabled at the same time.

View File

@ -165,7 +165,6 @@ func (c *Client) TemplateVersionByOrganizationAndName(ctx context.Context, organ
fmt.Sprintf("/api/v2/organizations/%s/templates/%s/versions/%s", organizationID.String(), templateName, versionName),
nil,
)
if err != nil {
return TemplateVersion{}, xerrors.Errorf("execute request: %w", err)
}

View File

@ -39,10 +39,12 @@ type TransitionStats struct {
P95 *int64 `example:"146"`
}
type TemplateBuildTimeStats map[WorkspaceTransition]TransitionStats
type UpdateActiveTemplateVersion struct {
ID uuid.UUID `json:"id" validate:"required" format:"uuid"`
}
type (
TemplateBuildTimeStats map[WorkspaceTransition]TransitionStats
UpdateActiveTemplateVersion struct {
ID uuid.UUID `json:"id" validate:"required" format:"uuid"`
}
)
type TemplateRole string
@ -236,8 +238,7 @@ func (c *Client) TemplateDAUs(ctx context.Context, templateID uuid.UUID) (*Templ
// AgentStatsReportRequest is a WebSocket request by coderd
// to the agent for stats.
// @typescript-ignore AgentStatsReportRequest
type AgentStatsReportRequest struct {
}
type AgentStatsReportRequest struct{}
// AgentStatsReportResponse is returned for each report
// request by the agent.