remove unndeeded function
This commit is contained in:
+7
-10
@@ -63,9 +63,14 @@ func runKeygen(ctx context.Context, args []string) error {
|
||||
|
||||
owner, err := q.OwnerByEmail(ctx, normEmail)
|
||||
if errors.Is(err, pgx.ErrNoRows) {
|
||||
var callsignArg any
|
||||
if normCall != "" {
|
||||
callsignArg = normCall
|
||||
}
|
||||
|
||||
created, cerr := q.CreateOwner(ctx, db.CreateOwnerParams{
|
||||
Email: normEmail,
|
||||
Callsign: nullableCallsign(normCall),
|
||||
Callsign: callsignArg,
|
||||
})
|
||||
if cerr != nil {
|
||||
return fmt.Errorf("keygen: creating owner: %w", cerr)
|
||||
@@ -97,7 +102,7 @@ func runKeygen(ctx context.Context, args []string) error {
|
||||
Label: nullableString(*label),
|
||||
Scopes: scopeList,
|
||||
QuotaTier: *tier,
|
||||
ExpiresAt: expiresAt,
|
||||
ExpiresAt: db.Timestamptz(expiresAt),
|
||||
})
|
||||
if err != nil {
|
||||
// The keys_scopes_known CHECK rejects unknown scopes, which is the
|
||||
@@ -149,11 +154,3 @@ func nullableString(s string) *string {
|
||||
|
||||
return &s
|
||||
}
|
||||
|
||||
func nullableCallsign(s string) *string {
|
||||
if s == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
return &s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user