= nil { return encodeErr } // Everything we post to the S3 bucket should be marked 'private' var acl = s3.Private var contentType = "application/octet-stream" return bucket.PutReader(storage_path, b, int64(b.Len()), contentType, acl, s3.Options{}) } 简单地使用Goroutines 一开始我们用了最简单的方法来实现POST请求的处理函数。我们尝试通过goroutine来并行处理请求。 func payloadHandler(w http.ResponseWriter, r *http.Request) { if r.Method !