File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import (
3737 "time"
3838
3939 "github.com/geldata/gel-go/gelcfg"
40+ "github.com/geldata/gel-go/internal"
4041 gelint "github.com/geldata/gel-go/internal/client"
4142 "github.com/geldata/gel-go/internal/descriptor"
4243 toml "github.com/pelletier/go-toml/v2"
@@ -62,10 +63,11 @@ func usage() {
6263}
6364
6465type cmdConfig struct {
65- mixedCaps bool
66- pubfuncs bool
67- pubtypes bool
68- rawmessage bool
66+ mixedCaps bool
67+ pubfuncs bool
68+ pubtypes bool
69+ rawmessage bool
70+ protocolVersion internal.ProtocolVersion
6971}
7072
7173func main () {
@@ -110,6 +112,11 @@ func main() {
110112 log .Println ("connected" )
111113 }
112114
115+ cfg .protocolVersion , err = gelint .ProtocolVersion (ctx , c )
116+ if err != nil {
117+ log .Fatalf ("error determining the protocol version: %s" , err )
118+ }
119+
113120 fileQueue := queueFilesInBackground ()
114121
115122 t , err := template .New ("files.template" ).
Original file line number Diff line number Diff line change @@ -81,14 +81,9 @@ func newQuery(
8181 log .Fatalf ("error reading %q: %s" , qryFile , err )
8282 }
8383
84- v , err := gelint .ProtocolVersion (ctx , p )
85- if err != nil {
86- log .Fatalf ("error determining the protocol version: %s" , err )
87- }
88-
8984 var qs querySetup
9085
91- if v .GTE (internal.ProtocolVersion {Major : 2 , Minor : 0 }) {
86+ if cfg . protocolVersion .GTE (internal.ProtocolVersion {Major : 2 , Minor : 0 }) {
9287 qs = & queryConfigV2 {}
9388 } else {
9489 qs = & queryConfigV1 {}
You can’t perform that action at this time.
0 commit comments