Update: added Makefile, editorconfig and dependency management (not needed though)

remotes/origin/HEAD v1.0.0
Darshil Chanpura 2018-07-06 22:24:50 +05:30
parent 0654cc1b7d
commit 6922ba74e1
4 changed files with 83 additions and 0 deletions

10
.editorconfig Normal file
View File

@ -0,0 +1,10 @@
root = true
[*]
indent_style = tab
indent_size = 4
# insert_final_newline = true
[{package.json,.travis.yml}]
indent_style = space
indent_size = 4

9
Gopkg.lock generated Normal file
View File

@ -0,0 +1,9 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "ab4fef131ee828e96ba67d31a7d690bd5f2f42040c6766b1b12fe856f87e0ff7"
solver-name = "gps-cdcl"
solver-version = 1

30
Gopkg.toml Normal file
View File

@ -0,0 +1,30 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
[prune]
go-tests = true
unused-packages = true

34
Makefile Normal file
View File

@ -0,0 +1,34 @@
PKGS := $(shell go list ./... | grep -v /vendor)
GO_FILES := $(shell find . -iname '*.go' -type f | grep -v /vendor/) # All the .go files, excluding vendor/
BINARY := dumb-http
PLATFORMS := windows linux darwin
VERSION ?= latest
os = $(word 1, $@)
bootstrap:
go get github.com/golang/dep/cmd/dep # Dependency management tool
go get github.com/golang/lint/golint # Linter
go get honnef.co/go/tools/cmd/megacheck # Badass static analyzer/linter
go get github.com/fzipp/gocyclo # Cyclomatic complexity check
dep ensure
test:
go test -v -race $(PKGS) # Normal Test
go vet ./... # go vet is the official Go static analyzer
megacheck ./... # "go vet on steroids" + linter
gocyclo -over 19 $(GO_FILES) # forbid code with huge functions
golint -set_exit_status $(PKGS) # one last linter
$(PLATFORMS):
@mkdir -p release
GOOS=$(os) GOARCH=amd64 go build -o release/$(BINARY)
tar -czf release/$(BINARY)-$(VERSION)-$(os)-amd64.tar.gz README.md -C release/ $(BINARY)
rm release/$(BINARY)
.PHONY: release
release: windows linux darwin
clean:
rm -rf release/*