Skip to content

Commit

Permalink
Fix lint errors reported by revive
Browse files Browse the repository at this point in the history
  • Loading branch information
minamijoyo committed Sep 10, 2021
1 parent c8bed6a commit 8ba278e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server/core/locking/locking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
4 changes: 2 additions & 2 deletions server/core/runtime/policy/conftest_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions server/events/pre_workflow_hooks_command_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion server/events/yaml/valid/global_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8ba278e

Please sign in to comment.