Skip to content

Commit

Permalink
Add object package to manage file/folder
Browse files Browse the repository at this point in the history
  • Loading branch information
lylex committed Dec 12, 2018
1 parent 9199ae0 commit e14f801
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### go ###
coverage.out
verder

### Binary ###
drm

Expand Down
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
#!make

SOURCE_FILES?=./...
GO_BIN ?= go
GOFMT ?= gofmt
GOIMPORTS ?= goimports
SOURCE_FILES ?= ./...

export GO111MODULE := on

.PHONY: test
test:
go test -v -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.out $(SOURCE_FILES) -run -timeout=5m
$(GO_BIN) test -v -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.out $(SOURCE_FILES) -run -timeout=5m

.PHONY: cover
cover: test
go tool cover -html=coverage.out
$(GO_BIN) tool cover -html=coverage.out

.PHONY: fmt
fmt:
find . -name '*.go' -not -wholename './vendor/*' | \
while read -r file; \
do gofmt -w -s "$$file"; \
goimports -w "$$file"; \
while read -r file; do \
$(GOFMT) -w -s "$$file"; \
$(GOIMPORTS) -w "$$file"; \
done

.PHONY: build
build:
go build -o drm .
$(GO_BIN) build -o drm .

.PHONY: dist
dist:
Expand Down
11 changes: 11 additions & 0 deletions pkg/object/object.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package object

import (
"time"
)

type Object struct {
FileName string
Dir string
DeletedAt time.Time
}

0 comments on commit e14f801

Please sign in to comment.