Commit Graph

4 Commits

Author SHA1 Message Date
Yuxuan 'fishy' Wang
17373a3f35 go: Fix things staticcheck complains about
Client: go

Staticcheck is the recommended replacement of the frozen and deprecated
official golint linter [1].

Fix the things it complained about (or add lint:ignore directive) in:

- lib/go/thrift
- lib/go/test/tests
- tutorial/go/src
- test/go/src
- compiler generated code

The majority of the fixes are in the following categories:

- Use of deprecated function (mainly the TConfiguration related ones)
- Redundant break in switch cases
- Unused and unexported variables/fields/functions

Also in the same spirit as fb539ae, remove the error return from
NewTSSLSocket as it can never be non-nil.

This change will be cherry-picked into 0.15.0 branch after merged.

[1]: https://groups.google.com/g/golang-nuts/c/rCP70Aq_tBc
2021-08-27 09:28:08 -07:00
Yuxuan 'fishy' Wang
a265236feb THRIFT-5447: Update supported Go versions
Client: go

Update go versions used in travis to 1.16.7 and 1.17, update
LANGUAGES.md, and update go's README to clarify on support policy.

This change will be cherry-picked into 0.15.0 branch after merged.
2021-08-19 14:09:24 -07:00
Yuxuan 'fishy' Wang
fb539ae412 THRIFT-5453: Defer DNS from NewTSocketConf to TSocket.Open
Client: go

We used to do DNS lookups in NewTSocketConf, without any timeout checks.
Stop doing that and do DNS lookups in TSocket.Open instead, which
already checks for ConnectTimeout set in TConfiguration.

Also remove the error return from NewTSocketConf.
2021-08-11 11:08:49 -07:00
Yuxuan 'fishy' Wang
b71f11e251 THRIFT-5358: Add go.mod file to root directory
Client: go

This unblocks the development under go 1.16+, which starts to complain
when there's no go.mod file in any of the directories.

The current approach is certainly not the best solution ever, for
example it does not run the tests under lib/go/test/tests but copy them
into lib/go/test/gopath/src/sometest and run them there instead, but
those improvements can be done in the future in follow up PRs and this
should be a good enough first step to unblock developments.
2021-03-24 13:32:14 -07:00