Skip to content

Commit

Permalink
no pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
kayra1 committed Apr 1, 2024
1 parent f36d64a commit bafd1c2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/certdb/certdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,16 @@ func (db *CertificateRequestsRepository) RetrieveAll() ([]CertificateRequest, er

// Retrieve gets a given CSR from the repository.
// It returns the row id and matching certificate alongside the CSR in a CertificateRequest object.
func (db *CertificateRequestsRepository) Retrieve(csr string) (*CertificateRequest, error) {
func (db *CertificateRequestsRepository) Retrieve(csr string) (CertificateRequest, error) {
var newCSR CertificateRequest
row := db.conn.QueryRow(fmt.Sprintf(queryGetCSR, db.table), csr)
if err := row.Scan(&newCSR.ID, &newCSR.CSR, &newCSR.Certificate); err != nil {
return nil, err
newCSR.ID = -1
newCSR.Certificate = ""
newCSR.CSR = ""
return newCSR, err
}
return &newCSR, nil
return newCSR, nil
}

// Create creates a new entry in the repository.
Expand Down

0 comments on commit bafd1c2

Please sign in to comment.