scanValues returns the types for scanning values from sql.Rows.
(columns []string)
| 64 | |
| 65 | // scanValues returns the types for scanning values from sql.Rows. |
| 66 | func (*GitCommit) scanValues(columns []string) ([]any, error) { |
| 67 | values := make([]any, len(columns)) |
| 68 | for i := range columns { |
| 69 | switch columns[i] { |
| 70 | case gitcommit.FieldCommitHash, gitcommit.FieldBranchName, gitcommit.FieldRepoName, gitcommit.FieldCommitMessage, gitcommit.FieldAuthor, gitcommit.FieldPrNumber: |
| 71 | values[i] = new(sql.NullString) |
| 72 | case gitcommit.FieldCreateTime, gitcommit.FieldUpdateTime, gitcommit.FieldCommitTimestamp, gitcommit.FieldTimestamp: |
| 73 | values[i] = new(sql.NullTime) |
| 74 | case gitcommit.FieldID: |
| 75 | values[i] = new(uuid.UUID) |
| 76 | default: |
| 77 | values[i] = new(sql.UnknownType) |
| 78 | } |
| 79 | } |
| 80 | return values, nil |
| 81 | } |
| 82 | |
| 83 | // assignValues assigns the values that were returned from sql.Rows (after scanning) |
| 84 | // to the GitCommit fields. |
nothing calls this directly
no outgoing calls
no test coverage detected