Browse files

Hack so it doesn't require changes to goamz/aws

  • Loading branch information...
1 parent 4187044 commit d6462d8dacaa8abe57984fb0c79bcab1d8acb640 @edsrzf edsrzf committed Sep 14, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −4 sqs.go
  2. +0 −1 sqsi_test.go
View
9 sqs.go
@@ -160,7 +160,8 @@ func (sqs *SQS) doRequest(req *http.Request, resp interface{}) os.Error {
}
func (sqs *SQS) post(action, path string, params http.Values, body []byte, resp interface{}) os.Error {
- req, err := sqs.newRequest("POST", action, sqs.Region.SQSEndpoint+path, params)
+ endpoint := strings.Replace(sqs.Region.EC2Endpoint, "ec2", "sqs", 1) + path
+ req, err := sqs.newRequest("POST", action, endpoint, params)
if err != nil {
return err
}
@@ -177,7 +178,8 @@ func (sqs *SQS) get(action, path string, params http.Values, resp interface{}) o
if params == nil {
params = http.Values{}
}
- req, err := sqs.newRequest("GET", action, sqs.Region.SQSEndpoint+path, params)
+ endpoint := strings.Replace(sqs.Region.EC2Endpoint, "ec2", "sqs", 1) + path
+ req, err := sqs.newRequest("GET", action, endpoint, params)
if err != nil {
return err
}
@@ -245,7 +247,6 @@ func (sqs *SQS) CreateQueue(name string, opt *CreateQueueOpt) (*Queue, os.Error)
func (q *Queue) DeleteQueue() os.Error {
params := http.Values{}
var resp ResponseMetadata
- println("path is", q.path)
if err := q.SQS.get("DeleteQueue", q.path, params, &resp); err != nil {
return err
}
@@ -312,7 +313,7 @@ type sendMessageResponse struct {
}
// SendMessage delivers a message to the specified queue.
-// It returns the sent message's ID as a string.
+// It returns the sent message's ID.
//
// See http://goo.gl/ThjJG for more details.
func (q *Queue) SendMessage(body string) (string, os.Error) {
View
1 sqsi_test.go
@@ -30,7 +30,6 @@ func (s *SI) TestBasicFunctionality(c *C) {
queues, err := s.sqs.ListQueues("")
c.Assert(err, IsNil)
- fmt.Println(queues)
_, err = q.SendMessage("hi")
c.Assert(err, IsNil)

0 comments on commit d6462d8

Please sign in to comment.