diff --git a/server/core/locking/locking_test.go b/server/core/locking/locking_test.go index fd8ce1e328..316b770ba5 100644 --- a/server/core/locking/locking_test.go +++ b/server/core/locking/locking_test.go @@ -178,7 +178,7 @@ func TestGetLock_NoOpLocker(t *testing.T) { l := locking.NewNoOpLocker() lock, err := l.GetLock("owner/repo/path/workspace") Ok(t, err) - var expected *models.ProjectLock = nil + var expected *models.ProjectLock Equals(t, expected, lock) } diff --git a/server/core/runtime/policy/conftest_client.go b/server/core/runtime/policy/conftest_client.go index 8adfdc99c4..620361f3c7 100644 --- a/server/core/runtime/policy/conftest_client.go +++ b/server/core/runtime/policy/conftest_client.go @@ -94,7 +94,7 @@ func (p *SourceResolverProxy) Resolve(policySet valid.PolicySet) (string, error) case valid.LocalPolicySet: return p.localSourceResolver.Resolve(policySet) default: - return "", errors.New(fmt.Sprintf("unable to resolve policy set source %s", source)) + return "", fmt.Errorf("unable to resolve policy set source %s", source) } } @@ -237,7 +237,7 @@ func getDefaultVersion() (*version.Version, error) { defaultVersion, exists := os.LookupEnv(DefaultConftestVersionEnvKey) if !exists { - return nil, errors.New(fmt.Sprintf("%s not set.", DefaultConftestVersionEnvKey)) + return nil, fmt.Errorf("%s not set", DefaultConftestVersionEnvKey) } wrappedVersion, err := version.NewVersion(defaultVersion) diff --git a/server/events/pre_workflow_hooks_command_runner_test.go b/server/events/pre_workflow_hooks_command_runner_test.go index e384a52353..3476e8446b 100644 --- a/server/events/pre_workflow_hooks_command_runner_test.go +++ b/server/events/pre_workflow_hooks_command_runner_test.go @@ -74,7 +74,7 @@ func TestRunPreHooks_Clone(t *testing.T) { t.Run("success hooks in cfg", func(t *testing.T) { preWorkflowHooksSetup(t) - var unlockCalled *bool = newBool(false) + var unlockCalled = newBool(false) unlockFn := func() { unlockCalled = newBool(true) } @@ -159,7 +159,7 @@ func TestRunPreHooks_Clone(t *testing.T) { t.Run("error cloning", func(t *testing.T) { preWorkflowHooksSetup(t) - var unlockCalled *bool = newBool(false) + var unlockCalled = newBool(false) unlockFn := func() { unlockCalled = newBool(true) } @@ -191,7 +191,7 @@ func TestRunPreHooks_Clone(t *testing.T) { t.Run("error running pre hook", func(t *testing.T) { preWorkflowHooksSetup(t) - var unlockCalled *bool = newBool(false) + var unlockCalled = newBool(false) unlockFn := func() { unlockCalled = newBool(true) } diff --git a/server/events/yaml/valid/global_cfg.go b/server/events/yaml/valid/global_cfg.go index 81068d11ab..6a630a8ca8 100644 --- a/server/events/yaml/valid/global_cfg.go +++ b/server/events/yaml/valid/global_cfg.go @@ -27,7 +27,7 @@ const DeleteSourceBranchOnMergeKey = "delete_source_branch_on_merge" // TODO: Make this more customizable, not everyone wants this rigid workflow // maybe something along the lines of defining overridable/non-overrideable apply // requirements in the config and removing the flag to enable policy checking. -var NonOverrideableApplyReqs []string = []string{PoliciesPassedApplyReq} +var NonOverrideableApplyReqs = []string{PoliciesPassedApplyReq} // GlobalCfg is the final parsed version of server-side repo config. type GlobalCfg struct {