Skip to content

Commit

Permalink
style: Remove dead code and enable deadcode linter (#3731)
Browse files Browse the repository at this point in the history
See #3565

Signed-off-by: Bryon Nevis <[email protected]>
  • Loading branch information
bnevis-i authored Sep 29, 2021
1 parent 2de07aa commit 87e8ed7
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 110 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
linters:
disable:
- deadcode
- errcheck
- gosimple
- ineffassign
Expand Down
2 changes: 0 additions & 2 deletions internal/core/command/controller/http/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ const (
testSourceName = "testSourceName"
testDeviceServiceName = "testDeviceService"
testCommandName = "testCommand"
testPathPrefix = common.ApiDeviceRoute + "/" + common.Name + "/" + testDeviceName + "/" + common.Command + "/"
testUrl = "http://localhost:59882"
testBaseAddress = "http://localhost:49990"
testQueryStrings = "a=1&b=2&ds-pushevent=no"
)
Expand Down
1 change: 0 additions & 1 deletion internal/core/data/application/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const (
testProfileName = "TestProfile"
testSourceName = "testSourceName"
testUUIDString = "ca93c8fa-9919-4ec5-85d3-f81b2b6a7bc1"
testCreatedTime = 1600666214495
testOriginTime = 1600666185705354000
nonexistentEventID = "8ad33474-fbc5-11ea-adc1-0242ac120002"
testEventCount = uint32(7778)
Expand Down
1 change: 0 additions & 1 deletion internal/core/data/controller/http/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"github.com/stretchr/testify/require"
)

var expectedCorrelationId = uuid.New().String()
var expectedEventId = uuid.New().String()

var testReading = dtos.BaseReading{
Expand Down
5 changes: 0 additions & 5 deletions internal/security/kdf/methods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"crypto/sha256"
"encoding/hex"
"errors"
"io"
"os"
"testing"
"time"
Expand Down Expand Up @@ -217,10 +216,6 @@ func TestShortWrite(t *testing.T) {
// Mock opening and reading of the seed file
//

func mockFileOpener(name string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) {
return &mockSeedFile{}, nil
}

type mockSeedFile struct {
mock.Mock
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ var (
testSubscriptionReceiver = "receiver"
testSubscriptionResendLimit = 5
testSubscriptionResendInterval = "10s"
unsupportedChannelType = "unsupportedChannelType"
)

func mockDic() *di.Container {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ var (
testSubscriptionReceiver = "receiver"
testSubscriptionResendLimit = 5
testSubscriptionResendInterval = "10s"
unsupportedChannelType = "unsupportedChannelType"
)

func mockDic() *di.Container {
Expand Down
87 changes: 0 additions & 87 deletions internal/support/scheduler/utils.go

This file was deleted.

5 changes: 0 additions & 5 deletions internal/system/executor/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ import (

const inspect = "inspect"

// messageExecutorCommandFailed returns a text error message and exists to support unit testing.
func messageExecutorCommandFailed(operationPrefix string, result string, errorMessage string) string {
return fmt.Sprintf("%s: %s (%s)", operationPrefix, errorMessage, strings.Replace(result, "\n", " ", -1))
}

// messageExecutorInspectFailed returns a text error message and exists to support unit testing.
func messageExecutorInspectFailed(operationPrefix string, errorMessage string) string {
return fmt.Sprintf("%s: %s", operationPrefix, errorMessage)
Expand Down
1 change: 0 additions & 1 deletion internal/system/executor/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const (
Restart = "restart"
Metrics = "metrics"

executorType = "docker"
failedStartPrefix = "Error starting service"
failedRestartPrefix = "Error restarting service"
failedStopPrefix = "Error stopping service"
Expand Down
9 changes: 4 additions & 5 deletions internal/system/executor/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ import (
)

const (
serviceName = "serviceName"
executableName = "executableName"
errorMessage = "errorMessage"
metricsSuccessRawResult = "metricsSuccessRawResult"
jsonDecodeFailureErrorMessage = "EOF"
serviceName = "serviceName"
executableName = "executableName"
errorMessage = "errorMessage"
metricsSuccessRawResult = "metricsSuccessRawResult"
)

type executorStubCall struct {
Expand Down

0 comments on commit 87e8ed7

Please sign in to comment.