-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Eray Ates <[email protected]>
- Loading branch information
Showing
11 changed files
with
38 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,13 @@ | ||
# Refer to golangci-lint's example config file for more options and information: | ||
# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml | ||
|
||
run: | ||
timeout: 5m | ||
modules-download-mode: readonly | ||
|
||
linters: | ||
enable: | ||
- errcheck | ||
- goimports | ||
- golint | ||
- govet | ||
- staticcheck | ||
|
||
issues: | ||
exclude-use-default: false | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
enable-all: true | ||
disable: | ||
- depguard | ||
- prealloc | ||
- lll | ||
- nlreturn | ||
- funlen | ||
- mnd | ||
- gochecknoinits | ||
- testpackage | ||
- gomnd # Deprecated | ||
fast: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ import ( | |
) | ||
|
||
var ( | ||
// Populated by goreleaser during build | ||
version = "v0.0.0" | ||
commit = "-" | ||
date = "-" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
package server | ||
package server_test | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
|
||
"github.com/worldline-go/forward/internal/server" | ||
) | ||
|
||
func TestParse(t *testing.T) { | ||
type args struct { | ||
hosts []string | ||
sockets []string | ||
} | ||
|
||
tests := []struct { | ||
name string | ||
args args | ||
want []Holder | ||
want []server.Holder | ||
}{ | ||
{ | ||
name: "default", | ||
args: args{ | ||
hosts: []string{"0.0.0.0:8080"}, | ||
sockets: []string{"/docker/:*,-POST,-PUT,-DELETE"}, | ||
}, | ||
want: []Holder{ | ||
want: []server.Holder{ | ||
{ | ||
Name: "default", | ||
Host: "0.0.0.0:8080", | ||
|
@@ -35,7 +38,7 @@ func TestParse(t *testing.T) { | |
hosts: []string{"[email protected]:8080", "[email protected]:8081"}, | ||
sockets: []string{"/docker/:*,-POST,-PUT,-DELETE", "test@/docker/:*,-POST,-PUT,-DELETE"}, | ||
}, | ||
want: []Holder{ | ||
want: []server.Holder{ | ||
{ | ||
Name: "default", | ||
Host: "0.0.0.0:8080", | ||
|
@@ -49,9 +52,10 @@ func TestParse(t *testing.T) { | |
}, | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := Parse(tt.args.hosts, tt.args.sockets); !reflect.DeepEqual(got, tt.want) { | ||
if got := server.Parse(tt.args.hosts, tt.args.sockets); !reflect.DeepEqual(got, tt.want) { | ||
t.Errorf("Parse() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
|