Skip to content

Commit 8a2144a

Browse files
committed
Adds license info to src file headers and formats comments.
1 parent 2bdbca8 commit 8a2144a

File tree

99 files changed

+1652
-337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1652
-337
lines changed

.golangci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ linters:
1717
- revive
1818
- unused
1919
- staticcheck
20+
- godot
2021

2122
linters-settings:
2223
gofmt:

LICENSE.txt renamed to LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The QuickFIX Software License, Version 1.0
22

3-
Copyright (c) 2001-2010 quickfixengine.org All rights
3+
Copyright (c) 2001- quickfixengine.org All rights
44
reserved.
55

66
Redistribution and use in source and binary forms, with or without

accepter_test.go

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) quickfixengine.org All rights reserved.
2+
//
3+
// This file may be distributed under the terms of the quickfixengine.org
4+
// license as defined by quickfixengine.org and appearing in the file
5+
// LICENSE included in the packaging of this file.
6+
//
7+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
8+
// THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A
9+
// PARTICULAR PURPOSE.
10+
//
11+
// See http://www.quickfixengine.org/LICENSE for licensing information.
12+
//
13+
// Contact [email protected] if any conditions of this licensing
14+
// are not clear to you.
15+
116
package quickfix
217

318
import (

acceptor.go

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) quickfixengine.org All rights reserved.
2+
//
3+
// This file may be distributed under the terms of the quickfixengine.org
4+
// license as defined by quickfixengine.org and appearing in the file
5+
// LICENSE included in the packaging of this file.
6+
//
7+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
8+
// THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A
9+
// PARTICULAR PURPOSE.
10+
//
11+
// See http://www.quickfixengine.org/LICENSE for licensing information.
12+
//
13+
// Contact [email protected] if any conditions of this licensing
14+
// are not clear to you.
15+
116
package quickfix
217

