← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~rvb/gomaasapi/fix-fallout into lp:gomaasapi

 

Raphaël Badin has proposed merging lp:~rvb/gomaasapi/fix-fallout into lp:gomaasapi with lp:~rvb/gomaasapi/upload-files2 as a prerequisite.

Commit message:
Change NewMAAS so that it returns a pointer.

Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~rvb/gomaasapi/fix-fallout/+merge/147957

In the vein of the others NewXX out there, NewMAAS should return a pointer to a MAASObject (now that MAASObject is a struct and not an interface.)
-- 
https://code.launchpad.net/~rvb/gomaasapi/fix-fallout/+merge/147957
Your team MAAS Maintainers is requested to review the proposed merge of lp:~rvb/gomaasapi/fix-fallout into lp:gomaasapi.
=== modified file 'maas.go'
--- maas.go	2013-02-11 12:15:14 +0000
+++ maas.go	2013-02-12 15:21:26 +0000
@@ -3,8 +3,9 @@
 
 package gomaasapi
 
-// NewMAAS returns an interface to the MAAS API as a MAASObject.
-func NewMAAS(client Client) MAASObject {
+// NewMAAS returns an interface to the MAAS API as a *MAASObject.
+func NewMAAS(client Client) *MAASObject {
 	attrs := map[string]interface{}{resourceURI: client.BaseURL.String()}
-	return newJSONMAASObject(attrs, client)
+	obj := newJSONMAASObject(attrs, client)
+	return &obj
 }

=== modified file 'testservice.go'
--- testservice.go	2013-02-12 07:17:17 +0000
+++ testservice.go	2013-02-12 15:21:26 +0000
@@ -27,7 +27,8 @@
 func NewTestMAAS(version string) *TestMAASObject {
 	server := NewTestServer(version)
 	authClient, _ := NewAnonymousClient(server.URL + fmt.Sprintf("/api/%s/", version))
-	return &TestMAASObject{NewMAAS(*authClient), server}
+	maas := NewMAAS(*authClient)
+	return &TestMAASObject{*maas, server}
 }
 
 // Close shuts down the test server.