Skip to content

Commit

Permalink
Replace Connection's Do() with Pipeline() (#13409)
Browse files Browse the repository at this point in the history
LROs and pagers require access to the Connection's pipeline.
  • Loading branch information
jhendrixMSFT authored Nov 9, 2020
1 parent 2fb1dbe commit 1d08536
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions sdk/armcore/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion sdk/armcore/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 1d08536

Please sign in to comment.