318
import (

application.go

+22-7
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,41 @@
1+
// Copyright (c) quickfixengine.org All rights reserved.
2+
//
3+
// This file may be distributed under the terms of the quickfixengine.org
4+
// license as defined by quickfixengine.org and appearing in the file
5+
// LICENSE included in the packaging of this file.
6+
//
7+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
8+
// THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A
9+
// PARTICULAR PURPOSE.
10+
//
11+
// See http://www.quickfixengine.org/LICENSE for licensing information.
12+
//
13+
// Contact [email protected] if any conditions of this licensing
14+
// are not clear to you.
15+
116
package quickfix
217

318
// Application interface should be implemented by FIX Applications.
419
// This is the primary interface for processing messages from a FIX Session.
520
type Application interface {
6-
//OnCreate notification of a session begin created.
21+
// OnCreate notification of a session begin created.
722
OnCreate(sessionID SessionID)
823

9-
//OnLogon notification of a session successfully logging on.
24+
// OnLogon notification of a session successfully logging on.
1025
OnLogon(sessionID SessionID)
1126

12-
//OnLogout notification of a session logging off or disconnecting.
27+
// OnLogout notification of a session logging off or disconnecting.
1328
OnLogout(sessionID SessionID)
1429

15-
//ToAdmin notification of admin message being sent to target.
30+
// ToAdmin notification of admin message being sent to target.
1631
ToAdmin(message *Message, sessionID SessionID)
1732

18-
//ToApp notification of app message being sent to target.
33+
// ToApp notification of app message being sent to target.
1934
ToApp(message *Message, sessionID SessionID) error
2035

21-
//FromAdmin notification of admin message being received from target.
36+
// FromAdmin notification of admin message being received from target.
2237
FromAdmin(message *Message, sessionID SessionID) MessageRejectError
2338

24-
//FromApp notification of app message being received from target.
39+
// FromApp notification of app message being received from target.
2540
FromApp(message *Message, sessionID SessionID) MessageRejectError
2641
}

begin_string.go

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
1+
// Copyright (c) quickfixengine.org All rights reserved.
2+
//
3+
// This file may be distributed under the terms of the quickfixengine.org
4+
// license as defined by quickfixengine.org and appearing in the file
5+
// LICENSE included in the packaging of this file.
6+
//
7+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
8+
// THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A
9+
// PARTICULAR PURPOSE.
10+
//
11+
// See http://www.quickfixengine.org/LICENSE for licensing information.
12+
//
13+
// Contact [email protected] if any conditions of this licensing
14+
// are not clear to you.
15+
116
package quickfix
217

3-
// FIX BeginString string values
18+
// FIX BeginString string values.
419
const (
520
BeginStringFIX40 = "FIX.4.0"
621
BeginStringFIX41 = "FIX.4.1"

cmd/generate-fix/generate-fix.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func main() {
164164
}
165165

166166
switch pkg {
167-
//uses fixt11 header/trailer
167+
// Uses fixt11 header/trailer.
168168
case "fix50", "fix50sp1", "fix50sp2":
169169
default:
170170
waitGroup.Add(1)

cmd/generate-fix/internal/globals.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var (
1414
GlobalFieldTypes []*datadictionary.FieldType
1515
)
1616

17-
//sort fieldtypes by name
17+
// Sort fieldtypes by name.
1818
type byFieldName []*datadictionary.FieldType
1919

2020
func (n byFieldName) Len() int { return len(n) }
@@ -36,14 +36,14 @@ func BuildGlobalFieldTypes(specs []*datadictionary.DataDictionary) {
3636
for _, spec := range specs {
3737
for _, field := range spec.FieldTypeByTag {
3838
if oldField, ok := globalFieldTypesLookup[field.Name()]; ok {
39-
//merge old enums with new
39+
// Merge old enums with new.
4040
if len(oldField.Enums) > 0 && field.Enums == nil {
4141
field.Enums = make(map[string]datadictionary.Enum)
4242
}
4343

4444
for enumVal, enum := range oldField.Enums {
4545
if _, ok := field.Enums[enumVal]; !ok {
46-
//Verify an existing enum doesn't have the same description. Keep newer enum
46+
// Verify an existing enum doesn't have the same description. Keep newer enum.
4747
okToKeepEnum := true
4848
for _, newEnum := range field.Enums {
4949
if newEnum.Description == enum.Description {

cmd/generate-fix/internal/template_helpers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ func routerBeginString(spec *datadictionary.DataDictionary) (routerBeginString s
306306
routerBeginString = "FIXT.1.1"
307307
case spec.Major != 5 && spec.ServicePack == 0:
308308
routerBeginString = fmt.Sprintf("FIX.%v.%v", spec.Major, spec.Minor)
309-
//ApplVerID enums
309+
// ApplVerID enums.
310310
case spec.Major == 2:
311311
routerBeginString = "0"
312312
case spec.Major == 3:

config/configuration.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package config
22

3-
//NOTE: Additions to this file should be made to both config/doc.go and http://www.quickfixgo.org/docs/
3+
// NOTE: Additions to this file should be made to both config/doc.go and http://www.quickfixgo.org/docs/
44

5-
// Const configuration settings
5+
// Const configuration settings.
66
const (
77
BeginString string = "BeginString"
88
SenderCompID string = "SenderCompID"

connection.go

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) quickfixengine.org All rights reserved.
2+
//
3+
// This file may be distributed under the terms of the quickfixengine.org
4+
// license as defined by quickfixengine.org and appearing in the file
5+
// LICENSE included in the packaging of this file.
6+
//
7+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
8+
// THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A
9+
// PARTICULAR PURPOSE.
10+
//
11+
// See http://www.quickfixengine.org/LICENSE for licensing information.
12+
//
13+
// Contact [email protected] if any conditions of this licensing
14+
// are not clear to you.
15+
116
package quickfix
217

318
import "io"

connection_internal_test.go

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) quickfixengine.org All rights reserved.
2+
//
3+
// This file may be distributed under the terms of the quickfixengine.org
4+
// license as defined by quickfixengine.org and appearing in the file
5+
// LICENSE included in the packaging of this file.
6+
//
7+
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
8+
// THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A
9+
// PARTICULAR PURPOSE.
10+
//
11+
// See http://www.quickfixengine.org/LICENSE for licensing information.
12+
//
13+
// Contact [email protected] if any conditions of this licensing
14+
// are not clear to you.
15+
116
package quickfix
217

318
import (

datadictionary/datadictionary.go

+25-26
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ type DataDictionary struct {
2323
Trailer *MessageDef
2424
}
2525

26-
// MessagePart can represent a Field, Repeating Group, or Component
26+
// MessagePart can represent a Field, Repeating Group, or Component.
2727
type MessagePart interface {
2828
Name() string
2929
Required() bool
3030
}
3131

32-
// messagePartWithFields is a MessagePart with multiple Fields
32+
// messagePartWithFields is a MessagePart with multiple Fields.
3333
type messagePartWithFields interface {
3434
MessagePart
3535
Fields() []*FieldDef
@@ -45,7 +45,7 @@ type ComponentType struct {
4545
requiredParts []MessagePart
4646
}
4747

48-
// NewComponentType returns an initialized component type
48+
// NewComponentType returns an initialized component type.
4949
func NewComponentType(name string, parts []MessagePart) *ComponentType {
5050
comp := ComponentType{
5151
name: name,
@@ -77,20 +77,20 @@ func NewComponentType(name string, parts []MessagePart) *ComponentType {
7777
return &comp
7878
}
7979

80-
// Name returns the name of this component type
80+
// Name returns the name of this component type.
8181
func (c ComponentType) Name() string { return c.name }
8282

8383
// Fields returns all fields contained in this component. Includes fields
84-
// encapsulated in components of this component
84+
// encapsulated in components of this component.
8585
func (c ComponentType) Fields() []*FieldDef { return c.fields }
8686

87-
// RequiredFields returns those fields that are required for this component
87+
// RequiredFields returns those fields that are required for this component.
8888
func (c ComponentType) RequiredFields() []*FieldDef { return c.requiredFields }
8989

90-
// RequiredParts returns those parts that are required for this component
90+
// RequiredParts returns those parts that are required for this component.
9191
func (c ComponentType) RequiredParts() []MessagePart { return c.requiredParts }
9292

93-
// Parts returns all parts in declaration order contained in this component
93+
// Parts returns all parts in declaration order contained in this component.
9494
func (c ComponentType) Parts() []MessagePart { return c.parts }
9595

9696
// TagSet is set for tags.
@@ -101,13 +101,13 @@ func (t TagSet) Add(tag int) {
101101
t[tag] = struct{}{}
102102
}
103103

104-
// Component is a Component as it appears in a given MessageDef
104+
// Component is a Component as it appears in a given MessageDef.
105105
type Component struct {
106106
*ComponentType
107107
required bool
108108
}
109109

110-
// NewComponent returns an initialized Component instance
110+
// NewComponent returns an initialized Component instance.
111111
func NewComponent(ct *ComponentType, required bool) *Component {
112112
return &Component{
113113
ComponentType: ct,
@@ -116,10 +116,10 @@ func NewComponent(ct *ComponentType, required bool) *Component {
116116
}
117117

118118
// Required returns true if this component is required for the containing
119-
// MessageDef
119+
// MessageDef.
120120
func (c Component) Required() bool { return c.required }
121121

122-
// Field models a field or repeating group in a message
122+
// Field models a field or repeating group in a message.
123123
type Field interface {
124124
Tag() int
125125
}
@@ -135,15 +135,15 @@ type FieldDef struct {
135135
requiredFields []*FieldDef
136136
}
137137

138-
// NewFieldDef returns an initialized FieldDef
138+
// NewFieldDef returns an initialized FieldDef.
139139
func NewFieldDef(fieldType *FieldType, required bool) *FieldDef {
140140
return &FieldDef{
141141
FieldType: fieldType,
142142
required: required,
143143
}
144144
}
145145

146-
// NewGroupFieldDef returns an initialized FieldDef for a repeating group
146+
// NewGroupFieldDef returns an initialized FieldDef for a repeating group.
147147
func NewGroupFieldDef(fieldType *FieldType, required bool, parts []MessagePart) *FieldDef {
148148
field := FieldDef{
149149
FieldType: fieldType,
@@ -179,7 +179,7 @@ func NewGroupFieldDef(fieldType *FieldType, required bool, parts []MessagePart)
179179
}
180180

181181
// Required returns true if this FieldDef is required for the containing
182-
// MessageDef
182+
// MessageDef.
183183
func (f FieldDef) Required() bool { return f.required }
184184

185185
// IsGroup is true if the field is a repeating group.
@@ -188,11 +188,11 @@ func (f FieldDef) IsGroup() bool {
188188
}
189189

190190
// RequiredParts returns those parts that are required for this FieldDef. IsGroup
191-
// must return true
191+
// must return true.
192192
func (f FieldDef) RequiredParts() []MessagePart { return f.requiredParts }
193193

194194
// RequiredFields returns those fields that are required for this FieldDef. IsGroup
195-
// must return true
195+
// must return true.
196196
func (f FieldDef) RequiredFields() []*FieldDef { return f.requiredFields }
197197

198198
func (f FieldDef) childTags() []int {
@@ -214,7 +214,7 @@ type FieldType struct {
214214
Enums map[string]Enum
215215
}
216216

217-
// NewFieldType returns a pointer to an initialized FieldType
217+
// NewFieldType returns a pointer to an initialized FieldType.
218218
func NewFieldType(name string, tag int, fixType string) *FieldType {
219219
return &FieldType{
220220
name: name,
@@ -223,10 +223,10 @@ func NewFieldType(name string, tag int, fixType string) *FieldType {
223223
}
224224
}
225225

226-
// Name returns the name for this FieldType
226+
// Name returns the name for this FieldType.
227227
func (f FieldType) Name() string { return f.name }
228228

229-
// Tag returns the tag for this fieldType
229+
// Tag returns the tag for this fieldType.
230230
func (f FieldType) Tag() int { return f.tag }
231231

232232
// Enum is a container for value and description.
@@ -240,19 +240,18 @@ type MessageDef struct {
240240
Name string
241241
MsgType string
242242
Fields map[int]*FieldDef
243-
//Parts are the MessageParts of contained in this MessageDef in declaration
244-
//order
243+
// Parts are the MessageParts of contained in this MessageDef in declaration order.
245244
Parts []MessagePart
246245
requiredParts []MessagePart
247246

248247
RequiredTags TagSet
249248
Tags TagSet
250249
}
251250

252-
// RequiredParts returns those parts that are required for this Message
251+
// RequiredParts returns those parts that are required for this Message.
253252
func (m MessageDef) RequiredParts() []MessagePart { return m.requiredParts }
254253

255-
// NewMessageDef returns a pointer to an initialized MessageDef
254+
// NewMessageDef returns a pointer to an initialized MessageDef.
256255
func NewMessageDef(name, msgType string, parts []MessagePart) *MessageDef {
257256
msg := MessageDef{
258257
Name: name,
@@ -283,8 +282,8 @@ func NewMessageDef(name, msgType string, parts []MessagePart) *MessageDef {
283282
switch pType := part.(type) {
284283
case messagePartWithFields:
285284
for _, f := range pType.Fields() {
286-
//field if required in component is required in message only if
287-
//component is required
285+
// Field if required in component is required in message only if
286+
// component is required.
288287
processField(f, pType.Required())
289288
}
290289

0 commit comments

Comments
 (0)