New flag showEmptyAdditionalInfo shows segment additional info (+08) even when it is empty
This commit is contained in:
parent
0eebc491d4
commit
eadeedcc3a
1 changed files with 14 additions and 8 deletions
|
@ -7,12 +7,17 @@ import (
|
||||||
|
|
||||||
type TitleInfo struct {
|
type TitleInfo struct {
|
||||||
FeragMessage
|
FeragMessage
|
||||||
printObjectName string
|
printObjectName string
|
||||||
titleName string
|
titleName string
|
||||||
publicationDate time.Time
|
publicationDate time.Time
|
||||||
countryCode string
|
countryCode string
|
||||||
printObjectColor string
|
printObjectColor string
|
||||||
additionalInfo string
|
additionalInfo string
|
||||||
|
showEmptyAdditionalInfo bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ti *TitleInfo) ShowEmptyAdditionalInfo() {
|
||||||
|
ti.showEmptyAdditionalInfo = true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ti *TitleInfo) SetPrintObjectName(printObjectName string) {
|
func (ti *TitleInfo) SetPrintObjectName(printObjectName string) {
|
||||||
|
@ -20,7 +25,7 @@ func (ti *TitleInfo) SetPrintObjectName(printObjectName string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ti *TitleInfo) AdditionalInfo() string {
|
func (ti *TitleInfo) AdditionalInfo() string {
|
||||||
if ti.additionalInfo == "" {
|
if ti.additionalInfo == "" && ti.showEmptyAdditionalInfo == false {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("+08%-50s", ti.additionalInfo)
|
return fmt.Sprintf("+08%-50s", ti.additionalInfo)
|
||||||
|
@ -100,7 +105,8 @@ func (ti *TitleInfo) SetTitleName(titleName string) {
|
||||||
|
|
||||||
func NewTitleInfo() *TitleInfo {
|
func NewTitleInfo() *TitleInfo {
|
||||||
t := TitleInfo{
|
t := TitleInfo{
|
||||||
FeragMessage: FeragMessage{"2440", "!"},
|
FeragMessage: FeragMessage{"2440", "!"},
|
||||||
|
showEmptyAdditionalInfo: false,
|
||||||
}
|
}
|
||||||
return &t
|
return &t
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue