Skip to content

Commit 3e2c2e6

Browse files
committed
Fix linters + Disable deadcode and golint.
A buncher of linter were not actually linting (yay) Had to disable deadcode and golint because their fixes would take too long.
1 parent 5d2b5a8 commit 3e2c2e6

File tree

29 files changed

+74
-93
lines changed

29 files changed

+74
-93
lines changed

api/caasfirewaller/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (c *Client) Life(appName string) (life.Value, error) {
8989
if err := results.Results[0].Error; err != nil {
9090
return "", maybeNotFound(err)
9191
}
92-
return life.Value(results.Results[0].Life), nil
92+
return results.Results[0].Life, nil
9393
}
9494

9595
// ApplicationConfig returns the config for the specified application.

api/caasoperator/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func (c *Client) Life(entityName string) (life.Value, error) {
248248
if err := results.Results[0].Error; err != nil {
249249
return "", maybeNotFound(err)
250250
}
251-
return life.Value(results.Results[0].Life), nil
251+
return results.Results[0].Life, nil
252252
}
253253

254254
// maybeNotFound returns an error satisfying errors.IsNotFound

api/caasoperatorprovisioner/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func (c *Client) Life(appName string) (life.Value, error) {
9898
if err := results.Results[0].Error; err != nil {
9999
return "", maybeNotFound(err)
100100
}
101-
return life.Value(results.Results[0].Life), nil
101+
return results.Results[0].Life, nil
102102
}
103103

104104
// OperatorProvisioningInfo holds the info needed to provision an operator.

api/caasunitprovisioner/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func (c *Client) Life(entityName string) (life.Value, error) {
285285
if err := results.Results[0].Error; err != nil {
286286
return "", maybeNotFound(err)
287287
}
288-
return life.Value(results.Results[0].Life), nil
288+
return results.Results[0].Life, nil
289289
}
290290

291291
// maybeNotFound returns an error satisfying errors.IsNotFound

api/lifeflag/facade.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (facade *Facade) Life(entity names.Tag) (life.Value, error) {
9090
}
9191
return "", errors.Trace(result.Error)
9292
}
93-
life := life.Value(result.Life)
93+
life := result.Life
9494
if err := life.Validate(); err != nil {
9595
return "", errors.Trace(err)
9696
}

api/watcher/watcher.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313

1414
"github.com/juju/juju/api/base"
1515
"github.com/juju/juju/apiserver/params"
16-
"github.com/juju/juju/core/life"
1716
"github.com/juju/juju/core/migration"
1817
"github.com/juju/juju/core/status"
1918
"github.com/juju/juju/core/watcher"
@@ -584,7 +583,7 @@ func (w *relationStatusWatcher) loop(initialChanges []params.RelationLifeSuspend
584583
for i, ch := range changes {
585584
result[i] = watcher.RelationStatusChange{
586585
Key: ch.Key,
587-
Life: life.Value(ch.Life),
586+
Life: ch.Life,
588587
Suspended: ch.Suspended,
589588
SuspendedReason: ch.SuspendedReason,
590589
}

apiserver/apiserver.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -457,21 +457,6 @@ func (srv *Server) getAgentToken() error {
457457
return nil
458458
}
459459

460-
// loggoWrapper is an io.Writer() that forwards the messages to a loggo.Logger.
461-
// Unfortunately http takes a concrete stdlib log.Logger struct, and not an
462-
// interface, so we can't just proxy all of the log levels without inspecting
463-
// the string content. For now, we just want to get the messages into the log
464-
// file.
465-
type loggoWrapper struct {
466-
logger loggo.Logger
467-
level loggo.Level
468-
}
469-
470-
func (w *loggoWrapper) Write(content []byte) (int, error) {
471-
w.logger.Logf(w.level, "%s", string(content))
472-
return len(content), nil
473-
}
474-
475460
// logsinkMetricsCollectorWrapper defines a wrapper for exposing the essentials
476461
// for the logsink api handler to interact with the metrics collector.
477462
type logsinkMetricsCollectorWrapper struct {

apiserver/common/networkingcommon/types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func NetworkInterfacesToStateArgs(ifaces []corenetwork.InterfaceInfo) (
176176
args := state.LinkLayerDeviceArgs{
177177
Name: iface.InterfaceName,
178178
MTU: mtu,
179-
ProviderID: corenetwork.Id(iface.ProviderId),
179+
ProviderID: iface.ProviderId,
180180
Type: corenetwork.LinkLayerDeviceType(iface.InterfaceType),
181181
MACAddress: iface.MACAddress,
182182
IsAutoStart: !iface.NoAutoStart,
@@ -220,9 +220,9 @@ func NetworkInterfacesToStateArgs(ifaces []corenetwork.InterfaceInfo) (
220220

221221
addr := state.LinkLayerDeviceAddress{
222222
DeviceName: iface.InterfaceName,
223-
ProviderID: corenetwork.Id(iface.ProviderAddressId),
224-
ProviderNetworkID: corenetwork.Id(iface.ProviderNetworkId),
225-
ProviderSubnetID: corenetwork.Id(iface.ProviderSubnetId),
223+
ProviderID: iface.ProviderAddressId,
224+
ProviderNetworkID: iface.ProviderNetworkId,
225+
ProviderSubnetID: iface.ProviderSubnetId,
226226
ConfigMethod: derivedConfigMethod,
227227
CIDRAddress: cidrAddress,
228228
DNSServers: iface.DNSServers.ToIPAddresses(),

apiserver/facades/controller/caasoperatorprovisioner/provisioner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func (a *API) IssueOperatorCertificate(args params.Entities) (params.IssueOperat
239239
}
240240

241241
res.Results[i] = params.IssueOperatorCertificateResult{
242-
CACert: string(caCert),
242+
CACert: caCert,
243243
Cert: string(cert),
244244
PrivateKey: string(privateKey),
245245
}

apiserver/params/network.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ type RemoveSpaceResults struct {
836836
// RemoveSpaceResult contains entries if removing a space is not possible.
837837
// Constraints are a slice of entities which has constraints on the space.
838838
// Bindings are a slice of entities which has bindings on that space.
839-
// Error is filled if an error has occured which is unexpected.
839+
// Error is filled if an error has occurred which is unexpected.
840840
type RemoveSpaceResult struct {
841841
Constraints []Entity `json:"constraints,omitempty"`
842842
Bindings []Entity `json:"bindings,omitempty"`

0 commit comments

Comments
 (0)