Remove unnecessary type alias for strings.Builder
TIL embedded types can be acessed by their non-namespaced name - so there actually is no need for a type alias to access .strings.Builder, one can just use .Builder.
This commit is contained in:
parent
faea88d48e
commit
3e14771ebf
2 changed files with 4 additions and 6 deletions
|
@ -14,7 +14,7 @@ import (
|
|||
|
||||
// HTMLWriter exports an org document into a html document.
|
||||
type HTMLWriter struct {
|
||||
stringBuilder
|
||||
strings.Builder
|
||||
document *Document
|
||||
HighlightCodeBlock func(source, lang string) string
|
||||
htmlEscape bool
|
||||
|
@ -57,7 +57,7 @@ func NewHTMLWriter() *HTMLWriter {
|
|||
|
||||
func (w *HTMLWriter) emptyClone() *HTMLWriter {
|
||||
wcopy := *w
|
||||
wcopy.stringBuilder = stringBuilder{}
|
||||
wcopy.Builder = strings.Builder{}
|
||||
return &wcopy
|
||||
}
|
||||
|
||||
|
|
|
@ -7,12 +7,10 @@ import (
|
|||
"unicode/utf8"
|
||||
)
|
||||
|
||||
type stringBuilder = strings.Builder
|
||||
|
||||
// OrgWriter export an org document into pretty printed org document.
|
||||
type OrgWriter struct {
|
||||
TagsColumn int
|
||||
stringBuilder
|
||||
strings.Builder
|
||||
indent string
|
||||
}
|
||||
|
||||
|
@ -38,7 +36,7 @@ func (w *OrgWriter) After(d *Document) {}
|
|||
|
||||
func (w *OrgWriter) emptyClone() *OrgWriter {
|
||||
wcopy := *w
|
||||
wcopy.stringBuilder = strings.Builder{}
|
||||
wcopy.Builder = strings.Builder{}
|
||||
return &wcopy
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue