From 009a3074fe05fbd451d882779b63fa02ad34c720 Mon Sep 17 00:00:00 2001 From: Oliver Jakoubek Date: Fri, 29 May 2020 14:39:59 +0200 Subject: [PATCH] gofmt all project files --- .idea/watcherTasks.xml | 29 +++++++++++++++++++++++++++++ ferag.go | 27 +++++++++++++++------------ ferag_message.go | 2 +- product_reference.go | 4 ++-- production_drop.go | 2 +- route_end.go | 2 +- route_info.go | 8 ++++---- route_list.go | 6 +++--- test/larger_test.go | 2 +- title_end.go | 2 +- title_info.go | 2 -- 11 files changed, 58 insertions(+), 28 deletions(-) create mode 100644 .idea/watcherTasks.xml diff --git a/.idea/watcherTasks.xml b/.idea/watcherTasks.xml new file mode 100644 index 0000000..97ad6d2 --- /dev/null +++ b/.idea/watcherTasks.xml @@ -0,0 +1,29 @@ + + + + + + + + \ No newline at end of file diff --git a/ferag.go b/ferag.go index 3faafb5..272bbd9 100644 --- a/ferag.go +++ b/ferag.go @@ -2,26 +2,26 @@ package feragstring const ( dateInputFormatISO = "2006-01-02" - dateOutputFormat = "060102" - linebreak = "\r\n" + dateOutputFormat = "060102" + linebreak = "\r\n" ) type FeragString struct { - TitleInfo *TitleInfo - TitleEnd *TitleEnd - ProductReferences []*ProductReference - ProductReferencesNr int - RouteListEntries []*RouteListEntry - RouteListEntryCount int - RouteInfoEntries []*RouteInfo + TitleInfo *TitleInfo + TitleEnd *TitleEnd + ProductReferences []*ProductReference + ProductReferencesNr int + RouteListEntries []*RouteListEntry + RouteListEntryCount int + RouteInfoEntries []*RouteInfo ProductionDropEntries []*ProductionDrop - RouteEndEntries []*RouteEnd + RouteEndEntries []*RouteEnd } func NewFeragString() *FeragString { fs := FeragString{ TitleInfo: NewTitleInfo(), - TitleEnd: NewTitleEnd(), + TitleEnd: NewTitleEnd(), } return &fs } @@ -32,8 +32,10 @@ func (fs *FeragString) SetTitleName(titleName string) { } func (fs *FeragString) PrintOut() string { + // +2440 | first message is the title info info := fs.TitleInfo.Message() + // +2450 | list of product references for _, pr := range fs.ProductReferences { info += pr.Message() } @@ -54,6 +56,7 @@ func (fs *FeragString) PrintOut() string { info += re.Message() } + // +2441 | last message is the corresponding title end info += fs.TitleEnd.Message() return info } @@ -94,4 +97,4 @@ func (fs *FeragString) AddProductionDrop(pd *ProductionDrop) error { func (fs *FeragString) AddRouteEnd(re *RouteEnd) error { fs.RouteEndEntries = append(fs.RouteEndEntries, re) return nil -} \ No newline at end of file +} diff --git a/ferag_message.go b/ferag_message.go index 2b52ac2..23b9121 100644 --- a/ferag_message.go +++ b/ferag_message.go @@ -7,7 +7,7 @@ import ( type FeragMessage struct { messageStart string - messageEnd string + messageEnd string } func (fm *FeragMessage) getMessageStart() string { diff --git a/product_reference.go b/product_reference.go index 9aa28b4..3d14d6e 100644 --- a/product_reference.go +++ b/product_reference.go @@ -128,7 +128,7 @@ func (pr *ProductReference) SetProductReferenceNumber(productReferenceNumber int func NewProductReference() *ProductReference { pr := ProductReference{ - FeragMessage: FeragMessage{"2450", "!"}, + FeragMessage: FeragMessage{"2450", "!"}, missingParameter: MissingParameter{ missingRate: 0, missingSize: 1, @@ -155,4 +155,4 @@ func (pr *ProductReference) Payload() string { func (pr *ProductReference) Message() string { message := pr.FeragMessage.MessageTemplate() return message(&pr.FeragMessage, pr.Payload()) -} \ No newline at end of file +} diff --git a/production_drop.go b/production_drop.go index 56cff7e..615baa9 100644 --- a/production_drop.go +++ b/production_drop.go @@ -4,7 +4,7 @@ import "fmt" type ProductionDrop struct { FeragMessage - agentName string + agentName string numberOfCopies int } diff --git a/route_end.go b/route_end.go index f4e43d3..0ee5e95 100644 --- a/route_end.go +++ b/route_end.go @@ -17,7 +17,7 @@ func (re *RouteEnd) SetRouteName(routeName string) { func NewRouteEnd() *RouteEnd { re := RouteEnd{ - FeragMessage: FeragMessage{ + FeragMessage: FeragMessage{ messageStart: "2406", messageEnd: "!", }, diff --git a/route_info.go b/route_info.go index d7aceff..717eb3f 100644 --- a/route_info.go +++ b/route_info.go @@ -4,10 +4,10 @@ import "fmt" type RouteInfo struct { FeragMessage - routeName string - topsheetMarker int + routeName string + topsheetMarker int eaAddressDefinition int - editionName string + editionName string } func (ri *RouteInfo) EditionName() string { @@ -44,7 +44,7 @@ func (ri *RouteInfo) RouteName() string { func NewRouteInfo() *RouteInfo { ri := RouteInfo{ - FeragMessage: FeragMessage{ + FeragMessage: FeragMessage{ messageStart: "2402", messageEnd: "!", }, diff --git a/route_list.go b/route_list.go index 5f4bcef..e437722 100644 --- a/route_list.go +++ b/route_list.go @@ -4,9 +4,9 @@ import "fmt" type RouteListEntry struct { FeragMessage - routeName string - routeCode int - rampNumber int + routeName string + routeCode int + rampNumber int copiesInRoute int } diff --git a/test/larger_test.go b/test/larger_test.go index 6e76c08..253a702 100644 --- a/test/larger_test.go +++ b/test/larger_test.go @@ -74,4 +74,4 @@ func TestNewFeragString(t *testing.T) { if testcontent != producedContent { t.Errorf("Files don't match!") } -} \ No newline at end of file +} diff --git a/title_end.go b/title_end.go index fdb7a6e..978fbd9 100644 --- a/title_end.go +++ b/title_end.go @@ -29,4 +29,4 @@ func (ti *TitleEnd) Message() string { message := ti.FeragMessage.MessageTemplate() payload := fmt.Sprintf("+40%-8s", ti.titleName) return message(&ti.FeragMessage, payload) -} \ No newline at end of file +} diff --git a/title_info.go b/title_info.go index 22b0931..c54e540 100644 --- a/title_info.go +++ b/title_info.go @@ -72,7 +72,6 @@ func (ti *TitleInfo) PublicationDate() string { return fmt.Sprintf("+95%-6s", ti.publicationDate.Format(dateOutputFormat)) } - func (ti *TitleInfo) Message() string { message := ti.FeragMessage.MessageTemplate() return message(&ti.FeragMessage, ti.Payload()) @@ -110,4 +109,3 @@ func NewTitleInfo() *TitleInfo { } return &t } -