sign.go
func AmazonBucket(subdomain string) string {
	if i := strings.LastIndex(subdomain, "."); i != -1 {
		return subdomain[:i]
	}
	return ""
}
func AmazonBucket(subdomain string) string {
	if i := strings.LastIndex(subdomain, "."); i != -1 {
		return subdomain[:i]
	}
	return ""
}
// AmazonBucket returns everything up to the last '.' in subdomain.
// It is designed to be used with the Amazon service.
//   "johnsmith.s3"           becomes "johnsmith"
//   "johnsmith.s3-eu-west-1" becomes "johnsmith"
//   "www.example.com.s3"     becomes "www.example.com"