← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~rvb/gomaasapi/add-makefile into lp:gomaasapi

 

Raphaël Badin has proposed merging lp:~rvb/gomaasapi/add-makefile into lp:gomaasapi.

Commit message:
Add Makefile (mostly copied from gwacl).

Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~rvb/gomaasapi/add-makefile/+merge/158606

adapted the makefile to gomaasapi's style (use Go's default formatting);  ran "make simplify"; fixed the template file so that it compiles.
-- 
https://code.launchpad.net/~rvb/gomaasapi/add-makefile/+merge/158606
Your team MAAS Maintainers is requested to review the proposed merge of lp:~rvb/gomaasapi/add-makefile into lp:gomaasapi.
=== added file 'Makefile'
--- Makefile	1970-01-01 00:00:00 +0000
+++ Makefile	2013-04-12 13:15:31 +0000
@@ -0,0 +1,26 @@
+# Build, and run tests.
+check: examples
+	go test ./...
+
+example_source := $(wildcard example/*.go)
+example_binaries := $(patsubst %.go,%,$(example_source))
+
+# Clean up binaries.
+clean:
+	$(RM) $(example_binaries)
+
+# Reformat the source files to match our layout standards.
+format:
+	gofmt -w .
+
+# Invoke gofmt's "simplify" option to streamline the source code.
+simplify:
+	gofmt -w -s .
+
+# Build the examples (we have no tests for them).
+examples: $(example_binaries)
+
+%: %.go
+	go build -o $@ $<
+
+.PHONY: check clean format examples

=== modified file 'templates/source_test.go'
--- templates/source_test.go	2013-01-28 09:15:36 +0000
+++ templates/source_test.go	2013-04-12 13:15:31 +0000
@@ -7,7 +7,11 @@
 	. "launchpad.net/gocheck"
 )
 
+type MyTestSuite struct{}
+
+var _ = Suite(&MyTestSuite{})
+
 // TODO: Replace with real test functions.  Give them real names.
-func (suite *GomaasapiTestSuite) TestXXX(c *C) {
+func (suite *MyTestSuite) TestXXX(c *C) {
 	c.Check(2+2, Equals, 4)
 }

=== modified file 'testservice.go'
--- testservice.go	2013-04-11 08:47:06 +0000
+++ testservice.go	2013-04-12 13:15:31 +0000
@@ -395,7 +395,7 @@
 // with the given prefix, sorted lexicographically.
 func listFilenames(server *TestServer, prefix string) []string {
 	var filenames = make([]string, 0)
-	for filename, _ := range server.files {
+	for filename := range server.files {
 		if strings.HasPrefix(filename, prefix) {
 			filenames = append(filenames, filename)
 		}


Follow ups