Use SetDeadline methods for socket timeout, update code with go fix #10

wants to merge 2 commits into


None yet

2 participants


This pull request contains two changes:

  • Changes in the socket classes to remove the use of SetTimeout and replace it with SetDeadline. This is required for the weekly version of Go since SetTimeout was removed. Following the guidelines in the Go docs I am calling SetDeadline just before any Read/Write method.
  • Automatic fixes in the code, performed by "go fix", which involve the use of the strconv package. Unfortunately this tool also appears to run "go fmt" internally so the file whitespace is changed and so it appears a lot of lines where changed. This is limited to only the JSON tests.
@pomack pomack was assigned Mar 26, 2012
pomack commented Mar 26, 2012

I prefer a gofmt be a completely separate checkin to reduce diffs. Can you run your code through this gofmt and see if that significantly reduces down the diffs?

gofmt -spaces=true -tabwidth=2 -tabindent=false -w=true *.go

It looks like it has been a while since I ran gofmt, so this may still have quite a few diffs.

I'll merge separately if this doesn't reduce diffs enough. Let me know.


I've added a new commit which fixes the formatting issues in the JSON test files.

pomack commented Mar 28, 2012

Hey Carlos,

Now that Go1 has been released, I've updated all branches to have a Go1 release and tagged the release as well. This includes your fixes. I've also changed the directory structure and Makefiles to support the new "go" command and more specifically "go install" command. The testcases all pass.

Had to do a lot of merging, so I hope I didn't screw up anything. Let me know whether it works properly for you.


Hello Aalok,

I'm now using your master branch under Go 1 with no problems, including generating a new binding for Cassandra with the thrift compiler, and passing all the library tests, both for thrift4go and my for Cassandra Go client, Gossie, which I've also updated to Go 1.

Thank you!

pomack commented Mar 29, 2012


I'll send my cumulative changes to the Apache Thrift project next week. Since you and a few others contributed to the changes, I'm not sure if they'll need your approval as well or not.

@pomack pomack closed this Mar 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment