code: func (a *Auth) writeCanonicalizedResource(buf *bytes.Buffer, req *http.Request) {
  	buf.WriteByte('/')
  	buf.WriteString(a.Account)
  	buf.WriteString(req.URL.Path)
  	if req.URL.RawQuery != "" {
  		vals, err := url.ParseQuery(req.URL.RawQuery)
  		if err != nil {
  			// This should never happen since we construct the URL ourselves in Go.
  			panic(err)
  		}
  
  		keys := make([]string, len(vals))
  		i := 0
  		for key := range vals {
  			keys[i] = key
  			i++
  		}
  		sort.Strings(keys)
  
  		for _, subres := range keys {
  			vv := vals[subres]
  			if len(vv) > 0 {
  				buf.WriteByte('\n')
  				buf.WriteString(strings.ToLower(subres))
  				buf.WriteByte(':')
  				for i, v := range vv {
  					if len(v) > 0 {
  						if i != 0 {
  							buf.WriteByte(',')
  						}
  						buf.WriteString(url.QueryEscape(v))
  					}
  				}
  			}
  		}
  	}
  }
docs: // From the Azure docs at: http://msdn.microsoft.com/en-US/library/azure/dd179428