add comment struct
This commit is contained in:
5
comment/comment.go
Normal file
5
comment/comment.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package comment
|
||||
|
||||
type Comment interface {
|
||||
String() string
|
||||
}
|
||||
15
comment/doc_comment.go
Normal file
15
comment/doc_comment.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package comment
|
||||
|
||||
type DocComment struct {
|
||||
value string
|
||||
}
|
||||
|
||||
func NewDocComment(value string) Comment {
|
||||
return &DocComment{
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *DocComment) String() string {
|
||||
return c.value
|
||||
}
|
||||
15
comment/plain_comment.go
Normal file
15
comment/plain_comment.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package comment
|
||||
|
||||
type PlainComment struct {
|
||||
value string
|
||||
}
|
||||
|
||||
func NewPlainComment(value string) Comment {
|
||||
return &PlainComment{
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *PlainComment) String() string {
|
||||
return c.value
|
||||
}
|
||||
Reference in New Issue
Block a user