Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update golangci-lint version #958

Merged
merged 4 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-go@v5
with:
cache: false
go-version: '1.21'
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.52
version: v1.56
lint-receptorctl:
name: lint-receptorctl
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ linters:
# - paralleltest # TODO: missing at some locations
- prealloc
- predeclared
- revive
# - revive
- rowserrcheck
- sqlclosecheck
- staticcheck
Expand Down
21 changes: 0 additions & 21 deletions tests/functional/mesh/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func (m *LibMesh) Start(_ string) error {
// Bootstrap nodes
for _, node := range m.GetNodes() {
err = node.StartLocalServices()

if err != nil {
return err
}
Expand All @@ -86,7 +85,6 @@ func (m *LibMesh) Start(_ string) error {
// Start listeners first, we connect below
for _, node := range m.GetNodes() {
err = node.StartListeners()

if err != nil {
return err
}
Expand All @@ -95,7 +93,6 @@ func (m *LibMesh) Start(_ string) error {
// Establish outbound connections
for _, node := range m.GetNodes() {
err = node.EstablishRemoteConnections()

if err != nil {
return err
}
Expand Down Expand Up @@ -318,19 +315,16 @@ func (n *LibNode) Start() error {
var err error

err = n.StartLocalServices()

if err != nil {
return err
}

err = n.StartListeners()

if err != nil {
return err
}

err = n.EstablishRemoteConnections()

if err != nil {
return err
}
Expand Down Expand Up @@ -399,13 +393,11 @@ func (n *LibNode) EstablishRemoteConnections() error {
switch connection.Protocol {
case "tcp":
err = n.TCPDial(dialAddr, connectionCost, tlscfg)

if err != nil {
return err
}
case "udp":
err = n.UDPDial(dialAddr, connectionCost)

if err != nil {
return err
}
Expand All @@ -416,7 +408,6 @@ func (n *LibNode) EstablishRemoteConnections() error {
}

err = n.WebSocketDial(proto+dialAddr, connectionCost, tlscfg)

if err != nil {
return err
}
Expand Down Expand Up @@ -468,7 +459,6 @@ func (n *LibNode) TCPListen(listenerCfg ListenerCfg) (*BackendInfo, error) {
netceptor.BackendConnectionCost(cost),
netceptor.BackendNodeCost(nodeCost),
)

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -512,7 +502,6 @@ func (n *LibNode) UDPListen(listenerCfg ListenerCfg) (*BackendInfo, error) {
netceptor.BackendConnectionCost(cost),
netceptor.BackendNodeCost(nodeCost),
)

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -561,7 +550,6 @@ func (n *LibNode) WebsocketListen(listenerCfg ListenerCfg) (*BackendInfo, error)
netceptor.BackendConnectionCost(cost),
netceptor.BackendNodeCost(nodeCost),
)

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -608,7 +596,6 @@ func (n *LibNode) StartLocalServices() error {
}

err = n.configureTLS()

if err != nil {
return err
}
Expand All @@ -619,31 +606,26 @@ func (n *LibNode) StartLocalServices() error {
}

n.workceptorInstance, err = workceptor.New(n.netceptorInstance.Context(), n.netceptorInstance, n.GetDataDir())

if err != nil {
return err
}

err = n.configureWorkSigning()

if err != nil {
return err
}

err = n.workceptorInstance.RegisterWithControlService(n.controlServer)

if err != nil {
return err
}

err = n.configureWorkers()

if err != nil {
return err
}

err = n.controlServer.RunControlSvc(n.controlerServerContext, "control", tlsCfg, n.ControlSocket, os.FileMode(0o600), "", nil)

if err != nil {
return err
}
Expand All @@ -658,7 +640,6 @@ func (n *LibNode) configureFirewallRules() error {
}

err = n.netceptorInstance.AddFirewallRules(rules, true)

if err != nil {
return err
}
Expand All @@ -674,7 +655,6 @@ func (n *LibNode) configureTLS() error {
}

err = n.netceptorInstance.SetServerTLSConfig(c.Name, tlscfg)

if err != nil {
return err
}
Expand All @@ -687,7 +667,6 @@ func (n *LibNode) configureTLS() error {
}

err = n.netceptorInstance.SetClientTLSConfig(c.Name, tlscfg, pinnedFingerprints)

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion tests/functional/mesh/mesh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ func TestMeshShutdown(t *testing.T) {
ctx1, cancel1 := context.WithTimeout(context.Background(), 60*time.Second)
defer cancel1()
err = m.WaitForReady(ctx1)

if err != nil {
t.Fatal(err)
}
Expand Down
1 change: 0 additions & 1 deletion tests/functional/mesh/receptorcontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ func (r *ReceptorControl) Status() (*netceptor.Status, error) {
}
status := netceptor.Status{}
err = json.Unmarshal(data, &status)

if err != nil {
return nil, err
}
Expand Down
16 changes: 0 additions & 16 deletions tests/functional/mesh/work_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,11 @@ func TestWorkSubmitWithIncorrectTLSClient(t *testing.T) {
defer cancel1()

err = controllers["node1"].AssertWorkFailed(ctx1, unitID)

if err != nil {
t.Fatal(err)
}

_, err = controllers["node1"].WorkRelease(unitID)

if err != nil {
t.Fatal(err)
}
Expand All @@ -87,7 +85,6 @@ func TestWorkSubmitWithIncorrectTLSClient(t *testing.T) {
defer cancel2()

err = controllers["node1"].AssertWorkReleased(ctx2, unitID)

if err != nil {
t.Fatal(err)
}
Expand All @@ -96,7 +93,6 @@ func TestWorkSubmitWithIncorrectTLSClient(t *testing.T) {
defer cancel3()

err = assertFilesReleased(ctx3, nodes["node1"].GetDataDir(), "node1", unitID)

if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -275,13 +271,11 @@ func TestWorkSubmitWhileRemoteNodeIsDown(t *testing.T) {
defer cancel1()

err = controllers["node1"].AssertWorkPending(ctx1, unitID)

if err != nil {
t.Fatal(err, m.GetDataDir())
}

err = nodes["node3"].Start()

if err != nil {
t.Fatal(err, m.GetDataDir())
}
Expand All @@ -291,7 +285,6 @@ func TestWorkSubmitWhileRemoteNodeIsDown(t *testing.T) {
defer cancel2()

err = m.WaitForReady(ctx2)

if err != nil {
t.Fatal(err, m.GetDataDir())
}
Expand All @@ -300,7 +293,6 @@ func TestWorkSubmitWhileRemoteNodeIsDown(t *testing.T) {
defer cancel3()

err = controllers["node1"].AssertWorkSucceeded(ctx3, unitID)

if err != nil {
t.Fatal(err, m.GetDataDir())
}
Expand Down Expand Up @@ -515,7 +507,6 @@ func TestRuntimeParams(t *testing.T) {
ctx1, cancel1 := context.WithTimeout(context.Background(), 120*time.Second)
defer cancel1()
err = m.WaitForReady(ctx1)

if err != nil {
t.Fatal(err, m.GetDataDir())
}
Expand All @@ -524,7 +515,6 @@ func TestRuntimeParams(t *testing.T) {
controllers := make(map[string]*ReceptorControl)
controllers["node1"] = NewReceptorControl()
err = controllers["node1"].Connect(nodes["node1"].GetControlSocket())

if err != nil {
t.Fatal(err, m.GetDataDir())
}
Expand All @@ -536,13 +526,11 @@ func TestRuntimeParams(t *testing.T) {
}

err = controllers["node1"].AssertWorkSucceeded(ctx1, unitID)

if err != nil {
t.Fatal(err, m.GetDataDir())
}

err = controllers["node1"].AssertWorkResults(unitID, []byte("it worked!"))

if err != nil {
t.Fatal(err, m.GetDataDir())
}
Expand Down Expand Up @@ -589,7 +577,6 @@ func TestKubeRuntimeParams(t *testing.T) {
"secret_kube_pod": "%s",
"secret_kube_config": "%s"
}`))

if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -618,13 +605,11 @@ func TestKubeRuntimeParams(t *testing.T) {
}

err = controllers["node1"].AssertWorkSucceeded(ctx1, unitID)

if err != nil {
t.Fatal(err, m.GetDataDir())
}

err = controllers["node1"].AssertWorkResults(unitID, []byte("1\n2\n3\n4\n5\n"))

if err != nil {
t.Fatal(err, m.GetDataDir())
}
Expand Down Expand Up @@ -782,7 +767,6 @@ func TestSignedWorkVerification(t *testing.T) {
}

err = m.Start(t.Name())

if err != nil {
t.Fatal(err)
}
Expand Down
1 change: 0 additions & 1 deletion tests/utils/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ func (lw *TestLogWriter) Write(p []byte) (n int, err error) {
defer lw.Lock.Unlock()

n, err = lw.Buffer.Write(p)

if err != nil {
return 0, err
}
Expand Down
Loading