@@ -20,7 +20,6 @@ import (
2020 "bytes"
2121 "fmt"
2222 "io"
23- "io/ioutil"
2423 "os"
2524 "os/signal"
2625 "path"
@@ -35,11 +34,12 @@ import (
3534 "github.com/quickfixgo/fix42/marketdatarequest"
3635 "github.com/quickfixgo/fix42/newordersingle"
3736 "github.com/quickfixgo/fix42/ordercancelrequest"
38- "github.com/quickfixgo/quickfix"
3937 "github.com/spf13/cobra"
38+
39+ "github.com/quickfixgo/quickfix"
4040)
4141
42- //Application implements the quickfix.Application interface
42+ // Application implements the quickfix.Application interface
4343type Application struct {
4444 * quickfix.MessageRouter
4545 * internal.OrderMatcher
@@ -58,29 +58,29 @@ func newApplication() *Application {
5858 return app
5959}
6060
61- //OnCreate implemented as part of Application interface
61+ // OnCreate implemented as part of Application interface
6262func (a Application ) OnCreate (sessionID quickfix.SessionID ) {}
6363
64- //OnLogon implemented as part of Application interface
64+ // OnLogon implemented as part of Application interface
6565func (a Application ) OnLogon (sessionID quickfix.SessionID ) {}
6666
67- //OnLogout implemented as part of Application interface
67+ // OnLogout implemented as part of Application interface
6868func (a Application ) OnLogout (sessionID quickfix.SessionID ) {}
6969
70- //ToAdmin implemented as part of Application interface
70+ // ToAdmin implemented as part of Application interface
7171func (a Application ) ToAdmin (msg * quickfix.Message , sessionID quickfix.SessionID ) {}
7272
73- //ToApp implemented as part of Application interface
73+ // ToApp implemented as part of Application interface
7474func (a Application ) ToApp (msg * quickfix.Message , sessionID quickfix.SessionID ) error {
7575 return nil
7676}
7777
78- //FromAdmin implemented as part of Application interface
78+ // FromAdmin implemented as part of Application interface
7979func (a Application ) FromAdmin (msg * quickfix.Message , sessionID quickfix.SessionID ) quickfix.MessageRejectError {
8080 return nil
8181}
8282
83- //FromApp implemented as part of Application interface, uses Router on incoming application messages
83+ // FromApp implemented as part of Application interface, uses Router on incoming application messages
8484func (a * Application ) FromApp (msg * quickfix.Message , sessionID quickfix.SessionID ) (reject quickfix.MessageRejectError ) {
8585 return a .Route (msg , sessionID )
8686}
@@ -264,23 +264,23 @@ func execute(cmd *cobra.Command, args []string) error {
264264 }
265265 default :
266266 {
267- return fmt .Errorf ("Incorrect argument number" )
267+ return fmt .Errorf ("incorrect argument number" )
268268 }
269269 }
270270
271271 cfg , err := os .Open (cfgFileName )
272272 if err != nil {
273- return fmt .Errorf ("Error opening %v, %v\n " , cfgFileName , err )
273+ return fmt .Errorf ("error opening %v, %v" , cfgFileName , err )
274274 }
275275 defer cfg .Close ()
276- stringData , readErr := ioutil .ReadAll (cfg )
276+ stringData , readErr := io .ReadAll (cfg )
277277 if readErr != nil {
278- return fmt .Errorf ("Error reading cfg: %s," , readErr )
278+ return fmt .Errorf ("error reading cfg: %s," , readErr )
279279 }
280280
281281 appSettings , err := quickfix .ParseSettings (bytes .NewReader (stringData ))
282282 if err != nil {
283- return fmt .Errorf ("Error reading cfg: %s," , err )
283+ return fmt .Errorf ("error reading cfg: %s," , err )
284284 }
285285
286286 logFactory := quickfix .NewScreenLogFactory ()
@@ -289,12 +289,12 @@ func execute(cmd *cobra.Command, args []string) error {
289289 printConfig (bytes .NewReader (stringData ))
290290 acceptor , err := quickfix .NewAcceptor (app , quickfix .NewMemoryStoreFactory (), appSettings , logFactory )
291291 if err != nil {
292- return fmt .Errorf ("Unable to create Acceptor : %s\n " , err )
292+ return fmt .Errorf ("unable to create acceptor : %s" , err )
293293 }
294294
295295 err = acceptor .Start ()
296296 if err != nil {
297- return fmt .Errorf ("Unable to start Acceptor : %s\n " , err )
297+ return fmt .Errorf ("unable to start acceptor : %s" , err )
298298 }
299299
300300 interrupt := make (chan os.Signal , 1 )
0 commit comments