From d9bf532cb5b94abb025831a3a6317efaf8905247 Mon Sep 17 00:00:00 2001 From: Arjen de Rijke Date: Fri, 8 Dec 2023 08:43:52 +0100 Subject: [PATCH 1/5] Fix macos workflow --- .github/workflows/macos.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 72a16ef..afab682 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -8,24 +8,13 @@ jobs: runs-on: macos-latest steps: - - name: Set up Go 1.x - uses: actions/setup-go@v4 - with: - go-version: ^1.13 - - name: Check out code into the Go module directory uses: actions/checkout@v4 + + - name: Set up Go 1.x + uses: actions/setup-go@v4 with: go-version: '1.20' - cache: false - - - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - name: Build run: go build -v ./... From 63bfd219fdc19f5f6f30f70d6dd470d64372bf18 Mon Sep 17 00:00:00 2001 From: Arjen de Rijke Date: Fri, 8 Dec 2023 08:51:43 +0100 Subject: [PATCH 2/5] Now the macos and linux workflows are the same --- .github/workflows/macos.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index afab682..f66d4eb 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,6 +1,10 @@ name: OSX -on: [push] +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] jobs: build: @@ -15,6 +19,7 @@ jobs: uses: actions/setup-go@v4 with: go-version: '1.20' + cache: false - name: Build run: go build -v ./... From 203f8c2089a4b13fc617cf319b9839845c735607 Mon Sep 17 00:00:00 2001 From: Arjen de Rijke Date: Fri, 8 Dec 2023 09:05:00 +0100 Subject: [PATCH 3/5] Add the staticcheck action on linux --- .github/workflows/go.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a14482d..843d064 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,6 +22,11 @@ jobs: go-version: '1.20' cache: false + - name: staticcheck + uses: dominikh/staticcheck-action@v1.3.0 + with: + version: "2023.1.6" + - name: Build run: go build -v ./... From 1e335e79d6413f90849cb8bbb8ac61cfc7dbb2ea Mon Sep 17 00:00:00 2001 From: Arjen de Rijke Date: Fri, 8 Dec 2023 09:50:25 +0100 Subject: [PATCH 4/5] Mark all issues found by the static checker --- src/converter.go | 10 ++++++++++ src/converter_test.go | 1 + src/driver.go | 8 ++++++++ src/mapi.go | 11 +++++++++++ src/stmt.go | 7 ++++++- 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/converter.go b/src/converter.go index 2d60028..cbc9aee 100644 --- a/src/converter.go +++ b/src/converter.go @@ -47,11 +47,17 @@ const ( mdb_TIMESTAMPTZ = "timestamptz" // full names and aliases, spaces are replaced with underscores + //lint:ignore U1000 mdb_CHARACTER = mdb_CHAR + //lint:ignore U1000 mdb_CHARACTER_VARYING = mdb_VARCHAR + //lint:ignore U1000 mdb_CHARACHTER_LARGE_OBJECT = mdb_CLOB + //lint:ignore U1000 mdb_BINARY_LARGE_OBJECT = mdb_BLOB + //lint:ignore U1000 mdb_NUMERIC = mdb_DECIMAL + //lint:ignore U1000 mdb_DOUBLE_PRECISION = mdb_DOUBLE ) @@ -255,6 +261,7 @@ func toByteString(v driver.Value) (string, error) { case []uint8: return toQuotedString(string(val)) default: + //lint:ignore ST1005 return "", fmt.Errorf("Unsupported type") } } @@ -266,6 +273,7 @@ func toDateTimeString(v driver.Value) (string, error) { case Date: return toQuotedString(fmt.Sprintf("%04d-%02d-%02d", val.Year, val.Month, val.Day)) default: + //lint:ignore ST1005 return "", fmt.Errorf("Unsupported type") } } @@ -298,6 +306,7 @@ func convertToGo(value, dataType string) (driver.Value, error) { value := strings.TrimSpace(value) return mapper(value) } + //lint:ignore ST1005 return nil, fmt.Errorf("Type not supported: %s", dataType) } @@ -311,5 +320,6 @@ func convertToMonet(value driver.Value) (string, error) { if mapper, ok := toMonetMappers[n]; ok { return mapper(value) } + //lint:ignore ST1005 return "", fmt.Errorf("Type not supported: %v", t) } diff --git a/src/converter_test.go b/src/converter_test.go index ee448ee..68e18db 100644 --- a/src/converter_test.go +++ b/src/converter_test.go @@ -104,6 +104,7 @@ func TestConvertToGo(t *testing.T) { func compareByteArray(t *testing.T, val []byte, e driver.Value) bool { switch exp := e.(type) { case []byte: + //lint:ignore S1004 return bytes.Compare(val, exp) == 0 default: return false diff --git a/src/driver.go b/src/driver.go index 2ff4379..d8c23ce 100644 --- a/src/driver.go +++ b/src/driver.go @@ -41,7 +41,9 @@ func parseDSN(name string) (config, error) { ipv6_re := regexp.MustCompile(`^((?P[^:]+?)(:(?P[^@]+?))?@)?\[(?P(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))+?)\](:(?P\d+?))?\/(?P.+?)$`) if ipv6_re.MatchString(name) { + //lint:ignore SA4006 m := make([]string, 0) + //lint:ignore SA4006 n := make([]string, 0) m = ipv6_re.FindAllStringSubmatch(name, -1)[0] n = ipv6_re.SubexpNames() @@ -60,12 +62,14 @@ func parseDSN(name string) (config, error) { configWithHost, err := parseHost(reverse(host), c) if err != nil { + //lint:ignore ST1005 return config{}, fmt.Errorf("Invalid DSN") } newConfig, err := parseCreds(reverse(creds), configWithHost) if err != nil { + //lint:ignore ST1005 return config{}, fmt.Errorf("Invalid DSN") } @@ -80,6 +84,7 @@ func parseCreds(creds string, c config) (config, error) { if found { if username == "" { + //lint:ignore ST1005 return c, fmt.Errorf("Invalid DSN") } @@ -93,10 +98,12 @@ func parseHost(host string, c config) (config, error) { host, dbName, found := Cut(host, "/") if !found { + //lint:ignore ST1005 return c, fmt.Errorf("Invalid DSN") } if host == "" { + //lint:ignore ST1005 return c, fmt.Errorf("Invalid DSN") } @@ -113,6 +120,7 @@ func parseHost(host string, c config) (config, error) { port_num, err := strconv.Atoi(port) if err != nil { + //lint:ignore ST1005 return c, fmt.Errorf("Invalid DSN") } diff --git a/src/mapi.go b/src/mapi.go index 424013f..940c929 100644 --- a/src/mapi.go +++ b/src/mapi.go @@ -98,6 +98,7 @@ func (c *MapiConn) Disconnect() { // Cmd sends a MAPI command to MonetDB. func (c *MapiConn) Cmd(operation string) (string, error) { if c.State != MAPI_STATE_READY { + //lint:ignore ST1005 return "", fmt.Errorf("Database not connected") } @@ -125,9 +126,11 @@ func (c *MapiConn) Cmd(operation string) (string, error) { return resp, nil } else if strings.HasPrefix(resp, mapi_MSG_ERROR) { + //lint:ignore ST1005 return "", fmt.Errorf("Operational error: %s", resp[1:]) } else { + //lint:ignore ST1005 return "", fmt.Errorf("Unknown state: %s", resp) } } @@ -198,6 +201,7 @@ func (c *MapiConn) tryLogin(iteration int) error { } else if strings.HasPrefix(prompt, mapi_MSG_ERROR) { // TODO log error + //lint:ignore ST1005 return fmt.Errorf("Database error: %s", prompt[1:]) } else if strings.HasPrefix(prompt, mapi_MSG_REDIRECT) { @@ -209,6 +213,7 @@ func (c *MapiConn) tryLogin(iteration int) error { if iteration <= 10 { c.tryLogin(iteration + 1) } else { + //lint:ignore ST1005 return fmt.Errorf("Maximal number of redirects reached (10)") } @@ -222,9 +227,11 @@ func (c *MapiConn) tryLogin(iteration int) error { c.Connect() } else { + //lint:ignore ST1005 return fmt.Errorf("Unknown redirect: %s", prompt) } } else { + //lint:ignore ST1005 return fmt.Errorf("Unknown state: %s", prompt) } @@ -242,6 +249,7 @@ func (c *MapiConn) challengeResponse(challenge []byte) (string, error) { algo := t[5] if protocol != "9" { + //lint:ignore ST1005 return "", fmt.Errorf("We only speak protocol v9") } @@ -250,6 +258,7 @@ func (c *MapiConn) challengeResponse(challenge []byte) (string, error) { h = crypto.SHA512.New() } else { // TODO support more algorithm + //lint:ignore ST1005 return "", fmt.Errorf("Unsupported algorithm: %s", algo) } io.WriteString(h, c.Password) @@ -270,6 +279,7 @@ func (c *MapiConn) challengeResponse(challenge []byte) (string, error) { pwhash = fmt.Sprintf("{MD5}%x", h.Sum(nil)) } else { + //lint:ignore ST1005 return "", fmt.Errorf("Unsupported hash algorithm required for login %s", hashes) } @@ -342,6 +352,7 @@ func (c *MapiConn) putBlock(b []byte) error { last = 1 } + //lint:ignore S1021 var packed uint16 packed = uint16((length << 1) + last) flag := new(bytes.Buffer) diff --git a/src/stmt.go b/src/stmt.go index e7eb7c1..272744a 100644 --- a/src/stmt.go +++ b/src/stmt.go @@ -82,6 +82,7 @@ func (s *Stmt) Query(args []driver.Value) (driver.Rows, error) { return rows, rows.err } + //lint:ignore SA4006 err = s.storeResult(r) rows.queryId = s.queryId rows.lastRowId = s.lastRowId @@ -185,6 +186,7 @@ func (s *Stmt) storeResult(r string) error { } else if strings.HasPrefix(line, mapi_MSG_QTRANS) { s.offset = 0 + //lint:ignore S1019 s.rows = make([][]driver.Value, 0, 0) s.lastRowId = 0 s.description = nil @@ -234,17 +236,19 @@ func (s *Stmt) storeResult(r string) error { return nil } else if strings.HasPrefix(line, mapi_MSG_ERROR) { + //lint:ignore ST1005 return fmt.Errorf("Database error: %s", line[1:]) - } } + //lint:ignore ST1005 return fmt.Errorf("Unknown state: %s", r) } func (s *Stmt) parseTuple(d string) ([]driver.Value, error) { items := strings.Split(d[1:len(d)-1], ",\t") if len(items) != len(s.description) { + //lint:ignore ST1005 return nil, fmt.Errorf("Length of row doesn't match header") } @@ -264,6 +268,7 @@ func (s *Stmt) updateDescription( internalSizes, precisions, scales, nullOks []int) { d := make([]description, len(columnNames)) + //lint:ignore S1005 for i, _ := range columnNames { desc := description{ columnName: columnNames[i], From 84bf9b8aab83b0244c888d29451dbf9e1e6a131a Mon Sep 17 00:00:00 2001 From: Arjen de Rijke Date: Fri, 8 Dec 2023 10:10:44 +0100 Subject: [PATCH 5/5] Add the reason everywhere, because it is mandatory --- src/converter.go | 20 ++++++++++---------- src/converter_test.go | 2 +- src/driver.go | 16 ++++++++-------- src/mapi.go | 22 +++++++++++----------- src/stmt.go | 12 ++++++------ 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/converter.go b/src/converter.go index cbc9aee..f091a04 100644 --- a/src/converter.go +++ b/src/converter.go @@ -47,17 +47,17 @@ const ( mdb_TIMESTAMPTZ = "timestamptz" // full names and aliases, spaces are replaced with underscores - //lint:ignore U1000 + //lint:ignore U1000 prepare to enable staticchecks mdb_CHARACTER = mdb_CHAR - //lint:ignore U1000 + //lint:ignore U1000 prepare to enable staticchecks mdb_CHARACTER_VARYING = mdb_VARCHAR - //lint:ignore U1000 + //lint:ignore U1000 prepare to enable staticchecks mdb_CHARACHTER_LARGE_OBJECT = mdb_CLOB - //lint:ignore U1000 + //lint:ignore U1000 prepare to enable staticchecks mdb_BINARY_LARGE_OBJECT = mdb_BLOB - //lint:ignore U1000 + //lint:ignore U1000 prepare to enable staticchecks mdb_NUMERIC = mdb_DECIMAL - //lint:ignore U1000 + //lint:ignore U1000 prepare to enable staticchecks mdb_DOUBLE_PRECISION = mdb_DOUBLE ) @@ -261,7 +261,7 @@ func toByteString(v driver.Value) (string, error) { case []uint8: return toQuotedString(string(val)) default: - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return "", fmt.Errorf("Unsupported type") } } @@ -273,7 +273,7 @@ func toDateTimeString(v driver.Value) (string, error) { case Date: return toQuotedString(fmt.Sprintf("%04d-%02d-%02d", val.Year, val.Month, val.Day)) default: - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return "", fmt.Errorf("Unsupported type") } } @@ -306,7 +306,7 @@ func convertToGo(value, dataType string) (driver.Value, error) { value := strings.TrimSpace(value) return mapper(value) } - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return nil, fmt.Errorf("Type not supported: %s", dataType) } @@ -320,6 +320,6 @@ func convertToMonet(value driver.Value) (string, error) { if mapper, ok := toMonetMappers[n]; ok { return mapper(value) } - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return "", fmt.Errorf("Type not supported: %v", t) } diff --git a/src/converter_test.go b/src/converter_test.go index 68e18db..dd42cee 100644 --- a/src/converter_test.go +++ b/src/converter_test.go @@ -104,7 +104,7 @@ func TestConvertToGo(t *testing.T) { func compareByteArray(t *testing.T, val []byte, e driver.Value) bool { switch exp := e.(type) { case []byte: - //lint:ignore S1004 + //lint:ignore S1004 prepare to enable staticchecks return bytes.Compare(val, exp) == 0 default: return false diff --git a/src/driver.go b/src/driver.go index d8c23ce..3dfb56a 100644 --- a/src/driver.go +++ b/src/driver.go @@ -41,9 +41,9 @@ func parseDSN(name string) (config, error) { ipv6_re := regexp.MustCompile(`^((?P[^:]+?)(:(?P[^@]+?))?@)?\[(?P(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))+?)\](:(?P\d+?))?\/(?P.+?)$`) if ipv6_re.MatchString(name) { - //lint:ignore SA4006 + //lint:ignore SA4006 prepare to enable staticchecks m := make([]string, 0) - //lint:ignore SA4006 + //lint:ignore SA4006 prepare to enable staticchecks n := make([]string, 0) m = ipv6_re.FindAllStringSubmatch(name, -1)[0] n = ipv6_re.SubexpNames() @@ -62,14 +62,14 @@ func parseDSN(name string) (config, error) { configWithHost, err := parseHost(reverse(host), c) if err != nil { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return config{}, fmt.Errorf("Invalid DSN") } newConfig, err := parseCreds(reverse(creds), configWithHost) if err != nil { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return config{}, fmt.Errorf("Invalid DSN") } @@ -84,7 +84,7 @@ func parseCreds(creds string, c config) (config, error) { if found { if username == "" { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return c, fmt.Errorf("Invalid DSN") } @@ -98,12 +98,12 @@ func parseHost(host string, c config) (config, error) { host, dbName, found := Cut(host, "/") if !found { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return c, fmt.Errorf("Invalid DSN") } if host == "" { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return c, fmt.Errorf("Invalid DSN") } @@ -120,7 +120,7 @@ func parseHost(host string, c config) (config, error) { port_num, err := strconv.Atoi(port) if err != nil { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return c, fmt.Errorf("Invalid DSN") } diff --git a/src/mapi.go b/src/mapi.go index 940c929..59ab5d8 100644 --- a/src/mapi.go +++ b/src/mapi.go @@ -98,7 +98,7 @@ func (c *MapiConn) Disconnect() { // Cmd sends a MAPI command to MonetDB. func (c *MapiConn) Cmd(operation string) (string, error) { if c.State != MAPI_STATE_READY { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return "", fmt.Errorf("Database not connected") } @@ -126,11 +126,11 @@ func (c *MapiConn) Cmd(operation string) (string, error) { return resp, nil } else if strings.HasPrefix(resp, mapi_MSG_ERROR) { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return "", fmt.Errorf("Operational error: %s", resp[1:]) } else { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return "", fmt.Errorf("Unknown state: %s", resp) } } @@ -201,7 +201,7 @@ func (c *MapiConn) tryLogin(iteration int) error { } else if strings.HasPrefix(prompt, mapi_MSG_ERROR) { // TODO log error - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return fmt.Errorf("Database error: %s", prompt[1:]) } else if strings.HasPrefix(prompt, mapi_MSG_REDIRECT) { @@ -213,7 +213,7 @@ func (c *MapiConn) tryLogin(iteration int) error { if iteration <= 10 { c.tryLogin(iteration + 1) } else { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return fmt.Errorf("Maximal number of redirects reached (10)") } @@ -227,11 +227,11 @@ func (c *MapiConn) tryLogin(iteration int) error { c.Connect() } else { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return fmt.Errorf("Unknown redirect: %s", prompt) } } else { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return fmt.Errorf("Unknown state: %s", prompt) } @@ -249,7 +249,7 @@ func (c *MapiConn) challengeResponse(challenge []byte) (string, error) { algo := t[5] if protocol != "9" { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return "", fmt.Errorf("We only speak protocol v9") } @@ -258,7 +258,7 @@ func (c *MapiConn) challengeResponse(challenge []byte) (string, error) { h = crypto.SHA512.New() } else { // TODO support more algorithm - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return "", fmt.Errorf("Unsupported algorithm: %s", algo) } io.WriteString(h, c.Password) @@ -279,7 +279,7 @@ func (c *MapiConn) challengeResponse(challenge []byte) (string, error) { pwhash = fmt.Sprintf("{MD5}%x", h.Sum(nil)) } else { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return "", fmt.Errorf("Unsupported hash algorithm required for login %s", hashes) } @@ -352,7 +352,7 @@ func (c *MapiConn) putBlock(b []byte) error { last = 1 } - //lint:ignore S1021 + //lint:ignore S1021 prepare to enable staticchecks var packed uint16 packed = uint16((length << 1) + last) flag := new(bytes.Buffer) diff --git a/src/stmt.go b/src/stmt.go index 272744a..d2b7837 100644 --- a/src/stmt.go +++ b/src/stmt.go @@ -82,7 +82,7 @@ func (s *Stmt) Query(args []driver.Value) (driver.Rows, error) { return rows, rows.err } - //lint:ignore SA4006 + //lint:ignore SA4006 prepare to enable staticchecks err = s.storeResult(r) rows.queryId = s.queryId rows.lastRowId = s.lastRowId @@ -186,7 +186,7 @@ func (s *Stmt) storeResult(r string) error { } else if strings.HasPrefix(line, mapi_MSG_QTRANS) { s.offset = 0 - //lint:ignore S1019 + //lint:ignore S1019 prepare to enable staticchecks s.rows = make([][]driver.Value, 0, 0) s.lastRowId = 0 s.description = nil @@ -236,19 +236,19 @@ func (s *Stmt) storeResult(r string) error { return nil } else if strings.HasPrefix(line, mapi_MSG_ERROR) { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return fmt.Errorf("Database error: %s", line[1:]) } } - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return fmt.Errorf("Unknown state: %s", r) } func (s *Stmt) parseTuple(d string) ([]driver.Value, error) { items := strings.Split(d[1:len(d)-1], ",\t") if len(items) != len(s.description) { - //lint:ignore ST1005 + //lint:ignore ST1005 prepare to enable staticchecks return nil, fmt.Errorf("Length of row doesn't match header") } @@ -268,7 +268,7 @@ func (s *Stmt) updateDescription( internalSizes, precisions, scales, nullOks []int) { d := make([]description, len(columnNames)) - //lint:ignore S1005 + //lint:ignore S1005 prepare to enable staticchecks for i, _ := range columnNames { desc := description{ columnName: columnNames[i],