mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: format Go more aggressively
This commit is contained in:
@ -17,11 +17,9 @@ import (
|
||||
|
||||
var _ database.Store = (*querier)(nil)
|
||||
|
||||
var (
|
||||
// NoActorError wraps ErrNoRows for the api to return a 404. This is the correct
|
||||
// response when the user is not authorized.
|
||||
NoActorError = xerrors.Errorf("no authorization actor in context: %w", sql.ErrNoRows)
|
||||
)
|
||||
// NoActorError wraps ErrNoRows for the api to return a 404. This is the correct
|
||||
// response when the user is not authorized.
|
||||
var NoActorError = xerrors.Errorf("no authorization actor in context: %w", sql.ErrNoRows)
|
||||
|
||||
// NotAuthorizedError is a sentinel error that unwraps to sql.ErrNoRows.
|
||||
// This allows the internal error to be read by the caller if needed. Otherwise
|
||||
|
@ -439,11 +439,13 @@ func (s *MethodTestSuite) TestParameters() {
|
||||
s.Run("TemplateVersionTemplate/InsertParameterValue", s.Subtest(func(db database.Store, check *expects) {
|
||||
j := dbgen.ProvisionerJob(s.T(), db, database.ProvisionerJob{})
|
||||
tpl := dbgen.Template(s.T(), db, database.Template{})
|
||||
v := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{JobID: j.ID,
|
||||
v := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{
|
||||
JobID: j.ID,
|
||||
TemplateID: uuid.NullUUID{
|
||||
UUID: tpl.ID,
|
||||
Valid: true,
|
||||
}},
|
||||
},
|
||||
},
|
||||
)
|
||||
check.Args(database.InsertParameterValueParams{
|
||||
ScopeID: j.ID,
|
||||
@ -528,12 +530,14 @@ func (s *MethodTestSuite) TestTemplate() {
|
||||
ID: tvid,
|
||||
Name: t1.Name,
|
||||
OrganizationID: o1.ID,
|
||||
TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}})
|
||||
TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true},
|
||||
})
|
||||
b := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{
|
||||
CreatedAt: now.Add(-2 * time.Hour),
|
||||
Name: t1.Name,
|
||||
OrganizationID: o1.ID,
|
||||
TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}})
|
||||
TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true},
|
||||
})
|
||||
check.Args(database.GetPreviousTemplateVersionParams{
|
||||
Name: t1.Name,
|
||||
OrganizationID: o1.ID,
|
||||
|
@ -25,12 +25,10 @@ import (
|
||||
"github.com/coder/coder/coderd/util/slice"
|
||||
)
|
||||
|
||||
var (
|
||||
skipMethods = map[string]string{
|
||||
"InTx": "Not relevant",
|
||||
"Ping": "Not relevant",
|
||||
}
|
||||
)
|
||||
var skipMethods = map[string]string{
|
||||
"InTx": "Not relevant",
|
||||
"Ping": "Not relevant",
|
||||
}
|
||||
|
||||
// TestMethodTestSuite runs MethodTestSuite.
|
||||
// In order for 'go test' to run this suite, we need to create
|
||||
|
@ -154,6 +154,7 @@ func (q *querier) DeleteOldAgentStats(ctx context.Context) error {
|
||||
func (q *querier) GetParameterSchemasCreatedAfter(ctx context.Context, createdAt time.Time) ([]database.ParameterSchema, error) {
|
||||
return q.db.GetParameterSchemasCreatedAfter(ctx, createdAt)
|
||||
}
|
||||
|
||||
func (q *querier) GetProvisionerJobsCreatedAfter(ctx context.Context, createdAt time.Time) ([]database.ProvisionerJob, error) {
|
||||
return q.db.GetProvisionerJobsCreatedAfter(ctx, createdAt)
|
||||
}
|
||||
|
Reference in New Issue
Block a user