mirror of
https://github.com/OJ/gobuster.git
synced 2024-05-26 16:26:04 +02:00
fix tests and linter
This commit is contained in:
parent
69b02f0287
commit
e025d5ac6d
|
@ -12,6 +12,7 @@ linters:
|
|||
- testpackage
|
||||
- godot
|
||||
- goerr113
|
||||
- gofumpt
|
||||
|
||||
issues:
|
||||
exclude-rules:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue