Prevent build failures which may occur when dependencies is
not up to date by updating them with the go get -u flag.
Add the go get -f flag as well, to override the check that
each package has been checked out from the repo implied by
its import path.
Add a vet target in order to catch suspicious constructs
reported by go vet.
Vet has successfully detected problems in the past,
for example, see
c9333b1b9b472feb5cad80e2c8276d41b64bde88
Some vet flags are noisy. In particular, the following flags
reports a large amount of generally unharmful constructs:
```
-assign: check for useless assignments
-composites: check that composite literals used field-keyed
elements
-shadow: check for shadowed variables
-shadowstrict: whether to be strict about shadowing
-unreachable: check for unreachable code
```
In order to skip running the flags mentioned above, vet is
invoked on a directory basis with `go tool vet .` since package-
level type-checking with `go vet` doesn't accept flags.
Hence, each file is vetted in isolation, which is weaker than
package-level type-checking. But nevertheless, it might catch
suspicious constructs that pose a real issue.
The vet target runs the following flags on the entire repo:
```
-asmdecl: check assembly against Go declarations
-atomic: check for common mistaken usages of the
sync/atomic package
-bool: check for mistakes involving boolean operators
-buildtags: check that +build tags are valid
-copylocks: check that locks are not passed by value
-methods: check that canonically named methods are canonically
defined
-nilfunc: check for comparisons between functions and nil
-printf: check printf-like invocations
-rangeloops: check that range loop variables are used correctly
-shift: check for useless shifts
-structtags: check that struct field tags have canonical format
and apply to exported fields as needed
-unsafeptr: check for misuse of unsafe.Pointer
```
Now and then, it might make sense to check the output of the
disabled flags manually.
For example, `VETARGS=-unreachable make vet` can detect several
lines of dead code that can be deleted, etc.
also required making some hardcoded values into more generic
functionality, which is generally a good thing. I verified that each
test function that I modified still passed.:
This code is copyright 2014 Akamai Technologies, Inc. <opensource@akamai.com>
Client works for RPC; will honor CONSUL_RPC_ADDR. HTTP works via consul/api;
honors CONSUL_HTTP_ADDR.
The format of a Unix socket in configuration data is:
"unix://[/path/to/socket];[username or uid];[gid];[mode]"
Obviously, the user must have appropriate permissions to create the socket
file in the given path and assign the requested uid/gid. Also note that Go does
not support gid lookups from group name, so gid must be numeric. See
https://codereview.appspot.com/101310044
When connecting from the client, the format is just the first part of the
above line:
"unix://[/path/to/socket]"
This code is copyright 2014 Akamai Technologies, Inc. <opensource@akamai.com>