mirror of
https://github.com/OJ/gobuster.git
synced 2024-06-04 07:16:03 +02:00
fix #482
This commit is contained in:
parent
24d951924a
commit
33c222ce5e
|
@ -1,28 +1,30 @@
|
|||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||
// README at: https://github.com/devcontainers/templates/tree/main/src/go
|
||||
{
|
||||
"name": "Go",
|
||||
"image": "mcr.microsoft.com/devcontainers/go",
|
||||
"features": {
|
||||
"ghcr.io/guiyomh/features/golangci-lint:0": {}
|
||||
},
|
||||
"postCreateCommand": "go mod download",
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
// "features": {},
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "go version",
|
||||
// Configure tool-specific properties.
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"golang.go",
|
||||
"shardulm94.trailing-spaces",
|
||||
"IBM.output-colorizer",
|
||||
"ms-vscode.makefile-tools",
|
||||
"ms-azuretools.vscode-docker"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
"name": "Go",
|
||||
"image": "mcr.microsoft.com/devcontainers/go",
|
||||
"features": {
|
||||
"ghcr.io/guiyomh/features/golangci-lint:0": {},
|
||||
"ghcr.io/devcontainers-contrib/features/go-task:1": {}
|
||||
},
|
||||
"postCreateCommand": "go mod download",
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
// "features": {},
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "go version",
|
||||
// Configure tool-specific properties.
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"golang.go",
|
||||
"shardulm94.trailing-spaces",
|
||||
"IBM.output-colorizer",
|
||||
"task.vscode-task",
|
||||
"github.vscode-github-actions",
|
||||
"redhat.vscode-yaml"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,6 +13,9 @@ jobs:
|
|||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
|
@ -29,10 +32,10 @@ jobs:
|
|||
go get -v -t -d ./...
|
||||
|
||||
- name: Build linux
|
||||
run: make linux
|
||||
run: task linux
|
||||
|
||||
- name: Build windows
|
||||
run: make windows
|
||||
run: task windows
|
||||
|
||||
- name: Test
|
||||
run: make test
|
||||
run: task test
|
||||
|
|
41
Makefile
41
Makefile
|
@ -1,41 +0,0 @@
|
|||
.DEFAULT_GOAL := linux
|
||||
|
||||
.PHONY: linux
|
||||
linux:
|
||||
go build -o ./gobuster
|
||||
|
||||
.PHONY: windows
|
||||
windows:
|
||||
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o ./gobuster.exe
|
||||
|
||||
.PHONY: fmt
|
||||
fmt:
|
||||
go fmt ./...
|
||||
|
||||
.PHONY: update
|
||||
update:
|
||||
go get -u
|
||||
go mod tidy -v
|
||||
|
||||
.PHONY: all
|
||||
all: fmt update linux windows test lint
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
go test -v -race ./...
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
"$$(go env GOPATH)/bin/golangci-lint" run ./...
|
||||
go mod tidy
|
||||
|
||||
.PHONY: lint-update
|
||||
lint-update:
|
||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin
|
||||
$$(go env GOPATH)/bin/golangci-lint --version
|
||||
|
||||
.PHONY: tag
|
||||
tag:
|
||||
@[ "${TAG}" ] && echo "Tagging a new version ${TAG}" || ( echo "TAG is not set"; exit 1 )
|
||||
git tag -a "${TAG}" -m "${TAG}"
|
||||
git push origin "${TAG}"
|
|
@ -0,0 +1,62 @@
|
|||
version: "3"
|
||||
|
||||
vars:
|
||||
PROGRAM: gobuster
|
||||
|
||||
tasks:
|
||||
update:
|
||||
cmds:
|
||||
- go get -u
|
||||
- go mod tidy -v
|
||||
|
||||
build:
|
||||
aliases: [default, linux]
|
||||
cmds:
|
||||
- go fmt ./...
|
||||
- go vet ./...
|
||||
- go build -o {{.PROGRAM}}
|
||||
env:
|
||||
CGO_ENABLED: 0
|
||||
|
||||
linux:
|
||||
cmds:
|
||||
- task: build
|
||||
env:
|
||||
CGO_ENABLED: 0
|
||||
GOOS: linux
|
||||
GOARCH: amd64
|
||||
|
||||
windows:
|
||||
cmds:
|
||||
- task: build
|
||||
env:
|
||||
CGO_ENABLED: 0
|
||||
GOOS: windows
|
||||
GOARCH: amd64
|
||||
|
||||
test:
|
||||
env:
|
||||
CGO_ENABLED: 1 # required by -race
|
||||
cmds:
|
||||
- go test -race -cover ./...
|
||||
|
||||
lint:
|
||||
cmds:
|
||||
- golangci-lint run ./... --timeout=30m
|
||||
- go mod tidy
|
||||
|
||||
lint-update:
|
||||
cmds:
|
||||
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b {{ .GOPATH }}/bin
|
||||
- golangci-lint --version
|
||||
vars:
|
||||
GOPATH:
|
||||
sh: go env GOPATH
|
||||
|
||||
tag:
|
||||
cmds:
|
||||
- git tag -a "${TAG}" -m "${TAG}"
|
||||
- git push origin "${TAG}"
|
||||
preconditions:
|
||||
- sh: '[[ -n "${TAG}" ]]'
|
||||
msg: "Please set the TAG environment variable"
|
|
@ -36,7 +36,12 @@ func resultWorker(g *libgobuster.Gobuster, filename string, wg *sync.WaitGroup)
|
|||
}
|
||||
if s != "" {
|
||||
s = strings.TrimSpace(s)
|
||||
_, _ = fmt.Printf("%s%s\n", TERMINAL_CLEAR_LINE, s)
|
||||
if g.Opts.NoProgress {
|
||||
_, _ = fmt.Printf("%s\n", s)
|
||||
} else {
|
||||
// only print the clear line when progress output is enabled
|
||||
_, _ = fmt.Printf("%s%s\n", TERMINAL_CLEAR_LINE, s)
|
||||
}
|
||||
if f != nil {
|
||||
err = writeToFile(f, s)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue