Skip to content

Commit

Permalink
Merge 3.1 cleaned branch
Browse files Browse the repository at this point in the history
  • Loading branch information
OJ committed Oct 7, 2020
2 parents 372f640 + 95de89d commit b3f43f1
Show file tree
Hide file tree
Showing 53 changed files with 6,746 additions and 689 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ jobs:

- name: Test
run: make test

- name: Lint
run: make lint
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ _testmain.go
gobuster
build
v3

.idea/
16 changes: 15 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
linters:
enable-all: true
disable:
- lll
- wsl
- gocyclo
- gocognit
- funlen
- lll
- dogsled
- gomnd
- nestif
- testpackage
- godot
- goerr113
- gofumpt

issues:
exclude-rules:
Expand All @@ -24,6 +34,10 @@ issues:
- gochecknoinits
- gochecknoglobals

- path: helper/useragents.go
linters:
- gochecknoglobals

- path: _test\.go
linters:
- scopelint
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

19 changes: 9 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
TARGET=./build
ARCHS=amd64 386
LDFLAGS="-s -w"
GCFLAGS="all=-trimpath=$(shell pwd)"
ASMFLAGS="all=-trimpath=$(shell pwd)"

current:
@go build -o ./gobuster; \
Expand All @@ -21,37 +19,38 @@ windows:
@for GOARCH in ${ARCHS}; do \
echo "Building for windows $${GOARCH} ..." ; \
mkdir -p ${TARGET}/gobuster-windows-$${GOARCH} ; \
GOOS=windows GOARCH=$${GOARCH} GO111MODULE=on CGO_ENABLED=0 go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/gobuster-windows-$${GOARCH}/gobuster.exe ; \
GOOS=windows GOARCH=$${GOARCH} GO111MODULE=on CGO_ENABLED=0 go build -ldflags=${LDFLAGS} -trimpath -o ${TARGET}/gobuster-windows-$${GOARCH}/gobuster.exe ; \
done; \
echo "Done."

linux:
@for GOARCH in ${ARCHS}; do \
echo "Building for linux $${GOARCH} ..." ; \
mkdir -p ${TARGET}/gobuster-linux-$${GOARCH} ; \
GOOS=linux GOARCH=$${GOARCH} GO111MODULE=on CGO_ENABLED=0 go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/gobuster-linux-$${GOARCH}/gobuster ; \
GOOS=linux GOARCH=$${GOARCH} GO111MODULE=on CGO_ENABLED=0 go build -ldflags=${LDFLAGS} -trimpath -o ${TARGET}/gobuster-linux-$${GOARCH}/gobuster ; \
done; \
echo "Done."

darwin:
@for GOARCH in ${ARCHS}; do \
echo "Building for darwin $${GOARCH} ..." ; \
mkdir -p ${TARGET}/gobuster-darwin-$${GOARCH} ; \
GOOS=darwin GOARCH=$${GOARCH} GO111MODULE=on CGO_ENABLED=0 go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/gobuster-darwin-$${GOARCH}/gobuster ; \
GOOS=darwin GOARCH=$${GOARCH} GO111MODULE=on CGO_ENABLED=0 go build -ldflags=${LDFLAGS} -trimpath -o ${TARGET}/gobuster-darwin-$${GOARCH}/gobuster ; \
done; \
echo "Done."

all: clean fmt update lint test darwin linux windows
all: clean fmt update test lint darwin linux windows

test:
@go test -v -race ./... ; \
echo "Done."

lint:
@go get -u github.com/golangci/golangci-lint@master ; \
golangci-lint run ./... ; \
go mod tidy ; \
echo Done
@if [ ! -f "$$(go env GOPATH)/bin/golangci-lint" ]; then \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.29.0; \
fi
"$$(go env GOPATH)/bin/golangci-lint" run ./...
go mod tidy

clean:
@rm -rf ${TARGET}/* ; \
Expand Down
Loading

0 comments on commit b3f43f1

Please sign in to comment.