cmd/dist: make dir check in defaulttarg() more robust
cmd/dist: make dir check in defaulttarg() more robust

1, strip last path separator from $GOROOT
   The user might define GOROOT=/path/to/go/, but then the dir
   check in defaulttarg() will always complain the current dir
   is not within $GOROOT/src/.
2, resolve symlinks in the default goroot
   Or if getcwd() returns a fully-resolved path, the check in
   defaulttarg() will always fail.

R=rsc
CC=golang-dev
http://codereview.appspot.com/5649073

Committer: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>

h8liu/golang,h8liu/golang,h8liu/golang,h8liu/golang,h8liu/golang,h8liu/golang,h8liu/golang