From 4b5cb476885e68d8d7424dad052463d532e0b6a0 Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Mon, 9 Nov 2020 08:44:50 -0800 Subject: [PATCH] Replace Connection's Do() with Pipeline() LROs and pagers require access to the Connection's pipeline. --- sdk/armcore/connection.go | 10 +++++----- sdk/armcore/connection_test.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/armcore/connection.go b/sdk/armcore/connection.go index fd1502390cf7..bd91a0c00da1 100644 --- a/sdk/armcore/connection.go +++ b/sdk/armcore/connection.go @@ -69,12 +69,12 @@ func NewConnectionWithPipeline(endpoint string, p azcore.Pipeline) *Connection { return &Connection{u: endpoint, p: p} } -// Do invokes the Do() method on the connection's pipeline. -func (c *Connection) Do(req *azcore.Request) (*azcore.Response, error) { - return c.p.Do(req) -} - // Endpoint returns the connection's ARM endpoint. func (c *Connection) Endpoint() string { return c.u } + +// Pipeline returns the connection's pipeline. +func (c *Connection) Pipeline() azcore.Pipeline { + return c.p +} diff --git a/sdk/armcore/connection_test.go b/sdk/armcore/connection_test.go index 3191cceccf0a..c5da0b37da42 100644 --- a/sdk/armcore/connection_test.go +++ b/sdk/armcore/connection_test.go @@ -56,7 +56,7 @@ func TestNewConnectionWithPipeline(t *testing.T) { if err != nil { t.Fatalf("Unexpected error: %v", err) } - resp, err := con.Do(req) + resp, err := con.Pipeline().Do(req) if err != nil { t.Fatalf("Unexpected error: %v", err) }