Skip to content

Commit

Permalink
Merge pull request #2 from cagiti/convert_to_module_based
Browse files Browse the repository at this point in the history
fix: attempt to convert to modules
  • Loading branch information
cagiti authored Apr 9, 2020
2 parents 1dcf20c + d351f8f commit 9c60d86
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 4 deletions.
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

SHELL := /bin/bash
GO := GO111MODULE=on GO15VENDOREXPERIMENT=1 go
GO_NOMOD := GO111MODULE=off go
GOTEST := $(GO) test
PACKAGE_DIRS := $(shell $(GO) list ./... | grep -v /vendor/)
GO_DEPENDENCIES := $(shell find . -type f -name '*.go')

build:
$(GO) build

build: test

test:
$(GOTEST) --tags=unit -failfast -short ./...

get-fmt-deps: ## Install test dependencies
$(GO_NOMOD) get golang.org/x/tools/cmd/goimports

fmt: importfmt ## Format the code
@FORMATTED=`$(GO) fmt $(PACKAGE_DIRS)`
@([[ ! -z "$(FORMATTED)" ]] && printf "Fixed unformatted files:\n$(FORMATTED)") || true

importfmt: get-fmt-deps
@echo "Formatting the imports..."
goimports -w $(GO_DEPENDENCIES)

modtidy:
$(GO) mod tidy
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/jenkins-x/logrus-stackdriver-formatter

go 1.13
4 changes: 2 additions & 2 deletions example_test.go → pkg/stackdriver/example_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package stackdriver_test
package stackdriver

import (
"os"
"strconv"

stackdriver "github.com/TV4/logrus-stackdriver-formatter"
stackdriver "github.com/jenkins-x/logrus-stackdriver-formatter"
"github.com/sirupsen/logrus"
)

Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions formatter_test.go → pkg/stackdriver/formatter_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build unit

package stackdriver

import (
Expand Down
2 changes: 1 addition & 1 deletion test/logger.go → pkg/stackdriver/logger.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package test
package stackdriver

import "github.com/sirupsen/logrus"

Expand Down
4 changes: 3 additions & 1 deletion stackskip_test.go → pkg/stackdriver/stackskip_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build unit

package stackdriver

import (
Expand All @@ -6,7 +8,7 @@ import (
"reflect"
"testing"

"github.com/TV4/logrus-stackdriver-formatter/test"
"github.com/jenkins-x/logrus-stackdriver-formatter"
"github.com/kr/pretty"
"github.com/sirupsen/logrus"
)
Expand Down

0 comments on commit 9c60d86

Please sign in to comment.