Skip to content

Commit

Permalink
add NewRecordType (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Jun 15, 2023
1 parent 40ffb0f commit 4a27613
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ const (
BranchRecord
)

func NewRecordType(typeString string) RecordType {
switch typeString {
case "commit":
return CommitRecord
case "checkout":
return CheckoutRecord
case "branch":
return BranchRecord
default:
return UndefinedRecord
}
}

func (t RecordType) String() string {
switch t {
Expand Down

0 comments on commit 4a27613

Please sign in to comment.