add comment struct

This commit is contained in:
z7zmey
2018-01-03 00:12:28 +02:00
parent bbf9b0cc09
commit e8655c5f4c
6 changed files with 44 additions and 1 deletions

5
comment/comment.go Normal file
View File

@@ -0,0 +1,5 @@
package comment
type Comment interface {
String() string
}

15
comment/doc_comment.go Normal file
View 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
View 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
}