Add support for injecting real ip (#296)

This commit is contained in:
Leonid Bugaev
2016-06-09 19:06:59 +06:00
parent a3aeca204c
commit 06d129d20d
9 changed files with 47 additions and 28 deletions
+7 -7
View File
@@ -104,19 +104,19 @@ func withoutIndex(s string) string {
type sortByFileIndex []string
func (s sortByFileIndex) Len() int {
return len(s)
return len(s)
}
func (s sortByFileIndex) Swap(i, j int) {
s[i], s[j] = s[j], s[i]
s[i], s[j] = s[j], s[i]
}
func (s sortByFileIndex) Less(i, j int) bool {
if withoutIndex(s[i]) == withoutIndex(s[j]) {
return getFileIndex(s[i]) < getFileIndex(s[j])
}
if withoutIndex(s[i]) == withoutIndex(s[j]) {
return getFileIndex(s[i]) < getFileIndex(s[j])
}
return s[i] < s[j]
return s[i] < s[j]
}
func (o *FileOutput) filename() string {
@@ -225,4 +225,4 @@ func (o *FileOutput) Close() {
}
o.file.Close()
}
}
}