Skip to content

Commit fd58869

Browse files
xaionaro@dx.centerxaionaro@dx.center
authored andcommitted
fix: remove unused code and fix remaining lint findings
- Remove unused grpcClient var and client import (root.go) - Remove unused longVal/boolVal helpers (jni_caller.go) - Use tagged switch on clientID (store.go, QF1002)
1 parent 2f10bdf commit fd58869

3 files changed

Lines changed: 2 additions & 14 deletions

File tree

cmd/jnicli/jni_caller.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,3 @@ func intVal(v int32) *pb.JValue {
223223
return &pb.JValue{Value: &pb.JValue_I{I: v}}
224224
}
225225

226-
// longVal is a shorthand for creating a JValue with a long.
227-
func longVal(v int64) *pb.JValue {
228-
return &pb.JValue{Value: &pb.JValue_J{J: v}}
229-
}
230-
231-
// boolVal is a shorthand for creating a JValue with a boolean.
232-
func boolVal(v bool) *pb.JValue {
233-
return &pb.JValue{Value: &pb.JValue_Z{Z: v}}
234-
}

cmd/jnicli/root.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"time"
1010

1111
"github.com/spf13/cobra"
12-
"github.com/AndroidGoLab/jni-proxy/grpc/client"
1312
"google.golang.org/grpc"
1413
"google.golang.org/grpc/credentials"
1514
)
@@ -26,7 +25,6 @@ var (
2625
)
2726

2827
var grpcConn *grpc.ClientConn
29-
var grpcClient *client.Client
3028

3129
var rootCmd = &cobra.Command{
3230
Use: "jnicli",
@@ -68,7 +66,6 @@ var rootCmd = &cobra.Command{
6866
return fmt.Errorf("connect to %s: %w", flagAddr, err)
6967
}
7068
grpcConn = conn
71-
grpcClient = client.NewClient(conn)
7269
return nil
7370
},
7471
PersistentPostRunE: func(cmd *cobra.Command, args []string) error {

grpc/server/acl/store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ func (s *Store) ListGrants(clientID string) ([]GrantInfo, error) {
198198
rows *sql.Rows
199199
err error
200200
)
201-
switch {
202-
case clientID == "":
201+
switch clientID {
202+
case "":
203203
rows, err = s.db.Query(`SELECT client_id, method_pattern, granted_at, granted_by FROM grants`)
204204
default:
205205
rows, err = s.db.Query(

0 commit comments

Comments
 (0)