Skip to content

Commit

Permalink
chore: linting of various unused arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
tinyzimmer committed Jul 31, 2023
1 parent 4605961 commit 2c7bf3d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkg/meshdb/networking/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (n *networking) DeleteNetworkACL(ctx context.Context, name string) error {
// ListNetworkACLs returns a list of NetworkACLs.
func (n *networking) ListNetworkACLs(ctx context.Context) (ACLs, error) {
out := make(ACLs, 0)
err := n.IterPrefix(ctx, NetworkACLsPrefix, func(key, value string) error {
err := n.IterPrefix(ctx, NetworkACLsPrefix, func(_, value string) error {
acl := &v1.NetworkACL{}
err := protojson.Unmarshal([]byte(value), acl)
if err != nil {
Expand Down Expand Up @@ -250,7 +250,7 @@ func (n *networking) DeleteRoute(ctx context.Context, name string) error {
// ListRoutes returns a list of Routes.
func (n *networking) ListRoutes(ctx context.Context) ([]*v1.Route, error) {
out := make([]*v1.Route, 0)
err := n.IterPrefix(ctx, RoutesPrefix, func(key, value string) error {
err := n.IterPrefix(ctx, RoutesPrefix, func(_, value string) error {
route := &v1.Route{}
err := protojson.Unmarshal([]byte(value), route)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/meshdb/peers/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (g *GraphStore) Edge(sourceNode, targetNode string) (graph.Edge[string], er
// ListEdges should return all edges in the graph in a slice.
func (g *GraphStore) ListEdges() ([]graph.Edge[string], error) {
edges := make([]graph.Edge[string], 0)
err := g.IterPrefix(context.Background(), EdgesPrefix, func(key, value string) error {
err := g.IterPrefix(context.Background(), EdgesPrefix, func(_, value string) error {
var edge Edge
err := json.Unmarshal([]byte(value), &edge)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/meshdb/peers/peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (p *peers) Delete(ctx context.Context, id string) error {

func (p *peers) List(ctx context.Context) ([]Node, error) {
out := make([]Node, 0)
err := p.db.IterPrefix(ctx, NodesPrefix, func(key, value string) error {
err := p.db.IterPrefix(ctx, NodesPrefix, func(_, value string) error {
var node Node
err := json.Unmarshal([]byte(value), &node)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions pkg/meshdb/rbac/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (r *rbac) DeleteRole(ctx context.Context, name string) error {
// ListRoles returns a list of all roles.
func (r *rbac) ListRoles(ctx context.Context) (RolesList, error) {
out := make(RolesList, 0)
err := r.IterPrefix(ctx, rolesPrefix, func(key, value string) error {
err := r.IterPrefix(ctx, rolesPrefix, func(_, value string) error {
role := &v1.Role{}
err := protojson.Unmarshal([]byte(value), role)
if err != nil {
Expand Down Expand Up @@ -264,7 +264,7 @@ func (r *rbac) DeleteRoleBinding(ctx context.Context, name string) error {
// ListRoleBindings returns a list of all rolebindings.
func (r *rbac) ListRoleBindings(ctx context.Context) ([]*v1.RoleBinding, error) {
out := make([]*v1.RoleBinding, 0)
err := r.IterPrefix(ctx, rolebindingsPrefix, func(key, value string) error {
err := r.IterPrefix(ctx, rolebindingsPrefix, func(_, value string) error {
rolebinding := &v1.RoleBinding{}
err := protojson.Unmarshal([]byte(value), rolebinding)
if err != nil {
Expand Down Expand Up @@ -330,7 +330,7 @@ func (r *rbac) DeleteGroup(ctx context.Context, name string) error {
// ListGroups returns a list of all groups.
func (r *rbac) ListGroups(ctx context.Context) ([]*v1.Group, error) {
out := make([]*v1.Group, 0)
err := r.IterPrefix(ctx, groupsPrefix, func(key, value string) error {
err := r.IterPrefix(ctx, groupsPrefix, func(_, value string) error {
group := &v1.Group{}
err := protojson.Unmarshal([]byte(value), group)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/plugins/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (m *manager) HasWatchers() bool {
// AuthUnaryInterceptor returns a unary interceptor for the configured auth plugin.
// If no plugin is configured, the returned function is a no-op.
func (m *manager) AuthUnaryInterceptor() grpc.UnaryServerInterceptor {
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
return func(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
if m.auth == nil {
return handler(ctx, req)
}
Expand All @@ -103,7 +103,7 @@ func (m *manager) AuthUnaryInterceptor() grpc.UnaryServerInterceptor {
// AuthStreamInterceptor returns a stream interceptor for the configured auth plugin.
// If no plugin is configured, the returned function is a no-op.
func (m *manager) AuthStreamInterceptor() grpc.StreamServerInterceptor {
return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
return func(srv interface{}, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
if m.auth == nil {
return handler(srv, ss)
}
Expand Down

0 comments on commit 2c7bf3d

Please sign in to comment.