diff --git a/Makefile b/Makefile index 5b0bf18c..1c38d59d 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,34 @@ +MINIOPATH=$(GOPATH)/src/github.com/minio-io/mc + all: getdeps install checkdeps: - @./checkdeps.sh + @echo "Checking deps.." + @(env bash $(PWD)/checkdeps.sh) -createsymlink: - @mkdir -p $(GOPATH)/src/github.com/minio-io/; - @if test ! -e $(GOPATH)/src/github.com/minio-io/mc; then echo "Creating symlink to $(GOPATH)/src/github.com/minio-io/mc" && ln -s $(PWD) $(GOPATH)/src/github.com/minio-io/mc; fi +checkgopath: + @echo "Checking if project is at ${MINIOPATH}" + @if [ ! -d ${MINIOPATH} ]; then echo "Project not found in $GOPATH, please follow instructions provided at https://github.com/Minio-io/minio/blob/master/CONTRIBUTING.md#setup-your-minio-github-repository" && exit 1; fi -getdeps: checkdeps +getdeps: checkdeps checkgopath @go get github.com/tools/godep && echo "Installed godep" + @go get github.com/golang/lint/golint && echo "Installed golint" + @go get golang.org/x/tools/cmd/vet && echo "Installed vet" -build-all: getdeps createsymlink +verifiers: getdeps vet fmt lint + +vet: + @echo "Running $@" + @go vet ./... +fmt: + @echo "Running $@" + @test -z "$$(gofmt -s -l . | grep -v Godeps/_workspace/src/ | tee /dev/stderr)" || \ + echo "+ please format Go code with 'gofmt -s'" +lint: + @echo "Running $@" + @test -z "$$(golint ./... | grep -v Godeps/_workspace/src/ | tee /dev/stderr)" + +build-all: getdeps verifiers @echo "Building Libraries" @godep go generate ./... @godep go build ./... diff --git a/pkg/s3/bucket.go b/pkg/s3/bucket.go index 4ce4a789..ec92ef14 100644 --- a/pkg/s3/bucket.go +++ b/pkg/s3/bucket.go @@ -35,6 +35,7 @@ limitations under the License. * See the License for the specific language governing permissions and * limitations under the License. */ + package s3 import ( diff --git a/pkg/s3/client_test.go b/pkg/s3/client_test.go index 0bdb7a8d..23a378ca 100644 --- a/pkg/s3/client_test.go +++ b/pkg/s3/client_test.go @@ -57,8 +57,8 @@ func TestParseBuckets(t *testing.T) { t.Errorf("num parsed buckets = %d; want %d", g, w) } - t1, err := time.Parse(xmlTimeFormat, "2006-06-21T07:04:31.000Z") - t2, err := time.Parse(xmlTimeFormat, "2006-06-21T07:04:32.000Z") + t1, err := time.Parse(iso8601Format, "2006-06-21T07:04:31.000Z") + t2, err := time.Parse(iso8601Format, "2006-06-21T07:04:32.000Z") want := []*Bucket{ {Name: "bucketOne", CreationDate: xmlTime{t1}}, {Name: "bucketTwo", CreationDate: xmlTime{t2}}, diff --git a/pkg/s3/error.go b/pkg/s3/error.go index b4635722..24c4fd6b 100644 --- a/pkg/s3/error.go +++ b/pkg/s3/error.go @@ -35,6 +35,7 @@ limitations under the License. * See the License for the specific language governing permissions and * limitations under the License. */ + package s3 import ( diff --git a/pkg/s3/object.go b/pkg/s3/object.go index 090e1075..aaf63c1d 100644 --- a/pkg/s3/object.go +++ b/pkg/s3/object.go @@ -35,6 +35,7 @@ limitations under the License. * See the License for the specific language governing permissions and * limitations under the License. */ + package s3 import ( diff --git a/pkg/s3/xmltime.go b/pkg/s3/xmltime.go index 2f15128f..623deed2 100644 --- a/pkg/s3/xmltime.go +++ b/pkg/s3/xmltime.go @@ -35,6 +35,7 @@ limitations under the License. * See the License for the specific language governing permissions and * limitations under the License. */ + package s3 import (