Skip to content

Commit

Permalink
task: remove unnecessary parenthesis (#2784)
Browse files Browse the repository at this point in the history
  • Loading branch information
gssbzn authored Mar 20, 2024
1 parent 603d7ba commit f9886af
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion internal/cli/atlas/networking/peering/create/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (opts *AzureOpts) newContainer() *atlasv2.CloudProviderContainer {
}

func (opts *AzureOpts) newPeer(containerID string) *atlasv2.BaseNetworkPeeringConnectionSettings {
return opts.newAzurePeer((containerID))
return opts.newAzurePeer(containerID)
}

func (opts *AzureOpts) newAzurePeer(containerID string) *atlasv2.BaseNetworkPeeringConnectionSettings {
Expand Down
16 changes: 8 additions & 8 deletions internal/kubernetes/operator/secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const (
type AtlasSecretBuilder func() (*corev1.Secret, map[string]string)

func NewAtlasSecretBuilder(name, namespace string, dictionary map[string]string) AtlasSecretBuilder {
return AtlasSecretBuilder(func() (*corev1.Secret, map[string]string) {
return func() (*corev1.Secret, map[string]string) {
secret := &corev1.Secret{
TypeMeta: v1.TypeMeta{
Kind: "Secret",
Expand All @@ -51,36 +51,36 @@ func NewAtlasSecretBuilder(name, namespace string, dictionary map[string]string)
},
}
return secret, dictionary
})
}
}

func (a AtlasSecretBuilder) WithData(data map[string][]byte) AtlasSecretBuilder {
return AtlasSecretBuilder(func() (*corev1.Secret, map[string]string) {
return func() (*corev1.Secret, map[string]string) {
s, d := a()
s.Data = data
return s, d
})
}
}

func (a AtlasSecretBuilder) WithProjectLabels(id, name string) AtlasSecretBuilder {
return AtlasSecretBuilder(func() (*corev1.Secret, map[string]string) {
return func() (*corev1.Secret, map[string]string) {
s, d := a()
s.Labels[ProjectIDLabelKey] = resources.NormalizeAtlasName(id, d)
s.Labels[ProjectNameLabelKey] = resources.NormalizeAtlasName(name, d)
return s, d
})
}
}

func (a AtlasSecretBuilder) WithNotifierLabels(id *string, typeName string) AtlasSecretBuilder {
return AtlasSecretBuilder(func() (*corev1.Secret, map[string]string) {
return func() (*corev1.Secret, map[string]string) {
s, d := a()
if id == nil {
return s, d
}
s.Labels[NotifierIDLabelKey] = resources.NormalizeAtlasName(*id, d)
s.Labels[NotifierNameLabelKey] = typeName // don't normalize type name, as it is already a short form
return s, d
})
}
}

func (a AtlasSecretBuilder) Build() *corev1.Secret {
Expand Down
4 changes: 2 additions & 2 deletions tools/templates-checker/templateparsing/templateparsing.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ func pipelineToIdentifiers(pipeline *parse.PipeNode) ([]string, error) {
}

switch arg := arg.(type) {
case (*parse.DotNode):
case *parse.DotNode:
return make([]string, 0), nil
case (*parse.FieldNode):
case *parse.FieldNode:
return arg.Ident, nil
default:
return nil, errors.New("unsupported node type")
Expand Down
10 changes: 5 additions & 5 deletions tools/templates-checker/templateparsing/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ func (c *TemplateCallTree) Validate(pkg *packages.Package, typeInfo types.Type)

func (c *TemplateCallTree) validateInner(pkg *packages.Package, result *ValidationResult, breadCrumb string, typeInfo types.Type) error {
switch typeInfo := typeInfo.(type) {
case (*types.Basic):
case *types.Basic:
return c.validateBasic(result, breadCrumb)
case (*types.Map):
case *types.Map:
return c.validateMap(pkg, result, breadCrumb, typeInfo)
case (*types.Named):
case *types.Named:
return c.validateStruct(pkg, result, breadCrumb, typeInfo)
case (*types.Pointer):
case *types.Pointer:
return c.validateInner(pkg, result, breadCrumb, typeInfo.Elem())
case (*types.Slice):
case *types.Slice:
return c.validateSlice(pkg, result, breadCrumb, typeInfo)

default:
Expand Down

0 comments on commit f9886af

Please sign in to comment.