From c3541af2845e1c2d4d9dc1df945e3b30ad9e5264 Mon Sep 17 00:00:00 2001 From: Markus Wyrsch Date: Fri, 19 May 2017 15:43:49 +0200 Subject: [PATCH] update vendor --- vendor/github.com/{fastly => Shinzu}/go-mtr/LICENSE | 0 .../github.com/{fastly => Shinzu}/go-mtr/README.md | 0 vendor/github.com/{fastly => Shinzu}/go-mtr/mtr.go | 9 ++++++++- vendor/vendor.json | 12 ++++++------ 4 files changed, 14 insertions(+), 7 deletions(-) rename vendor/github.com/{fastly => Shinzu}/go-mtr/LICENSE (100%) rename vendor/github.com/{fastly => Shinzu}/go-mtr/README.md (100%) rename vendor/github.com/{fastly => Shinzu}/go-mtr/mtr.go (94%) diff --git a/vendor/github.com/fastly/go-mtr/LICENSE b/vendor/github.com/Shinzu/go-mtr/LICENSE similarity index 100% rename from vendor/github.com/fastly/go-mtr/LICENSE rename to vendor/github.com/Shinzu/go-mtr/LICENSE diff --git a/vendor/github.com/fastly/go-mtr/README.md b/vendor/github.com/Shinzu/go-mtr/README.md similarity index 100% rename from vendor/github.com/fastly/go-mtr/README.md rename to vendor/github.com/Shinzu/go-mtr/README.md diff --git a/vendor/github.com/fastly/go-mtr/mtr.go b/vendor/github.com/Shinzu/go-mtr/mtr.go similarity index 94% rename from vendor/github.com/fastly/go-mtr/mtr.go rename to vendor/github.com/Shinzu/go-mtr/mtr.go index f477f6b..6c985ea 100644 --- a/vendor/github.com/fastly/go-mtr/mtr.go +++ b/vendor/github.com/Shinzu/go-mtr/mtr.go @@ -9,6 +9,7 @@ import ( "net" "os/exec" "strconv" + "strings" ) type Host struct { @@ -99,7 +100,13 @@ func (m *MTR) processOutput() { case 'd': m.Hosts[hostnum].Name = string(line[finalFieldIdx:]) case 'p': - m.Hosts[hostnum].PacketMicrosecs = append(m.Hosts[hostnum].PacketMicrosecs, parseByteNum(line[finalFieldIdx:])) + s := strings.Fields(string(line))[2] + n, err := strconv.Atoi(s) + if err != nil { + fmt.Printf("ERR: Can not convert %s to int\n", s) + } else { + m.Hosts[hostnum].PacketMicrosecs = append(m.Hosts[hostnum].PacketMicrosecs, n) + } } } diff --git a/vendor/vendor.json b/vendor/vendor.json index 01e8093..aeada3b 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -2,6 +2,12 @@ "comment": "", "ignore": "test", "package": [ + { + "checksumSHA1": "eWtZkjKnHpi39X/pOytiQdFpVZQ=", + "path": "github.com/Shinzu/go-mtr", + "revision": "3a40e82ebda6f5afdb0f505928bb3dc924fd0779", + "revisionTime": "2017-05-19T13:34:45Z" + }, { "checksumSHA1": "SdEcxwaW92m0H3pao3BPj2ZpvaU=", "path": "github.com/Sirupsen/logrus", @@ -14,12 +20,6 @@ "revision": "b965b613227fddccbfffe13eae360ed3fa822f8d", "revisionTime": "2015-02-23T13:51:52Z" }, - { - "checksumSHA1": "A0vIHHbbz63EvbRZeBK+Kwd9a2k=", - "path": "github.com/fastly/go-mtr", - "revision": "f38deed4611e5b0f16e2d7defe86a53fa4c5dba5", - "revisionTime": "2014-03-28T22:46:22Z" - }, { "checksumSHA1": "p+kMSQKvtjS2WOuE96yhF2qeMpY=", "path": "github.com/golang/protobuf/proto",