Skip to content

Commit

Permalink
modern goreturns
Browse files Browse the repository at this point in the history
  • Loading branch information
Sayan Samanta committed Mar 31, 2020
1 parent d2a4f7d commit f259947
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 12 deletions.
11 changes: 6 additions & 5 deletions handlers/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ package handlers
import (
"errors"
"fmt"
"github.com/Clever/leakybucket"
"github.com/Clever/sphinx/common"
"github.com/Clever/sphinx/limit"
"github.com/Clever/sphinx/ratelimiter"
"github.com/stretchr/testify/mock"
"net/http"
"net/http/httptest"
"net/url"
"strings"
"testing"
"time"

"github.com/Clever/leakybucket"
"github.com/Clever/sphinx/common"
"github.com/Clever/sphinx/limit"
"github.com/Clever/sphinx/ratelimiter"
"github.com/stretchr/testify/mock"
)

func constructMockRequestWithHeaders(headers map[string][]string) *http.Request {
Expand Down
3 changes: 2 additions & 1 deletion limitkeys/headerlimitkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package limitkeys

import (
"fmt"
"github.com/Clever/sphinx/common"
"net/http"
"sort"
"strings"

"github.com/Clever/sphinx/common"
)

type headerLimitKey struct {
Expand Down
3 changes: 2 additions & 1 deletion limitkeys/headerlimitkey_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package limitkeys

import (
"github.com/Clever/sphinx/common"
"testing"

"github.com/Clever/sphinx/common"
)

func getRequest(headers map[string][]string) common.Request {
Expand Down
1 change: 1 addition & 0 deletions limitkeys/limitkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package limitkeys

import (
"fmt"

"github.com/Clever/sphinx/common"
)

Expand Down
3 changes: 2 additions & 1 deletion matchers/headermatcher.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package matchers

import (
"github.com/Clever/sphinx/common"
"net/http"
"regexp"

"github.com/Clever/sphinx/common"
)

// type to deserialize configuration
Expand Down
1 change: 1 addition & 0 deletions matchers/matchers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package matchers

import (
"fmt"

"github.com/Clever/sphinx/common"
)

Expand Down
3 changes: 2 additions & 1 deletion matchers/pathmatcher.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package matchers

import (
"github.com/Clever/sphinx/common"
"regexp"

"github.com/Clever/sphinx/common"
)

type pathMatcherConfig struct {
Expand Down
7 changes: 4 additions & 3 deletions ratelimiter/ratelimiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package ratelimiter

import (
"fmt"
"net/http"
"testing"
"time"

"github.com/Clever/leakybucket"
"github.com/Clever/sphinx/common"
"github.com/Clever/sphinx/config"
"github.com/Clever/sphinx/limit"
"net/http"
"testing"
"time"
)

func returnLastAddStatus(rateLimiter RateLimiter, request common.Request, numAdds int) ([]Status, error) {
Expand Down

0 comments on commit f259947

Please sign in to comment.