1
1
Fork 0
mirror of https://github.com/OJ/gobuster.git synced 2024-05-12 12:36:02 +02:00

fix tests and linter

This commit is contained in:
Christian Mehlmauer 2020-08-01 13:10:34 +02:00
parent 69b02f0287
commit e025d5ac6d
No known key found for this signature in database
GPG Key ID: DCF54A05D6E62591
4 changed files with 7 additions and 6 deletions

View File

@ -12,6 +12,7 @@ linters:
- testpackage
- godot
- goerr113
- gofumpt
issues:
exclude-rules:

View File

@ -53,7 +53,7 @@ func SliceContains(s []int, e int) bool {
// JoinIntSlice joins an int slice by ,
func JoinIntSlice(s []int) string {
var valuesText []string
valuesText := make([]string, len(s))
for _, number := range s {
text := strconv.Itoa(number)
valuesText = append(valuesText, text)

View File

@ -60,7 +60,7 @@ func (set *StringSet) Length() int {
// Stringify the set
func (set *StringSet) Stringify() string {
var values []string
values := make([]string, len(set.Set))
for s := range set.Set {
values = append(values, s)
}
@ -87,7 +87,7 @@ func (set *IntSet) Contains(i int) bool {
// Stringify the set
func (set *IntSet) Stringify() string {
var values []int
values := make([]int, len(set.Set))
for s := range set.Set {
values = append(values, s)
}

View File

@ -46,7 +46,7 @@ func TestRequest(t *testing.T) {
if err != nil {
t.Fatalf("Got Error: %v", err)
}
status, length, body, err := c.Request(h.URL, RequestOptions{ReturnBody: true})
status, length, _, body, err := c.Request(h.URL, RequestOptions{ReturnBody: true})
if err != nil {
t.Fatalf("Got Error: %v", err)
}
@ -70,7 +70,7 @@ func BenchmarkRequestWithoutBody(b *testing.B) {
b.Fatalf("Got Error: %v", err)
}
for x := 0; x < b.N; x++ {
_, _, _, err := c.Request(h.URL, RequestOptions{ReturnBody: false})
_, _, _, _, err := c.Request(h.URL, RequestOptions{ReturnBody: false})
if err != nil {
b.Fatalf("Got Error: %v", err)
}
@ -86,7 +86,7 @@ func BenchmarkRequestWitBody(b *testing.B) {
b.Fatalf("Got Error: %v", err)
}
for x := 0; x < b.N; x++ {
_, _, _, err := c.Request(h.URL, RequestOptions{ReturnBody: true})
_, _, _, _, err := c.Request(h.URL, RequestOptions{ReturnBody: true})
if err != nil {
b.Fatalf("Got Error: %v", err)
}