add .travis.yml

This commit is contained in:
rui.zheng 2017-08-12 14:15:28 +08:00
parent c89aea9b4c
commit 4d2e9ca518
2 changed files with 15 additions and 1 deletions

8
.travis.yml Normal file
View File

@ -0,0 +1,8 @@
language: go
sudo: false
go:
- 1.8
script:
- go test -v
- cd cmd/gost && go build

View File

@ -485,7 +485,13 @@ func parseIP(s string) (ips []string) {
}
file, err := os.Open(s)
if err != nil {
return strings.Split(s, ",")
ss := strings.Split(s, ",")
for _, s := range ss {
if ip := net.ParseIP(s); ip != nil {
ips = append(ips, s)
}
}
return
}
scanner := bufio.NewScanner(file)