Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcommit.go
More file actions
Latest commit
85 lines (68 loc) · 1.53 KB
/
Copy pathcommit.go
File metadata and controls
85 lines (68 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package parser
// Commit represents a commit that adheres to the conventional commits specification
typeCommitstruct {
messagestring
headerstring
bodystring
footerstring
commitTypestring
scopestring
descriptionstring
notes []Note
isBreakingChangebool
}
// Message returns input commit message
func (c*Commit) Message() string {
returnc.message
}
// Header returns header of the commit
func (c*Commit) Header() string {
returnc.header
}
// Body returns body of the commit
func (c*Commit) Body() string {
returnc.body
}
// Footer returns footer of the commit
func (c*Commit) Footer() string {
returnc.footer
}
// Type returns type of the commit
func (c*Commit) Type() string {
returnc.commitType
}
// Scope returns scope of the commit
func (c*Commit) Scope() string {
returnc.scope
}
// Description returns description of the commit
func (c*Commit) Description() string {
returnc.description
}
// Notes returns footer notes of the commit
func (c*Commit) Notes() []Note {
returnc.notes
}
// IsBreakingChange returns true if commit is breaking change
func (c*Commit) IsBreakingChange() bool {
returnc.isBreakingChange
}
// Note represents one footer note
typeNotestruct {
tokenstring
valuestring
}
funcnewNote(token, valuestring) Note {
returnNote{
token: token,
value: value,
}
}
// Token returns the token of the Footer Note
func (n*Note) Token() string {
returnn.token
}
// Value returns the value of the Footer Note
func (n*Note) Value() string {
returnn.value
}