Skip to content
Snippets Groups Projects
Commit e6b8a89c authored by Rohith's avatar Rohith
Browse files

- fixing the formatting of the code

- adding a check in the make test to find format errors
parent 6e6205b5
No related branches found
No related tags found
No related merge requests found
......@@ -74,9 +74,18 @@ lint:
fi
@golint .
gofmt:
@echo "--> Running gofmt check"
@gofmt -s -l *.go \
| grep -q \.go ; if [ $$? -eq 0 ]; then \
echo "You need to runn the make format, we have file unformatted"; \
gofmt -s -l *.go; \
exit 1; \
fi
format:
@echo "--> Running go fmt"
@go fmt $(PACKAGES)
@gofmt -s -w *.go
coverage:
@echo "--> Running go coverage"
......@@ -90,6 +99,7 @@ cover:
test: deps
@echo "--> Running the tests"
@godep go test -v
@$(MAKE) gofmt
@$(MAKE) vet
@$(MAKE) cover
......
package main
const buildID = "v0.0.6, git+sha: 8f1b3d8"
......@@ -54,17 +54,17 @@ func newFakeKeycloakProxy(t *testing.T) *KeycloakProxy {
"aud": fakeClientID,
},
Resources: []*Resource{
&Resource{
{
URL: fakeAdminRoleURL,
Methods: []string{"GET"},
RolesAllowed: []string{fakeAdminRole},
},
&Resource{
{
URL: fakeTestRoleURL,
Methods: []string{"GET"},
RolesAllowed: []string{fakeTestRole},
},
&Resource{
{
URL: fakeTestAdminRolesURL,
Methods: []string{"GET"},
RolesAllowed: []string{fakeAdminRole, fakeTestRole},
......
......@@ -90,7 +90,7 @@ func TestEncryptDataBlock(t *testing.T) {
func TestFindCookie(t *testing.T) {
cookies := []*http.Cookie{
&http.Cookie{
{
Name: "cookie_there",
},
}
......@@ -176,10 +176,10 @@ func TestValidateResources(t *testing.T) {
}{
{
Resources: []*Resource{
&Resource{
{
URL: "/test",
},
&Resource{
{
URL: "/test1",
Methods: []string{},
},
......@@ -188,10 +188,10 @@ func TestValidateResources(t *testing.T) {
},
{
Resources: []*Resource{
&Resource{
{
URL: "/test",
},
&Resource{},
{},
},
},
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment