Skip to content

Commit

Permalink
[CR] Use standard db:"-" tag, copy all input to convertRawCommit
Browse files Browse the repository at this point in the history
  • Loading branch information
arielshaqed committed Oct 28, 2020
1 parent ff6ee88 commit 3ff1f62
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion auth/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (s *Statements) Scan(src interface{}) error {

type Credential struct {
AccessKeyID string `db:"access_key_id"`
AccessSecretKey string `db:"not-a-tag-in-our-database" json:"-"`
AccessSecretKey string `db:"-" json:"-"`
AccessSecretKeyEncryptedBytes []byte `db:"access_secret_key" json:"-"`
IssuedDate time.Time `db:"issued_date"`
UserID int `db:"user_id"`
Expand Down
4 changes: 2 additions & 2 deletions catalog/cataloger_get_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (c *cataloger) GetCommit(ctx context.Context, repository, reference string)
if err := tx.GetStruct(&rawCommit, query, branchID, ref.CommitID); err != nil {
return nil, err
}
commit := convertRawCommit(&rawCommit)
commit := convertRawCommit(rawCommit)
return commit, nil
}, c.txOpts(ctx, db.ReadOnly())...)
if err != nil {
Expand All @@ -40,7 +40,7 @@ func (c *cataloger) GetCommit(ctx context.Context, repository, reference string)
return res.(*CommitLog), err
}

func convertRawCommit(raw *commitLogRaw) *CommitLog {
func convertRawCommit(raw commitLogRaw) *CommitLog {
metadata := raw.Metadata
if metadata == nil {
metadata = make(Metadata)
Expand Down
3 changes: 1 addition & 2 deletions catalog/cataloger_list_commits.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ func (c *cataloger) ListCommits(ctx context.Context, repository, branch string,
func convertRawCommits(rawCommits []commitLogRaw) []*CommitLog {
commits := make([]*CommitLog, len(rawCommits))
for i, commit := range rawCommits {
copy := commit
commits[i] = convertRawCommit(&copy)
commits[i] = convertRawCommit(commit)
}
return commits
}

0 comments on commit 3ff1f62

Please sign in to comment.