diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 9415be8..9a013b4 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -19,8 +19,8 @@ A clear description of what you expected to happen. **system information:** - OS: [e.g. Linux] - - Go version [e.g. Go 1.21.xx] - - QF/Go Version [e.g. v0.8.1] + - Go version [e.g. Go 1.23.xx] + - QF/Go Version [e.g. v0.9.7] **Additional context** Add any other context about the problem here. \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82ad28a..ec9bba9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,15 +18,15 @@ jobs: name: Linter runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: '1.21' cache: false - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: - version: v1.51 + version: v1.64.6 build: name: build diff --git a/cmd/cmd.go b/cmd/cmd.go index 24f30be..a0dc945 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -33,7 +33,7 @@ func Execute() error { c := &cobra.Command{ Use: "qf", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { if versionF { version.PrintVersion() return nil diff --git a/cmd/executor/executor.go b/cmd/executor/executor.go index 1d89eca..36024b4 100644 --- a/cmd/executor/executor.go +++ b/cmd/executor/executor.go @@ -79,12 +79,12 @@ func (e *executor) genExecID() field.ExecIDField { } // quickfix.Application interface -func (e executor) OnCreate(sessionID quickfix.SessionID) {} -func (e executor) OnLogon(sessionID quickfix.SessionID) {} -func (e executor) OnLogout(sessionID quickfix.SessionID) {} -func (e executor) ToAdmin(msg *quickfix.Message, sessionID quickfix.SessionID) {} -func (e executor) ToApp(msg *quickfix.Message, sessionID quickfix.SessionID) error { return nil } -func (e executor) FromAdmin(msg *quickfix.Message, sessionID quickfix.SessionID) quickfix.MessageRejectError { +func (e executor) OnCreate(_ quickfix.SessionID) {} +func (e executor) OnLogon(_ quickfix.SessionID) {} +func (e executor) OnLogout(_ quickfix.SessionID) {} +func (e executor) ToAdmin(_ *quickfix.Message, _ quickfix.SessionID) {} +func (e executor) ToApp(_ *quickfix.Message, _ quickfix.SessionID) error { return nil } +func (e executor) FromAdmin(_ *quickfix.Message, _ quickfix.SessionID) quickfix.MessageRejectError { return nil } @@ -505,7 +505,7 @@ var ( } ) -func execute(cmd *cobra.Command, args []string) error { +func execute(_ *cobra.Command, args []string) error { var cfgFileName string argLen := len(args) switch argLen { diff --git a/cmd/ordermatch/internal/order.go b/cmd/ordermatch/internal/order.go index f51f802..ab777c7 100644 --- a/cmd/ordermatch/internal/order.go +++ b/cmd/ordermatch/internal/order.go @@ -40,7 +40,7 @@ type Order struct { } func (o Order) IsClosed() bool { - return o.OpenQuantity().Equals(decimal.Zero) + return o.OpenQuantity().Equal(decimal.Zero) } func (o Order) OpenQuantity() decimal.Decimal { diff --git a/cmd/ordermatch/ordermatch.go b/cmd/ordermatch/ordermatch.go index c1714fb..d26c356 100644 --- a/cmd/ordermatch/ordermatch.go +++ b/cmd/ordermatch/ordermatch.go @@ -59,24 +59,24 @@ func newApplication() *Application { } // OnCreate implemented as part of Application interface -func (a Application) OnCreate(sessionID quickfix.SessionID) {} +func (a Application) OnCreate(_ quickfix.SessionID) {} // OnLogon implemented as part of Application interface -func (a Application) OnLogon(sessionID quickfix.SessionID) {} +func (a Application) OnLogon(_ quickfix.SessionID) {} // OnLogout implemented as part of Application interface -func (a Application) OnLogout(sessionID quickfix.SessionID) {} +func (a Application) OnLogout(_ quickfix.SessionID) {} // ToAdmin implemented as part of Application interface -func (a Application) ToAdmin(msg *quickfix.Message, sessionID quickfix.SessionID) {} +func (a Application) ToAdmin(_ *quickfix.Message, _ quickfix.SessionID) {} // ToApp implemented as part of Application interface -func (a Application) ToApp(msg *quickfix.Message, sessionID quickfix.SessionID) error { +func (a Application) ToApp(_ *quickfix.Message, _ quickfix.SessionID) error { return nil } // FromAdmin implemented as part of Application interface -func (a Application) FromAdmin(msg *quickfix.Message, sessionID quickfix.SessionID) quickfix.MessageRejectError { +func (a Application) FromAdmin(_ *quickfix.Message, _ quickfix.SessionID) quickfix.MessageRejectError { return nil } @@ -85,7 +85,7 @@ func (a *Application) FromApp(msg *quickfix.Message, sessionID quickfix.SessionI return a.Route(msg, sessionID) } -func (a *Application) onNewOrderSingle(msg newordersingle.NewOrderSingle, sessionID quickfix.SessionID) quickfix.MessageRejectError { +func (a *Application) onNewOrderSingle(msg newordersingle.NewOrderSingle, _ quickfix.SessionID) quickfix.MessageRejectError { clOrdID, err := msg.GetClOrdID() if err != nil { return err @@ -150,7 +150,7 @@ func (a *Application) onNewOrderSingle(msg newordersingle.NewOrderSingle, sessio return nil } -func (a *Application) onOrderCancelRequest(msg ordercancelrequest.OrderCancelRequest, sessionID quickfix.SessionID) quickfix.MessageRejectError { +func (a *Application) onOrderCancelRequest(msg ordercancelrequest.OrderCancelRequest, _ quickfix.SessionID) quickfix.MessageRejectError { origClOrdID, err := msg.GetOrigClOrdID() if err != nil { return err @@ -174,7 +174,7 @@ func (a *Application) onOrderCancelRequest(msg ordercancelrequest.OrderCancelReq return nil } -func (a *Application) onMarketDataRequest(msg marketdatarequest.MarketDataRequest, sessionID quickfix.SessionID) (err quickfix.MessageRejectError) { +func (a *Application) onMarketDataRequest(msg marketdatarequest.MarketDataRequest, _ quickfix.SessionID) (err quickfix.MessageRejectError) { fmt.Printf("%+v\n", msg) return } @@ -250,7 +250,7 @@ var ( } ) -func execute(cmd *cobra.Command, args []string) error { +func execute(_ *cobra.Command, args []string) error { var cfgFileName string argLen := len(args) switch argLen { diff --git a/cmd/tradeclient/tradeclient.go b/cmd/tradeclient/tradeclient.go index 9f17d53..e30428b 100644 --- a/cmd/tradeclient/tradeclient.go +++ b/cmd/tradeclient/tradeclient.go @@ -27,6 +27,7 @@ import ( "github.com/spf13/cobra" "github.com/quickfixgo/quickfix" + "github.com/quickfixgo/quickfix/log/file" ) // TradeClient implements the quickfix.Application interface @@ -34,30 +35,30 @@ type TradeClient struct { } // OnCreate implemented as part of Application interface -func (e TradeClient) OnCreate(sessionID quickfix.SessionID) {} +func (e TradeClient) OnCreate(_ quickfix.SessionID) {} // OnLogon implemented as part of Application interface -func (e TradeClient) OnLogon(sessionID quickfix.SessionID) {} +func (e TradeClient) OnLogon(_ quickfix.SessionID) {} // OnLogout implemented as part of Application interface -func (e TradeClient) OnLogout(sessionID quickfix.SessionID) {} +func (e TradeClient) OnLogout(_ quickfix.SessionID) {} // FromAdmin implemented as part of Application interface -func (e TradeClient) FromAdmin(msg *quickfix.Message, sessionID quickfix.SessionID) (reject quickfix.MessageRejectError) { +func (e TradeClient) FromAdmin(_ *quickfix.Message, _ quickfix.SessionID) (reject quickfix.MessageRejectError) { return nil } // ToAdmin implemented as part of Application interface -func (e TradeClient) ToAdmin(msg *quickfix.Message, sessionID quickfix.SessionID) {} +func (e TradeClient) ToAdmin(_ *quickfix.Message, _ quickfix.SessionID) {} // ToApp implemented as part of Application interface -func (e TradeClient) ToApp(msg *quickfix.Message, sessionID quickfix.SessionID) (err error) { +func (e TradeClient) ToApp(msg *quickfix.Message, _ quickfix.SessionID) (err error) { utils.PrintInfo(fmt.Sprintf("Sending: %s", msg.String())) return } // FromApp implemented as part of Application interface. This is the callback for all Application level messages from the counter party. -func (e TradeClient) FromApp(msg *quickfix.Message, sessionID quickfix.SessionID) (reject quickfix.MessageRejectError) { +func (e TradeClient) FromApp(msg *quickfix.Message, _ quickfix.SessionID) (reject quickfix.MessageRejectError) { utils.PrintInfo(fmt.Sprintf("FromApp: %s", msg.String())) return } @@ -80,7 +81,7 @@ var ( } ) -func execute(cmd *cobra.Command, args []string) error { +func execute(_ *cobra.Command, args []string) error { var cfgFileName string argLen := len(args) switch argLen { @@ -117,7 +118,7 @@ func execute(cmd *cobra.Command, args []string) error { } app := TradeClient{} - fileLogFactory, err := quickfix.NewFileLogFactory(appSettings) + fileLogFactory, err := file.NewLogFactory(appSettings) if err != nil { return fmt.Errorf("error creating file log factory: %s,", err) diff --git a/go.mod b/go.mod index 1cfecdc..b32519e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/quickfixgo/examples -go 1.21 +go 1.23 + +toolchain go1.23.9 require ( github.com/fatih/color v1.16.0 @@ -13,22 +15,23 @@ require ( github.com/quickfixgo/fix43 v0.1.0 github.com/quickfixgo/fix44 v0.1.0 github.com/quickfixgo/fix50 v0.1.0 - github.com/quickfixgo/quickfix v0.9.0 + github.com/quickfixgo/quickfix v0.9.7 github.com/quickfixgo/tag v0.1.0 - github.com/shopspring/decimal v1.3.1 + github.com/shopspring/decimal v1.4.0 github.com/spf13/cobra v1.8.0 ) require ( - github.com/armon/go-proxyproto v0.1.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/pires/go-proxyproto v0.7.0 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/quagmt/udecimal v1.8.0 // indirect github.com/quickfixgo/fixt11 v0.1.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/net v0.18.0 // indirect - golang.org/x/sys v0.14.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.19.0 // indirect ) diff --git a/go.sum b/go.sum index 4e86b54..895f114 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -github.com/armon/go-proxyproto v0.1.0 h1:TWWcSsjco7o2itn6r25/5AqKBiWmsiuzsUDLT/MTl7k= -github.com/armon/go-proxyproto v0.1.0/go.mod h1:Xj90dce2VKbHzRAeiVQAMBtj4M5oidoXJ8lmgyW21mw= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -16,10 +14,14 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/pires/go-proxyproto v0.7.0 h1:IukmRewDQFWC7kfnb66CSomk2q/seBuilHBYFwyq0Hs= +github.com/pires/go-proxyproto v0.7.0/go.mod h1:Vz/1JPY/OACxWGQNIRY2BeyDmpoaWmEP40O9LbuiFR4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/quagmt/udecimal v1.8.0 h1:d4MJNGb/dg8r03AprkeSiDlVKtkZnL10L3de/YGOiiI= +github.com/quagmt/udecimal v1.8.0/go.mod h1:ScmJ/xTGZcEoYiyMMzgDLn79PEJHcMBiJ4NNRT3FirA= github.com/quickfixgo/enum v0.1.0 h1:TnCPOqxAWA5/IWp7lsvj97x7oyuHYgj3STBJlBzZGjM= github.com/quickfixgo/enum v0.1.0/go.mod h1:65gdG2/8vr6uOYcjZBObVHMuTEYc5rr/+aKVWTrFIrQ= github.com/quickfixgo/field v0.1.0 h1:JVO6fVD6Nkyy8e/ROYQtV/nQhMX/BStD5Lq7XIgYz2g= @@ -38,30 +40,30 @@ github.com/quickfixgo/fix50 v0.1.0 h1:fD+93ap9P2lWbI42MFOdcUnzf+GRQHkyqWYYCKeTko github.com/quickfixgo/fix50 v0.1.0/go.mod h1:ZxQTqXY1IJnpN0v2CgYTFn3/ffbKsX/fWI31O3pBk9M= github.com/quickfixgo/fixt11 v0.1.0 h1:7pPnTNPa5wESbQVezLK6ExbSaqcJS2oruMUgnNNH8ZM= github.com/quickfixgo/fixt11 v0.1.0/go.mod h1:JV9yBYvw7dx6hQZeI3rV7eJ6c3SUf5bXwSU3Eb09ok0= -github.com/quickfixgo/quickfix v0.9.0 h1:WshR3GUSxR69ZrSQfppKs2zZ12dTYtU3JUgQg+PAOdA= -github.com/quickfixgo/quickfix v0.9.0/go.mod h1:t5Z881dOZ2Dz5vM6KIbMCx3YpAiFPFf/iCLCSn91Qqo= +github.com/quickfixgo/quickfix v0.9.7 h1:vvx/cydUG6cnGDyYeUxKA5MTzbYFQulthdTHzmmsvmc= +github.com/quickfixgo/quickfix v0.9.7/go.mod h1:LpvubslWDsNapeQDvhYS2Qty9gJtm2vr/gSdUcpdEwU= github.com/quickfixgo/tag v0.1.0 h1:R2A1Zf7CBE903+mOQlmTlfTmNZQz/yh7HunMbgcsqsA= github.com/quickfixgo/tag v0.1.0/go.mod h1:l/drB1eO3PwN9JQTDC9Vt2EqOcaXk3kGJ+eeCQljvAI= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= -github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=