gofmt all project files
This commit is contained in:
parent
e0b9309cfc
commit
009a3074fe
11 changed files with 58 additions and 28 deletions
29
.idea/watcherTasks.xml
Normal file
29
.idea/watcherTasks.xml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectTasksOptions">
|
||||||
|
<TaskOptions isEnabled="true">
|
||||||
|
<option name="arguments" value="fmt $FilePath$" />
|
||||||
|
<option name="checkSyntaxErrors" value="true" />
|
||||||
|
<option name="description" />
|
||||||
|
<option name="exitCodeBehavior" value="ERROR" />
|
||||||
|
<option name="fileExtension" value="go" />
|
||||||
|
<option name="immediateSync" value="false" />
|
||||||
|
<option name="name" value="go fmt" />
|
||||||
|
<option name="output" value="$FilePath$" />
|
||||||
|
<option name="outputFilters">
|
||||||
|
<array />
|
||||||
|
</option>
|
||||||
|
<option name="outputFromStdout" value="false" />
|
||||||
|
<option name="program" value="$GoExecPath$" />
|
||||||
|
<option name="runOnExternalChanges" value="false" />
|
||||||
|
<option name="scopeName" value="Project Files" />
|
||||||
|
<option name="trackOnlyRoot" value="true" />
|
||||||
|
<option name="workingDir" value="$ProjectFileDir$" />
|
||||||
|
<envs>
|
||||||
|
<env name="GOROOT" value="$GOROOT$" />
|
||||||
|
<env name="GOPATH" value="$GOPATH$" />
|
||||||
|
<env name="PATH" value="$GoBinDirs$" />
|
||||||
|
</envs>
|
||||||
|
</TaskOptions>
|
||||||
|
</component>
|
||||||
|
</project>
|
25
ferag.go
25
ferag.go
|
@ -2,26 +2,26 @@ package feragstring
|
||||||
|
|
||||||
const (
|
const (
|
||||||
dateInputFormatISO = "2006-01-02"
|
dateInputFormatISO = "2006-01-02"
|
||||||
dateOutputFormat = "060102"
|
dateOutputFormat = "060102"
|
||||||
linebreak = "\r\n"
|
linebreak = "\r\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
type FeragString struct {
|
type FeragString struct {
|
||||||
TitleInfo *TitleInfo
|
TitleInfo *TitleInfo
|
||||||
TitleEnd *TitleEnd
|
TitleEnd *TitleEnd
|
||||||
ProductReferences []*ProductReference
|
ProductReferences []*ProductReference
|
||||||
ProductReferencesNr int
|
ProductReferencesNr int
|
||||||
RouteListEntries []*RouteListEntry
|
RouteListEntries []*RouteListEntry
|
||||||
RouteListEntryCount int
|
RouteListEntryCount int
|
||||||
RouteInfoEntries []*RouteInfo
|
RouteInfoEntries []*RouteInfo
|
||||||
ProductionDropEntries []*ProductionDrop
|
ProductionDropEntries []*ProductionDrop
|
||||||
RouteEndEntries []*RouteEnd
|
RouteEndEntries []*RouteEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewFeragString() *FeragString {
|
func NewFeragString() *FeragString {
|
||||||
fs := FeragString{
|
fs := FeragString{
|
||||||
TitleInfo: NewTitleInfo(),
|
TitleInfo: NewTitleInfo(),
|
||||||
TitleEnd: NewTitleEnd(),
|
TitleEnd: NewTitleEnd(),
|
||||||
}
|
}
|
||||||
return &fs
|
return &fs
|
||||||
}
|
}
|
||||||
|
@ -32,8 +32,10 @@ func (fs *FeragString) SetTitleName(titleName string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fs *FeragString) PrintOut() string {
|
func (fs *FeragString) PrintOut() string {
|
||||||
|
// +2440 | first message is the title info
|
||||||
info := fs.TitleInfo.Message()
|
info := fs.TitleInfo.Message()
|
||||||
|
|
||||||
|
// +2450 | list of product references
|
||||||
for _, pr := range fs.ProductReferences {
|
for _, pr := range fs.ProductReferences {
|
||||||
info += pr.Message()
|
info += pr.Message()
|
||||||
}
|
}
|
||||||
|
@ -54,6 +56,7 @@ func (fs *FeragString) PrintOut() string {
|
||||||
info += re.Message()
|
info += re.Message()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// +2441 | last message is the corresponding title end
|
||||||
info += fs.TitleEnd.Message()
|
info += fs.TitleEnd.Message()
|
||||||
return info
|
return info
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
|
|
||||||
type FeragMessage struct {
|
type FeragMessage struct {
|
||||||
messageStart string
|
messageStart string
|
||||||
messageEnd string
|
messageEnd string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fm *FeragMessage) getMessageStart() string {
|
func (fm *FeragMessage) getMessageStart() string {
|
||||||
|
|
|
@ -128,7 +128,7 @@ func (pr *ProductReference) SetProductReferenceNumber(productReferenceNumber int
|
||||||
|
|
||||||
func NewProductReference() *ProductReference {
|
func NewProductReference() *ProductReference {
|
||||||
pr := ProductReference{
|
pr := ProductReference{
|
||||||
FeragMessage: FeragMessage{"2450", "!"},
|
FeragMessage: FeragMessage{"2450", "!"},
|
||||||
missingParameter: MissingParameter{
|
missingParameter: MissingParameter{
|
||||||
missingRate: 0,
|
missingRate: 0,
|
||||||
missingSize: 1,
|
missingSize: 1,
|
||||||
|
|
|
@ -4,7 +4,7 @@ import "fmt"
|
||||||
|
|
||||||
type ProductionDrop struct {
|
type ProductionDrop struct {
|
||||||
FeragMessage
|
FeragMessage
|
||||||
agentName string
|
agentName string
|
||||||
numberOfCopies int
|
numberOfCopies int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ func (re *RouteEnd) SetRouteName(routeName string) {
|
||||||
|
|
||||||
func NewRouteEnd() *RouteEnd {
|
func NewRouteEnd() *RouteEnd {
|
||||||
re := RouteEnd{
|
re := RouteEnd{
|
||||||
FeragMessage: FeragMessage{
|
FeragMessage: FeragMessage{
|
||||||
messageStart: "2406",
|
messageStart: "2406",
|
||||||
messageEnd: "!",
|
messageEnd: "!",
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,10 +4,10 @@ import "fmt"
|
||||||
|
|
||||||
type RouteInfo struct {
|
type RouteInfo struct {
|
||||||
FeragMessage
|
FeragMessage
|
||||||
routeName string
|
routeName string
|
||||||
topsheetMarker int
|
topsheetMarker int
|
||||||
eaAddressDefinition int
|
eaAddressDefinition int
|
||||||
editionName string
|
editionName string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ri *RouteInfo) EditionName() string {
|
func (ri *RouteInfo) EditionName() string {
|
||||||
|
@ -44,7 +44,7 @@ func (ri *RouteInfo) RouteName() string {
|
||||||
|
|
||||||
func NewRouteInfo() *RouteInfo {
|
func NewRouteInfo() *RouteInfo {
|
||||||
ri := RouteInfo{
|
ri := RouteInfo{
|
||||||
FeragMessage: FeragMessage{
|
FeragMessage: FeragMessage{
|
||||||
messageStart: "2402",
|
messageStart: "2402",
|
||||||
messageEnd: "!",
|
messageEnd: "!",
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,9 +4,9 @@ import "fmt"
|
||||||
|
|
||||||
type RouteListEntry struct {
|
type RouteListEntry struct {
|
||||||
FeragMessage
|
FeragMessage
|
||||||
routeName string
|
routeName string
|
||||||
routeCode int
|
routeCode int
|
||||||
rampNumber int
|
rampNumber int
|
||||||
copiesInRoute int
|
copiesInRoute int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,6 @@ func (ti *TitleInfo) PublicationDate() string {
|
||||||
return fmt.Sprintf("+95%-6s", ti.publicationDate.Format(dateOutputFormat))
|
return fmt.Sprintf("+95%-6s", ti.publicationDate.Format(dateOutputFormat))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (ti *TitleInfo) Message() string {
|
func (ti *TitleInfo) Message() string {
|
||||||
message := ti.FeragMessage.MessageTemplate()
|
message := ti.FeragMessage.MessageTemplate()
|
||||||
return message(&ti.FeragMessage, ti.Payload())
|
return message(&ti.FeragMessage, ti.Payload())
|
||||||
|
@ -110,4 +109,3 @@ func NewTitleInfo() *TitleInfo {
|
||||||
}
|
}
|
||||||
return &t
|
return &t
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue