浏览代码

Update vendored dependencies

DarthSim 6 年之前
父节点
当前提交
384a2909c3
共有 100 个文件被更改,包括 2598 次插入939 次删除
  1. 48 42
      Gopkg.lock
  2. 1 1
      vendor/github.com/aws/aws-sdk-go/aws/client/client.go
  3. 1 1
      vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go
  4. 35 0
      vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go
  5. 56 0
      vendor/github.com/aws/aws-sdk-go/aws/csm/metric.go
  6. 26 0
      vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go
  7. 30 10
      vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go
  8. 4 0
      vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go
  9. 1 1
      vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go
  10. 206 8
      vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
  11. 1 1
      vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go
  12. 2 2
      vendor/github.com/aws/aws-sdk-go/aws/request/request.go
  13. 1 1
      vendor/github.com/aws/aws-sdk-go/aws/session/doc.go
  14. 1 1
      vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go
  15. 2 2
      vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go
  16. 1 1
      vendor/github.com/aws/aws-sdk-go/aws/version.go
  17. 1 1
      vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go
  18. 1 1
      vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go
  19. 1 1
      vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go
  20. 33 65
      vendor/github.com/aws/aws-sdk-go/service/s3/api.go
  21. 27 12
      vendor/github.com/go-ole/go-ole/com.go
  22. 1 1
      vendor/github.com/go-ole/go-ole/com_func.go
  23. 3 0
      vendor/github.com/go-ole/go-ole/idispatch_windows.go
  24. 6 6
      vendor/github.com/go-ole/go-ole/safearray_func.go
  25. 4 4
      vendor/github.com/go-ole/go-ole/safearray_windows.go
  26. 19 19
      vendor/github.com/go-ole/go-ole/safearrayconversion.go
  27. 2 2
      vendor/github.com/go-ole/go-ole/variant.go
  28. 22 0
      vendor/github.com/go-ole/go-ole/variant_date_386.go
  29. 20 0
      vendor/github.com/go-ole/go-ole/variant_date_amd64.go
  30. 12 0
      vendor/github.com/go-ole/go-ole/variant_ppc64le.go
  31. 1 1
      vendor/github.com/gofrs/uuid/codec.go
  32. 10 96
      vendor/github.com/googleapis/gax-go/call_option.go
  33. 2 1
      vendor/github.com/googleapis/gax-go/gax.go
  34. 31 15
      vendor/github.com/googleapis/gax-go/header.go
  35. 6 43
      vendor/github.com/googleapis/gax-go/invoke.go
  36. 161 0
      vendor/github.com/googleapis/gax-go/v2/call_option.go
  37. 39 0
      vendor/github.com/googleapis/gax-go/v2/gax.go
  38. 53 0
      vendor/github.com/googleapis/gax-go/v2/header.go
  39. 99 0
      vendor/github.com/googleapis/gax-go/v2/invoke.go
  40. 1 1
      vendor/github.com/mat/besticon/LICENSE
  41. 24 6
      vendor/github.com/newrelic/go-agent/context.go
  42. 4 0
      vendor/github.com/newrelic/go-agent/context_stub.go
  43. 20 5
      vendor/github.com/newrelic/go-agent/instrumentation.go
  44. 0 2
      vendor/github.com/newrelic/go-agent/internal/adaptive_sampler.go
  45. 93 124
      vendor/github.com/newrelic/go-agent/internal/attributes.go
  46. 124 160
      vendor/github.com/newrelic/go-agent/internal/collector.go
  47. 4 1
      vendor/github.com/newrelic/go-agent/internal/connect_reply.go
  48. 17 0
      vendor/github.com/newrelic/go-agent/internal/context.go
  49. 3 10
      vendor/github.com/newrelic/go-agent/internal/cross_process_http.go
  50. 0 8
      vendor/github.com/newrelic/go-agent/internal/distributed_tracing.go
  51. 17 2
      vendor/github.com/newrelic/go-agent/internal/expect.go
  52. 6 3
      vendor/github.com/newrelic/go-agent/internal/limits.go
  53. 7 3
      vendor/github.com/newrelic/go-agent/internal/logger/logger.go
  54. 10 0
      vendor/github.com/newrelic/go-agent/internal/security_policies.go
  55. 1 1
      vendor/github.com/newrelic/go-agent/internal/span_events.go
  56. 1 1
      vendor/github.com/newrelic/go-agent/internal/tracing.go
  57. 2 4
      vendor/github.com/newrelic/go-agent/internal/txn_cross_process.go
  58. 64 83
      vendor/github.com/newrelic/go-agent/internal_app.go
  59. 68 19
      vendor/github.com/newrelic/go-agent/internal_txn.go
  60. 21 3
      vendor/github.com/newrelic/go-agent/segments.go
  61. 33 0
      vendor/github.com/newrelic/go-agent/transaction.go
  62. 1 1
      vendor/github.com/newrelic/go-agent/version.go
  63. 9 3
      vendor/github.com/prometheus/common/expfmt/text_create.go
  64. 3 3
      vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go
  65. 0 1
      vendor/github.com/prometheus/common/model/metric.go
  66. 9 9
      vendor/github.com/prometheus/procfs/xfs/parse.go
  67. 2 1
      vendor/github.com/shirou/gopsutil/mem/mem.go
  68. 5 0
      vendor/github.com/shirou/gopsutil/mem/mem_linux.go
  69. 17 18
      vendor/github.com/stretchr/testify/LICENSE
  70. 27 5
      vendor/github.com/stretchr/testify/assert/assertions.go
  71. 1 1
      vendor/github.com/stretchr/testify/require/requirements.go
  72. 24 0
      vendor/github.com/stretchr/testify/suite/suite.go
  73. 9 1
      vendor/golang.org/x/net/http2/hpack/hpack.go
  74. 10 4
      vendor/golang.org/x/net/trace/trace.go
  75. 29 0
      vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s
  76. 1 1
      vendor/golang.org/x/sys/unix/fcntl.go
  77. 18 0
      vendor/golang.org/x/sys/unix/fcntl_darwin.go
  78. 61 0
      vendor/golang.org/x/sys/unix/mkasm_darwin.go
  79. 3 3
      vendor/golang.org/x/sys/unix/mkpost.go
  80. 34 3
      vendor/golang.org/x/sys/unix/mksyscall.go
  81. 404 0
      vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go
  82. 190 0
      vendor/golang.org/x/sys/unix/mksysnum.go
  83. 19 6
      vendor/golang.org/x/sys/unix/sockcmsg_unix.go
  84. 8 8
      vendor/golang.org/x/sys/unix/syscall_aix.go
  85. 25 37
      vendor/golang.org/x/sys/unix/syscall_darwin.go
  86. 9 14
      vendor/golang.org/x/sys/unix/syscall_darwin_386.go
  87. 9 14
      vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
  88. 12 14
      vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
  89. 12 14
      vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
  90. 31 0
      vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
  91. 7 0
      vendor/golang.org/x/sys/unix/syscall_dragonfly.go
  92. 7 0
      vendor/golang.org/x/sys/unix/syscall_freebsd.go
  93. 52 0
      vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
  94. 7 0
      vendor/golang.org/x/sys/unix/syscall_linux.go
  95. 16 2
      vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
  96. 8 0
      vendor/golang.org/x/sys/unix/syscall_linux_arm.go
  97. 8 1
      vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
  98. 7 0
      vendor/golang.org/x/sys/unix/syscall_netbsd.go
  99. 7 0
      vendor/golang.org/x/sys/unix/syscall_openbsd.go
  100. 7 0
      vendor/golang.org/x/sys/unix/syscall_solaris.go

+ 48 - 42
Gopkg.lock

@@ -26,7 +26,7 @@
   version = "1.0.0"
   version = "1.0.0"
 
 
 [[projects]]
 [[projects]]
-  digest = "1:925b994ff7dbd4ccd8ceeb31af5221c72445eb40e0cfdbb70b70a89c2ba37625"
+  digest = "1:5494cf2a25198713bb2ada9824abccc5610230f6d35c79deec16258a9a92203b"
   name = "github.com/aws/aws-sdk-go"
   name = "github.com/aws/aws-sdk-go"
   packages = [
   packages = [
     "aws",
     "aws",
@@ -65,8 +65,8 @@
     "service/sts",
     "service/sts",
   ]
   ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "c4e0e593d5f18b478f17ff0e86b56d41a70ced2d"
-  version = "v1.16.2"
+  revision = "6d55516ad2946220d9e26804f224c1c215f293ea"
+  version = "v1.16.17"
 
 
 [[projects]]
 [[projects]]
   branch = "master"
   branch = "master"
@@ -123,23 +123,23 @@
   version = "v0.2.0"
   version = "v0.2.0"
 
 
 [[projects]]
 [[projects]]
-  digest = "1:cb4e216bd9f58866f42dc65893455b24f879b026fdaa1ecc3aafff625fdb5a66"
+  digest = "1:022649cb675f044f3b7b6ab58c528dad7b11eee526ecd792a1b04ee4b0c692da"
   name = "github.com/go-ole/go-ole"
   name = "github.com/go-ole/go-ole"
   packages = [
   packages = [
     ".",
     ".",
     "oleutil",
     "oleutil",
   ]
   ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "a41e3c4b706f6ae8dfbff342b06e40fa4d2d0506"
-  version = "v1.2.1"
+  revision = "39dc8486bd0952279431257138bc428275b86797"
+  version = "v1.2.2"
 
 
 [[projects]]
 [[projects]]
-  digest = "1:c967237d234df97d560a82b9e3166234b88fb947676af4e3c897a7d613a287a6"
+  digest = "1:bde9f189072512ba353f3641d4839cb4c9c7edf421e467f2c03f267b402bd16c"
   name = "github.com/gofrs/uuid"
   name = "github.com/gofrs/uuid"
   packages = ["."]
   packages = ["."]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "7077aa61129615a0d7f45c49101cd011ab221c27"
-  version = "v3.1.2"
+  revision = "6b08a5c5172ba18946672b49749cde22873dd7c2"
+  version = "v3.2.0"
 
 
 [[projects]]
 [[projects]]
   digest = "1:5ae5b54d7cd695bafa92bf426b7c3d046f907260ec0fcb4fe5c368d937597c00"
   digest = "1:5ae5b54d7cd695bafa92bf426b7c3d046f907260ec0fcb4fe5c368d937597c00"
@@ -165,12 +165,15 @@
   version = "v1.1.0"
   version = "v1.1.0"
 
 
 [[projects]]
 [[projects]]
-  digest = "1:fb9f5147a9d6fc69057d05b0739bcd79562c55db143c3bdacfe1c9c6129461f6"
+  digest = "1:fd4d1f4c2d75aee3833ee7d8ef11fcf42ddec3c63d1819548288c3d868d6eb14"
   name = "github.com/googleapis/gax-go"
   name = "github.com/googleapis/gax-go"
-  packages = ["."]
+  packages = [
+    ".",
+    "v2",
+  ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "b001040cd31805261cbd978842099e326dfa857b"
-  version = "v2.0.2"
+  revision = "c8a15bac9b9fe955bd9f900272f9a306465d28cf"
+  version = "v2.0.3"
 
 
 [[projects]]
 [[projects]]
   digest = "1:1d879fa52622c803ae26e4960efd41e299067885b19c9c536352f0d41bcf8c7e"
   digest = "1:1d879fa52622c803ae26e4960efd41e299067885b19c9c536352f0d41bcf8c7e"
@@ -196,12 +199,12 @@
   revision = "ae77be60afb1dcacde03767a8c37337fad28ac14"
   revision = "ae77be60afb1dcacde03767a8c37337fad28ac14"
 
 
 [[projects]]
 [[projects]]
-  digest = "1:eef8a6f2bc77c0e954645a6306d48dff8948f400367183b8ad003bf817d3aa13"
+  digest = "1:a4e095309329d4548b915b87bb668c8d98f71e3e0af596060dd5eea054db342c"
   name = "github.com/mat/besticon"
   name = "github.com/mat/besticon"
   packages = ["ico"]
   packages = ["ico"]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "257c937cf48f690c78c900f895e9fc4027962ac2"
-  version = "v3.8.0"
+  revision = "b665f81996e70f0df9962a349cf989c1a9996a87"
+  version = "v3.9.0"
 
 
 [[projects]]
 [[projects]]
   branch = "master"
   branch = "master"
@@ -220,7 +223,7 @@
   version = "v1.0.1"
   version = "v1.0.1"
 
 
 [[projects]]
 [[projects]]
-  digest = "1:cf92116489ef1f446ff62aced9d21f2355ef6e72bd85e01801b914e5bbfbd900"
+  digest = "1:283a1684d33267d7c521bbbd578f521b535bfb1994dbbd1160a2c9bca82949d3"
   name = "github.com/newrelic/go-agent"
   name = "github.com/newrelic/go-agent"
   packages = [
   packages = [
     ".",
     ".",
@@ -232,8 +235,8 @@
     "internal/utilization",
     "internal/utilization",
   ]
   ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "46d73e6be8b4faeee70850d0df829e4fe00d6819"
-  version = "v2.1.0"
+  revision = "a138039206f5b43233e37885306a4dfbdd20e5ce"
+  version = "v2.2.0"
 
 
 [[projects]]
 [[projects]]
   digest = "1:93b1d84c5fa6d1ea52f4114c37714cddd84d5b78f151b62bb101128dd51399bf"
   digest = "1:93b1d84c5fa6d1ea52f4114c37714cddd84d5b78f151b62bb101128dd51399bf"
@@ -277,11 +280,11 @@
   name = "github.com/prometheus/client_model"
   name = "github.com/prometheus/client_model"
   packages = ["go"]
   packages = ["go"]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f"
+  revision = "f287a105a20ec685d797f65cd0ce8fbeaef42da1"
 
 
 [[projects]]
 [[projects]]
   branch = "master"
   branch = "master"
-  digest = "1:06375f3b602de9c99fa99b8484f0e949fd5273e6e9c6592b5a0dd4cd9085f3ea"
+  digest = "1:4340e7fba4a17b3c5c8c874698eae0db8573668bfa541903bd6a654915d6b2bb"
   name = "github.com/prometheus/common"
   name = "github.com/prometheus/common"
   packages = [
   packages = [
     "expfmt",
     "expfmt",
@@ -289,11 +292,11 @@
     "model",
     "model",
   ]
   ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "4724e9255275ce38f7179b2478abeae4e28c904f"
+  revision = "2998b132700a7d019ff618c06a234b47c1f3f681"
 
 
 [[projects]]
 [[projects]]
   branch = "master"
   branch = "master"
-  digest = "1:102dea0c03a915acfc634b7c67f2662012b5483b56d9025e33f5188e112759b6"
+  digest = "1:21971c48d2d34cf633e1898e60bb968eb046a42010ebeb73c8733d7b610cbf59"
   name = "github.com/prometheus/procfs"
   name = "github.com/prometheus/procfs"
   packages = [
   packages = [
     ".",
     ".",
@@ -302,10 +305,10 @@
     "xfs",
     "xfs",
   ]
   ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "1dc9a6cbc91aacc3e8b2d63db4d2e957a5394ac4"
+  revision = "b1a0a9a36d7453ba0f62578b99712f3a6c5f82d1"
 
 
 [[projects]]
 [[projects]]
-  digest = "1:d0c064d8db7da0a052c5a24ceae9c36f2ed345f26f55e58268ee8a5308b5a103"
+  digest = "1:b649932a02293e0b78dca76add8e6db43e405012e29d8662c14cdcb28ffc9f8b"
   name = "github.com/shirou/gopsutil"
   name = "github.com/shirou/gopsutil"
   packages = [
   packages = [
     "internal/common",
     "internal/common",
@@ -313,11 +316,11 @@
     "mem",
     "mem",
   ]
   ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "0f70a4a06f7a1039305ec9b3ba9c2800f8929fba"
-  version = "v2.18.11"
+  revision = "ccc1c1016bc5d10e803189ee43417c50cdde7f1b"
+  version = "v2.18.12"
 
 
 [[projects]]
 [[projects]]
-  digest = "1:b31059dac028ff111793a8345eacf0f99d0f1150ead34ebf32fdd2b7d54c2d45"
+  digest = "1:478d30bda4aa1674ff097066a5da483e660ab51915a7ba62aef73149915aa938"
   name = "github.com/stretchr/testify"
   name = "github.com/stretchr/testify"
   packages = [
   packages = [
     "assert",
     "assert",
@@ -325,8 +328,8 @@
     "suite",
     "suite",
   ]
   ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686"
-  version = "v1.2.2"
+  revision = "ffdc059bfe9ce6a4e144ba849dbedead332c6053"
+  version = "v1.3.0"
 
 
 [[projects]]
 [[projects]]
   digest = "1:fe16cada1d1885b0092d869e39bdd96195d2c65c6f79830a291978f027db1fc6"
   digest = "1:fe16cada1d1885b0092d869e39bdd96195d2c65c6f79830a291978f027db1fc6"
@@ -367,7 +370,7 @@
 
 
 [[projects]]
 [[projects]]
   branch = "master"
   branch = "master"
-  digest = "1:f9eb627e1450a0417d409f65fe6efdc8b8c2394cbe31975e2829a3b07ad8e525"
+  digest = "1:6d9afbae920f65834081d5bf61e3d63f63a3a45057e6e7c635e316b7b90afaa7"
   name = "golang.org/x/net"
   name = "golang.org/x/net"
   packages = [
   packages = [
     "context",
     "context",
@@ -381,7 +384,7 @@
     "trace",
     "trace",
   ]
   ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "610586996380ceef02dd726cc09df7e00a3f8e56"
+  revision = "915654e7eabcea33ae277abbecf52f0d8b7a9fdc"
 
 
 [[projects]]
 [[projects]]
   branch = "master"
   branch = "master"
@@ -395,7 +398,7 @@
     "jwt",
     "jwt",
   ]
   ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "d668ce993890a79bda886613ee587a69dd5da7a6"
+  revision = "fd3eaa146cbb5c89ce187c275fb79bd3a36a5ffc"
 
 
 [[projects]]
 [[projects]]
   branch = "master"
   branch = "master"
@@ -403,18 +406,18 @@
   name = "golang.org/x/sync"
   name = "golang.org/x/sync"
   packages = ["errgroup"]
   packages = ["errgroup"]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "42b317875d0fa942474b76e1b46a6060d720ae6e"
+  revision = "37e7f081c4d4c64e13b10787722085407fe5d15f"
 
 
 [[projects]]
 [[projects]]
   branch = "master"
   branch = "master"
-  digest = "1:b9652309d4d5820d01ef9aed88f46dd6b8021b3eaa4d5f0f6808e2d84386040d"
+  digest = "1:a387cb801e1eacd9a2369522ea11d73077dcb6b7d9525d73c56d12754a0e8afc"
   name = "golang.org/x/sys"
   name = "golang.org/x/sys"
   packages = [
   packages = [
     "unix",
     "unix",
     "windows",
     "windows",
   ]
   ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "ad97f365e15054527b467150f898ec66d7f81e14"
+  revision = "48ac38b7c8cbedd50b1613c0fccacfc7d88dfcdf"
 
 
 [[projects]]
 [[projects]]
   digest = "1:e7071ed636b5422cc51c0e3a6cebc229d6c9fffc528814b519a980641422d619"
   digest = "1:e7071ed636b5422cc51c0e3a6cebc229d6c9fffc528814b519a980641422d619"
@@ -440,7 +443,6 @@
   version = "v0.3.0"
   version = "v0.3.0"
 
 
 [[projects]]
 [[projects]]
-  branch = "master"
   digest = "1:23d9fc277640dc6c36702437a57f0ee033b9f7c9f05a7a425abc7df28f6dd259"
   digest = "1:23d9fc277640dc6c36702437a57f0ee033b9f7c9f05a7a425abc7df28f6dd259"
   name = "google.golang.org/api"
   name = "google.golang.org/api"
   packages = [
   packages = [
@@ -456,10 +458,11 @@
     "transport/http/internal/propagation",
     "transport/http/internal/propagation",
   ]
   ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "1a5ef82f9af45ef51c486291ef2b0a16d82fdb95"
+  revision = "19e022d8cf43ce81f046bae8cc18c5397cc7732f"
+  version = "v0.1.0"
 
 
 [[projects]]
 [[projects]]
-  digest = "1:b63b351b57e64ae8aec1af030dc5e74a2676fcda62102f006ae4411fac1b04c8"
+  digest = "1:d395d49d784dd3a11938a3e85091b6570664aa90ff2767a626565c6c130fa7e9"
   name = "google.golang.org/appengine"
   name = "google.golang.org/appengine"
   packages = [
   packages = [
     ".",
     ".",
@@ -474,8 +477,8 @@
     "urlfetch",
     "urlfetch",
   ]
   ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "4a4468ece617fc8205e99368fa2200e9d1fad421"
-  version = "v1.3.0"
+  revision = "e9657d882bb81064595ca3b56cbe2546bbabf7b1"
+  version = "v1.4.0"
 
 
 [[projects]]
 [[projects]]
   branch = "master"
   branch = "master"
@@ -488,7 +491,7 @@
     "googleapis/rpc/status",
     "googleapis/rpc/status",
   ]
   ]
   pruneopts = "NUT"
   pruneopts = "NUT"
-  revision = "bd91e49a0898e27abb88c339b432fa53d7497ac0"
+  revision = "6909d8a4a91b6d3fd1c4580b6e35816be4706fef"
 
 
 [[projects]]
 [[projects]]
   digest = "1:638e6e596d67d0a0c8aeb76ebdcf73561b701ea43f21963b1db231d96ed7db68"
   digest = "1:638e6e596d67d0a0c8aeb76ebdcf73561b701ea43f21963b1db231d96ed7db68"
@@ -549,6 +552,9 @@
     "github.com/stretchr/testify/assert",
     "github.com/stretchr/testify/assert",
     "github.com/stretchr/testify/require",
     "github.com/stretchr/testify/require",
     "github.com/stretchr/testify/suite",
     "github.com/stretchr/testify/suite",
+    "golang.org/x/image/riff",
+    "golang.org/x/image/vp8",
+    "golang.org/x/image/vp8l",
     "golang.org/x/image/webp",
     "golang.org/x/image/webp",
     "golang.org/x/net/netutil",
     "golang.org/x/net/netutil",
     "golang.org/x/sync/errgroup",
     "golang.org/x/sync/errgroup",

+ 1 - 1
vendor/github.com/aws/aws-sdk-go/aws/client/client.go

@@ -18,7 +18,7 @@ type Config struct {
 
 
 	// States that the signing name did not come from a modeled source but
 	// States that the signing name did not come from a modeled source but
 	// was derived based on other data. Used by service client constructors
 	// was derived based on other data. Used by service client constructors
-	// to determine if the signin name can be overriden based on metadata the
+	// to determine if the signin name can be overridden based on metadata the
 	// service has.
 	// service has.
 	SigningNameDerived bool
 	SigningNameDerived bool
 }
 }

+ 1 - 1
vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go

@@ -17,7 +17,7 @@ var SDKVersionUserAgentHandler = request.NamedHandler{
 }
 }
 
 
 const execEnvVar = `AWS_EXECUTION_ENV`
 const execEnvVar = `AWS_EXECUTION_ENV`
-const execEnvUAKey = `exec_env`
+const execEnvUAKey = `exec-env`
 
 
 // AddHostExecEnvUserAgentHander is a request handler appending the SDK's
 // AddHostExecEnvUserAgentHander is a request handler appending the SDK's
 // execution environment to the user agent.
 // execution environment to the user agent.

+ 35 - 0
vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go

@@ -49,6 +49,8 @@
 package credentials
 package credentials
 
 
 import (
 import (
+	"fmt"
+	"github.com/aws/aws-sdk-go/aws/awserr"
 	"sync"
 	"sync"
 	"time"
 	"time"
 )
 )
@@ -97,6 +99,14 @@ type Provider interface {
 	IsExpired() bool
 	IsExpired() bool
 }
 }
 
 
+// An Expirer is an interface that Providers can implement to expose the expiration
+// time, if known.  If the Provider cannot accurately provide this info,
+// it should not implement this interface.
+type Expirer interface {
+	// The time at which the credentials are no longer valid
+	ExpiresAt() time.Time
+}
+
 // An ErrorProvider is a stub credentials provider that always returns an error
 // An ErrorProvider is a stub credentials provider that always returns an error
 // this is used by the SDK when construction a known provider is not possible
 // this is used by the SDK when construction a known provider is not possible
 // due to an error.
 // due to an error.
@@ -163,6 +173,11 @@ func (e *Expiry) IsExpired() bool {
 	return e.expiration.Before(curTime())
 	return e.expiration.Before(curTime())
 }
 }
 
 
+// ExpiresAt returns the expiration time of the credential
+func (e *Expiry) ExpiresAt() time.Time {
+	return e.expiration
+}
+
 // A Credentials provides concurrency safe retrieval of AWS credentials Value.
 // A Credentials provides concurrency safe retrieval of AWS credentials Value.
 // Credentials will cache the credentials value until they expire. Once the value
 // Credentials will cache the credentials value until they expire. Once the value
 // expires the next Get will attempt to retrieve valid credentials.
 // expires the next Get will attempt to retrieve valid credentials.
@@ -255,3 +270,23 @@ func (c *Credentials) IsExpired() bool {
 func (c *Credentials) isExpired() bool {
 func (c *Credentials) isExpired() bool {
 	return c.forceRefresh || c.provider.IsExpired()
 	return c.forceRefresh || c.provider.IsExpired()
 }
 }
+
+// ExpiresAt provides access to the functionality of the Expirer interface of
+// the underlying Provider, if it supports that interface.  Otherwise, it returns
+// an error.
+func (c *Credentials) ExpiresAt() (time.Time, error) {
+	c.m.RLock()
+	defer c.m.RUnlock()
+
+	expirer, ok := c.provider.(Expirer)
+	if !ok {
+		return time.Time{}, awserr.New("ProviderNotExpirer",
+			fmt.Sprintf("provider %s does not support ExpiresAt()", c.creds.ProviderName),
+			nil)
+	}
+	if c.forceRefresh {
+		// set expiration time to the distant past
+		return time.Time{}, nil
+	}
+	return expirer.ExpiresAt(), nil
+}

+ 56 - 0
vendor/github.com/aws/aws-sdk-go/aws/csm/metric.go

@@ -3,6 +3,8 @@ package csm
 import (
 import (
 	"strconv"
 	"strconv"
 	"time"
 	"time"
+
+	"github.com/aws/aws-sdk-go/aws"
 )
 )
 
 
 type metricTime time.Time
 type metricTime time.Time
@@ -39,6 +41,12 @@ type metric struct {
 	SDKException        *string `json:"SdkException,omitempty"`
 	SDKException        *string `json:"SdkException,omitempty"`
 	SDKExceptionMessage *string `json:"SdkExceptionMessage,omitempty"`
 	SDKExceptionMessage *string `json:"SdkExceptionMessage,omitempty"`
 
 
+	FinalHTTPStatusCode      *int    `json:"FinalHttpStatusCode,omitempty"`
+	FinalAWSException        *string `json:"FinalAwsException,omitempty"`
+	FinalAWSExceptionMessage *string `json:"FinalAwsExceptionMessage,omitempty"`
+	FinalSDKException        *string `json:"FinalSdkException,omitempty"`
+	FinalSDKExceptionMessage *string `json:"FinalSdkExceptionMessage,omitempty"`
+
 	DestinationIP    *string `json:"DestinationIp,omitempty"`
 	DestinationIP    *string `json:"DestinationIp,omitempty"`
 	ConnectionReused *int    `json:"ConnectionReused,omitempty"`
 	ConnectionReused *int    `json:"ConnectionReused,omitempty"`
 
 
@@ -51,3 +59,51 @@ type metric struct {
 
 
 	MaxRetriesExceeded *int `json:"MaxRetriesExceeded,omitempty"`
 	MaxRetriesExceeded *int `json:"MaxRetriesExceeded,omitempty"`
 }
 }
+
+func (m *metric) TruncateFields() {
+	m.ClientID = truncateString(m.ClientID, 255)
+	m.UserAgent = truncateString(m.UserAgent, 256)
+
+	m.AWSException = truncateString(m.AWSException, 128)
+	m.AWSExceptionMessage = truncateString(m.AWSExceptionMessage, 512)
+
+	m.SDKException = truncateString(m.SDKException, 128)
+	m.SDKExceptionMessage = truncateString(m.SDKExceptionMessage, 512)
+
+	m.FinalAWSException = truncateString(m.FinalAWSException, 128)
+	m.FinalAWSExceptionMessage = truncateString(m.FinalAWSExceptionMessage, 512)
+
+	m.FinalSDKException = truncateString(m.FinalSDKException, 128)
+	m.FinalSDKExceptionMessage = truncateString(m.FinalSDKExceptionMessage, 512)
+}
+
+func truncateString(v *string, l int) *string {
+	if v != nil && len(*v) > l {
+		nv := (*v)[:l]
+		return &nv
+	}
+
+	return v
+}
+
+func (m *metric) SetException(e metricException) {
+	switch te := e.(type) {
+	case awsException:
+		m.AWSException = aws.String(te.exception)
+		m.AWSExceptionMessage = aws.String(te.message)
+	case sdkException:
+		m.SDKException = aws.String(te.exception)
+		m.SDKExceptionMessage = aws.String(te.message)
+	}
+}
+
+func (m *metric) SetFinalException(e metricException) {
+	switch te := e.(type) {
+	case awsException:
+		m.FinalAWSException = aws.String(te.exception)
+		m.FinalAWSExceptionMessage = aws.String(te.message)
+	case sdkException:
+		m.FinalSDKException = aws.String(te.exception)
+		m.FinalSDKExceptionMessage = aws.String(te.message)
+	}
+}

+ 26 - 0
vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go

@@ -0,0 +1,26 @@
+package csm
+
+type metricException interface {
+	Exception() string
+	Message() string
+}
+
+type requestException struct {
+	exception string
+	message   string
+}
+
+func (e requestException) Exception() string {
+	return e.exception
+}
+func (e requestException) Message() string {
+	return e.message
+}
+
+type awsException struct {
+	requestException
+}
+
+type sdkException struct {
+	requestException
+}

+ 30 - 10
vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go

@@ -82,14 +82,15 @@ func (rep *Reporter) sendAPICallAttemptMetric(r *request.Request) {
 
 
 	if r.Error != nil {
 	if r.Error != nil {
 		if awserr, ok := r.Error.(awserr.Error); ok {
 		if awserr, ok := r.Error.(awserr.Error); ok {
-			setError(&m, awserr)
+			m.SetException(getMetricException(awserr))
 		}
 		}
 	}
 	}
 
 
+	m.TruncateFields()
 	rep.metricsCh.Push(m)
 	rep.metricsCh.Push(m)
 }
 }
 
 
-func setError(m *metric, err awserr.Error) {
+func getMetricException(err awserr.Error) metricException {
 	msg := err.Error()
 	msg := err.Error()
 	code := err.Code()
 	code := err.Code()
 
 
@@ -97,11 +98,13 @@ func setError(m *metric, err awserr.Error) {
 	case "RequestError",
 	case "RequestError",
 		"SerializationError",
 		"SerializationError",
 		request.CanceledErrorCode:
 		request.CanceledErrorCode:
-		m.SDKException = &code
-		m.SDKExceptionMessage = &msg
+		return sdkException{
+			requestException{exception: code, message: msg},
+		}
 	default:
 	default:
-		m.AWSException = &code
-		m.AWSExceptionMessage = &msg
+		return awsException{
+			requestException{exception: code, message: msg},
+		}
 	}
 	}
 }
 }
 
 
@@ -116,6 +119,7 @@ func (rep *Reporter) sendAPICallMetric(r *request.Request) {
 		API:                aws.String(r.Operation.Name),
 		API:                aws.String(r.Operation.Name),
 		Service:            aws.String(r.ClientInfo.ServiceID),
 		Service:            aws.String(r.ClientInfo.ServiceID),
 		Timestamp:          (*metricTime)(&now),
 		Timestamp:          (*metricTime)(&now),
+		UserAgent:          aws.String(r.HTTPRequest.Header.Get("User-Agent")),
 		Type:               aws.String("ApiCall"),
 		Type:               aws.String("ApiCall"),
 		AttemptCount:       aws.Int(r.RetryCount + 1),
 		AttemptCount:       aws.Int(r.RetryCount + 1),
 		Region:             r.Config.Region,
 		Region:             r.Config.Region,
@@ -124,6 +128,18 @@ func (rep *Reporter) sendAPICallMetric(r *request.Request) {
 		MaxRetriesExceeded: aws.Int(boolIntValue(r.RetryCount >= r.MaxRetries())),
 		MaxRetriesExceeded: aws.Int(boolIntValue(r.RetryCount >= r.MaxRetries())),
 	}
 	}
 
 
+	if r.HTTPResponse != nil {
+		m.FinalHTTPStatusCode = aws.Int(r.HTTPResponse.StatusCode)
+	}
+
+	if r.Error != nil {
+		if awserr, ok := r.Error.(awserr.Error); ok {
+			m.SetFinalException(getMetricException(awserr))
+		}
+	}
+
+	m.TruncateFields()
+
 	// TODO: Probably want to figure something out for logging dropped
 	// TODO: Probably want to figure something out for logging dropped
 	// metrics
 	// metrics
 	rep.metricsCh.Push(m)
 	rep.metricsCh.Push(m)
@@ -223,11 +239,15 @@ func (rep *Reporter) InjectHandlers(handlers *request.Handlers) {
 		return
 		return
 	}
 	}
 
 
-	apiCallHandler := request.NamedHandler{Name: APICallMetricHandlerName, Fn: rep.sendAPICallMetric}
-	apiCallAttemptHandler := request.NamedHandler{Name: APICallAttemptMetricHandlerName, Fn: rep.sendAPICallAttemptMetric}
+	handlers.Complete.PushFrontNamed(request.NamedHandler{
+		Name: APICallMetricHandlerName,
+		Fn:   rep.sendAPICallMetric,
+	})
 
 
-	handlers.Complete.PushFrontNamed(apiCallHandler)
-	handlers.CompleteAttempt.PushFrontNamed(apiCallAttemptHandler)
+	handlers.CompleteAttempt.PushFrontNamed(request.NamedHandler{
+		Name: APICallAttemptMetricHandlerName,
+		Fn:   rep.sendAPICallAttemptMetric,
+	})
 }
 }
 
 
 // boolIntValue return 1 for true and 0 for false.
 // boolIntValue return 1 for true and 0 for false.

+ 4 - 0
vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go

@@ -118,6 +118,10 @@ func (c *EC2Metadata) Region() (string, error) {
 		return "", err
 		return "", err
 	}
 	}
 
 
+	if len(resp) == 0 {
+		return "", awserr.New("EC2MetadataError", "invalid Region response", nil)
+	}
+
 	// returns region without the suffix. Eg: us-west-2a becomes us-west-2
 	// returns region without the suffix. Eg: us-west-2a becomes us-west-2
 	return resp[:len(resp)-1], nil
 	return resp[:len(resp)-1], nil
 }
 }

+ 1 - 1
vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go

@@ -4,7 +4,7 @@
 // This package's client can be disabled completely by setting the environment
 // This package's client can be disabled completely by setting the environment
 // variable "AWS_EC2_METADATA_DISABLED=true". This environment variable set to
 // variable "AWS_EC2_METADATA_DISABLED=true". This environment variable set to
 // true instructs the SDK to disable the EC2 Metadata client. The client cannot
 // true instructs the SDK to disable the EC2 Metadata client. The client cannot
-// be used while the environemnt variable is set to true, (case insensitive).
+// be used while the environment variable is set to true, (case insensitive).
 package ec2metadata
 package ec2metadata
 
 
 import (
 import (

+ 206 - 8
vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go

@@ -22,6 +22,7 @@ const (
 	ApSoutheast2RegionID = "ap-southeast-2" // Asia Pacific (Sydney).
 	ApSoutheast2RegionID = "ap-southeast-2" // Asia Pacific (Sydney).
 	CaCentral1RegionID   = "ca-central-1"   // Canada (Central).
 	CaCentral1RegionID   = "ca-central-1"   // Canada (Central).
 	EuCentral1RegionID   = "eu-central-1"   // EU (Frankfurt).
 	EuCentral1RegionID   = "eu-central-1"   // EU (Frankfurt).
+	EuNorth1RegionID     = "eu-north-1"     // EU (Stockholm).
 	EuWest1RegionID      = "eu-west-1"      // EU (Ireland).
 	EuWest1RegionID      = "eu-west-1"      // EU (Ireland).
 	EuWest2RegionID      = "eu-west-2"      // EU (London).
 	EuWest2RegionID      = "eu-west-2"      // EU (London).
 	EuWest3RegionID      = "eu-west-3"      // EU (Paris).
 	EuWest3RegionID      = "eu-west-3"      // EU (Paris).
@@ -111,6 +112,9 @@ var awsPartition = partition{
 		"eu-central-1": region{
 		"eu-central-1": region{
 			Description: "EU (Frankfurt)",
 			Description: "EU (Frankfurt)",
 		},
 		},
+		"eu-north-1": region{
+			Description: "EU (Stockholm)",
+		},
 		"eu-west-1": region{
 		"eu-west-1": region{
 			Description: "EU (Ireland)",
 			Description: "EU (Ireland)",
 		},
 		},
@@ -153,6 +157,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -229,6 +234,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -255,6 +261,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -274,6 +281,9 @@ var awsPartition = partition{
 			},
 			},
 			Endpoints: endpoints{
 			Endpoints: endpoints{
 				"ap-northeast-1": endpoint{},
 				"ap-northeast-1": endpoint{},
+				"ap-southeast-1": endpoint{},
+				"ap-southeast-2": endpoint{},
+				"eu-central-1":   endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"us-east-1":      endpoint{},
 				"us-east-1":      endpoint{},
 				"us-west-2":      endpoint{},
 				"us-west-2":      endpoint{},
@@ -322,6 +332,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -341,10 +352,18 @@ var awsPartition = partition{
 				},
 				},
 			},
 			},
 			Endpoints: endpoints{
 			Endpoints: endpoints{
+				"ap-northeast-1": endpoint{},
+				"ap-northeast-2": endpoint{},
+				"ap-south-1":     endpoint{},
 				"ap-southeast-1": endpoint{},
 				"ap-southeast-1": endpoint{},
+				"ap-southeast-2": endpoint{},
+				"ca-central-1":   endpoint{},
+				"eu-central-1":   endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
+				"eu-west-2":      endpoint{},
 				"us-east-1":      endpoint{},
 				"us-east-1":      endpoint{},
 				"us-east-2":      endpoint{},
 				"us-east-2":      endpoint{},
+				"us-west-1":      endpoint{},
 				"us-west-2":      endpoint{},
 				"us-west-2":      endpoint{},
 			},
 			},
 		},
 		},
@@ -360,6 +379,7 @@ var awsPartition = partition{
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
+				"eu-west-3":      endpoint{},
 				"sa-east-1":      endpoint{},
 				"sa-east-1":      endpoint{},
 				"us-east-1":      endpoint{},
 				"us-east-1":      endpoint{},
 				"us-east-2":      endpoint{},
 				"us-east-2":      endpoint{},
@@ -425,6 +445,7 @@ var awsPartition = partition{
 			Endpoints: endpoints{
 			Endpoints: endpoints{
 				"ap-southeast-1": endpoint{},
 				"ap-southeast-1": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
+				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
@@ -443,6 +464,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -496,6 +518,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -530,6 +553,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -620,6 +644,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -747,6 +772,7 @@ var awsPartition = partition{
 			},
 			},
 			Endpoints: endpoints{
 			Endpoints: endpoints{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
+				"eu-central-1":   endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"us-east-1":      endpoint{},
 				"us-east-1":      endpoint{},
 				"us-east-2":      endpoint{},
 				"us-east-2":      endpoint{},
@@ -763,6 +789,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -789,6 +816,21 @@ var awsPartition = partition{
 				"us-west-2":      endpoint{},
 				"us-west-2":      endpoint{},
 			},
 			},
 		},
 		},
+		"datasync": service{
+
+			Endpoints: endpoints{
+				"ap-northeast-1": endpoint{},
+				"ap-northeast-2": endpoint{},
+				"ap-southeast-1": endpoint{},
+				"ap-southeast-2": endpoint{},
+				"eu-central-1":   endpoint{},
+				"eu-west-1":      endpoint{},
+				"us-east-1":      endpoint{},
+				"us-east-2":      endpoint{},
+				"us-west-1":      endpoint{},
+				"us-west-2":      endpoint{},
+			},
+		},
 		"dax": service{
 		"dax": service{
 
 
 			Endpoints: endpoints{
 			Endpoints: endpoints{
@@ -820,6 +862,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -856,6 +899,35 @@ var awsPartition = partition{
 				"us-west-2":      endpoint{},
 				"us-west-2":      endpoint{},
 			},
 			},
 		},
 		},
+		"docdb": service{
+
+			Endpoints: endpoints{
+				"eu-west-1": endpoint{
+					Hostname: "rds.eu-west-1.amazonaws.com",
+					CredentialScope: credentialScope{
+						Region: "eu-west-1",
+					},
+				},
+				"us-east-1": endpoint{
+					Hostname: "rds.us-east-1.amazonaws.com",
+					CredentialScope: credentialScope{
+						Region: "us-east-1",
+					},
+				},
+				"us-east-2": endpoint{
+					Hostname: "rds.us-east-2.amazonaws.com",
+					CredentialScope: credentialScope{
+						Region: "us-east-2",
+					},
+				},
+				"us-west-2": endpoint{
+					Hostname: "rds.us-west-2.amazonaws.com",
+					CredentialScope: credentialScope{
+						Region: "us-west-2",
+					},
+				},
+			},
+		},
 		"ds": service{
 		"ds": service{
 
 
 			Endpoints: endpoints{
 			Endpoints: endpoints{
@@ -887,6 +959,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -916,6 +989,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -947,6 +1021,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -967,6 +1042,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -987,6 +1063,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1013,6 +1090,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1050,6 +1128,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1075,10 +1154,11 @@ var awsPartition = partition{
 				"eu-central-1": endpoint{
 				"eu-central-1": endpoint{
 					SSLCommonName: "{service}.{region}.{dnsSuffix}",
 					SSLCommonName: "{service}.{region}.{dnsSuffix}",
 				},
 				},
-				"eu-west-1": endpoint{},
-				"eu-west-2": endpoint{},
-				"eu-west-3": endpoint{},
-				"sa-east-1": endpoint{},
+				"eu-north-1": endpoint{},
+				"eu-west-1":  endpoint{},
+				"eu-west-2":  endpoint{},
+				"eu-west-3":  endpoint{},
+				"sa-east-1":  endpoint{},
 				"us-east-1": endpoint{
 				"us-east-1": endpoint{
 					SSLCommonName: "{service}.{region}.{dnsSuffix}",
 					SSLCommonName: "{service}.{region}.{dnsSuffix}",
 				},
 				},
@@ -1128,6 +1208,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1148,6 +1229,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1182,9 +1264,22 @@ var awsPartition = partition{
 			Defaults: endpoint{
 			Defaults: endpoint{
 				Protocols: []string{"https"},
 				Protocols: []string{"https"},
 			},
 			},
+			Endpoints: endpoints{
+				"ap-northeast-1": endpoint{},
+				"ap-southeast-2": endpoint{},
+				"eu-central-1":   endpoint{},
+				"eu-west-1":      endpoint{},
+				"us-east-1":      endpoint{},
+				"us-east-2":      endpoint{},
+				"us-west-2":      endpoint{},
+			},
+		},
+		"fsx": service{
+
 			Endpoints: endpoints{
 			Endpoints: endpoints{
 				"eu-west-1": endpoint{},
 				"eu-west-1": endpoint{},
 				"us-east-1": endpoint{},
 				"us-east-1": endpoint{},
+				"us-east-2": endpoint{},
 				"us-west-2": endpoint{},
 				"us-west-2": endpoint{},
 			},
 			},
 		},
 		},
@@ -1219,6 +1314,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1243,6 +1339,7 @@ var awsPartition = partition{
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"us-east-1":      endpoint{},
 				"us-east-1":      endpoint{},
 				"us-east-2":      endpoint{},
 				"us-east-2":      endpoint{},
+				"us-west-1":      endpoint{},
 				"us-west-2":      endpoint{},
 				"us-west-2":      endpoint{},
 			},
 			},
 		},
 		},
@@ -1373,6 +1470,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1389,6 +1487,7 @@ var awsPartition = partition{
 				"eu-central-1": endpoint{},
 				"eu-central-1": endpoint{},
 				"eu-west-1":    endpoint{},
 				"eu-west-1":    endpoint{},
 				"us-east-1":    endpoint{},
 				"us-east-1":    endpoint{},
+				"us-east-2":    endpoint{},
 				"us-west-2":    endpoint{},
 				"us-west-2":    endpoint{},
 			},
 			},
 		},
 		},
@@ -1412,6 +1511,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1432,6 +1532,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1470,6 +1571,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1570,6 +1672,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1616,6 +1719,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1626,6 +1730,21 @@ var awsPartition = partition{
 				"us-west-2":      endpoint{},
 				"us-west-2":      endpoint{},
 			},
 			},
 		},
 		},
+		"mq": service{
+
+			Endpoints: endpoints{
+				"ap-northeast-1": endpoint{},
+				"ap-northeast-2": endpoint{},
+				"ap-southeast-1": endpoint{},
+				"ap-southeast-2": endpoint{},
+				"eu-central-1":   endpoint{},
+				"eu-west-1":      endpoint{},
+				"us-east-1":      endpoint{},
+				"us-east-2":      endpoint{},
+				"us-west-1":      endpoint{},
+				"us-west-2":      endpoint{},
+			},
+		},
 		"mturk-requester": service{
 		"mturk-requester": service{
 			IsRegionalized: boxedFalse,
 			IsRegionalized: boxedFalse,
 
 
@@ -1639,6 +1758,18 @@ var awsPartition = partition{
 		"neptune": service{
 		"neptune": service{
 
 
 			Endpoints: endpoints{
 			Endpoints: endpoints{
+				"ap-southeast-1": endpoint{
+					Hostname: "rds.ap-southeast-1.amazonaws.com",
+					CredentialScope: credentialScope{
+						Region: "ap-southeast-1",
+					},
+				},
+				"ap-southeast-2": endpoint{
+					Hostname: "rds.ap-southeast-2.amazonaws.com",
+					CredentialScope: credentialScope{
+						Region: "ap-southeast-2",
+					},
+				},
 				"eu-central-1": endpoint{
 				"eu-central-1": endpoint{
 					Hostname: "rds.eu-central-1.amazonaws.com",
 					Hostname: "rds.eu-central-1.amazonaws.com",
 					CredentialScope: credentialScope{
 					CredentialScope: credentialScope{
@@ -1731,9 +1862,10 @@ var awsPartition = partition{
 				},
 				},
 			},
 			},
 			Endpoints: endpoints{
 			Endpoints: endpoints{
-				"eu-west-1": endpoint{},
-				"us-east-1": endpoint{},
-				"us-west-2": endpoint{},
+				"eu-central-1": endpoint{},
+				"eu-west-1":    endpoint{},
+				"us-east-1":    endpoint{},
+				"us-west-2":    endpoint{},
 			},
 			},
 		},
 		},
 		"polly": service{
 		"polly": service{
@@ -1766,6 +1898,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1788,6 +1921,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1819,6 +1953,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -1829,6 +1964,14 @@ var awsPartition = partition{
 				"us-west-2":      endpoint{},
 				"us-west-2":      endpoint{},
 			},
 			},
 		},
 		},
+		"robomaker": service{
+
+			Endpoints: endpoints{
+				"eu-west-1": endpoint{},
+				"us-east-1": endpoint{},
+				"us-west-2": endpoint{},
+			},
+		},
 		"route53": service{
 		"route53": service{
 			PartitionEndpoint: "aws-global",
 			PartitionEndpoint: "aws-global",
 			IsRegionalized:    boxedFalse,
 			IsRegionalized:    boxedFalse,
@@ -1848,6 +1991,20 @@ var awsPartition = partition{
 				"us-east-1": endpoint{},
 				"us-east-1": endpoint{},
 			},
 			},
 		},
 		},
+		"route53resolver": service{
+			Defaults: endpoint{
+				Protocols: []string{"http", "https"},
+			},
+			Endpoints: endpoints{
+				"ap-northeast-1": endpoint{},
+				"ap-southeast-1": endpoint{},
+				"ap-southeast-2": endpoint{},
+				"eu-west-1":      endpoint{},
+				"us-east-1":      endpoint{},
+				"us-east-2":      endpoint{},
+				"us-west-2":      endpoint{},
+			},
+		},
 		"runtime.lex": service{
 		"runtime.lex": service{
 			Defaults: endpoint{
 			Defaults: endpoint{
 				CredentialScope: credentialScope{
 				CredentialScope: credentialScope{
@@ -1905,6 +2062,7 @@ var awsPartition = partition{
 				},
 				},
 				"ca-central-1": endpoint{},
 				"ca-central-1": endpoint{},
 				"eu-central-1": endpoint{},
 				"eu-central-1": endpoint{},
+				"eu-north-1":   endpoint{},
 				"eu-west-1": endpoint{
 				"eu-west-1": endpoint{
 					Hostname:          "s3.eu-west-1.amazonaws.com",
 					Hostname:          "s3.eu-west-1.amazonaws.com",
 					SignatureVersions: []string{"s3", "s3v4"},
 					SignatureVersions: []string{"s3", "s3v4"},
@@ -1995,6 +2153,13 @@ var awsPartition = partition{
 						Region: "eu-central-1",
 						Region: "eu-central-1",
 					},
 					},
 				},
 				},
+				"eu-north-1": endpoint{
+					Hostname:          "s3-control.eu-north-1.amazonaws.com",
+					SignatureVersions: []string{"s3v4"},
+					CredentialScope: credentialScope{
+						Region: "eu-north-1",
+					},
+				},
 				"eu-west-1": endpoint{
 				"eu-west-1": endpoint{
 					Hostname:          "s3-control.eu-west-1.amazonaws.com",
 					Hostname:          "s3-control.eu-west-1.amazonaws.com",
 					SignatureVersions: []string{"s3v4"},
 					SignatureVersions: []string{"s3v4"},
@@ -2259,7 +2424,7 @@ var awsPartition = partition{
 		"shield": service{
 		"shield": service{
 			IsRegionalized: boxedFalse,
 			IsRegionalized: boxedFalse,
 			Defaults: endpoint{
 			Defaults: endpoint{
-				SSLCommonName: "Shield.us-east-1.amazonaws.com",
+				SSLCommonName: "shield.us-east-1.amazonaws.com",
 				Protocols:     []string{"https"},
 				Protocols:     []string{"https"},
 			},
 			},
 			Endpoints: endpoints{
 			Endpoints: endpoints{
@@ -2317,6 +2482,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -2340,6 +2506,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -2386,6 +2553,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -2406,8 +2574,11 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
+				"eu-west-3":      endpoint{},
+				"sa-east-1":      endpoint{},
 				"us-east-1":      endpoint{},
 				"us-east-1":      endpoint{},
 				"us-east-2":      endpoint{},
 				"us-east-2":      endpoint{},
 				"us-west-1":      endpoint{},
 				"us-west-1":      endpoint{},
@@ -2424,6 +2595,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -2449,6 +2621,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -2488,6 +2661,7 @@ var awsPartition = partition{
 				"aws-global":     endpoint{},
 				"aws-global":     endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -2538,6 +2712,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -2558,6 +2733,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -2688,6 +2864,7 @@ var awsPartition = partition{
 				"ap-southeast-2": endpoint{},
 				"ap-southeast-2": endpoint{},
 				"ca-central-1":   endpoint{},
 				"ca-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
 				"eu-central-1":   endpoint{},
+				"eu-north-1":     endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-1":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-2":      endpoint{},
 				"eu-west-3":      endpoint{},
 				"eu-west-3":      endpoint{},
@@ -3196,6 +3373,7 @@ var awsusgovPartition = partition{
 				},
 				},
 			},
 			},
 			Endpoints: endpoints{
 			Endpoints: endpoints{
+				"us-gov-east-1": endpoint{},
 				"us-gov-west-1": endpoint{},
 				"us-gov-west-1": endpoint{},
 			},
 			},
 		},
 		},
@@ -3246,6 +3424,12 @@ var awsusgovPartition = partition{
 				"us-gov-west-1": endpoint{},
 				"us-gov-west-1": endpoint{},
 			},
 			},
 		},
 		},
+		"ds": service{
+
+			Endpoints: endpoints{
+				"us-gov-west-1": endpoint{},
+			},
+		},
 		"dynamodb": service{
 		"dynamodb": service{
 
 
 			Endpoints: endpoints{
 			Endpoints: endpoints{
@@ -3311,6 +3495,12 @@ var awsusgovPartition = partition{
 				"us-gov-west-1": endpoint{},
 				"us-gov-west-1": endpoint{},
 			},
 			},
 		},
 		},
+		"elasticfilesystem": service{
+
+			Endpoints: endpoints{
+				"us-gov-west-1": endpoint{},
+			},
+		},
 		"elasticloadbalancing": service{
 		"elasticloadbalancing": service{
 
 
 			Endpoints: endpoints{
 			Endpoints: endpoints{
@@ -3332,6 +3522,7 @@ var awsusgovPartition = partition{
 		"es": service{
 		"es": service{
 
 
 			Endpoints: endpoints{
 			Endpoints: endpoints{
+				"us-gov-east-1": endpoint{},
 				"us-gov-west-1": endpoint{},
 				"us-gov-west-1": endpoint{},
 			},
 			},
 		},
 		},
@@ -3418,6 +3609,12 @@ var awsusgovPartition = partition{
 				"us-gov-west-1": endpoint{},
 				"us-gov-west-1": endpoint{},
 			},
 			},
 		},
 		},
+		"mediaconvert": service{
+
+			Endpoints: endpoints{
+				"us-gov-west-1": endpoint{},
+			},
+		},
 		"metering.marketplace": service{
 		"metering.marketplace": service{
 			Defaults: endpoint{
 			Defaults: endpoint{
 				CredentialScope: credentialScope{
 				CredentialScope: credentialScope{
@@ -3534,6 +3731,7 @@ var awsusgovPartition = partition{
 		"snowball": service{
 		"snowball": service{
 
 
 			Endpoints: endpoints{
 			Endpoints: endpoints{
+				"us-gov-east-1": endpoint{},
 				"us-gov-west-1": endpoint{},
 				"us-gov-west-1": endpoint{},
 			},
 			},
 		},
 		},

+ 1 - 1
vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go

@@ -35,7 +35,7 @@ type Options struct {
 	//
 	//
 	// If resolving an endpoint on the partition list the provided region will
 	// If resolving an endpoint on the partition list the provided region will
 	// be used to determine which partition's domain name pattern to the service
 	// be used to determine which partition's domain name pattern to the service
-	// endpoint ID with. If both the service and region are unkonwn and resolving
+	// endpoint ID with. If both the service and region are unknown and resolving
 	// the endpoint on partition list an UnknownEndpointError error will be returned.
 	// the endpoint on partition list an UnknownEndpointError error will be returned.
 	//
 	//
 	// If resolving and endpoint on a partition specific resolver that partition's
 	// If resolving and endpoint on a partition specific resolver that partition's

+ 2 - 2
vendor/github.com/aws/aws-sdk-go/aws/request/request.go

@@ -266,7 +266,7 @@ func (r *Request) SetReaderBody(reader io.ReadSeeker) {
 
 
 // Presign returns the request's signed URL. Error will be returned
 // Presign returns the request's signed URL. Error will be returned
 // if the signing fails. The expire parameter is only used for presigned Amazon
 // if the signing fails. The expire parameter is only used for presigned Amazon
-// S3 API requests. All other AWS services will use a fixed expriation
+// S3 API requests. All other AWS services will use a fixed expiration
 // time of 15 minutes.
 // time of 15 minutes.
 //
 //
 // It is invalid to create a presigned URL with a expire duration 0 or less. An
 // It is invalid to create a presigned URL with a expire duration 0 or less. An
@@ -286,7 +286,7 @@ func (r *Request) Presign(expire time.Duration) (string, error) {
 // PresignRequest behaves just like presign, with the addition of returning a
 // PresignRequest behaves just like presign, with the addition of returning a
 // set of headers that were signed. The expire parameter is only used for
 // set of headers that were signed. The expire parameter is only used for
 // presigned Amazon S3 API requests. All other AWS services will use a fixed
 // presigned Amazon S3 API requests. All other AWS services will use a fixed
-// expriation time of 15 minutes.
+// expiration time of 15 minutes.
 //
 //
 // It is invalid to create a presigned URL with a expire duration 0 or less. An
 // It is invalid to create a presigned URL with a expire duration 0 or less. An
 // error is returned if expire duration is 0 or less.
 // error is returned if expire duration is 0 or less.

+ 1 - 1
vendor/github.com/aws/aws-sdk-go/aws/session/doc.go

@@ -183,7 +183,7 @@ be returned when creating the session.
     // from assumed role.
     // from assumed role.
     svc := s3.New(sess)
     svc := s3.New(sess)
 
 
-To setup assume role outside of a session see the stscrds.AssumeRoleProvider
+To setup assume role outside of a session see the stscreds.AssumeRoleProvider
 documentation.
 documentation.
 
 
 Environment Variables
 Environment Variables

+ 1 - 1
vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go

@@ -80,7 +80,7 @@ type envConfig struct {
 	//	AWS_CONFIG_FILE=$HOME/my_shared_config
 	//	AWS_CONFIG_FILE=$HOME/my_shared_config
 	SharedConfigFile string
 	SharedConfigFile string
 
 
-	// Sets the path to a custom Credentials Authroity (CA) Bundle PEM file
+	// Sets the path to a custom Credentials Authority (CA) Bundle PEM file
 	// that the SDK will use instead of the system's root CA bundle.
 	// that the SDK will use instead of the system's root CA bundle.
 	// Only use this if you want to configure the SDK to use a custom set
 	// Only use this if you want to configure the SDK to use a custom set
 	// of CAs.
 	// of CAs.

+ 2 - 2
vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go

@@ -182,7 +182,7 @@ type Signer struct {
 	// http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
 	// http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
 	DisableURIPathEscaping bool
 	DisableURIPathEscaping bool
 
 
-	// Disales the automatical setting of the HTTP request's Body field with the
+	// Disables the automatical setting of the HTTP request's Body field with the
 	// io.ReadSeeker passed in to the signer. This is useful if you're using a
 	// io.ReadSeeker passed in to the signer. This is useful if you're using a
 	// custom wrapper around the body for the io.ReadSeeker and want to preserve
 	// custom wrapper around the body for the io.ReadSeeker and want to preserve
 	// the Body value on the Request.Body.
 	// the Body value on the Request.Body.
@@ -754,7 +754,7 @@ func makeSha256Reader(reader io.ReadSeeker) []byte {
 const doubleSpace = "  "
 const doubleSpace = "  "
 
 
 // stripExcessSpaces will rewrite the passed in slice's string values to not
 // stripExcessSpaces will rewrite the passed in slice's string values to not
-// contain muliple side-by-side spaces.
+// contain multiple side-by-side spaces.
 func stripExcessSpaces(vals []string) {
 func stripExcessSpaces(vals []string) {
 	var j, k, l, m, spaces int
 	var j, k, l, m, spaces int
 	for i, str := range vals {
 	for i, str := range vals {

+ 1 - 1
vendor/github.com/aws/aws-sdk-go/aws/version.go

@@ -5,4 +5,4 @@ package aws
 const SDKName = "aws-sdk-go"
 const SDKName = "aws-sdk-go"
 
 
 // SDKVersion is the version of this SDK
 // SDKVersion is the version of this SDK
-const SDKVersion = "1.16.2"
+const SDKVersion = "1.16.17"

+ 1 - 1
vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go

@@ -317,7 +317,7 @@ loop:
 		return nil, NewParseError(fmt.Sprintf("incomplete expression: %v", stack.container))
 		return nil, NewParseError(fmt.Sprintf("incomplete expression: %v", stack.container))
 	}
 	}
 
 
-	// returns a sublist which exludes the start symbol
+	// returns a sublist which excludes the start symbol
 	return stack.List(), nil
 	return stack.List(), nil
 }
 }
 
 

+ 1 - 1
vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go

@@ -15,7 +15,7 @@ func newExprStatement(ast AST) AST {
 	return newAST(ASTKindExprStatement, ast)
 	return newAST(ASTKindExprStatement, ast)
 }
 }
 
 
-// CommentStatement represents a comment in the ini defintion.
+// CommentStatement represents a comment in the ini definition.
 //
 //
 //	grammar:
 //	grammar:
 //	comment -> #comment' | ;comment'
 //	comment -> #comment' | ;comment'

+ 1 - 1
vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go

@@ -7,6 +7,6 @@ const (
 )
 )
 
 
 // ECSContainerCredentialsURI is the endpoint to retrieve container
 // ECSContainerCredentialsURI is the endpoint to retrieve container
-// credentials. This can be overriden to test to ensure the credential process
+// credentials. This can be overridden to test to ensure the credential process
 // is behaving correctly.
 // is behaving correctly.
 var ECSContainerCredentialsURI = "http://169.254.170.2"
 var ECSContainerCredentialsURI = "http://169.254.170.2"

+ 33 - 65
vendor/github.com/aws/aws-sdk-go/service/s3/api.go

@@ -460,8 +460,7 @@ func (c *S3) DeleteBucketRequest(input *DeleteBucketInput) (req *request.Request
 
 
 	output = &DeleteBucketOutput{}
 	output = &DeleteBucketOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -537,8 +536,7 @@ func (c *S3) DeleteBucketAnalyticsConfigurationRequest(input *DeleteBucketAnalyt
 
 
 	output = &DeleteBucketAnalyticsConfigurationOutput{}
 	output = &DeleteBucketAnalyticsConfigurationOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -614,8 +612,7 @@ func (c *S3) DeleteBucketCorsRequest(input *DeleteBucketCorsInput) (req *request
 
 
 	output = &DeleteBucketCorsOutput{}
 	output = &DeleteBucketCorsOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -690,8 +687,7 @@ func (c *S3) DeleteBucketEncryptionRequest(input *DeleteBucketEncryptionInput) (
 
 
 	output = &DeleteBucketEncryptionOutput{}
 	output = &DeleteBucketEncryptionOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -766,8 +762,7 @@ func (c *S3) DeleteBucketInventoryConfigurationRequest(input *DeleteBucketInvent
 
 
 	output = &DeleteBucketInventoryConfigurationOutput{}
 	output = &DeleteBucketInventoryConfigurationOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -843,8 +838,7 @@ func (c *S3) DeleteBucketLifecycleRequest(input *DeleteBucketLifecycleInput) (re
 
 
 	output = &DeleteBucketLifecycleOutput{}
 	output = &DeleteBucketLifecycleOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -919,8 +913,7 @@ func (c *S3) DeleteBucketMetricsConfigurationRequest(input *DeleteBucketMetricsC
 
 
 	output = &DeleteBucketMetricsConfigurationOutput{}
 	output = &DeleteBucketMetricsConfigurationOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -996,8 +989,7 @@ func (c *S3) DeleteBucketPolicyRequest(input *DeleteBucketPolicyInput) (req *req
 
 
 	output = &DeleteBucketPolicyOutput{}
 	output = &DeleteBucketPolicyOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -1072,8 +1064,7 @@ func (c *S3) DeleteBucketReplicationRequest(input *DeleteBucketReplicationInput)
 
 
 	output = &DeleteBucketReplicationOutput{}
 	output = &DeleteBucketReplicationOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -1150,8 +1141,7 @@ func (c *S3) DeleteBucketTaggingRequest(input *DeleteBucketTaggingInput) (req *r
 
 
 	output = &DeleteBucketTaggingOutput{}
 	output = &DeleteBucketTaggingOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -1226,8 +1216,7 @@ func (c *S3) DeleteBucketWebsiteRequest(input *DeleteBucketWebsiteInput) (req *r
 
 
 	output = &DeleteBucketWebsiteOutput{}
 	output = &DeleteBucketWebsiteOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -1527,8 +1516,7 @@ func (c *S3) DeletePublicAccessBlockRequest(input *DeletePublicAccessBlockInput)
 
 
 	output = &DeletePublicAccessBlockOutput{}
 	output = &DeletePublicAccessBlockOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -3714,8 +3702,7 @@ func (c *S3) HeadBucketRequest(input *HeadBucketInput) (req *request.Request, ou
 
 
 	output = &HeadBucketOutput{}
 	output = &HeadBucketOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -4836,8 +4823,7 @@ func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateC
 
 
 	output = &PutBucketAccelerateConfigurationOutput{}
 	output = &PutBucketAccelerateConfigurationOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -4912,8 +4898,7 @@ func (c *S3) PutBucketAclRequest(input *PutBucketAclInput) (req *request.Request
 
 
 	output = &PutBucketAclOutput{}
 	output = &PutBucketAclOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -4988,8 +4973,7 @@ func (c *S3) PutBucketAnalyticsConfigurationRequest(input *PutBucketAnalyticsCon
 
 
 	output = &PutBucketAnalyticsConfigurationOutput{}
 	output = &PutBucketAnalyticsConfigurationOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -5065,8 +5049,7 @@ func (c *S3) PutBucketCorsRequest(input *PutBucketCorsInput) (req *request.Reque
 
 
 	output = &PutBucketCorsOutput{}
 	output = &PutBucketCorsOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -5141,8 +5124,7 @@ func (c *S3) PutBucketEncryptionRequest(input *PutBucketEncryptionInput) (req *r
 
 
 	output = &PutBucketEncryptionOutput{}
 	output = &PutBucketEncryptionOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -5218,8 +5200,7 @@ func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryCon
 
 
 	output = &PutBucketInventoryConfigurationOutput{}
 	output = &PutBucketInventoryConfigurationOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -5300,8 +5281,7 @@ func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *req
 
 
 	output = &PutBucketLifecycleOutput{}
 	output = &PutBucketLifecycleOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -5380,8 +5360,7 @@ func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleCon
 
 
 	output = &PutBucketLifecycleConfigurationOutput{}
 	output = &PutBucketLifecycleConfigurationOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -5457,8 +5436,7 @@ func (c *S3) PutBucketLoggingRequest(input *PutBucketLoggingInput) (req *request
 
 
 	output = &PutBucketLoggingOutput{}
 	output = &PutBucketLoggingOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -5535,8 +5513,7 @@ func (c *S3) PutBucketMetricsConfigurationRequest(input *PutBucketMetricsConfigu
 
 
 	output = &PutBucketMetricsConfigurationOutput{}
 	output = &PutBucketMetricsConfigurationOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -5617,8 +5594,7 @@ func (c *S3) PutBucketNotificationRequest(input *PutBucketNotificationInput) (re
 
 
 	output = &PutBucketNotificationOutput{}
 	output = &PutBucketNotificationOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -5697,8 +5673,7 @@ func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificat
 
 
 	output = &PutBucketNotificationConfigurationOutput{}
 	output = &PutBucketNotificationConfigurationOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -5773,8 +5748,7 @@ func (c *S3) PutBucketPolicyRequest(input *PutBucketPolicyInput) (req *request.R
 
 
 	output = &PutBucketPolicyOutput{}
 	output = &PutBucketPolicyOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -5850,8 +5824,7 @@ func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) (req
 
 
 	output = &PutBucketReplicationOutput{}
 	output = &PutBucketReplicationOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -5928,8 +5901,7 @@ func (c *S3) PutBucketRequestPaymentRequest(input *PutBucketRequestPaymentInput)
 
 
 	output = &PutBucketRequestPaymentOutput{}
 	output = &PutBucketRequestPaymentOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -6008,8 +5980,7 @@ func (c *S3) PutBucketTaggingRequest(input *PutBucketTaggingInput) (req *request
 
 
 	output = &PutBucketTaggingOutput{}
 	output = &PutBucketTaggingOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -6084,8 +6055,7 @@ func (c *S3) PutBucketVersioningRequest(input *PutBucketVersioningInput) (req *r
 
 
 	output = &PutBucketVersioningOutput{}
 	output = &PutBucketVersioningOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -6161,8 +6131,7 @@ func (c *S3) PutBucketWebsiteRequest(input *PutBucketWebsiteInput) (req *request
 
 
 	output = &PutBucketWebsiteOutput{}
 	output = &PutBucketWebsiteOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -6689,8 +6658,7 @@ func (c *S3) PutPublicAccessBlockRequest(input *PutPublicAccessBlockInput) (req
 
 
 	output = &PutPublicAccessBlockOutput{}
 	output = &PutPublicAccessBlockOutput{}
 	req = c.newRequest(op, input, output)
 	req = c.newRequest(op, input, output)
-	req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler)
-	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+	req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
 	return
 	return
 }
 }
 
 
@@ -22404,7 +22372,7 @@ type SelectObjectContentEventStreamReader interface {
 	// HTTP this will also close the HTTP connection.
 	// HTTP this will also close the HTTP connection.
 	Close() error
 	Close() error
 
 
-	// Returns any error that has occured while reading from the event stream.
+	// Returns any error that has occurred while reading from the event stream.
 	Err() error
 	Err() error
 }
 }
 
 

+ 27 - 12
vendor/github.com/go-ole/go-ole/com.go

@@ -3,9 +3,7 @@
 package ole
 package ole
 
 
 import (
 import (
-	"errors"
 	"syscall"
 	"syscall"
-	"time"
 	"unicode/utf16"
 	"unicode/utf16"
 	"unsafe"
 	"unsafe"
 )
 )
@@ -21,6 +19,7 @@ var (
 	procStringFromCLSID, _         = modole32.FindProc("StringFromCLSID")
 	procStringFromCLSID, _         = modole32.FindProc("StringFromCLSID")
 	procStringFromIID, _           = modole32.FindProc("StringFromIID")
 	procStringFromIID, _           = modole32.FindProc("StringFromIID")
 	procIIDFromString, _           = modole32.FindProc("IIDFromString")
 	procIIDFromString, _           = modole32.FindProc("IIDFromString")
+	procCoGetObject, _             = modole32.FindProc("CoGetObject")
 	procGetUserDefaultLCID, _      = modkernel32.FindProc("GetUserDefaultLCID")
 	procGetUserDefaultLCID, _      = modkernel32.FindProc("GetUserDefaultLCID")
 	procCopyMemory, _              = modkernel32.FindProc("RtlMoveMemory")
 	procCopyMemory, _              = modkernel32.FindProc("RtlMoveMemory")
 	procVariantInit, _             = modoleaut32.FindProc("VariantInit")
 	procVariantInit, _             = modoleaut32.FindProc("VariantInit")
@@ -209,6 +208,32 @@ func GetActiveObject(clsid *GUID, iid *GUID) (unk *IUnknown, err error) {
 	return
 	return
 }
 }
 
 
+type BindOpts struct {
+	CbStruct          uint32
+	GrfFlags          uint32
+	GrfMode           uint32
+	TickCountDeadline uint32
+}
+
+// GetObject retrieves pointer to active object.
+func GetObject(programID string, bindOpts *BindOpts, iid *GUID) (unk *IUnknown, err error) {
+	if bindOpts != nil {
+		bindOpts.CbStruct = uint32(unsafe.Sizeof(BindOpts{}))
+	}
+	if iid == nil {
+		iid = IID_IUnknown
+	}
+	hr, _, _ := procCoGetObject.Call(
+		uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(programID))),
+		uintptr(unsafe.Pointer(bindOpts)),
+		uintptr(unsafe.Pointer(iid)),
+		uintptr(unsafe.Pointer(&unk)))
+	if hr != 0 {
+		err = NewError(hr)
+	}
+	return
+}
+
 // VariantInit initializes variant.
 // VariantInit initializes variant.
 func VariantInit(v *VARIANT) (err error) {
 func VariantInit(v *VARIANT) (err error) {
 	hr, _, _ := procVariantInit.Call(uintptr(unsafe.Pointer(v)))
 	hr, _, _ := procVariantInit.Call(uintptr(unsafe.Pointer(v)))
@@ -317,13 +342,3 @@ func DispatchMessage(msg *Msg) (ret int32) {
 	ret = int32(r0)
 	ret = int32(r0)
 	return
 	return
 }
 }
-
-// GetVariantDate converts COM Variant Time value to Go time.Time.
-func GetVariantDate(value float64) (time.Time, error) {
-	var st syscall.Systemtime
-	r, _, _ := procVariantTimeToSystemTime.Call(uintptr(value), uintptr(unsafe.Pointer(&st)))
-	if r != 0 {
-		return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil
-	}
-	return time.Now(), errors.New("Could not convert to time, passing current time.")
-}

+ 1 - 1
vendor/github.com/go-ole/go-ole/com_func.go

@@ -169,6 +169,6 @@ func DispatchMessage(msg *Msg) int32 {
 	return int32(0)
 	return int32(0)
 }
 }
 
 
-func GetVariantDate(value float64) (time.Time, error) {
+func GetVariantDate(value uint64) (time.Time, error) {
 	return time.Now(), NewError(E_NOTIMPL)
 	return time.Now(), NewError(E_NOTIMPL)
 }
 }

+ 3 - 0
vendor/github.com/go-ole/go-ole/idispatch_windows.go

@@ -3,6 +3,7 @@
 package ole
 package ole
 
 
 import (
 import (
+	"math/big"
 	"syscall"
 	"syscall"
 	"time"
 	"time"
 	"unsafe"
 	"unsafe"
@@ -132,6 +133,8 @@ func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...interface{}
 				vargs[n] = NewVariant(VT_R8, *(*int64)(unsafe.Pointer(&vv)))
 				vargs[n] = NewVariant(VT_R8, *(*int64)(unsafe.Pointer(&vv)))
 			case *float64:
 			case *float64:
 				vargs[n] = NewVariant(VT_R8|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*float64)))))
 				vargs[n] = NewVariant(VT_R8|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*float64)))))
+			case *big.Int:
+				vargs[n] = NewVariant(VT_DECIMAL, v.(*big.Int).Int64())
 			case string:
 			case string:
 				vargs[n] = NewVariant(VT_BSTR, int64(uintptr(unsafe.Pointer(SysAllocStringLen(v.(string))))))
 				vargs[n] = NewVariant(VT_BSTR, int64(uintptr(unsafe.Pointer(SysAllocStringLen(v.(string))))))
 			case *string:
 			case *string:

+ 6 - 6
vendor/github.com/go-ole/go-ole/safearray_func.go

@@ -124,12 +124,12 @@ func safeArrayGetElementSize(safearray *SafeArray) (*uint32, error) {
 }
 }
 
 
 // safeArrayGetElement retrieves element at given index.
 // safeArrayGetElement retrieves element at given index.
-func safeArrayGetElement(safearray *SafeArray, index int64, pv unsafe.Pointer) error {
+func safeArrayGetElement(safearray *SafeArray, index int32, pv unsafe.Pointer) error {
 	return NewError(E_NOTIMPL)
 	return NewError(E_NOTIMPL)
 }
 }
 
 
 // safeArrayGetElement retrieves element at given index and converts to string.
 // safeArrayGetElement retrieves element at given index and converts to string.
-func safeArrayGetElementString(safearray *SafeArray, index int64) (string, error) {
+func safeArrayGetElementString(safearray *SafeArray, index int32) (string, error) {
 	return "", NewError(E_NOTIMPL)
 	return "", NewError(E_NOTIMPL)
 }
 }
 
 
@@ -146,8 +146,8 @@ func safeArrayGetIID(safearray *SafeArray) (*GUID, error) {
 // multidimensional array.
 // multidimensional array.
 //
 //
 // AKA: SafeArrayGetLBound in Windows API.
 // AKA: SafeArrayGetLBound in Windows API.
-func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (int64, error) {
-	return int64(0), NewError(E_NOTIMPL)
+func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (int32, error) {
+	return int32(0), NewError(E_NOTIMPL)
 }
 }
 
 
 // safeArrayGetUBound returns upper bounds of SafeArray.
 // safeArrayGetUBound returns upper bounds of SafeArray.
@@ -156,8 +156,8 @@ func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (int64, error) {
 // multidimensional array.
 // multidimensional array.
 //
 //
 // AKA: SafeArrayGetUBound in Windows API.
 // AKA: SafeArrayGetUBound in Windows API.
-func safeArrayGetUBound(safearray *SafeArray, dimension uint32) (int64, error) {
-	return int64(0), NewError(E_NOTIMPL)
+func safeArrayGetUBound(safearray *SafeArray, dimension uint32) (int32, error) {
+	return int32(0), NewError(E_NOTIMPL)
 }
 }
 
 
 // safeArrayGetVartype returns data type of SafeArray.
 // safeArrayGetVartype returns data type of SafeArray.

+ 4 - 4
vendor/github.com/go-ole/go-ole/safearray_windows.go

@@ -205,7 +205,7 @@ func safeArrayGetElementSize(safearray *SafeArray) (length *uint32, err error) {
 }
 }
 
 
 // safeArrayGetElement retrieves element at given index.
 // safeArrayGetElement retrieves element at given index.
-func safeArrayGetElement(safearray *SafeArray, index int64, pv unsafe.Pointer) error {
+func safeArrayGetElement(safearray *SafeArray, index int32, pv unsafe.Pointer) error {
 	return convertHresultToError(
 	return convertHresultToError(
 		procSafeArrayGetElement.Call(
 		procSafeArrayGetElement.Call(
 			uintptr(unsafe.Pointer(safearray)),
 			uintptr(unsafe.Pointer(safearray)),
@@ -214,7 +214,7 @@ func safeArrayGetElement(safearray *SafeArray, index int64, pv unsafe.Pointer) e
 }
 }
 
 
 // safeArrayGetElementString retrieves element at given index and converts to string.
 // safeArrayGetElementString retrieves element at given index and converts to string.
-func safeArrayGetElementString(safearray *SafeArray, index int64) (str string, err error) {
+func safeArrayGetElementString(safearray *SafeArray, index int32) (str string, err error) {
 	var element *int16
 	var element *int16
 	err = convertHresultToError(
 	err = convertHresultToError(
 		procSafeArrayGetElement.Call(
 		procSafeArrayGetElement.Call(
@@ -243,7 +243,7 @@ func safeArrayGetIID(safearray *SafeArray) (guid *GUID, err error) {
 // multidimensional array.
 // multidimensional array.
 //
 //
 // AKA: SafeArrayGetLBound in Windows API.
 // AKA: SafeArrayGetLBound in Windows API.
-func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (lowerBound int64, err error) {
+func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (lowerBound int32, err error) {
 	err = convertHresultToError(
 	err = convertHresultToError(
 		procSafeArrayGetLBound.Call(
 		procSafeArrayGetLBound.Call(
 			uintptr(unsafe.Pointer(safearray)),
 			uintptr(unsafe.Pointer(safearray)),
@@ -258,7 +258,7 @@ func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (lowerBound int6
 // multidimensional array.
 // multidimensional array.
 //
 //
 // AKA: SafeArrayGetUBound in Windows API.
 // AKA: SafeArrayGetUBound in Windows API.
-func safeArrayGetUBound(safearray *SafeArray, dimension uint32) (upperBound int64, err error) {
+func safeArrayGetUBound(safearray *SafeArray, dimension uint32) (upperBound int32, err error) {
 	err = convertHresultToError(
 	err = convertHresultToError(
 		procSafeArrayGetUBound.Call(
 		procSafeArrayGetUBound.Call(
 			uintptr(unsafe.Pointer(safearray)),
 			uintptr(unsafe.Pointer(safearray)),

+ 19 - 19
vendor/github.com/go-ole/go-ole/safearrayconversion.go

@@ -14,7 +14,7 @@ func (sac *SafeArrayConversion) ToStringArray() (strings []string) {
 	totalElements, _ := sac.TotalElements(0)
 	totalElements, _ := sac.TotalElements(0)
 	strings = make([]string, totalElements)
 	strings = make([]string, totalElements)
 
 
-	for i := int64(0); i < totalElements; i++ {
+	for i := int32(0); i < totalElements; i++ {
 		strings[int32(i)], _ = safeArrayGetElementString(sac.Array, i)
 		strings[int32(i)], _ = safeArrayGetElementString(sac.Array, i)
 	}
 	}
 
 
@@ -25,7 +25,7 @@ func (sac *SafeArrayConversion) ToByteArray() (bytes []byte) {
 	totalElements, _ := sac.TotalElements(0)
 	totalElements, _ := sac.TotalElements(0)
 	bytes = make([]byte, totalElements)
 	bytes = make([]byte, totalElements)
 
 
-	for i := int64(0); i < totalElements; i++ {
+	for i := int32(0); i < totalElements; i++ {
 		safeArrayGetElement(sac.Array, i, unsafe.Pointer(&bytes[int32(i)]))
 		safeArrayGetElement(sac.Array, i, unsafe.Pointer(&bytes[int32(i)]))
 	}
 	}
 
 
@@ -37,59 +37,59 @@ func (sac *SafeArrayConversion) ToValueArray() (values []interface{}) {
 	values = make([]interface{}, totalElements)
 	values = make([]interface{}, totalElements)
 	vt, _ := safeArrayGetVartype(sac.Array)
 	vt, _ := safeArrayGetVartype(sac.Array)
 
 
-	for i := 0; i < int(totalElements); i++ {
+	for i := int32(0); i < totalElements; i++ {
 		switch VT(vt) {
 		switch VT(vt) {
 		case VT_BOOL:
 		case VT_BOOL:
 			var v bool
 			var v bool
-			safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
+			safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v))
 			values[i] = v
 			values[i] = v
 		case VT_I1:
 		case VT_I1:
 			var v int8
 			var v int8
-			safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
+			safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v))
 			values[i] = v
 			values[i] = v
 		case VT_I2:
 		case VT_I2:
 			var v int16
 			var v int16
-			safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
+			safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v))
 			values[i] = v
 			values[i] = v
 		case VT_I4:
 		case VT_I4:
 			var v int32
 			var v int32
-			safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
+			safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v))
 			values[i] = v
 			values[i] = v
 		case VT_I8:
 		case VT_I8:
 			var v int64
 			var v int64
-			safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
+			safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v))
 			values[i] = v
 			values[i] = v
 		case VT_UI1:
 		case VT_UI1:
 			var v uint8
 			var v uint8
-			safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
+			safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v))
 			values[i] = v
 			values[i] = v
 		case VT_UI2:
 		case VT_UI2:
 			var v uint16
 			var v uint16
-			safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
+			safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v))
 			values[i] = v
 			values[i] = v
 		case VT_UI4:
 		case VT_UI4:
 			var v uint32
 			var v uint32
-			safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
+			safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v))
 			values[i] = v
 			values[i] = v
 		case VT_UI8:
 		case VT_UI8:
 			var v uint64
 			var v uint64
-			safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
+			safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v))
 			values[i] = v
 			values[i] = v
 		case VT_R4:
 		case VT_R4:
 			var v float32
 			var v float32
-			safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
+			safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v))
 			values[i] = v
 			values[i] = v
 		case VT_R8:
 		case VT_R8:
 			var v float64
 			var v float64
-			safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
+			safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v))
 			values[i] = v
 			values[i] = v
 		case VT_BSTR:
 		case VT_BSTR:
 			var v string
 			var v string
-			safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
+			safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v))
 			values[i] = v
 			values[i] = v
 		case VT_VARIANT:
 		case VT_VARIANT:
 			var v VARIANT
 			var v VARIANT
-			safeArrayGetElement(sac.Array, int64(i), unsafe.Pointer(&v))
+			safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v))
 			values[i] = v.Value()
 			values[i] = v.Value()
 		default:
 		default:
 			// TODO
 			// TODO
@@ -111,14 +111,14 @@ func (sac *SafeArrayConversion) GetSize() (length *uint32, err error) {
 	return safeArrayGetElementSize(sac.Array)
 	return safeArrayGetElementSize(sac.Array)
 }
 }
 
 
-func (sac *SafeArrayConversion) TotalElements(index uint32) (totalElements int64, err error) {
+func (sac *SafeArrayConversion) TotalElements(index uint32) (totalElements int32, err error) {
 	if index < 1 {
 	if index < 1 {
 		index = 1
 		index = 1
 	}
 	}
 
 
 	// Get array bounds
 	// Get array bounds
-	var LowerBounds int64
-	var UpperBounds int64
+	var LowerBounds int32
+	var UpperBounds int32
 
 
 	LowerBounds, err = safeArrayGetLBound(sac.Array, index)
 	LowerBounds, err = safeArrayGetLBound(sac.Array, index)
 	if err != nil {
 	if err != nil {

+ 2 - 2
vendor/github.com/go-ole/go-ole/variant.go

@@ -88,10 +88,10 @@ func (v *VARIANT) Value() interface{} {
 		return v.ToString()
 		return v.ToString()
 	case VT_DATE:
 	case VT_DATE:
 		// VT_DATE type will either return float64 or time.Time.
 		// VT_DATE type will either return float64 or time.Time.
-		d := float64(v.Val)
+		d := uint64(v.Val)
 		date, err := GetVariantDate(d)
 		date, err := GetVariantDate(d)
 		if err != nil {
 		if err != nil {
-			return d
+			return float64(v.Val)
 		}
 		}
 		return date
 		return date
 	case VT_UNKNOWN:
 	case VT_UNKNOWN:

+ 22 - 0
vendor/github.com/go-ole/go-ole/variant_date_386.go

@@ -0,0 +1,22 @@
+// +build windows,386
+
+package ole
+
+import (
+	"errors"
+	"syscall"
+	"time"
+	"unsafe"
+)
+
+// GetVariantDate converts COM Variant Time value to Go time.Time.
+func GetVariantDate(value uint64) (time.Time, error) {
+	var st syscall.Systemtime
+	v1 := uint32(value)
+	v2 := uint32(value >> 32)
+	r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st)))
+	if r != 0 {
+		return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil
+	}
+	return time.Now(), errors.New("Could not convert to time, passing current time.")
+}

+ 20 - 0
vendor/github.com/go-ole/go-ole/variant_date_amd64.go

@@ -0,0 +1,20 @@
+// +build windows,amd64
+
+package ole
+
+import (
+	"errors"
+	"syscall"
+	"time"
+	"unsafe"
+)
+
+// GetVariantDate converts COM Variant Time value to Go time.Time.
+func GetVariantDate(value uint64) (time.Time, error) {
+	var st syscall.Systemtime
+	r, _, _ := procVariantTimeToSystemTime.Call(uintptr(value), uintptr(unsafe.Pointer(&st)))
+	if r != 0 {
+		return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil
+	}
+	return time.Now(), errors.New("Could not convert to time, passing current time.")
+}

+ 12 - 0
vendor/github.com/go-ole/go-ole/variant_ppc64le.go

@@ -0,0 +1,12 @@
+// +build ppc64le
+
+package ole
+
+type VARIANT struct {
+	VT         VT      //  2
+	wReserved1 uint16  //  4
+	wReserved2 uint16  //  6
+	wReserved3 uint16  //  8
+	Val        int64   // 16
+	_          [8]byte // 24
+}

+ 1 - 1
vendor/github.com/gofrs/uuid/codec.go

@@ -191,7 +191,7 @@ func (u *UUID) decodePlain(t []byte) error {
 	case 36:
 	case 36:
 		return u.decodeCanonical(t)
 		return u.decodeCanonical(t)
 	default:
 	default:
-		return fmt.Errorf("uuid: incorrrect UUID length: %s", t)
+		return fmt.Errorf("uuid: incorrect UUID length: %s", t)
 	}
 	}
 }
 }
 
 

+ 10 - 96
vendor/github.com/googleapis/gax-go/call_option.go

@@ -30,37 +30,21 @@
 package gax
 package gax
 
 
 import (
 import (
-	"math/rand"
-	"time"
-
+	v2 "github.com/googleapis/gax-go/v2"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc/codes"
 	"google.golang.org/grpc/codes"
-	"google.golang.org/grpc/status"
 )
 )
 
 
 // CallOption is an option used by Invoke to control behaviors of RPC calls.
 // CallOption is an option used by Invoke to control behaviors of RPC calls.
 // CallOption works by modifying relevant fields of CallSettings.
 // CallOption works by modifying relevant fields of CallSettings.
-type CallOption interface {
-	// Resolve applies the option by modifying cs.
-	Resolve(cs *CallSettings)
-}
+type CallOption = v2.CallOption
 
 
 // Retryer is used by Invoke to determine retry behavior.
 // Retryer is used by Invoke to determine retry behavior.
-type Retryer interface {
-	// Retry reports whether a request should be retriedand how long to pause before retrying
-	// if the previous attempt returned with err. Invoke never calls Retry with nil error.
-	Retry(err error) (pause time.Duration, shouldRetry bool)
-}
-
-type retryerOption func() Retryer
-
-func (o retryerOption) Resolve(s *CallSettings) {
-	s.Retry = o
-}
+type Retryer = v2.Retryer
 
 
 // WithRetry sets CallSettings.Retry to fn.
 // WithRetry sets CallSettings.Retry to fn.
 func WithRetry(fn func() Retryer) CallOption {
 func WithRetry(fn func() Retryer) CallOption {
-	return retryerOption(fn)
+	return v2.WithRetry(fn)
 }
 }
 
 
 // OnCodes returns a Retryer that retries if and only if
 // OnCodes returns a Retryer that retries if and only if
@@ -69,89 +53,19 @@ func WithRetry(fn func() Retryer) CallOption {
 //
 //
 // bo is only used for its parameters; each Retryer has its own copy.
 // bo is only used for its parameters; each Retryer has its own copy.
 func OnCodes(cc []codes.Code, bo Backoff) Retryer {
 func OnCodes(cc []codes.Code, bo Backoff) Retryer {
-	return &boRetryer{
-		backoff: bo,
-		codes:   append([]codes.Code(nil), cc...),
-	}
-}
-
-type boRetryer struct {
-	backoff Backoff
-	codes   []codes.Code
-}
-
-func (r *boRetryer) Retry(err error) (time.Duration, bool) {
-	st, ok := status.FromError(err)
-	if !ok {
-		return 0, false
-	}
-	c := st.Code()
-	for _, rc := range r.codes {
-		if c == rc {
-			return r.backoff.Pause(), true
-		}
-	}
-	return 0, false
+	return v2.OnCodes(cc, bo)
 }
 }
 
 
 // Backoff implements exponential backoff.
 // Backoff implements exponential backoff.
 // The wait time between retries is a random value between 0 and the "retry envelope".
 // The wait time between retries is a random value between 0 and the "retry envelope".
 // The envelope starts at Initial and increases by the factor of Multiplier every retry,
 // The envelope starts at Initial and increases by the factor of Multiplier every retry,
 // but is capped at Max.
 // but is capped at Max.
-type Backoff struct {
-	// Initial is the initial value of the retry envelope, defaults to 1 second.
-	Initial time.Duration
-
-	// Max is the maximum value of the retry envelope, defaults to 30 seconds.
-	Max time.Duration
-
-	// Multiplier is the factor by which the retry envelope increases.
-	// It should be greater than 1 and defaults to 2.
-	Multiplier float64
-
-	// cur is the current retry envelope
-	cur time.Duration
-}
-
-func (bo *Backoff) Pause() time.Duration {
-	if bo.Initial == 0 {
-		bo.Initial = time.Second
-	}
-	if bo.cur == 0 {
-		bo.cur = bo.Initial
-	}
-	if bo.Max == 0 {
-		bo.Max = 30 * time.Second
-	}
-	if bo.Multiplier < 1 {
-		bo.Multiplier = 2
-	}
-	// Select a duration between zero and the current max. It might seem counterintuitive to
-	// have so much jitter, but https://www.awsarchitectureblog.com/2015/03/backoff.html
-	// argues that that is the best strategy.
-	d := time.Duration(rand.Int63n(int64(bo.cur)))
-	bo.cur = time.Duration(float64(bo.cur) * bo.Multiplier)
-	if bo.cur > bo.Max {
-		bo.cur = bo.Max
-	}
-	return d
-}
-
-type grpcOpt []grpc.CallOption
-
-func (o grpcOpt) Resolve(s *CallSettings) {
-	s.GRPC = o
-}
+type Backoff = v2.Backoff
 
 
+// WithGRPCOptions allows passing gRPC call options during client creation.
 func WithGRPCOptions(opt ...grpc.CallOption) CallOption {
 func WithGRPCOptions(opt ...grpc.CallOption) CallOption {
-	return grpcOpt(append([]grpc.CallOption(nil), opt...))
+	return v2.WithGRPCOptions(opt...)
 }
 }
 
 
-type CallSettings struct {
-	// Retry returns a Retryer to be used to control retry logic of a method call.
-	// If Retry is nil or the returned Retryer is nil, the call will not be retried.
-	Retry func() Retryer
-
-	// CallOptions to be forwarded to GRPC.
-	GRPC []grpc.CallOption
-}
+// CallSettings allow fine-grained control over how calls are made.
+type CallSettings = v2.CallSettings

+ 2 - 1
vendor/github.com/googleapis/gax-go/gax.go

@@ -35,4 +35,5 @@
 // to simplify code generation and to provide more convenient and idiomatic API surfaces.
 // to simplify code generation and to provide more convenient and idiomatic API surfaces.
 package gax
 package gax
 
 
-const Version = "2.0.0"
+// Version specifies the gax version.
+const Version = "1.0.1"

+ 31 - 15
vendor/github.com/googleapis/gax-go/header.go

@@ -1,24 +1,40 @@
+// Copyright 2018, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
 package gax
 package gax
 
 
-import "bytes"
+import v2 "github.com/googleapis/gax-go/v2"
 
 
 // XGoogHeader is for use by the Google Cloud Libraries only.
 // XGoogHeader is for use by the Google Cloud Libraries only.
 //
 //
 // XGoogHeader formats key-value pairs.
 // XGoogHeader formats key-value pairs.
 // The resulting string is suitable for x-goog-api-client header.
 // The resulting string is suitable for x-goog-api-client header.
 func XGoogHeader(keyval ...string) string {
 func XGoogHeader(keyval ...string) string {
-	if len(keyval) == 0 {
-		return ""
-	}
-	if len(keyval)%2 != 0 {
-		panic("gax.Header: odd argument count")
-	}
-	var buf bytes.Buffer
-	for i := 0; i < len(keyval); i += 2 {
-		buf.WriteByte(' ')
-		buf.WriteString(keyval[i])
-		buf.WriteByte('/')
-		buf.WriteString(keyval[i+1])
-	}
-	return buf.String()[1:]
+	return v2.XGoogHeader(keyval...)
 }
 }

+ 6 - 43
vendor/github.com/googleapis/gax-go/invoke.go

@@ -32,58 +32,21 @@ package gax
 import (
 import (
 	"context"
 	"context"
 	"time"
 	"time"
+
+	v2 "github.com/googleapis/gax-go/v2"
 )
 )
 
 
-// A user defined call stub.
-type APICall func(context.Context, CallSettings) error
+// APICall is a user defined call stub.
+type APICall = v2.APICall
 
 
 // Invoke calls the given APICall,
 // Invoke calls the given APICall,
 // performing retries as specified by opts, if any.
 // performing retries as specified by opts, if any.
 func Invoke(ctx context.Context, call APICall, opts ...CallOption) error {
 func Invoke(ctx context.Context, call APICall, opts ...CallOption) error {
-	var settings CallSettings
-	for _, opt := range opts {
-		opt.Resolve(&settings)
-	}
-	return invoke(ctx, call, settings, Sleep)
+	return v2.Invoke(ctx, call, opts...)
 }
 }
 
 
 // Sleep is similar to time.Sleep, but it can be interrupted by ctx.Done() closing.
 // Sleep is similar to time.Sleep, but it can be interrupted by ctx.Done() closing.
 // If interrupted, Sleep returns ctx.Err().
 // If interrupted, Sleep returns ctx.Err().
 func Sleep(ctx context.Context, d time.Duration) error {
 func Sleep(ctx context.Context, d time.Duration) error {
-	t := time.NewTimer(d)
-	select {
-	case <-ctx.Done():
-		t.Stop()
-		return ctx.Err()
-	case <-t.C:
-		return nil
-	}
-}
-
-type sleeper func(ctx context.Context, d time.Duration) error
-
-// invoke implements Invoke, taking an additional sleeper argument for testing.
-func invoke(ctx context.Context, call APICall, settings CallSettings, sp sleeper) error {
-	var retryer Retryer
-	for {
-		err := call(ctx, settings)
-		if err == nil {
-			return nil
-		}
-		if settings.Retry == nil {
-			return err
-		}
-		if retryer == nil {
-			if r := settings.Retry(); r != nil {
-				retryer = r
-			} else {
-				return err
-			}
-		}
-		if d, ok := retryer.Retry(err); !ok {
-			return err
-		} else if err = sp(ctx, d); err != nil {
-			return err
-		}
-	}
+	return v2.Sleep(ctx, d)
 }
 }

+ 161 - 0
vendor/github.com/googleapis/gax-go/v2/call_option.go

@@ -0,0 +1,161 @@
+// Copyright 2016, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+package gax
+
+import (
+	"math/rand"
+	"time"
+
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/codes"
+	"google.golang.org/grpc/status"
+)
+
+// CallOption is an option used by Invoke to control behaviors of RPC calls.
+// CallOption works by modifying relevant fields of CallSettings.
+type CallOption interface {
+	// Resolve applies the option by modifying cs.
+	Resolve(cs *CallSettings)
+}
+
+// Retryer is used by Invoke to determine retry behavior.
+type Retryer interface {
+	// Retry reports whether a request should be retriedand how long to pause before retrying
+	// if the previous attempt returned with err. Invoke never calls Retry with nil error.
+	Retry(err error) (pause time.Duration, shouldRetry bool)
+}
+
+type retryerOption func() Retryer
+
+func (o retryerOption) Resolve(s *CallSettings) {
+	s.Retry = o
+}
+
+// WithRetry sets CallSettings.Retry to fn.
+func WithRetry(fn func() Retryer) CallOption {
+	return retryerOption(fn)
+}
+
+// OnCodes returns a Retryer that retries if and only if
+// the previous attempt returns a GRPC error whose error code is stored in cc.
+// Pause times between retries are specified by bo.
+//
+// bo is only used for its parameters; each Retryer has its own copy.
+func OnCodes(cc []codes.Code, bo Backoff) Retryer {
+	return &boRetryer{
+		backoff: bo,
+		codes:   append([]codes.Code(nil), cc...),
+	}
+}
+
+type boRetryer struct {
+	backoff Backoff
+	codes   []codes.Code
+}
+
+func (r *boRetryer) Retry(err error) (time.Duration, bool) {
+	st, ok := status.FromError(err)
+	if !ok {
+		return 0, false
+	}
+	c := st.Code()
+	for _, rc := range r.codes {
+		if c == rc {
+			return r.backoff.Pause(), true
+		}
+	}
+	return 0, false
+}
+
+// Backoff implements exponential backoff.
+// The wait time between retries is a random value between 0 and the "retry envelope".
+// The envelope starts at Initial and increases by the factor of Multiplier every retry,
+// but is capped at Max.
+type Backoff struct {
+	// Initial is the initial value of the retry envelope, defaults to 1 second.
+	Initial time.Duration
+
+	// Max is the maximum value of the retry envelope, defaults to 30 seconds.
+	Max time.Duration
+
+	// Multiplier is the factor by which the retry envelope increases.
+	// It should be greater than 1 and defaults to 2.
+	Multiplier float64
+
+	// cur is the current retry envelope
+	cur time.Duration
+}
+
+// Pause returns the next time.Duration that the caller should use to backoff.
+func (bo *Backoff) Pause() time.Duration {
+	if bo.Initial == 0 {
+		bo.Initial = time.Second
+	}
+	if bo.cur == 0 {
+		bo.cur = bo.Initial
+	}
+	if bo.Max == 0 {
+		bo.Max = 30 * time.Second
+	}
+	if bo.Multiplier < 1 {
+		bo.Multiplier = 2
+	}
+	// Select a duration between 1ns and the current max. It might seem
+	// counterintuitive to have so much jitter, but
+	// https://www.awsarchitectureblog.com/2015/03/backoff.html argues that
+	// that is the best strategy.
+	d := time.Duration(1 + rand.Int63n(int64(bo.cur)))
+	bo.cur = time.Duration(float64(bo.cur) * bo.Multiplier)
+	if bo.cur > bo.Max {
+		bo.cur = bo.Max
+	}
+	return d
+}
+
+type grpcOpt []grpc.CallOption
+
+func (o grpcOpt) Resolve(s *CallSettings) {
+	s.GRPC = o
+}
+
+// WithGRPCOptions allows passing gRPC call options during client creation.
+func WithGRPCOptions(opt ...grpc.CallOption) CallOption {
+	return grpcOpt(append([]grpc.CallOption(nil), opt...))
+}
+
+// CallSettings allow fine-grained control over how calls are made.
+type CallSettings struct {
+	// Retry returns a Retryer to be used to control retry logic of a method call.
+	// If Retry is nil or the returned Retryer is nil, the call will not be retried.
+	Retry func() Retryer
+
+	// CallOptions to be forwarded to GRPC.
+	GRPC []grpc.CallOption
+}

+ 39 - 0
vendor/github.com/googleapis/gax-go/v2/gax.go

@@ -0,0 +1,39 @@
+// Copyright 2016, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Package gax contains a set of modules which aid the development of APIs
+// for clients and servers based on gRPC and Google API conventions.
+//
+// Application code will rarely need to use this library directly.
+// However, code generated automatically from API definition files can use it
+// to simplify code generation and to provide more convenient and idiomatic API surfaces.
+package gax
+
+// Version specifies the gax-go version being used.
+const Version = "2.0.3"

+ 53 - 0
vendor/github.com/googleapis/gax-go/v2/header.go

@@ -0,0 +1,53 @@
+// Copyright 2018, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+package gax
+
+import "bytes"
+
+// XGoogHeader is for use by the Google Cloud Libraries only.
+//
+// XGoogHeader formats key-value pairs.
+// The resulting string is suitable for x-goog-api-client header.
+func XGoogHeader(keyval ...string) string {
+	if len(keyval) == 0 {
+		return ""
+	}
+	if len(keyval)%2 != 0 {
+		panic("gax.Header: odd argument count")
+	}
+	var buf bytes.Buffer
+	for i := 0; i < len(keyval); i += 2 {
+		buf.WriteByte(' ')
+		buf.WriteString(keyval[i])
+		buf.WriteByte('/')
+		buf.WriteString(keyval[i+1])
+	}
+	return buf.String()[1:]
+}

+ 99 - 0
vendor/github.com/googleapis/gax-go/v2/invoke.go

@@ -0,0 +1,99 @@
+// Copyright 2016, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+package gax
+
+import (
+	"context"
+	"strings"
+	"time"
+)
+
+// APICall is a user defined call stub.
+type APICall func(context.Context, CallSettings) error
+
+// Invoke calls the given APICall,
+// performing retries as specified by opts, if any.
+func Invoke(ctx context.Context, call APICall, opts ...CallOption) error {
+	var settings CallSettings
+	for _, opt := range opts {
+		opt.Resolve(&settings)
+	}
+	return invoke(ctx, call, settings, Sleep)
+}
+
+// Sleep is similar to time.Sleep, but it can be interrupted by ctx.Done() closing.
+// If interrupted, Sleep returns ctx.Err().
+func Sleep(ctx context.Context, d time.Duration) error {
+	t := time.NewTimer(d)
+	select {
+	case <-ctx.Done():
+		t.Stop()
+		return ctx.Err()
+	case <-t.C:
+		return nil
+	}
+}
+
+type sleeper func(ctx context.Context, d time.Duration) error
+
+// invoke implements Invoke, taking an additional sleeper argument for testing.
+func invoke(ctx context.Context, call APICall, settings CallSettings, sp sleeper) error {
+	var retryer Retryer
+	for {
+		err := call(ctx, settings)
+		if err == nil {
+			return nil
+		}
+		if settings.Retry == nil {
+			return err
+		}
+		// Never retry permanent certificate errors. (e.x. if ca-certificates
+		// are not installed). We should only make very few, targeted
+		// exceptions: many (other) status=Unavailable should be retried, such
+		// as if there's a network hiccup, or the internet goes out for a
+		// minute. This is also why here we are doing string parsing instead of
+		// simply making Unavailable a non-retried code elsewhere.
+		if strings.Contains(err.Error(), "x509: certificate signed by unknown authority") {
+			return err
+		}
+		if retryer == nil {
+			if r := settings.Retry(); r != nil {
+				retryer = r
+			} else {
+				return err
+			}
+		}
+		if d, ok := retryer.Retry(err); !ok {
+			return err
+		} else if err = sp(ctx, d); err != nil {
+			return err
+		}
+	}
+}

+ 1 - 1
vendor/github.com/mat/besticon/LICENSE

@@ -1,6 +1,6 @@
 The MIT License (MIT)
 The MIT License (MIT)
 
 
-Copyright (c) 2015-2018 Matthias Lüdtke, Hamburg - https://github.com/mat
+Copyright (c) 2015-2019 Matthias Lüdtke, Hamburg - https://github.com/mat
 
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 of this software and associated documentation files (the "Software"), to deal

+ 24 - 6
vendor/github.com/newrelic/go-agent/context.go

@@ -5,21 +5,31 @@ package newrelic
 import (
 import (
 	"context"
 	"context"
 	"net/http"
 	"net/http"
-)
-
-type contextKeyType struct{}
 
 
-var contextKey = contextKeyType(struct{}{})
+	"github.com/newrelic/go-agent/internal"
+)
 
 
 // NewContext returns a new Context that carries the provided transcation.
 // NewContext returns a new Context that carries the provided transcation.
 func NewContext(ctx context.Context, txn Transaction) context.Context {
 func NewContext(ctx context.Context, txn Transaction) context.Context {
-	return context.WithValue(ctx, contextKey, txn)
+	return context.WithValue(ctx, internal.TransactionContextKey, txn)
 }
 }
 
 
 // FromContext returns the Transaction from the context if present, and nil
 // FromContext returns the Transaction from the context if present, and nil
 // otherwise.
 // otherwise.
 func FromContext(ctx context.Context) Transaction {
 func FromContext(ctx context.Context) Transaction {
-	h, _ := ctx.Value(contextKey).(Transaction)
+	h, _ := ctx.Value(internal.TransactionContextKey).(Transaction)
+	if nil != h {
+		return h
+	}
+	// If we couldn't find a transaction using
+	// internal.TransactionContextKey, try with
+	// internal.GinTransactionContextKey.  Unfortunately, gin.Context.Set
+	// requires a string key, so we cannot use
+	// internal.TransactionContextKey in nrgin.Middleware.  We check for two
+	// keys (rather than turning internal.TransactionContextKey into a
+	// string key) because context.WithValue will cause golint to complain
+	// if used with a string key.
+	h, _ = ctx.Value(internal.GinTransactionContextKey).(Transaction)
 	return h
 	return h
 }
 }
 
 
@@ -29,3 +39,11 @@ func RequestWithTransactionContext(req *http.Request, txn Transaction) *http.Req
 	ctx = NewContext(ctx, txn)
 	ctx = NewContext(ctx, txn)
 	return req.WithContext(ctx)
 	return req.WithContext(ctx)
 }
 }
+
+func transactionFromRequestContext(req *http.Request) Transaction {
+	var txn Transaction
+	if nil != req {
+		txn = FromContext(req.Context())
+	}
+	return txn
+}

+ 4 - 0
vendor/github.com/newrelic/go-agent/context_stub.go

@@ -8,3 +8,7 @@ import "net/http"
 func RequestWithTransactionContext(req *http.Request, txn Transaction) *http.Request {
 func RequestWithTransactionContext(req *http.Request, txn Transaction) *http.Request {
 	return req
 	return req
 }
 }
+
+func transactionFromRequestContext(req *http.Request) Transaction {
+	return nil
+}

+ 20 - 5
vendor/github.com/newrelic/go-agent/instrumentation.go

@@ -22,7 +22,17 @@ import "net/http"
 //		txn.SetName("other-name")
 //		txn.SetName("other-name")
 //	}
 //	}
 //
 //
+// The Transaction is added to the request's context, so it may be alternatively
+// accessed like this:
+//
+//	// 'req' is the variable name of the *http.Request.
+//	txn := newrelic.FromContext(req.Context())
+//
+// This function is safe to call if 'app' is nil.
 func WrapHandle(app Application, pattern string, handler http.Handler) (string, http.Handler) {
 func WrapHandle(app Application, pattern string, handler http.Handler) (string, http.Handler) {
+	if app == nil {
+		return pattern, handler
+	}
 	return pattern, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 	return pattern, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		txn := app.StartTransaction(pattern, w, r)
 		txn := app.StartTransaction(pattern, w, r)
 		defer txn.End()
 		defer txn.End()
@@ -41,13 +51,18 @@ func WrapHandleFunc(app Application, pattern string, handler func(http.ResponseW
 }
 }
 
 
 // NewRoundTripper creates an http.RoundTripper to instrument external requests.
 // NewRoundTripper creates an http.RoundTripper to instrument external requests.
-// This RoundTripper must be used in same the goroutine as the other uses of the
-// Transaction's SegmentTracer methods.  http.DefaultTransport is used if an
-// http.RoundTripper is not provided.
+// The http.RoundTripper returned will create an external segment before
+// delegating to the original RoundTripper provided (or http.DefaultTransport if
+// none is provided).  If the Transaction parameter is nil, the RoundTripper
+// will look for a Transaction in the request's context (using FromContext).
+// This is STRONGLY recommended because it allows you to reuse the same client
+// for multiple transactions.  Example use:
 //
 //
 //   client := &http.Client{}
 //   client := &http.Client{}
-//   client.Transport = newrelic.NewRoundTripper(txn, nil)
-//   resp, err := client.Get("http://example.com/")
+//   client.Transport = newrelic.NewRoundTripper(nil, client.Transport)
+//   request, _ := http.NewRequest("GET", "http://example.com", nil)
+//   request = newrelic.RequestWithTransactionContext(request, txn)
+//   resp, err := client.Do(request)
 //
 //
 func NewRoundTripper(txn Transaction, original http.RoundTripper) http.RoundTripper {
 func NewRoundTripper(txn Transaction, original http.RoundTripper) http.RoundTripper {
 	return roundTripperFunc(func(request *http.Request) (*http.Response, error) {
 	return roundTripperFunc(func(request *http.Request) (*http.Response, error) {

+ 0 - 2
vendor/github.com/newrelic/go-agent/internal/adaptive_sampler.go

@@ -86,8 +86,6 @@ func (as *adaptiveSampler) ComputeSampled(priority float32, now time.Time) bool
 			return true
 			return true
 		}
 		}
 		return false
 		return false
-	} else if as.currentPeriod.numSampled > as.Target {
-		return false
 	}
 	}
 
 
 	if priority >= as.priorityMin {
 	if priority >= as.priorityMin {

+ 93 - 124
vendor/github.com/newrelic/go-agent/internal/attributes.go

@@ -9,27 +9,50 @@ import (
 	"strings"
 	"strings"
 )
 )
 
 
+// AgentAttributeID uniquely identifies each agent attribute.
+type AgentAttributeID int
+
 // New agent attributes must be added in the following places:
 // New agent attributes must be added in the following places:
 // * Constants here.
 // * Constants here.
 // * Top level attributes.go file.
 // * Top level attributes.go file.
-// * agentAttributes
-// * agentAttributeDests
-// * calculateAgentAttributeDests
-// * writeAgentAttributes
+// * agentAttributeInfo
 const (
 const (
-	responseCode          = "httpResponseCode"
-	requestMethod         = "request.method"
-	requestAccept         = "request.headers.accept"
-	requestContentType    = "request.headers.contentType"
-	requestContentLength  = "request.headers.contentLength"
-	requestHost           = "request.headers.host"
-	responseContentType   = "response.headers.contentType"
-	responseContentLength = "response.headers.contentLength"
-	hostDisplayName       = "host.displayName"
-	requestUserAgent      = "request.headers.User-Agent"
-	requestReferer        = "request.headers.referer"
+	AttributeHostDisplayName AgentAttributeID = iota
+	attributeRequestMethod
+	attributeRequestAcceptHeader
+	attributeRequestContentType
+	attributeRequestContentLength
+	attributeRequestHeadersHost
+	attributeRequestHeadersUserAgent
+	attributeRequestHeadersReferer
+	attributeResponseHeadersContentType
+	attributeResponseHeadersContentLength
+	attributeResponseCode
+)
+
+var (
+	usualDests         = DestAll &^ destBrowser
+	tracesDests        = destTxnTrace | destError
+	agentAttributeInfo = map[AgentAttributeID]struct {
+		name         string
+		defaultDests destinationSet
+	}{
+		AttributeHostDisplayName:              {name: "host.displayName", defaultDests: usualDests},
+		attributeRequestMethod:                {name: "request.method", defaultDests: usualDests},
+		attributeRequestAcceptHeader:          {name: "request.headers.accept", defaultDests: usualDests},
+		attributeRequestContentType:           {name: "request.headers.contentType", defaultDests: usualDests},
+		attributeRequestContentLength:         {name: "request.headers.contentLength", defaultDests: usualDests},
+		attributeRequestHeadersHost:           {name: "request.headers.host", defaultDests: usualDests},
+		attributeRequestHeadersUserAgent:      {name: "request.headers.User-Agent", defaultDests: tracesDests},
+		attributeRequestHeadersReferer:        {name: "request.headers.referer", defaultDests: tracesDests},
+		attributeResponseHeadersContentType:   {name: "response.headers.contentType", defaultDests: usualDests},
+		attributeResponseHeadersContentLength: {name: "response.headers.contentLength", defaultDests: usualDests},
+		attributeResponseCode:                 {name: "httpResponseCode", defaultDests: usualDests},
+	}
 )
 )
 
 
+func (id AgentAttributeID) name() string { return agentAttributeInfo[id].name }
+
 // https://source.datanerd.us/agents/agent-specs/blob/master/Agent-Attributes-PORTED.md
 // https://source.datanerd.us/agents/agent-specs/blob/master/Agent-Attributes-PORTED.md
 
 
 // AttributeDestinationConfig matches newrelic.AttributeDestinationConfig to
 // AttributeDestinationConfig matches newrelic.AttributeDestinationConfig to
@@ -78,7 +101,7 @@ type AttributeConfig struct {
 	// lexicographical order.  Modifiers appearing later have precedence
 	// lexicographical order.  Modifiers appearing later have precedence
 	// over modifiers appearing earlier.
 	// over modifiers appearing earlier.
 	wildcardModifiers []*attributeModifier
 	wildcardModifiers []*attributeModifier
-	agentDests        agentAttributeDests
+	agentDests        map[AgentAttributeID]destinationSet
 }
 }
 
 
 type includeExclude struct {
 type includeExclude struct {
@@ -196,7 +219,10 @@ func CreateAttributeConfig(input AttributeConfigInput, includeEnabled bool) *Att
 
 
 	sort.Sort(byMatch(c.wildcardModifiers))
 	sort.Sort(byMatch(c.wildcardModifiers))
 
 
-	c.agentDests = calculateAgentAttributeDests(c)
+	c.agentDests = make(map[AgentAttributeID]destinationSet)
+	for id, info := range agentAttributeInfo {
+		c.agentDests[id] = applyAttributeConfig(c, info.name, info.defaultDests)
+	}
 
 
 	return c
 	return c
 }
 }
@@ -206,104 +232,37 @@ type userAttribute struct {
 	dests destinationSet
 	dests destinationSet
 }
 }
 
 
-// Attributes are key value pairs attached to the various collected data types.
-type Attributes struct {
-	config *AttributeConfig
-	user   map[string]userAttribute
-	Agent  agentAttributes
-}
-
-type agentAttributes struct {
-	HostDisplayName              string
-	RequestMethod                string
-	RequestAcceptHeader          string
-	RequestContentType           string
-	RequestContentLength         int
-	RequestHeadersHost           string
-	RequestHeadersUserAgent      string
-	RequestHeadersReferer        string
-	ResponseHeadersContentType   string
-	ResponseHeadersContentLength int
-	ResponseCode                 string
-}
-
-type agentAttributeDests struct {
-	HostDisplayName              destinationSet
-	RequestMethod                destinationSet
-	RequestAcceptHeader          destinationSet
-	RequestContentType           destinationSet
-	RequestContentLength         destinationSet
-	RequestHeadersHost           destinationSet
-	RequestHeadersUserAgent      destinationSet
-	RequestHeadersReferer        destinationSet
-	ResponseHeadersContentType   destinationSet
-	ResponseHeadersContentLength destinationSet
-	ResponseCode                 destinationSet
-}
-
-func calculateAgentAttributeDests(c *AttributeConfig) agentAttributeDests {
-	usual := DestAll &^ destBrowser
-	traces := destTxnTrace | destError
-	return agentAttributeDests{
-		HostDisplayName:              applyAttributeConfig(c, hostDisplayName, usual),
-		RequestMethod:                applyAttributeConfig(c, requestMethod, usual),
-		RequestAcceptHeader:          applyAttributeConfig(c, requestAccept, usual),
-		RequestContentType:           applyAttributeConfig(c, requestContentType, usual),
-		RequestContentLength:         applyAttributeConfig(c, requestContentLength, usual),
-		RequestHeadersHost:           applyAttributeConfig(c, requestHost, usual),
-		RequestHeadersUserAgent:      applyAttributeConfig(c, requestUserAgent, traces),
-		RequestHeadersReferer:        applyAttributeConfig(c, requestReferer, traces),
-		ResponseHeadersContentType:   applyAttributeConfig(c, responseContentType, usual),
-		ResponseHeadersContentLength: applyAttributeConfig(c, responseContentLength, usual),
-		ResponseCode:                 applyAttributeConfig(c, responseCode, usual),
-	}
-}
-
-type agentAttributeWriter struct {
-	jsonFieldsWriter
-	d destinationSet
+type agentAttributeValue struct {
+	stringVal string
+	otherVal  interface{}
 }
 }
 
 
-func (w *agentAttributeWriter) writeString(name string, val string, d destinationSet) {
-	if "" != val && 0 != w.d&d {
-		w.stringField(name, truncateStringValueIfLong(val))
-	}
-}
+type agentAttributes map[AgentAttributeID]agentAttributeValue
 
 
-func (w *agentAttributeWriter) writeInt(name string, val int, d destinationSet) {
-	if val >= 0 && 0 != w.d&d {
-		w.intField(name, int64(val))
+// Add is used to add agent attributes.  Only one of stringVal and otherVal
+// should be populated.  Since most agent attribute values are strings,
+// stringVal exists to avoid allocations.
+func (attr agentAttributes) Add(id AgentAttributeID, stringVal string, otherVal interface{}) {
+	if "" != stringVal || otherVal != nil {
+		attr[id] = agentAttributeValue{
+			stringVal: truncateStringValueIfLong(stringVal),
+			otherVal:  otherVal,
+		}
 	}
 	}
 }
 }
 
 
-func writeAgentAttributes(buf *bytes.Buffer, d destinationSet, values agentAttributes, dests agentAttributeDests) {
-	w := &agentAttributeWriter{
-		jsonFieldsWriter: jsonFieldsWriter{buf: buf},
-		d:                d,
-	}
-	buf.WriteByte('{')
-	w.writeString(hostDisplayName, values.HostDisplayName, dests.HostDisplayName)
-	w.writeString(requestMethod, values.RequestMethod, dests.RequestMethod)
-	w.writeString(requestAccept, values.RequestAcceptHeader, dests.RequestAcceptHeader)
-	w.writeString(requestContentType, values.RequestContentType, dests.RequestContentType)
-	w.writeInt(requestContentLength, values.RequestContentLength, dests.RequestContentLength)
-	w.writeString(requestHost, values.RequestHeadersHost, dests.RequestHeadersHost)
-	w.writeString(requestUserAgent, values.RequestHeadersUserAgent, dests.RequestHeadersUserAgent)
-	w.writeString(requestReferer, values.RequestHeadersReferer, dests.RequestHeadersReferer)
-	w.writeString(responseContentType, values.ResponseHeadersContentType, dests.ResponseHeadersContentType)
-	w.writeInt(responseContentLength, values.ResponseHeadersContentLength, dests.ResponseHeadersContentLength)
-	w.writeString(responseCode, values.ResponseCode, dests.ResponseCode)
-	buf.WriteByte('}')
+// Attributes are key value pairs attached to the various collected data types.
+type Attributes struct {
+	config *AttributeConfig
+	user   map[string]userAttribute
+	Agent  agentAttributes
 }
 }
 
 
 // NewAttributes creates a new Attributes.
 // NewAttributes creates a new Attributes.
 func NewAttributes(config *AttributeConfig) *Attributes {
 func NewAttributes(config *AttributeConfig) *Attributes {
 	return &Attributes{
 	return &Attributes{
 		config: config,
 		config: config,
-		Agent: agentAttributes{
-			RequestContentLength:         -1,
-			ResponseHeadersContentLength: -1,
-		},
+		Agent:  make(agentAttributes),
 	}
 	}
 }
 }
 
 
@@ -438,7 +397,19 @@ func agentAttributesJSON(a *Attributes, buf *bytes.Buffer, d destinationSet) {
 		buf.WriteString("{}")
 		buf.WriteString("{}")
 		return
 		return
 	}
 	}
-	writeAgentAttributes(buf, d, a.Agent, a.config.agentDests)
+	w := jsonFieldsWriter{buf: buf}
+	buf.WriteByte('{')
+	for id, val := range a.Agent {
+		if 0 != a.config.agentDests[id]&d {
+			if val.stringVal != "" {
+				w.stringField(id.name(), val.stringVal)
+			} else {
+				writeAttributeValueJSON(&w, id.name(), val.otherVal)
+			}
+		}
+	}
+	buf.WriteByte('}')
+
 }
 }
 
 
 func userAttributesJSON(a *Attributes, buf *bytes.Buffer, d destinationSet, extraAttributes map[string]interface{}) {
 func userAttributesJSON(a *Attributes, buf *bytes.Buffer, d destinationSet, extraAttributes map[string]interface{}) {
@@ -472,23 +443,21 @@ func userAttributesStringJSON(a *Attributes, d destinationSet, extraAttributes m
 }
 }
 
 
 // RequestAgentAttributes gathers agent attributes out of the request.
 // RequestAgentAttributes gathers agent attributes out of the request.
-func RequestAgentAttributes(a *Attributes, r *http.Request) {
-	a.Agent.RequestMethod = r.Method
+func RequestAgentAttributes(a *Attributes, method string, h http.Header) {
+	a.Agent.Add(attributeRequestMethod, method, nil)
 
 
-	h := r.Header
 	if nil == h {
 	if nil == h {
 		return
 		return
 	}
 	}
-	a.Agent.RequestAcceptHeader = h.Get("Accept")
-	a.Agent.RequestContentType = h.Get("Content-Type")
-	a.Agent.RequestHeadersHost = h.Get("Host")
-	a.Agent.RequestHeadersUserAgent = h.Get("User-Agent")
-	a.Agent.RequestHeadersReferer = SafeURLFromString(h.Get("Referer"))
+	a.Agent.Add(attributeRequestAcceptHeader, h.Get("Accept"), nil)
+	a.Agent.Add(attributeRequestContentType, h.Get("Content-Type"), nil)
+	a.Agent.Add(attributeRequestHeadersHost, h.Get("Host"), nil)
+	a.Agent.Add(attributeRequestHeadersUserAgent, h.Get("User-Agent"), nil)
+	a.Agent.Add(attributeRequestHeadersReferer, SafeURLFromString(h.Get("Referer")), nil)
 
 
-	// Per NewAttributes(), the default for this field is -1 (which is also what
-	// GetContentLengthFromHeader() returns if no content length is found), so we
-	// can just use the return value unconditionally.
-	a.Agent.RequestContentLength = int(GetContentLengthFromHeader(h))
+	if l := GetContentLengthFromHeader(h); l >= 0 {
+		a.Agent.Add(attributeRequestContentLength, "", l)
+	}
 }
 }
 
 
 // ResponseHeaderAttributes gather agent attributes from the response headers.
 // ResponseHeaderAttributes gather agent attributes from the response headers.
@@ -496,12 +465,11 @@ func ResponseHeaderAttributes(a *Attributes, h http.Header) {
 	if nil == h {
 	if nil == h {
 		return
 		return
 	}
 	}
-	a.Agent.ResponseHeadersContentType = h.Get("Content-Type")
+	a.Agent.Add(attributeResponseHeadersContentType, h.Get("Content-Type"), nil)
 
 
-	// Per NewAttributes(), the default for this field is -1 (which is also what
-	// GetContentLengthFromHeader() returns if no content length is found), so we
-	// can just use the return value unconditionally.
-	a.Agent.ResponseHeadersContentLength = int(GetContentLengthFromHeader(h))
+	if l := GetContentLengthFromHeader(h); l >= 0 {
+		a.Agent.Add(attributeResponseHeadersContentLength, "", l)
+	}
 }
 }
 
 
 var (
 var (
@@ -520,8 +488,9 @@ var (
 
 
 // ResponseCodeAttribute sets the response code agent attribute.
 // ResponseCodeAttribute sets the response code agent attribute.
 func ResponseCodeAttribute(a *Attributes, code int) {
 func ResponseCodeAttribute(a *Attributes, code int) {
-	a.Agent.ResponseCode = statusCodeLookup[code]
-	if a.Agent.ResponseCode == "" {
-		a.Agent.ResponseCode = strconv.Itoa(code)
+	rc := statusCodeLookup[code]
+	if rc == "" {
+		rc = strconv.Itoa(code)
 	}
 	}
+	a.Agent.Add(attributeResponseCode, rc, nil)
 }
 }

+ 124 - 160
vendor/github.com/newrelic/go-agent/internal/collector.go

@@ -15,7 +15,7 @@ import (
 )
 )
 
 
 const (
 const (
-	procotolVersion = "16"
+	procotolVersion = "17"
 	userAgentPrefix = "NewRelic-Go-Agent/"
 	userAgentPrefix = "NewRelic-Go-Agent/"
 
 
 	// Methods used in collector communication.
 	// Methods used in collector communication.
@@ -31,23 +31,13 @@ const (
 	cmdSpanEvents   = "span_event_data"
 	cmdSpanEvents   = "span_event_data"
 )
 )
 
 
-var (
-	// ErrPayloadTooLarge is created in response to receiving a 413 response
-	// code.
-	ErrPayloadTooLarge = errors.New("payload too large")
-	// ErrUnauthorized is created in response to receiving a 401 response code.
-	ErrUnauthorized = errors.New("unauthorized")
-	// ErrUnsupportedMedia is created in response to receiving a 415
-	// response code.
-	ErrUnsupportedMedia = errors.New("unsupported media")
-)
-
 // RpmCmd contains fields specific to an individual call made to RPM.
 // RpmCmd contains fields specific to an individual call made to RPM.
 type RpmCmd struct {
 type RpmCmd struct {
-	Name      string
-	Collector string
-	RunID     string
-	Data      []byte
+	Name              string
+	Collector         string
+	RunID             string
+	Data              []byte
+	RequestHeadersMap map[string]string
 }
 }
 
 
 // RpmControls contains fields which will be the same for all calls made
 // RpmControls contains fields which will be the same for all calls made
@@ -59,6 +49,59 @@ type RpmControls struct {
 	AgentVersion string
 	AgentVersion string
 }
 }
 
 
+// RPMResponse contains a NR endpoint response.
+//
+// Agent Behavior Summary:
+//
+// on connect/preconnect:
+//     410 means shutdown
+//     200, 202 mean success (start run)
+//     all other response codes and errors mean try after backoff
+//
+// on harvest:
+//     410 means shutdown
+//     401, 409 mean restart run
+//     408, 429, 500, 503 mean save data for next harvest
+//     all other response codes and errors discard the data and continue the current harvest
+type RPMResponse struct {
+	statusCode int
+	body       []byte
+	// Err indicates whether or not the call was successful: newRPMResponse
+	// should be used to avoid mismatch between statusCode and Err.
+	Err                      error
+	disconnectSecurityPolicy bool
+}
+
+func newRPMResponse(statusCode int) RPMResponse {
+	var err error
+	if statusCode != 200 && statusCode != 202 {
+		err = fmt.Errorf("response code: %d", statusCode)
+	}
+	return RPMResponse{statusCode: statusCode, Err: err}
+}
+
+// IsDisconnect indicates that the agent should disconnect.
+func (resp RPMResponse) IsDisconnect() bool {
+	return resp.statusCode == 410 || resp.disconnectSecurityPolicy
+}
+
+// IsRestartException indicates that the agent should restart.
+func (resp RPMResponse) IsRestartException() bool {
+	return resp.statusCode == 401 ||
+		resp.statusCode == 409
+}
+
+// ShouldSaveHarvestData indicates that the agent should save the data and try
+// to send it in the next harvest.
+func (resp RPMResponse) ShouldSaveHarvestData() bool {
+	switch resp.statusCode {
+	case 408, 429, 500, 503:
+		return true
+	default:
+		return false
+	}
+}
+
 func rpmURL(cmd RpmCmd, cs RpmControls) string {
 func rpmURL(cmd RpmCmd, cs RpmControls) string {
 	var u url.URL
 	var u url.URL
 
 
@@ -80,66 +123,50 @@ func rpmURL(cmd RpmCmd, cs RpmControls) string {
 	return u.String()
 	return u.String()
 }
 }
 
 
-type unexpectedStatusCodeErr struct {
-	code int
-}
-
-func (e unexpectedStatusCodeErr) Error() string {
-	return fmt.Sprintf("unexpected HTTP status code: %d", e.code)
-}
-
-func collectorRequestInternal(url string, data []byte, cs RpmControls) ([]byte, error) {
-	deflated, err := compress(data)
+func collectorRequestInternal(url string, cmd RpmCmd, cs RpmControls) RPMResponse {
+	deflated, err := compress(cmd.Data)
 	if nil != err {
 	if nil != err {
-		return nil, err
+		return RPMResponse{Err: err}
 	}
 	}
 
 
 	req, err := http.NewRequest("POST", url, deflated)
 	req, err := http.NewRequest("POST", url, deflated)
 	if nil != err {
 	if nil != err {
-		return nil, err
+		return RPMResponse{Err: err}
 	}
 	}
 
 
 	req.Header.Add("Accept-Encoding", "identity, deflate")
 	req.Header.Add("Accept-Encoding", "identity, deflate")
 	req.Header.Add("Content-Type", "application/octet-stream")
 	req.Header.Add("Content-Type", "application/octet-stream")
 	req.Header.Add("User-Agent", userAgentPrefix+cs.AgentVersion)
 	req.Header.Add("User-Agent", userAgentPrefix+cs.AgentVersion)
 	req.Header.Add("Content-Encoding", "deflate")
 	req.Header.Add("Content-Encoding", "deflate")
+	for k, v := range cmd.RequestHeadersMap {
+		req.Header.Add(k, v)
+	}
 
 
 	resp, err := cs.Client.Do(req)
 	resp, err := cs.Client.Do(req)
 	if err != nil {
 	if err != nil {
-		return nil, err
+		return RPMResponse{Err: err}
 	}
 	}
 
 
 	defer resp.Body.Close()
 	defer resp.Body.Close()
 
 
-	switch resp.StatusCode {
-	case 200:
-		// Nothing to do.
-	case 401:
-		return nil, ErrUnauthorized
-	case 413:
-		return nil, ErrPayloadTooLarge
-	case 415:
-		return nil, ErrUnsupportedMedia
-	default:
-		// If the response code is not 200, then the collector may not return
-		// valid JSON.
-		return nil, unexpectedStatusCodeErr{code: resp.StatusCode}
-	}
+	r := newRPMResponse(resp.StatusCode)
 
 
 	// Read the entire response, rather than using resp.Body as input to json.NewDecoder to
 	// Read the entire response, rather than using resp.Body as input to json.NewDecoder to
 	// avoid the issue described here:
 	// avoid the issue described here:
 	// https://github.com/google/go-github/pull/317
 	// https://github.com/google/go-github/pull/317
 	// https://ahmetalpbalkan.com/blog/golang-json-decoder-pitfalls/
 	// https://ahmetalpbalkan.com/blog/golang-json-decoder-pitfalls/
 	// Also, collector JSON responses are expected to be quite small.
 	// Also, collector JSON responses are expected to be quite small.
-	b, err := ioutil.ReadAll(resp.Body)
-	if nil != err {
-		return nil, err
+	body, err := ioutil.ReadAll(resp.Body)
+	if nil == r.Err {
+		r.Err = err
 	}
 	}
-	return parseResponse(b)
+	r.body = body
+
+	return r
 }
 }
 
 
 // CollectorRequest makes a request to New Relic.
 // CollectorRequest makes a request to New Relic.
-func CollectorRequest(cmd RpmCmd, cs RpmControls) ([]byte, error) {
+func CollectorRequest(cmd RpmCmd, cs RpmControls) RPMResponse {
 	url := rpmURL(cmd, cs)
 	url := rpmURL(cmd, cs)
 
 
 	if cs.Logger.DebugEnabled() {
 	if cs.Logger.DebugEnabled() {
@@ -150,89 +177,26 @@ func CollectorRequest(cmd RpmCmd, cs RpmControls) ([]byte, error) {
 		})
 		})
 	}
 	}
 
 
-	resp, err := collectorRequestInternal(url, cmd.Data, cs)
-	if err != nil {
-		cs.Logger.Debug("rpm failure", map[string]interface{}{
-			"command": cmd.Name,
-			"url":     url,
-			"error":   err.Error(),
-		})
-	}
+	resp := collectorRequestInternal(url, cmd, cs)
 
 
 	if cs.Logger.DebugEnabled() {
 	if cs.Logger.DebugEnabled() {
-		cs.Logger.Debug("rpm response", map[string]interface{}{
-			"command":  cmd.Name,
-			"url":      url,
-			"response": JSONString(resp),
-		})
-	}
-
-	return resp, err
-}
-
-type rpmException struct {
-	Message   string `json:"message"`
-	ErrorType string `json:"error_type"`
-}
-
-func (e *rpmException) Error() string {
-	return fmt.Sprintf("%s: %s", e.ErrorType, e.Message)
-}
-
-func hasType(e error, expected string) bool {
-	rpmErr, ok := e.(*rpmException)
-	if !ok {
-		return false
-	}
-	return rpmErr.ErrorType == expected
-
-}
-
-const (
-	forceRestartType   = "NewRelic::Agent::ForceRestartException"
-	disconnectType     = "NewRelic::Agent::ForceDisconnectException"
-	licenseInvalidType = "NewRelic::Agent::LicenseException"
-	runtimeType        = "RuntimeError"
-)
-
-// IsRestartException indicates if the error was a restart exception.
-func IsRestartException(e error) bool { return hasType(e, forceRestartType) }
-
-// IsLicenseException indicates if the error was an invalid exception.
-func IsLicenseException(e error) bool { return hasType(e, licenseInvalidType) }
-
-// IsRuntime indicates if the error was a runtime exception.
-func IsRuntime(e error) bool { return hasType(e, runtimeType) }
-
-// IsDisconnect indicates if the error was a disconnect exception.
-func IsDisconnect(e error) bool {
-	// Unrecognized or missing security policies should be treated as
-	// disconnects.
-	if _, ok := e.(errUnknownRequiredPolicy); ok {
-		return true
-	}
-	if _, ok := e.(errUnsetPolicy); ok {
-		return true
-	}
-	return hasType(e, disconnectType)
-}
-
-func parseResponse(b []byte) ([]byte, error) {
-	var r struct {
-		ReturnValue json.RawMessage `json:"return_value"`
-		Exception   *rpmException   `json:"exception"`
-	}
-
-	err := json.Unmarshal(b, &r)
-	if nil != err {
-		return nil, err
-	}
-
-	if nil != r.Exception {
-		return nil, r.Exception
+		if err := resp.Err; err != nil {
+			cs.Logger.Debug("rpm failure", map[string]interface{}{
+				"command":  cmd.Name,
+				"url":      url,
+				"response": string(resp.body), // Body might not be JSON on failure.
+				"error":    err.Error(),
+			})
+		} else {
+			cs.Logger.Debug("rpm response", map[string]interface{}{
+				"command":  cmd.Name,
+				"url":      url,
+				"response": JSONString(resp.body),
+			})
+		}
 	}
 	}
 
 
-	return r.ReturnValue, nil
+	return resp
 }
 }
 
 
 const (
 const (
@@ -269,12 +233,12 @@ type preconnectRequest struct {
 }
 }
 
 
 // ConnectAttempt tries to connect an application.
 // ConnectAttempt tries to connect an application.
-func ConnectAttempt(config ConnectJSONCreator, securityPoliciesToken string, cs RpmControls) (*ConnectReply, error) {
+func ConnectAttempt(config ConnectJSONCreator, securityPoliciesToken string, cs RpmControls) (*ConnectReply, RPMResponse) {
 	preconnectData, err := json.Marshal([]preconnectRequest{
 	preconnectData, err := json.Marshal([]preconnectRequest{
-		preconnectRequest{SecurityPoliciesToken: securityPoliciesToken},
+		{SecurityPoliciesToken: securityPoliciesToken},
 	})
 	})
 	if nil != err {
 	if nil != err {
-		return nil, fmt.Errorf("unable to marshal preconnect data: %v", err)
+		return nil, RPMResponse{Err: fmt.Errorf("unable to marshal preconnect data: %v", err)}
 	}
 	}
 
 
 	call := RpmCmd{
 	call := RpmCmd{
@@ -283,57 +247,57 @@ func ConnectAttempt(config ConnectJSONCreator, securityPoliciesToken string, cs
 		Data:      preconnectData,
 		Data:      preconnectData,
 	}
 	}
 
 
-	out, err := CollectorRequest(call, cs)
-	if nil != err {
-		// err is intentionally unmodified:  We do not want to change
-		// the type of these collector errors.
-		return nil, err
+	resp := CollectorRequest(call, cs)
+	if nil != resp.Err {
+		return nil, resp
 	}
 	}
 
 
-	var preconnect PreconnectReply
-	err = json.Unmarshal(out, &preconnect)
+	var preconnect struct {
+		Preconnect PreconnectReply `json:"return_value"`
+	}
+	err = json.Unmarshal(resp.body, &preconnect)
 	if nil != err {
 	if nil != err {
-		// Unknown policies detected during unmarshal should produce a
-		// disconnect.
-		if IsDisconnect(err) {
-			return nil, err
+		// Certain security policy errors must be treated as a disconnect.
+		return nil, RPMResponse{
+			Err:                      fmt.Errorf("unable to process preconnect reply: %v", err),
+			disconnectSecurityPolicy: isDisconnectSecurityPolicyError(err),
 		}
 		}
-		return nil, fmt.Errorf("unable to parse preconnect reply: %v", err)
 	}
 	}
 
 
-	js, err := config.CreateConnectJSON(preconnect.SecurityPolicies.PointerIfPopulated())
+	js, err := config.CreateConnectJSON(preconnect.Preconnect.SecurityPolicies.PointerIfPopulated())
 	if nil != err {
 	if nil != err {
-		return nil, fmt.Errorf("unable to create connect data: %v", err)
+		return nil, RPMResponse{Err: fmt.Errorf("unable to create connect data: %v", err)}
 	}
 	}
 
 
-	call.Collector = preconnect.Collector
+	call.Collector = preconnect.Preconnect.Collector
 	call.Data = js
 	call.Data = js
 	call.Name = cmdConnect
 	call.Name = cmdConnect
 
 
-	rawReply, err := CollectorRequest(call, cs)
-	if nil != err {
-		// err is intentionally unmodified:  We do not want to change
-		// the type of these collector errors.
-		return nil, err
+	resp = CollectorRequest(call, cs)
+	if nil != resp.Err {
+		return nil, resp
 	}
 	}
 
 
-	reply := ConnectReplyDefaults()
-	err = json.Unmarshal(rawReply, reply)
+	var reply struct {
+		Reply *ConnectReply `json:"return_value"`
+	}
+	reply.Reply = ConnectReplyDefaults()
+	err = json.Unmarshal(resp.body, &reply)
 	if nil != err {
 	if nil != err {
-		return nil, fmt.Errorf("unable to parse connect reply: %v", err)
+		return nil, RPMResponse{Err: fmt.Errorf("unable to parse connect reply: %v", err)}
 	}
 	}
 	// Note:  This should never happen.  It would mean the collector
 	// Note:  This should never happen.  It would mean the collector
 	// response is malformed.  This exists merely as extra defensiveness.
 	// response is malformed.  This exists merely as extra defensiveness.
-	if "" == reply.RunID {
-		return nil, errors.New("connect reply missing agent run id")
+	if "" == reply.Reply.RunID {
+		return nil, RPMResponse{Err: errors.New("connect reply missing agent run id")}
 	}
 	}
 
 
-	reply.PreconnectReply = preconnect
+	reply.Reply.PreconnectReply = preconnect.Preconnect
 
 
-	reply.AdaptiveSampler = newAdaptiveSampler(adaptiveSamplerInput{
-		Period: time.Duration(reply.SamplingTargetPeriodInSeconds) * time.Second,
-		Target: reply.SamplingTarget,
+	reply.Reply.AdaptiveSampler = newAdaptiveSampler(adaptiveSamplerInput{
+		Period: time.Duration(reply.Reply.SamplingTargetPeriodInSeconds) * time.Second,
+		Target: reply.Reply.SamplingTarget,
 	}, time.Now())
 	}, time.Now())
 
 
-	return reply, nil
+	return reply.Reply, resp
 }
 }

+ 4 - 1
vendor/github.com/newrelic/go-agent/internal/connect_reply.go

@@ -22,7 +22,8 @@ type PreconnectReply struct {
 // ConnectReply contains all of the settings and state send down from the
 // ConnectReply contains all of the settings and state send down from the
 // collector.  It should not be modified after creation.
 // collector.  It should not be modified after creation.
 type ConnectReply struct {
 type ConnectReply struct {
-	RunID AgentRunID `json:"agent_run_id"`
+	RunID             AgentRunID        `json:"agent_run_id"`
+	RequestHeadersMap map[string]string `json:"request_headers_map"`
 
 
 	// Transaction Name Modifiers
 	// Transaction Name Modifiers
 	SegmentTerms segmentRules `json:"transaction_segment_terms"`
 	SegmentTerms segmentRules `json:"transaction_segment_terms"`
@@ -43,6 +44,7 @@ type ConnectReply struct {
 	CollectTraces          bool               `json:"collect_traces"`
 	CollectTraces          bool               `json:"collect_traces"`
 	CollectErrors          bool               `json:"collect_errors"`
 	CollectErrors          bool               `json:"collect_errors"`
 	CollectErrorEvents     bool               `json:"collect_error_events"`
 	CollectErrorEvents     bool               `json:"collect_error_events"`
+	CollectSpanEvents      bool               `json:"collect_span_events"`
 
 
 	// RUM
 	// RUM
 	AgentLoader string `json:"js_agent_loader"`
 	AgentLoader string `json:"js_agent_loader"`
@@ -103,6 +105,7 @@ func ConnectReplyDefaults() *ConnectReply {
 		CollectTraces:          true,
 		CollectTraces:          true,
 		CollectErrors:          true,
 		CollectErrors:          true,
 		CollectErrorEvents:     true,
 		CollectErrorEvents:     true,
+		CollectSpanEvents:      true,
 		// No transactions should be sampled before the application is
 		// No transactions should be sampled before the application is
 		// connected.
 		// connected.
 		AdaptiveSampler: SampleNothing{},
 		AdaptiveSampler: SampleNothing{},

+ 17 - 0
vendor/github.com/newrelic/go-agent/internal/context.go

@@ -0,0 +1,17 @@
+package internal
+
+type contextKeyType struct{}
+
+var (
+	// TransactionContextKey is the key used for newrelic.FromContext and
+	// newrelic.NewContext.
+	TransactionContextKey = contextKeyType(struct{}{})
+
+	// GinTransactionContextKey is used as the context key in
+	// nrgin.Middleware and nrgin.Transaction.  Unfortunately, Gin requires
+	// a string context key. We use two different context keys (and check
+	// both in nrgin.Transaction and newrelic.FromContext) rather than use a
+	// single string key because context.WithValue will fail golint if used
+	// with a string key.
+	GinTransactionContextKey = "newRelicTransaction"
+)

+ 3 - 10
vendor/github.com/newrelic/go-agent/internal/cross_process_http.go

@@ -6,16 +6,9 @@ import (
 	"github.com/newrelic/go-agent/internal/cat"
 	"github.com/newrelic/go-agent/internal/cat"
 )
 )
 
 
-// InitFromHTTPRequest initialises the TxnCrossProcess from the given request.
-// This is a convenience method to keep newTxn() as clean as possible, and to
-// support unit tests.
-func (txp *TxnCrossProcess) InitFromHTTPRequest(enabled bool, dt bool, reply *ConnectReply, req *http.Request) error {
-	metadata := CrossProcessMetadata{}
-	if req != nil {
-		metadata = HTTPHeaderToMetadata(req.Header)
-	}
-
-	return txp.Init(enabled, dt, reply, metadata)
+// InboundHTTPRequest adds the inbound request metadata to the TxnCrossProcess.
+func (txp *TxnCrossProcess) InboundHTTPRequest(hdr http.Header) error {
+	return txp.handleInboundRequestHeaders(HTTPHeaderToMetadata(hdr))
 }
 }
 
 
 // AppDataToHTTPHeader encapsulates the given appData value in the correct HTTP
 // AppDataToHTTPHeader encapsulates the given appData value in the correct HTTP

+ 0 - 8
vendor/github.com/newrelic/go-agent/internal/distributed_tracing.go

@@ -139,14 +139,6 @@ func (e ErrPayloadMissingField) Error() string {
 	return fmt.Sprintf("payload is missing required fields: %s", e.message)
 	return fmt.Sprintf("payload is missing required fields: %s", e.message)
 }
 }
 
 
-// ErrTrustedAccountKey indicates we don't trust the account, per the
-// new trusted_account_key routine.
-type ErrTrustedAccountKey struct{ Message string }
-
-func (e ErrTrustedAccountKey) Error() string {
-	return fmt.Sprintf("trusted account key error: %s", e.Message)
-}
-
 // ErrUnsupportedPayloadVersion indicates that the major version number is
 // ErrUnsupportedPayloadVersion indicates that the major version number is
 // unknown.
 // unknown.
 type ErrUnsupportedPayloadVersion struct{ version int }
 type ErrUnsupportedPayloadVersion struct{ version int }

+ 17 - 2
vendor/github.com/newrelic/go-agent/internal/expect.go

@@ -102,6 +102,21 @@ type WantSlowQuery struct {
 	Params       map[string]interface{}
 	Params       map[string]interface{}
 }
 }
 
 
+// HarvestTestinger is implemented by the app.  It sets an empty test harvest
+// and modifies the connect reply if a callback is provided.
+type HarvestTestinger interface {
+	HarvestTesting(replyfn func(*ConnectReply))
+}
+
+// HarvestTesting allows integration packages to test instrumentation.
+func HarvestTesting(app interface{}, replyfn func(*ConnectReply)) {
+	ta, ok := app.(HarvestTestinger)
+	if !ok {
+		panic("HarvestTesting type assertion failure")
+	}
+	ta.HarvestTesting(replyfn)
+}
+
 // Expect exposes methods that allow for testing whether the correct data was
 // Expect exposes methods that allow for testing whether the correct data was
 // captured.
 // captured.
 type Expect interface {
 type Expect interface {
@@ -450,7 +465,7 @@ func ExpectSpanEventsAbsent(v Validator, events *spanEvents, names []string) {
 // ExpectSpanEvents allows testing of span events.  It passes if events exactly matches expect.
 // ExpectSpanEvents allows testing of span events.  It passes if events exactly matches expect.
 func ExpectSpanEvents(v Validator, events *spanEvents, expect []WantEvent) {
 func ExpectSpanEvents(v Validator, events *spanEvents, expect []WantEvent) {
 	if len(events.events.events) != len(expect) {
 	if len(events.events.events) != len(expect) {
-		v.Error("number of txn events does not match",
+		v.Error("number of span events does not match",
 			len(events.events.events), len(expect))
 			len(events.events.events), len(expect))
 		return
 		return
 	}
 	}
@@ -463,7 +478,7 @@ func ExpectSpanEvents(v Validator, events *spanEvents, expect []WantEvent) {
 				e.Intrinsics = mergeAttributes(map[string]interface{}{
 				e.Intrinsics = mergeAttributes(map[string]interface{}{
 					// The following intrinsics should always be present in
 					// The following intrinsics should always be present in
 					// span events:
 					// span events:
-					"type":      "Transaction",
+					"type":      "Span",
 					"timestamp": MatchAnything,
 					"timestamp": MatchAnything,
 					"duration":  MatchAnything,
 					"duration":  MatchAnything,
 				}, e.Intrinsics)
 				}, e.Intrinsics)

+ 6 - 3
vendor/github.com/newrelic/go-agent/internal/limits.go

@@ -5,9 +5,12 @@ import "time"
 const (
 const (
 	// app behavior
 	// app behavior
 
 
-	// ConnectBackoff is the wait time between unsuccessful connect
-	// attempts.
-	ConnectBackoff = 20 * time.Second
+	// ConnectBackoffStart is the initial backoff time between unsuccessful connect
+	// attempts.  It is doubled until the ConnectBackoffLimit is reached.
+	// https://source.datanerd.us/agents/agent-specs/blob/master/Collector-Response-Handling.md#retries-and-backoffs
+	ConnectBackoffStart = 15 * time.Second
+	// ConnectBackoffLimit is the largest connect backoff possible.
+	ConnectBackoffLimit = 240 * time.Second
 	// HarvestPeriod is the period that collected data is sent to New Relic.
 	// HarvestPeriod is the period that collected data is sent to New Relic.
 	HarvestPeriod = 60 * time.Second
 	HarvestPeriod = 60 * time.Second
 	// CollectorTimeout is the timeout used in the client for communication
 	// CollectorTimeout is the timeout used in the client for communication

+ 7 - 3
vendor/github.com/newrelic/go-agent/internal/logger/logger.go

@@ -19,7 +19,11 @@ type Logger interface {
 }
 }
 
 
 // ShimLogger implements Logger and does nothing.
 // ShimLogger implements Logger and does nothing.
-type ShimLogger struct{}
+type ShimLogger struct {
+	// IsDebugEnabled is useful as it allows DebugEnabled code paths to be
+	// tested.
+	IsDebugEnabled bool
+}
 
 
 // Error allows ShimLogger to implement Logger.
 // Error allows ShimLogger to implement Logger.
 func (s ShimLogger) Error(string, map[string]interface{}) {}
 func (s ShimLogger) Error(string, map[string]interface{}) {}
@@ -34,7 +38,7 @@ func (s ShimLogger) Info(string, map[string]interface{}) {}
 func (s ShimLogger) Debug(string, map[string]interface{}) {}
 func (s ShimLogger) Debug(string, map[string]interface{}) {}
 
 
 // DebugEnabled allows ShimLogger to implement Logger.
 // DebugEnabled allows ShimLogger to implement Logger.
-func (s ShimLogger) DebugEnabled() bool { return false }
+func (s ShimLogger) DebugEnabled() bool { return s.IsDebugEnabled }
 
 
 type logFile struct {
 type logFile struct {
 	l       *log.Logger
 	l       *log.Logger
@@ -66,7 +70,7 @@ func (f *logFile) fire(level, msg string, ctx map[string]interface{}) {
 		ctx,
 		ctx,
 	})
 	})
 	if nil == err {
 	if nil == err {
-		f.l.Printf(string(js))
+		f.l.Print(string(js))
 	} else {
 	} else {
 		f.l.Printf("unable to marshal log entry: %v", err)
 		f.l.Printf("unable to marshal log entry: %v", err)
 	}
 	}

+ 10 - 0
vendor/github.com/newrelic/go-agent/internal/security_policies.go

@@ -99,3 +99,13 @@ type errUnsetPolicy struct{ name string }
 func (err errUnsetPolicy) Error() string {
 func (err errUnsetPolicy) Error() string {
 	return fmt.Sprintf("policy '%s' not received, please contact support", err.name)
 	return fmt.Sprintf("policy '%s' not received, please contact support", err.name)
 }
 }
+
+func isDisconnectSecurityPolicyError(e error) bool {
+	if _, ok := e.(errUnknownRequiredPolicy); ok {
+		return true
+	}
+	if _, ok := e.(errUnsetPolicy); ok {
+		return true
+	}
+	return false
+}

+ 1 - 1
vendor/github.com/newrelic/go-agent/internal/span_events.go

@@ -15,7 +15,7 @@ const (
 	spanCategoryGeneric                = "generic"
 	spanCategoryGeneric                = "generic"
 )
 )
 
 
-// SpanEvent represents a span event, neccessary to support Distributed Tracing.
+// SpanEvent represents a span event, necessary to support Distributed Tracing.
 type SpanEvent struct {
 type SpanEvent struct {
 	TraceID         string
 	TraceID         string
 	GUID            string
 	GUID            string

+ 1 - 1
vendor/github.com/newrelic/go-agent/internal/tracing.go

@@ -333,7 +333,7 @@ func EndExternalSegment(t *TxnData, start SegmentStartTime, now time.Time, u *ur
 	}
 	}
 
 
 	key := externalMetricKey{
 	key := externalMetricKey{
-		Host: host,
+		Host:                    host,
 		ExternalCrossProcessID:  crossProcessID,
 		ExternalCrossProcessID:  crossProcessID,
 		ExternalTransactionName: transactionName,
 		ExternalTransactionName: transactionName,
 	}
 	}

+ 2 - 4
vendor/github.com/newrelic/go-agent/internal/txn_cross_process.go

@@ -65,15 +65,13 @@ type CrossProcessMetadata struct {
 }
 }
 
 
 // Init initialises a TxnCrossProcess based on the given application connect
 // Init initialises a TxnCrossProcess based on the given application connect
-// reply and metadata fields, if any.
-func (txp *TxnCrossProcess) Init(enabled bool, dt bool, reply *ConnectReply, metadata CrossProcessMetadata) error {
+// reply.
+func (txp *TxnCrossProcess) Init(enabled bool, dt bool, reply *ConnectReply) {
 	txp.CrossProcessID = []byte(reply.CrossProcessID)
 	txp.CrossProcessID = []byte(reply.CrossProcessID)
 	txp.EncodingKey = []byte(reply.EncodingKey)
 	txp.EncodingKey = []byte(reply.EncodingKey)
 	txp.DistributedTracingEnabled = dt
 	txp.DistributedTracingEnabled = dt
 	txp.Enabled = enabled
 	txp.Enabled = enabled
 	txp.TrustedAccounts = reply.TrustedAccounts
 	txp.TrustedAccounts = reply.TrustedAccounts
-
-	return txp.handleInboundRequestHeaders(metadata)
 }
 }
 
 
 // CreateCrossProcessMetadata generates request metadata that enable CAT and
 // CreateCrossProcessMetadata generates request metadata that enable CAT and

+ 64 - 83
vendor/github.com/newrelic/go-agent/internal_app.go

@@ -55,7 +55,7 @@ type app struct {
 	// Sends to these channels should not occur without a <-shutdownStarted
 	// Sends to these channels should not occur without a <-shutdownStarted
 	// select option to prevent deadlock.
 	// select option to prevent deadlock.
 	dataChan           chan appData
 	dataChan           chan appData
-	collectorErrorChan chan error
+	collectorErrorChan chan internal.RPMResponse
 	connectChan        chan *appRun
 	connectChan        chan *appRun
 
 
 	harvestTicker *time.Ticker
 	harvestTicker *time.Ticker
@@ -93,19 +93,6 @@ func newAppRun(config Config, reply *internal.ConnectReply) *appRun {
 	}
 	}
 }
 }
 
 
-func isFatalHarvestError(e error) bool {
-	return internal.IsDisconnect(e) ||
-		internal.IsLicenseException(e) ||
-		internal.IsRestartException(e)
-}
-
-func shouldSaveFailedHarvest(e error) bool {
-	if e == internal.ErrPayloadTooLarge || e == internal.ErrUnsupportedMedia {
-		return false
-	}
-	return true
-}
-
 func (app *app) doHarvest(h *internal.Harvest, harvestStart time.Time, run *appRun) {
 func (app *app) doHarvest(h *internal.Harvest, harvestStart time.Time, run *appRun) {
 	h.CreateFinalMetrics()
 	h.CreateFinalMetrics()
 	h.Metrics = h.Metrics.ApplyRules(run.MetricRules)
 	h.Metrics = h.Metrics.ApplyRules(run.MetricRules)
@@ -115,77 +102,81 @@ func (app *app) doHarvest(h *internal.Harvest, harvestStart time.Time, run *appR
 		cmd := p.EndpointMethod()
 		cmd := p.EndpointMethod()
 		data, err := p.Data(run.RunID.String(), harvestStart)
 		data, err := p.Data(run.RunID.String(), harvestStart)
 
 
-		if nil == data && nil == err {
+		if nil != err {
+			app.config.Logger.Warn("unable to create harvest data", map[string]interface{}{
+				"cmd":   cmd,
+				"error": err.Error(),
+			})
 			continue
 			continue
 		}
 		}
-
-		if nil == err {
-			call := internal.RpmCmd{
-				Collector: run.Collector,
-				RunID:     run.RunID.String(),
-				Name:      cmd,
-				Data:      data,
-			}
-
-			// The reply from harvest calls is always unused.
-			_, err = internal.CollectorRequest(call, app.rpmControls)
+		if nil == data {
+			continue
 		}
 		}
 
 
-		if nil == err {
-			continue
+		call := internal.RpmCmd{
+			Collector:         run.Collector,
+			RunID:             run.RunID.String(),
+			Name:              cmd,
+			Data:              data,
+			RequestHeadersMap: run.RequestHeadersMap,
 		}
 		}
 
 
-		if isFatalHarvestError(err) {
+		resp := internal.CollectorRequest(call, app.rpmControls)
+
+		if resp.IsDisconnect() || resp.IsRestartException() {
 			select {
 			select {
-			case app.collectorErrorChan <- err:
+			case app.collectorErrorChan <- resp:
 			case <-app.shutdownStarted:
 			case <-app.shutdownStarted:
 			}
 			}
 			return
 			return
 		}
 		}
 
 
-		app.config.Logger.Warn("harvest failure", map[string]interface{}{
-			"cmd":   cmd,
-			"error": err.Error(),
-		})
+		if nil != resp.Err {
+			app.config.Logger.Warn("harvest failure", map[string]interface{}{
+				"cmd":         cmd,
+				"error":       resp.Err.Error(),
+				"retain_data": resp.ShouldSaveHarvestData(),
+			})
+		}
 
 
-		if shouldSaveFailedHarvest(err) {
+		if resp.ShouldSaveHarvestData() {
 			app.Consume(run.RunID, p)
 			app.Consume(run.RunID, p)
 		}
 		}
 	}
 	}
 }
 }
 
 
-func connectAttempt(app *app) (*appRun, error) {
-	reply, err := internal.ConnectAttempt(config{app.config}, app.config.SecurityPoliciesToken, app.rpmControls)
-	if nil != err {
-		return nil, err
-	}
-	return newAppRun(app.config, reply), nil
-}
-
 func (app *app) connectRoutine() {
 func (app *app) connectRoutine() {
+	backoff := internal.ConnectBackoffStart
 	for {
 	for {
-		run, err := connectAttempt(app)
-		if nil == err {
+		reply, resp := internal.ConnectAttempt(config{app.config},
+			app.config.SecurityPoliciesToken, app.rpmControls)
+
+		if reply != nil {
 			select {
 			select {
-			case app.connectChan <- run:
+			case app.connectChan <- newAppRun(app.config, reply):
 			case <-app.shutdownStarted:
 			case <-app.shutdownStarted:
 			}
 			}
 			return
 			return
 		}
 		}
 
 
-		if internal.IsDisconnect(err) || internal.IsLicenseException(err) {
+		if resp.IsDisconnect() {
 			select {
 			select {
-			case app.collectorErrorChan <- err:
+			case app.collectorErrorChan <- resp:
 			case <-app.shutdownStarted:
 			case <-app.shutdownStarted:
 			}
 			}
 			return
 			return
 		}
 		}
 
 
-		app.config.Logger.Warn("application connect failure", map[string]interface{}{
-			"error": err.Error(),
-		})
+		if nil != resp.Err {
+			app.config.Logger.Warn("application connect failure", map[string]interface{}{
+				"error": resp.Err.Error(),
+			})
+		}
 
 
-		time.Sleep(internal.ConnectBackoff)
+		time.Sleep(backoff)
+		if backoff < internal.ConnectBackoffLimit {
+			backoff *= 2
+		}
 	}
 	}
 }
 }
 
 
@@ -274,25 +265,17 @@ func (app *app) process() {
 
 
 			close(app.shutdownComplete)
 			close(app.shutdownComplete)
 			return
 			return
-		case err := <-app.collectorErrorChan:
+		case resp := <-app.collectorErrorChan:
 			run = nil
 			run = nil
 			h = nil
 			h = nil
 			app.setState(nil, nil)
 			app.setState(nil, nil)
 
 
-			switch {
-			case internal.IsDisconnect(err):
-				app.setState(nil, err)
+			if resp.IsDisconnect() {
+				app.setState(nil, resp.Err)
 				app.config.Logger.Error("application disconnected", map[string]interface{}{
 				app.config.Logger.Error("application disconnected", map[string]interface{}{
 					"app": app.config.AppName,
 					"app": app.config.AppName,
-					"err": err.Error(),
 				})
 				})
-			case internal.IsLicenseException(err):
-				app.setState(nil, err)
-				app.config.Logger.Error("invalid license", map[string]interface{}{
-					"app":     app.config.AppName,
-					"license": app.config.License,
-				})
-			case internal.IsRestartException(err):
+			} else if resp.IsRestartException() {
 				app.config.Logger.Info("application restarted", map[string]interface{}{
 				app.config.Logger.Info("application restarted", map[string]interface{}{
 					"app": app.config.AppName,
 					"app": app.config.AppName,
 				})
 				})
@@ -404,7 +387,7 @@ func newApp(c Config) (Application, error) {
 		shutdownStarted:    make(chan struct{}),
 		shutdownStarted:    make(chan struct{}),
 		shutdownComplete:   make(chan struct{}),
 		shutdownComplete:   make(chan struct{}),
 		connectChan:        make(chan *appRun, 1),
 		connectChan:        make(chan *appRun, 1),
-		collectorErrorChan: make(chan error, 1),
+		collectorErrorChan: make(chan internal.RPMResponse, 1),
 		dataChan:           make(chan appData, internal.AppDataChanSize),
 		dataChan:           make(chan appData, internal.AppDataChanSize),
 		rpmControls: internal.RpmControls{
 		rpmControls: internal.RpmControls{
 			License: c.License,
 			License: c.License,
@@ -451,13 +434,23 @@ func newTestApp(replyfn func(*internal.ConnectReply), cfg Config) (expectApp, er
 		return nil, err
 		return nil, err
 	}
 	}
 	app := application.(*app)
 	app := application.(*app)
+	app.HarvestTesting(replyfn)
+
+	return app, nil
+}
+
+var (
+	_ internal.HarvestTestinger = &app{}
+	_ internal.Expect           = &app{}
+)
+
+func (app *app) HarvestTesting(replyfn func(*internal.ConnectReply)) {
 	if nil != replyfn {
 	if nil != replyfn {
-		replyfn(app.placeholderRun.ConnectReply)
-		app.placeholderRun = newAppRun(cfg, app.placeholderRun.ConnectReply)
+		reply := internal.ConnectReplyDefaults()
+		replyfn(reply)
+		app.placeholderRun = newAppRun(app.config, reply)
 	}
 	}
 	app.testHarvest = internal.NewHarvest(time.Now())
 	app.testHarvest = internal.NewHarvest(time.Now())
-
-	return app, nil
 }
 }
 
 
 func (app *app) getState() (*appRun, error) {
 func (app *app) getState() (*appRun, error) {
@@ -479,16 +472,6 @@ func (app *app) setState(run *appRun, err error) {
 	app.err = err
 	app.err = err
 }
 }
 
 
-func transportTypeFromRequest(r *http.Request) TransportType {
-	if strings.HasPrefix(r.Proto, "HTTP") {
-		if r.TLS != nil {
-			return TransportHTTPS
-		}
-		return TransportHTTP
-	}
-	return TransportUnknown
-}
-
 // StartTransaction implements newrelic.Application's StartTransaction.
 // StartTransaction implements newrelic.Application's StartTransaction.
 func (app *app) StartTransaction(name string, w http.ResponseWriter, r *http.Request) Transaction {
 func (app *app) StartTransaction(name string, w http.ResponseWriter, r *http.Request) Transaction {
 	run, _ := app.getState()
 	run, _ := app.getState()
@@ -498,12 +481,10 @@ func (app *app) StartTransaction(name string, w http.ResponseWriter, r *http.Req
 		W:          w,
 		W:          w,
 		Consumer:   app,
 		Consumer:   app,
 		attrConfig: run.AttributeConfig,
 		attrConfig: run.AttributeConfig,
-	}, r, name))
+	}, name))
 
 
 	if nil != r {
 	if nil != r {
-		if p := r.Header.Get(DistributedTracePayloadHeader); p != "" {
-			txn.AcceptDistributedTracePayload(transportTypeFromRequest(r), p)
-		}
+		txn.SetWebRequest(NewWebRequest(r))
 	}
 	}
 	return txn
 	return txn
 }
 }

+ 68 - 19
vendor/github.com/newrelic/go-agent/internal_txn.go

@@ -6,6 +6,7 @@ import (
 	"net/http"
 	"net/http"
 	"net/url"
 	"net/url"
 	"reflect"
 	"reflect"
+	"strings"
 	"sync"
 	"sync"
 	"time"
 	"time"
 
 
@@ -39,13 +40,12 @@ type txn struct {
 	internal.TxnData
 	internal.TxnData
 }
 }
 
 
-func newTxn(input txnInput, req *http.Request, name string) *txn {
+func newTxn(input txnInput, name string) *txn {
 	txn := &txn{
 	txn := &txn{
 		txnInput: input,
 		txnInput: input,
 	}
 	}
 	txn.Start = time.Now()
 	txn.Start = time.Now()
 	txn.Name = name
 	txn.Name = name
-	txn.IsWeb = nil != req
 	txn.Attrs = internal.NewAttributes(input.attrConfig)
 	txn.Attrs = internal.NewAttributes(input.attrConfig)
 
 
 	if input.Config.DistributedTracer.Enabled {
 	if input.Config.DistributedTracer.Enabled {
@@ -60,22 +60,15 @@ func newTxn(input txnInput, req *http.Request, name string) *txn {
 		if txn.BetterCAT.Sampled {
 		if txn.BetterCAT.Sampled {
 			txn.BetterCAT.Priority += 1.0
 			txn.BetterCAT.Priority += 1.0
 		}
 		}
-		txn.SpanEventsEnabled = input.Config.SpanEvents.Enabled
+		txn.SpanEventsEnabled = txn.Config.SpanEvents.Enabled && txn.Reply.CollectSpanEvents
 	}
 	}
 
 
-	if nil != req {
-		txn.Queuing = internal.QueueDuration(req.Header, txn.Start)
-		internal.RequestAgentAttributes(txn.Attrs, req)
-	}
-	txn.Attrs.Agent.HostDisplayName = txn.Config.HostDisplayName
+	txn.Attrs.Agent.Add(internal.AttributeHostDisplayName, txn.Config.HostDisplayName, nil)
 	txn.TxnTrace.Enabled = txn.txnTracesEnabled()
 	txn.TxnTrace.Enabled = txn.txnTracesEnabled()
 	txn.TxnTrace.SegmentThreshold = txn.Config.TransactionTracer.SegmentThreshold
 	txn.TxnTrace.SegmentThreshold = txn.Config.TransactionTracer.SegmentThreshold
 	txn.StackTraceThreshold = txn.Config.TransactionTracer.StackTraceThreshold
 	txn.StackTraceThreshold = txn.Config.TransactionTracer.StackTraceThreshold
 	txn.SlowQueriesEnabled = txn.slowQueriesEnabled()
 	txn.SlowQueriesEnabled = txn.slowQueriesEnabled()
 	txn.SlowQueryThreshold = txn.Config.DatastoreTracer.SlowQuery.Threshold
 	txn.SlowQueryThreshold = txn.Config.DatastoreTracer.SlowQuery.Threshold
-	if nil != req && nil != req.URL {
-		txn.CleanURL = internal.SafeURL(req.URL)
-	}
 
 
 	// Synthetics support is tied up with a transaction's Old CAT field,
 	// Synthetics support is tied up with a transaction's Old CAT field,
 	// CrossProcess. To support Synthetics with either BetterCAT or Old CAT,
 	// CrossProcess. To support Synthetics with either BetterCAT or Old CAT,
@@ -83,11 +76,61 @@ func newTxn(input txnInput, req *http.Request, name string) *txn {
 	// the top-level configuration.
 	// the top-level configuration.
 	doOldCAT := txn.Config.CrossApplicationTracer.Enabled
 	doOldCAT := txn.Config.CrossApplicationTracer.Enabled
 	noGUID := txn.Config.DistributedTracer.Enabled
 	noGUID := txn.Config.DistributedTracer.Enabled
-	txn.CrossProcess.InitFromHTTPRequest(doOldCAT, noGUID, input.Reply, req)
+	txn.CrossProcess.Init(doOldCAT, noGUID, input.Reply)
 
 
 	return txn
 	return txn
 }
 }
 
 
+type requestWrap struct{ request *http.Request }
+
+func (r requestWrap) Header() http.Header { return r.request.Header }
+func (r requestWrap) URL() *url.URL       { return r.request.URL }
+func (r requestWrap) Method() string      { return r.request.Method }
+
+func (r requestWrap) Transport() TransportType {
+	if strings.HasPrefix(r.request.Proto, "HTTP") {
+		if r.request.TLS != nil {
+			return TransportHTTPS
+		}
+		return TransportHTTP
+	}
+	return TransportUnknown
+
+}
+
+func (txn *txn) SetWebRequest(r WebRequest) error {
+	txn.Lock()
+	defer txn.Unlock()
+
+	if txn.finished {
+		return errAlreadyEnded
+	}
+
+	// Any call to SetWebRequest should indicate a web transaction.
+	txn.IsWeb = true
+
+	if nil == r {
+		return nil
+	}
+	if h := r.Header(); nil != h {
+		txn.Queuing = internal.QueueDuration(h, txn.Start)
+
+		if p := h.Get(DistributedTracePayloadHeader); p != "" {
+			txn.acceptDistributedTracePayloadLocked(r.Transport(), p)
+		}
+
+		txn.CrossProcess.InboundHTTPRequest(h)
+	}
+
+	internal.RequestAgentAttributes(txn.Attrs, r.Method(), r.Header())
+
+	if u := r.URL(); nil != u {
+		txn.CleanURL = internal.SafeURL(u)
+	}
+
+	return nil
+}
+
 func (txn *txn) slowQueriesEnabled() bool {
 func (txn *txn) slowQueriesEnabled() bool {
 	return txn.Config.DatastoreTracer.SlowQuery.Enabled &&
 	return txn.Config.DatastoreTracer.SlowQuery.Enabled &&
 		txn.Reply.CollectTraces
 		txn.Reply.CollectTraces
@@ -180,7 +223,7 @@ func (txn *txn) MergeIntoHarvest(h *internal.Harvest) {
 		h.SlowSQLs.Merge(txn.SlowQueries, txn.TxnEvent)
 		h.SlowSQLs.Merge(txn.SlowQueries, txn.TxnEvent)
 	}
 	}
 
 
-	if txn.BetterCAT.Sampled && txn.Config.SpanEvents.Enabled {
+	if txn.BetterCAT.Sampled && txn.SpanEventsEnabled {
 		h.SpanEvents.MergeFromTransaction(&txn.TxnData)
 		h.SpanEvents.MergeFromTransaction(&txn.TxnData)
 	}
 	}
 }
 }
@@ -358,10 +401,10 @@ func (txn *txn) End() error {
 
 
 	if txn.Config.Logger.DebugEnabled() {
 	if txn.Config.Logger.DebugEnabled() {
 		txn.Config.Logger.Debug("transaction ended", map[string]interface{}{
 		txn.Config.Logger.Debug("transaction ended", map[string]interface{}{
-			"name":        txn.FinalName,
-			"duration_ms": txn.Duration.Seconds() * 1000.0,
-			"ignored":     txn.ignore,
-			"run":         txn.Reply.RunID,
+			"name":          txn.FinalName,
+			"duration_ms":   txn.Duration.Seconds() * 1000.0,
+			"ignored":       txn.ignore,
+			"app_connected": "" != txn.Reply.RunID,
 		})
 		})
 	}
 	}
 
 
@@ -737,7 +780,7 @@ func (txn *txn) CreateDistributedTracePayload() (payload DistributedTracePayload
 		p.TrustedAccountKey = txn.Reply.TrustedAccountKey
 		p.TrustedAccountKey = txn.Reply.TrustedAccountKey
 	}
 	}
 
 
-	if txn.BetterCAT.Sampled && txn.Config.SpanEvents.Enabled {
+	if txn.BetterCAT.Sampled && txn.SpanEventsEnabled {
 		p.ID = txn.CurrentSpanIdentifier()
 		p.ID = txn.CurrentSpanIdentifier()
 	}
 	}
 
 
@@ -758,12 +801,18 @@ var (
 	errOutboundPayloadCreated   = errors.New("outbound payload already created")
 	errOutboundPayloadCreated   = errors.New("outbound payload already created")
 	errAlreadyAccepted          = errors.New("AcceptDistributedTracePayload has already been called")
 	errAlreadyAccepted          = errors.New("AcceptDistributedTracePayload has already been called")
 	errInboundPayloadDTDisabled = errors.New("DistributedTracer must be enabled to accept an inbound payload")
 	errInboundPayloadDTDisabled = errors.New("DistributedTracer must be enabled to accept an inbound payload")
+	errTrustedAccountKey        = errors.New("trusted account key missing or does not match")
 )
 )
 
 
 func (txn *txn) AcceptDistributedTracePayload(t TransportType, p interface{}) error {
 func (txn *txn) AcceptDistributedTracePayload(t TransportType, p interface{}) error {
 	txn.Lock()
 	txn.Lock()
 	defer txn.Unlock()
 	defer txn.Unlock()
 
 
+	return txn.acceptDistributedTracePayloadLocked(t, p)
+}
+
+func (txn *txn) acceptDistributedTracePayloadLocked(t TransportType, p interface{}) error {
+
 	if !txn.BetterCAT.Enabled {
 	if !txn.BetterCAT.Enabled {
 		return errInboundPayloadDTDisabled
 		return errInboundPayloadDTDisabled
 	}
 	}
@@ -820,7 +869,7 @@ func (txn *txn) AcceptDistributedTracePayload(t TransportType, p interface{}) er
 	}
 	}
 	if receivedTrustKey != txn.Reply.TrustedAccountKey {
 	if receivedTrustKey != txn.Reply.TrustedAccountKey {
 		txn.AcceptPayloadUntrustedAccount = true
 		txn.AcceptPayloadUntrustedAccount = true
-		return internal.ErrTrustedAccountKey{Message: "trusted account key missing or does not match"}
+		return errTrustedAccountKey
 	}
 	}
 
 
 	if 0 != payload.Priority {
 	if 0 != payload.Priority {

+ 21 - 3
vendor/github.com/newrelic/go-agent/segments.go

@@ -114,15 +114,33 @@ func StartSegment(txn Transaction, name string) *Segment {
 //    segment.Response = resp
 //    segment.Response = resp
 //    segment.End()
 //    segment.End()
 //
 //
+// In addition to starting an external segment, StartExternalSegment also adds
+// distributed tracing headers to the request.  Therefore, it is recommended
+// over populating ExternalSegment structs manually.
+//
+// If the Transaction parameter is nil, StartExternalSegment will look for a
+// Transaction in the request's context using FromContext.  Example:
+//
+//    request = newrelic.RequestWithTransactionContext(request, txn)
+//    segment := newrelic.StartExternalSegment(nil, request)
+//    resp, err := client.Do(request)
+//    segment.Response = resp
+//    segment.End()
+//
 func StartExternalSegment(txn Transaction, request *http.Request) *ExternalSegment {
 func StartExternalSegment(txn Transaction, request *http.Request) *ExternalSegment {
+	if nil == txn {
+		txn = transactionFromRequestContext(request)
+	}
 	s := &ExternalSegment{
 	s := &ExternalSegment{
 		StartTime: StartSegmentNow(txn),
 		StartTime: StartSegmentNow(txn),
 		Request:   request,
 		Request:   request,
 	}
 	}
 
 
-	for key, values := range s.OutboundHeaders() {
-		for _, value := range values {
-			request.Header.Add(key, value)
+	if request != nil && request.Header != nil {
+		for key, values := range s.OutboundHeaders() {
+			for _, value := range values {
+				request.Header.Add(key, value)
+			}
 		}
 		}
 	}
 	}
 
 

+ 33 - 0
vendor/github.com/newrelic/go-agent/transaction.go

@@ -2,6 +2,7 @@ package newrelic
 
 
 import (
 import (
 	"net/http"
 	"net/http"
+	"net/url"
 )
 )
 
 
 // Transaction represents a request or a background task.
 // Transaction represents a request or a background task.
@@ -38,6 +39,13 @@ type Transaction interface {
 	// https://docs.newrelic.com/docs/agents/manage-apm-agents/agent-metrics/collect-custom-attributes
 	// https://docs.newrelic.com/docs/agents/manage-apm-agents/agent-metrics/collect-custom-attributes
 	AddAttribute(key string, value interface{}) error
 	AddAttribute(key string, value interface{}) error
 
 
+	// SetWebRequest marks the transaction as a web transaction.  If
+	// WebRequest is non-nil, SetWebRequest will additionally collect
+	// details on request attributes, url, and method.  If headers are
+	// present, the agent will look for a distributed tracing header.  Use
+	// NewWebRequest to transform a *http.Request into a WebRequest.
+	SetWebRequest(WebRequest) error
+
 	// StartSegmentNow allows the timing of functions, external calls, and
 	// StartSegmentNow allows the timing of functions, external calls, and
 	// datastore calls.  The segments of each transaction MUST be used in a
 	// datastore calls.  The segments of each transaction MUST be used in a
 	// single goroutine.  Consumers are encouraged to use the
 	// single goroutine.  Consumers are encouraged to use the
@@ -105,3 +113,28 @@ var (
 	TransportQueue   = TransportType{name: "Queue"}
 	TransportQueue   = TransportType{name: "Queue"}
 	TransportOther   = TransportType{name: "Other"}
 	TransportOther   = TransportType{name: "Other"}
 )
 )
+
+// WebRequest may be implemented to provide request information to
+// Transaction.SetWebRequest.
+type WebRequest interface {
+	// Header may return nil if you don't have any headers or don't want to
+	// transform them to http.Header format.
+	Header() http.Header
+	// URL may return nil if you don't have a URL or don't want to transform
+	// it to *url.URL.
+	URL() *url.URL
+	Method() string
+	// If a distributed tracing header is found in the headers returned by
+	// Header(), this TransportType will be used in the distributed tracing
+	// metrics.
+	Transport() TransportType
+}
+
+// NewWebRequest turns a *http.Request into a WebRequest for input into
+// Transaction.SetWebRequest.
+func NewWebRequest(request *http.Request) WebRequest {
+	if nil == request {
+		return nil
+	}
+	return requestWrap{request: request}
+}

+ 1 - 1
vendor/github.com/newrelic/go-agent/version.go

@@ -2,7 +2,7 @@ package newrelic
 
 
 const (
 const (
 	major = "2"
 	major = "2"
-	minor = "1"
+	minor = "2"
 	patch = "0"
 	patch = "0"
 
 
 	// Version is the full string version of this Go Agent.
 	// Version is the full string version of this Go Agent.

+ 9 - 3
vendor/github.com/prometheus/common/expfmt/text_create.go

@@ -436,11 +436,11 @@ func writeEscapedString(w enhancedWriter, v string, includeDoubleQuote bool) (in
 func writeFloat(w enhancedWriter, f float64) (int, error) {
 func writeFloat(w enhancedWriter, f float64) (int, error) {
 	switch {
 	switch {
 	case f == 1:
 	case f == 1:
-		return 1, w.WriteByte('1')
+		return w.WriteString("1.0")
 	case f == 0:
 	case f == 0:
-		return 1, w.WriteByte('0')
+		return w.WriteString("0.0")
 	case f == -1:
 	case f == -1:
-		return w.WriteString("-1")
+		return w.WriteString("-1.0")
 	case math.IsNaN(f):
 	case math.IsNaN(f):
 		return w.WriteString("NaN")
 		return w.WriteString("NaN")
 	case math.IsInf(f, +1):
 	case math.IsInf(f, +1):
@@ -450,6 +450,12 @@ func writeFloat(w enhancedWriter, f float64) (int, error) {
 	default:
 	default:
 		bp := numBufPool.Get().(*[]byte)
 		bp := numBufPool.Get().(*[]byte)
 		*bp = strconv.AppendFloat((*bp)[:0], f, 'g', -1, 64)
 		*bp = strconv.AppendFloat((*bp)[:0], f, 'g', -1, 64)
+		// Add a .0 if used fixed point and there is no decimal
+		// point already. This is for future proofing with OpenMetrics,
+		// where floats always contain either an exponent or decimal.
+		if !bytes.ContainsAny(*bp, "e.") {
+			*bp = append(*bp, '.', '0')
+		}
 		written, err := w.Write(*bp)
 		written, err := w.Write(*bp)
 		numBufPool.Put(bp)
 		numBufPool.Put(bp)
 		return written, err
 		return written, err

+ 3 - 3
vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go

@@ -1,12 +1,12 @@
 /*
 /*
+Copyright (c) 2011, Open Knowledge Foundation Ltd.
+All rights reserved.
+
 HTTP Content-Type Autonegotiation.
 HTTP Content-Type Autonegotiation.
 
 
 The functions in this package implement the behaviour specified in
 The functions in this package implement the behaviour specified in
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
 
 
-Copyright (c) 2011, Open Knowledge Foundation Ltd.
-All rights reserved.
-
 Redistribution and use in source and binary forms, with or without
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 modification, are permitted provided that the following conditions are
 met:
 met:

+ 0 - 1
vendor/github.com/prometheus/common/model/metric.go

@@ -21,7 +21,6 @@ import (
 )
 )
 
 
 var (
 var (
-	separator = []byte{0}
 	// MetricNameRE is a regular expression matching valid metric
 	// MetricNameRE is a regular expression matching valid metric
 	// names. Note that the IsValidMetricName function performs the same
 	// names. Note that the IsValidMetricName function performs the same
 	// check but faster than a match with this regular expression.
 	// check but faster than a match with this regular expression.

+ 9 - 9
vendor/github.com/prometheus/procfs/xfs/parse.go

@@ -43,15 +43,15 @@ func ParseStats(r io.Reader) (*Stats, error) {
 		fieldXpc         = "xpc"
 		fieldXpc         = "xpc"
 
 
 		// Unimplemented at this time due to lack of documentation.
 		// Unimplemented at this time due to lack of documentation.
-		fieldPushAil = "push_ail"
-		fieldXstrat  = "xstrat"
-		fieldAbtb2   = "abtb2"
-		fieldAbtc2   = "abtc2"
-		fieldBmbt2   = "bmbt2"
-		fieldIbt2    = "ibt2"
-		fieldFibt2   = "fibt2"
-		fieldQm      = "qm"
-		fieldDebug   = "debug"
+		// fieldPushAil = "push_ail"
+		// fieldXstrat  = "xstrat"
+		// fieldAbtb2   = "abtb2"
+		// fieldAbtc2   = "abtc2"
+		// fieldBmbt2   = "bmbt2"
+		// fieldIbt2    = "ibt2"
+		// fieldFibt2   = "fibt2"
+		// fieldQm      = "qm"
+		// fieldDebug   = "debug"
 	)
 	)
 
 
 	var xfss Stats
 	var xfss Stats

+ 2 - 1
vendor/github.com/shirou/gopsutil/mem/mem.go

@@ -44,7 +44,7 @@ type VirtualMemoryStat struct {
 
 
 	// FreeBSD specific numbers:
 	// FreeBSD specific numbers:
 	// https://reviews.freebsd.org/D8467
 	// https://reviews.freebsd.org/D8467
-	Laundry  uint64 `json:"laundry"`
+	Laundry uint64 `json:"laundry"`
 
 
 	// Linux specific numbers
 	// Linux specific numbers
 	// https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s2-proc-meminfo.html
 	// https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s2-proc-meminfo.html
@@ -57,6 +57,7 @@ type VirtualMemoryStat struct {
 	WritebackTmp   uint64 `json:"writebacktmp"`
 	WritebackTmp   uint64 `json:"writebacktmp"`
 	Shared         uint64 `json:"shared"`
 	Shared         uint64 `json:"shared"`
 	Slab           uint64 `json:"slab"`
 	Slab           uint64 `json:"slab"`
+	SReclaimable   uint64 `json:"sreclaimable"`
 	PageTables     uint64 `json:"pagetables"`
 	PageTables     uint64 `json:"pagetables"`
 	SwapCached     uint64 `json:"swapcached"`
 	SwapCached     uint64 `json:"swapcached"`
 	CommitLimit    uint64 `json:"commitlimit"`
 	CommitLimit    uint64 `json:"commitlimit"`

+ 5 - 0
vendor/github.com/shirou/gopsutil/mem/mem_linux.go

@@ -61,6 +61,8 @@ func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) {
 			ret.Shared = t * 1024
 			ret.Shared = t * 1024
 		case "Slab":
 		case "Slab":
 			ret.Slab = t * 1024
 			ret.Slab = t * 1024
+		case "SReclaimable":
+			ret.SReclaimable = t * 1024
 		case "PageTables":
 		case "PageTables":
 			ret.PageTables = t * 1024
 			ret.PageTables = t * 1024
 		case "SwapCached":
 		case "SwapCached":
@@ -97,6 +99,9 @@ func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) {
 			ret.HugePageSize = t * 1024
 			ret.HugePageSize = t * 1024
 		}
 		}
 	}
 	}
+
+	ret.Cached += ret.SReclaimable
+
 	if !memavail {
 	if !memavail {
 		ret.Available = ret.Free + ret.Buffers + ret.Cached
 		ret.Available = ret.Free + ret.Buffers + ret.Cached
 	}
 	}

+ 17 - 18
vendor/github.com/stretchr/testify/LICENSE

@@ -1,22 +1,21 @@
-Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell
+MIT License
 
 
-Please consider promoting this project if you find it useful.
+Copyright (c) 2012-2018 Mat Ryer and Tyler Bunnell
 
 
-Permission is hereby granted, free of charge, to any person 
-obtaining a copy of this software and associated documentation 
-files (the "Software"), to deal in the Software without restriction, 
-including without limitation the rights to use, copy, modify, merge, 
-publish, distribute, sublicense, and/or sell copies of the Software, 
-and to permit persons to whom the Software is furnished to do so, 
-subject to the following conditions:
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
 
 
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
 
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 
-OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
-OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 27 - 5
vendor/github.com/stretchr/testify/assert/assertions.go

@@ -39,7 +39,7 @@ type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) bool
 // for table driven tests.
 // for table driven tests.
 type BoolAssertionFunc func(TestingT, bool, ...interface{}) bool
 type BoolAssertionFunc func(TestingT, bool, ...interface{}) bool
 
 
-// ValuesAssertionFunc is a common function prototype when validating an error value.  Can be useful
+// ErrorAssertionFunc is a common function prototype when validating an error value.  Can be useful
 // for table driven tests.
 // for table driven tests.
 type ErrorAssertionFunc func(TestingT, error, ...interface{}) bool
 type ErrorAssertionFunc func(TestingT, error, ...interface{}) bool
 
 
@@ -179,7 +179,11 @@ func messageFromMsgAndArgs(msgAndArgs ...interface{}) string {
 		return ""
 		return ""
 	}
 	}
 	if len(msgAndArgs) == 1 {
 	if len(msgAndArgs) == 1 {
-		return msgAndArgs[0].(string)
+		msg := msgAndArgs[0]
+		if msgAsStr, ok := msg.(string); ok {
+			return msgAsStr
+		}
+		return fmt.Sprintf("%+v", msg)
 	}
 	}
 	if len(msgAndArgs) > 1 {
 	if len(msgAndArgs) > 1 {
 		return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...)
 		return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...)
@@ -415,6 +419,17 @@ func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
 	return Fail(t, "Expected value not to be nil.", msgAndArgs...)
 	return Fail(t, "Expected value not to be nil.", msgAndArgs...)
 }
 }
 
 
+// containsKind checks if a specified kind in the slice of kinds.
+func containsKind(kinds []reflect.Kind, kind reflect.Kind) bool {
+	for i := 0; i < len(kinds); i++ {
+		if kind == kinds[i] {
+			return true
+		}
+	}
+
+	return false
+}
+
 // isNil checks if a specified object is nil or not, without Failing.
 // isNil checks if a specified object is nil or not, without Failing.
 func isNil(object interface{}) bool {
 func isNil(object interface{}) bool {
 	if object == nil {
 	if object == nil {
@@ -423,7 +438,14 @@ func isNil(object interface{}) bool {
 
 
 	value := reflect.ValueOf(object)
 	value := reflect.ValueOf(object)
 	kind := value.Kind()
 	kind := value.Kind()
-	if kind >= reflect.Chan && kind <= reflect.Slice && value.IsNil() {
+	isNilableKind := containsKind(
+		[]reflect.Kind{
+			reflect.Chan, reflect.Func,
+			reflect.Interface, reflect.Map,
+			reflect.Ptr, reflect.Slice},
+		kind)
+
+	if isNilableKind && value.IsNil() {
 		return true
 		return true
 	}
 	}
 
 
@@ -1327,7 +1349,7 @@ func typeAndKind(v interface{}) (reflect.Type, reflect.Kind) {
 }
 }
 
 
 // diff returns a diff of both values as long as both are of the same type and
 // diff returns a diff of both values as long as both are of the same type and
-// are a struct, map, slice or array. Otherwise it returns an empty string.
+// are a struct, map, slice, array or string. Otherwise it returns an empty string.
 func diff(expected interface{}, actual interface{}) string {
 func diff(expected interface{}, actual interface{}) string {
 	if expected == nil || actual == nil {
 	if expected == nil || actual == nil {
 		return ""
 		return ""
@@ -1345,7 +1367,7 @@ func diff(expected interface{}, actual interface{}) string {
 	}
 	}
 
 
 	var e, a string
 	var e, a string
-	if ek != reflect.String {
+	if et != reflect.TypeOf("") {
 		e = spewConfig.Sdump(expected)
 		e = spewConfig.Sdump(expected)
 		a = spewConfig.Sdump(actual)
 		a = spewConfig.Sdump(actual)
 	} else {
 	} else {

+ 1 - 1
vendor/github.com/stretchr/testify/require/requirements.go

@@ -22,7 +22,7 @@ type ValueAssertionFunc func(TestingT, interface{}, ...interface{})
 // for table driven tests.
 // for table driven tests.
 type BoolAssertionFunc func(TestingT, bool, ...interface{})
 type BoolAssertionFunc func(TestingT, bool, ...interface{})
 
 
-// ValuesAssertionFunc is a common function prototype when validating an error value.  Can be useful
+// ErrorAssertionFunc is a common function prototype when validating an error value.  Can be useful
 // for table driven tests.
 // for table driven tests.
 type ErrorAssertionFunc func(TestingT, error, ...interface{})
 type ErrorAssertionFunc func(TestingT, error, ...interface{})
 
 

+ 24 - 0
vendor/github.com/stretchr/testify/suite/suite.go

@@ -55,10 +55,32 @@ func (suite *Suite) Assert() *assert.Assertions {
 	return suite.Assertions
 	return suite.Assertions
 }
 }
 
 
+func failOnPanic(t *testing.T) {
+	r := recover()
+	if r != nil {
+		t.Errorf("test panicked: %v", r)
+		t.FailNow()
+	}
+}
+
+// Run provides suite functionality around golang subtests.  It should be
+// called in place of t.Run(name, func(t *testing.T)) in test suite code.
+// The passed-in func will be executed as a subtest with a fresh instance of t.
+// Provides compatibility with go test pkg -run TestSuite/TestName/SubTestName.
+func (suite *Suite) Run(name string, subtest func()) bool {
+	oldT := suite.T()
+	defer suite.SetT(oldT)
+	return oldT.Run(name, func(t *testing.T) {
+		suite.SetT(t)
+		subtest()
+	})
+}
+
 // Run takes a testing suite and runs all of the tests attached
 // Run takes a testing suite and runs all of the tests attached
 // to it.
 // to it.
 func Run(t *testing.T, suite TestingSuite) {
 func Run(t *testing.T, suite TestingSuite) {
 	suite.SetT(t)
 	suite.SetT(t)
+	defer failOnPanic(t)
 
 
 	if setupAllSuite, ok := suite.(SetupAllSuite); ok {
 	if setupAllSuite, ok := suite.(SetupAllSuite); ok {
 		setupAllSuite.SetupSuite()
 		setupAllSuite.SetupSuite()
@@ -84,6 +106,8 @@ func Run(t *testing.T, suite TestingSuite) {
 				F: func(t *testing.T) {
 				F: func(t *testing.T) {
 					parentT := suite.T()
 					parentT := suite.T()
 					suite.SetT(t)
 					suite.SetT(t)
+					defer failOnPanic(t)
+
 					if setupTestSuite, ok := suite.(SetupTestSuite); ok {
 					if setupTestSuite, ok := suite.(SetupTestSuite); ok {
 						setupTestSuite.SetupTest()
 						setupTestSuite.SetupTest()
 					}
 					}

+ 9 - 1
vendor/golang.org/x/net/http2/hpack/hpack.go

@@ -92,6 +92,8 @@ type Decoder struct {
 	// saveBuf is previous data passed to Write which we weren't able
 	// saveBuf is previous data passed to Write which we weren't able
 	// to fully parse before. Unlike buf, we own this data.
 	// to fully parse before. Unlike buf, we own this data.
 	saveBuf bytes.Buffer
 	saveBuf bytes.Buffer
+
+	firstField bool // processing the first field of the header block
 }
 }
 
 
 // NewDecoder returns a new decoder with the provided maximum dynamic
 // NewDecoder returns a new decoder with the provided maximum dynamic
@@ -101,6 +103,7 @@ func NewDecoder(maxDynamicTableSize uint32, emitFunc func(f HeaderField)) *Decod
 	d := &Decoder{
 	d := &Decoder{
 		emit:        emitFunc,
 		emit:        emitFunc,
 		emitEnabled: true,
 		emitEnabled: true,
+		firstField:  true,
 	}
 	}
 	d.dynTab.table.init()
 	d.dynTab.table.init()
 	d.dynTab.allowedMaxSize = maxDynamicTableSize
 	d.dynTab.allowedMaxSize = maxDynamicTableSize
@@ -226,11 +229,15 @@ func (d *Decoder) DecodeFull(p []byte) ([]HeaderField, error) {
 	return hf, nil
 	return hf, nil
 }
 }
 
 
+// Close declares that the decoding is complete and resets the Decoder
+// to be reused again for a new header block. If there is any remaining
+// data in the decoder's buffer, Close returns an error.
 func (d *Decoder) Close() error {
 func (d *Decoder) Close() error {
 	if d.saveBuf.Len() > 0 {
 	if d.saveBuf.Len() > 0 {
 		d.saveBuf.Reset()
 		d.saveBuf.Reset()
 		return DecodingError{errors.New("truncated headers")}
 		return DecodingError{errors.New("truncated headers")}
 	}
 	}
+	d.firstField = true
 	return nil
 	return nil
 }
 }
 
 
@@ -266,6 +273,7 @@ func (d *Decoder) Write(p []byte) (n int, err error) {
 			d.saveBuf.Write(d.buf)
 			d.saveBuf.Write(d.buf)
 			return len(p), nil
 			return len(p), nil
 		}
 		}
+		d.firstField = false
 		if err != nil {
 		if err != nil {
 			break
 			break
 		}
 		}
@@ -391,7 +399,7 @@ func (d *Decoder) callEmit(hf HeaderField) error {
 func (d *Decoder) parseDynamicTableSizeUpdate() error {
 func (d *Decoder) parseDynamicTableSizeUpdate() error {
 	// RFC 7541, sec 4.2: This dynamic table size update MUST occur at the
 	// RFC 7541, sec 4.2: This dynamic table size update MUST occur at the
 	// beginning of the first header block following the change to the dynamic table size.
 	// beginning of the first header block following the change to the dynamic table size.
-	if d.dynTab.size > 0 {
+	if !d.firstField && d.dynTab.size > 0 {
 		return DecodingError{errors.New("dynamic table size update MUST occur at the beginning of a header block")}
 		return DecodingError{errors.New("dynamic table size update MUST occur at the beginning of a header block")}
 	}
 	}
 
 

+ 10 - 4
vendor/golang.org/x/net/trace/trace.go

@@ -86,6 +86,12 @@ import (
 // FOR DEBUGGING ONLY. This will slow down the program.
 // FOR DEBUGGING ONLY. This will slow down the program.
 var DebugUseAfterFinish = false
 var DebugUseAfterFinish = false
 
 
+// HTTP ServeMux paths.
+const (
+	debugRequestsPath = "/debug/requests"
+	debugEventsPath   = "/debug/events"
+)
+
 // AuthRequest determines whether a specific request is permitted to load the
 // AuthRequest determines whether a specific request is permitted to load the
 // /debug/requests or /debug/events pages.
 // /debug/requests or /debug/events pages.
 //
 //
@@ -112,8 +118,8 @@ var AuthRequest = func(req *http.Request) (any, sensitive bool) {
 }
 }
 
 
 func init() {
 func init() {
-	_, pat := http.DefaultServeMux.Handler(&http.Request{URL: &url.URL{Path: "/debug/requests"}})
-	if pat != "" {
+	_, pat := http.DefaultServeMux.Handler(&http.Request{URL: &url.URL{Path: debugRequestsPath}})
+	if pat == debugRequestsPath {
 		panic("/debug/requests is already registered. You may have two independent copies of " +
 		panic("/debug/requests is already registered. You may have two independent copies of " +
 			"golang.org/x/net/trace in your binary, trying to maintain separate state. This may " +
 			"golang.org/x/net/trace in your binary, trying to maintain separate state. This may " +
 			"involve a vendored copy of golang.org/x/net/trace.")
 			"involve a vendored copy of golang.org/x/net/trace.")
@@ -121,8 +127,8 @@ func init() {
 
 
 	// TODO(jbd): Serve Traces from /debug/traces in the future?
 	// TODO(jbd): Serve Traces from /debug/traces in the future?
 	// There is no requirement for a request to be present to have traces.
 	// There is no requirement for a request to be present to have traces.
-	http.HandleFunc("/debug/requests", Traces)
-	http.HandleFunc("/debug/events", Events)
+	http.HandleFunc(debugRequestsPath, Traces)
+	http.HandleFunc(debugEventsPath, Events)
 }
 }
 
 
 // NewContext returns a copy of the parent context
 // NewContext returns a copy of the parent context

+ 29 - 0
vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s

@@ -0,0 +1,29 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build !gccgo
+
+#include "textflag.h"
+
+//
+// System call support for ARM64, FreeBSD
+//
+
+// Just jump to package syscall's implementation for all these functions.
+// The runtime may know about them.
+
+TEXT	·Syscall(SB),NOSPLIT,$0-56
+	JMP	syscall·Syscall(SB)
+
+TEXT	·Syscall6(SB),NOSPLIT,$0-80
+	JMP	syscall·Syscall6(SB)
+
+TEXT	·Syscall9(SB),NOSPLIT,$0-104
+	JMP	syscall·Syscall9(SB)
+
+TEXT ·RawSyscall(SB),NOSPLIT,$0-56
+	JMP	syscall·RawSyscall(SB)
+
+TEXT	·RawSyscall6(SB),NOSPLIT,$0-80
+	JMP	syscall·RawSyscall6(SB)

+ 1 - 1
vendor/golang.org/x/sys/unix/fcntl.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 // license that can be found in the LICENSE file.
 
 
-// +build darwin dragonfly freebsd linux netbsd openbsd
+// +build dragonfly freebsd linux netbsd openbsd
 
 
 package unix
 package unix
 
 

+ 18 - 0
vendor/golang.org/x/sys/unix/fcntl_darwin.go

@@ -0,0 +1,18 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package unix
+
+import "unsafe"
+
+// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
+func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
+	return fcntl(int(fd), cmd, arg)
+}
+
+// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
+func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
+	_, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk))))
+	return err
+}

+ 61 - 0
vendor/golang.org/x/sys/unix/mkasm_darwin.go

@@ -0,0 +1,61 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build ignore
+
+// mkasm_darwin.go generates assembly trampolines to call libSystem routines from Go.
+//This program must be run after mksyscall.go.
+package main
+
+import (
+	"bytes"
+	"fmt"
+	"io/ioutil"
+	"log"
+	"os"
+	"strings"
+)
+
+func main() {
+	in1, err := ioutil.ReadFile("syscall_darwin.go")
+	if err != nil {
+		log.Fatalf("can't open syscall_darwin.go: %s", err)
+	}
+	arch := os.Args[1]
+	in2, err := ioutil.ReadFile(fmt.Sprintf("syscall_darwin_%s.go", arch))
+	if err != nil {
+		log.Fatalf("can't open syscall_darwin_%s.go: %s", arch, err)
+	}
+	in3, err := ioutil.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.go", arch))
+	if err != nil {
+		log.Fatalf("can't open zsyscall_darwin_%s.go: %s", arch, err)
+	}
+	in := string(in1) + string(in2) + string(in3)
+
+	trampolines := map[string]bool{}
+
+	var out bytes.Buffer
+
+	fmt.Fprintf(&out, "// go run mkasm_darwin.go %s\n", strings.Join(os.Args[1:], " "))
+	fmt.Fprintf(&out, "// Code generated by the command above; DO NOT EDIT.\n")
+	fmt.Fprintf(&out, "\n")
+	fmt.Fprintf(&out, "// +build go1.12\n")
+	fmt.Fprintf(&out, "\n")
+	fmt.Fprintf(&out, "#include \"textflag.h\"\n")
+	for _, line := range strings.Split(in, "\n") {
+		if !strings.HasPrefix(line, "func ") || !strings.HasSuffix(line, "_trampoline()") {
+			continue
+		}
+		fn := line[5 : len(line)-13]
+		if !trampolines[fn] {
+			trampolines[fn] = true
+			fmt.Fprintf(&out, "TEXT ·%s_trampoline(SB),NOSPLIT,$0-0\n", fn)
+			fmt.Fprintf(&out, "\tJMP\t%s(SB)\n", fn)
+		}
+	}
+	err = ioutil.WriteFile(fmt.Sprintf("zsyscall_darwin_%s.s", arch), out.Bytes(), 0644)
+	if err != nil {
+		log.Fatalf("can't write zsyscall_darwin_%s.s: %s", arch, err)
+	}
+}

+ 3 - 3
vendor/golang.org/x/sys/unix/mkpost.go

@@ -28,10 +28,10 @@ func main() {
 	if goarch == "" {
 	if goarch == "" {
 		goarch = os.Getenv("GOARCH")
 		goarch = os.Getenv("GOARCH")
 	}
 	}
-	// Check that we are using the new build system if we should be.
-	if goos == "linux" && goarch != "sparc64" {
+	// Check that we are using the Docker-based build system if we should be.
+	if goos == "linux" {
 		if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
 		if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
-			os.Stderr.WriteString("In the new build system, mkpost should not be called directly.\n")
+			os.Stderr.WriteString("In the Docker-based build system, mkpost should not be called directly.\n")
 			os.Stderr.WriteString("See README.md\n")
 			os.Stderr.WriteString("See README.md\n")
 			os.Exit(1)
 			os.Exit(1)
 		}
 		}

+ 34 - 3
vendor/golang.org/x/sys/unix/mksyscall.go

@@ -93,10 +93,10 @@ func main() {
 		goarch = os.Getenv("GOARCH")
 		goarch = os.Getenv("GOARCH")
 	}
 	}
 
 
-	// Check that we are using the new build system if we should
-	if goos == "linux" && goarch != "sparc64" {
+	// Check that we are using the Docker-based build system if we should
+	if goos == "linux" {
 		if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
 		if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
-			fmt.Fprintf(os.Stderr, "In the new build system, mksyscall should not be called directly.\n")
+			fmt.Fprintf(os.Stderr, "In the Docker-based build system, mksyscall should not be called directly.\n")
 			fmt.Fprintf(os.Stderr, "See README.md\n")
 			fmt.Fprintf(os.Stderr, "See README.md\n")
 			os.Exit(1)
 			os.Exit(1)
 		}
 		}
@@ -116,6 +116,12 @@ func main() {
 		endianness = "little-endian"
 		endianness = "little-endian"
 	}
 	}
 
 
+	libc := false
+	if goos == "darwin" && strings.Contains(buildTags(), ",go1.12") {
+		libc = true
+	}
+	trampolines := map[string]bool{}
+
 	text := ""
 	text := ""
 	for _, path := range flag.Args() {
 	for _, path := range flag.Args() {
 		file, err := os.Open(path)
 		file, err := os.Open(path)
@@ -272,6 +278,20 @@ func main() {
 				sysname = strings.ToUpper(sysname)
 				sysname = strings.ToUpper(sysname)
 			}
 			}
 
 
+			var libcFn string
+			if libc {
+				asm = "syscall_" + strings.ToLower(asm[:1]) + asm[1:] // internal syscall call
+				sysname = strings.TrimPrefix(sysname, "SYS_")         // remove SYS_
+				sysname = strings.ToLower(sysname)                    // lowercase
+				if sysname == "getdirentries64" {
+					// Special case - libSystem name and
+					// raw syscall name don't match.
+					sysname = "__getdirentries64"
+				}
+				libcFn = sysname
+				sysname = "funcPC(libc_" + sysname + "_trampoline)"
+			}
+
 			// Actual call.
 			// Actual call.
 			arglist := strings.Join(args, ", ")
 			arglist := strings.Join(args, ", ")
 			call := fmt.Sprintf("%s(%s, %s)", asm, sysname, arglist)
 			call := fmt.Sprintf("%s(%s, %s)", asm, sysname, arglist)
@@ -339,6 +359,17 @@ func main() {
 			text += "\treturn\n"
 			text += "\treturn\n"
 			text += "}\n\n"
 			text += "}\n\n"
 
 
+			if libc && !trampolines[libcFn] {
+				// some system calls share a trampoline, like read and readlen.
+				trampolines[libcFn] = true
+				// Declare assembly trampoline.
+				text += fmt.Sprintf("func libc_%s_trampoline()\n", libcFn)
+				// Assembly trampoline calls the libc_* function, which this magic
+				// redirects to use the function from libSystem.
+				text += fmt.Sprintf("//go:linkname libc_%s libc_%s\n", libcFn, libcFn)
+				text += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"/usr/lib/libSystem.B.dylib\"\n", libcFn, libcFn)
+				text += "\n"
+			}
 		}
 		}
 		if err := s.Err(); err != nil {
 		if err := s.Err(); err != nil {
 			fmt.Fprintf(os.Stderr, err.Error())
 			fmt.Fprintf(os.Stderr, err.Error())

+ 404 - 0
vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go

@@ -0,0 +1,404 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build ignore
+
+/*
+This program reads a file containing function prototypes
+(like syscall_aix.go) and generates system call bodies.
+The prototypes are marked by lines beginning with "//sys"
+and read like func declarations if //sys is replaced by func, but:
+	* The parameter lists must give a name for each argument.
+	  This includes return parameters.
+	* The parameter lists must give a type for each argument:
+	  the (x, y, z int) shorthand is not allowed.
+	* If the return parameter is an error number, it must be named err.
+	* If go func name needs to be different than its libc name,
+	* or the function is not in libc, name could be specified
+	* at the end, after "=" sign, like
+	  //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt
+*/
+package main
+
+import (
+	"bufio"
+	"flag"
+	"fmt"
+	"os"
+	"regexp"
+	"strings"
+)
+
+var (
+	b32  = flag.Bool("b32", false, "32bit big-endian")
+	l32  = flag.Bool("l32", false, "32bit little-endian")
+	aix  = flag.Bool("aix", false, "aix")
+	tags = flag.String("tags", "", "build tags")
+)
+
+// cmdLine returns this programs's commandline arguments
+func cmdLine() string {
+	return "go run mksyscall_aix_ppc.go " + strings.Join(os.Args[1:], " ")
+}
+
+// buildTags returns build tags
+func buildTags() string {
+	return *tags
+}
+
+// Param is function parameter
+type Param struct {
+	Name string
+	Type string
+}
+
+// usage prints the program usage
+func usage() {
+	fmt.Fprintf(os.Stderr, "usage: go run mksyscall_aix_ppc.go [-b32 | -l32] [-tags x,y] [file ...]\n")
+	os.Exit(1)
+}
+
+// parseParamList parses parameter list and returns a slice of parameters
+func parseParamList(list string) []string {
+	list = strings.TrimSpace(list)
+	if list == "" {
+		return []string{}
+	}
+	return regexp.MustCompile(`\s*,\s*`).Split(list, -1)
+}
+
+// parseParam splits a parameter into name and type
+func parseParam(p string) Param {
+	ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p)
+	if ps == nil {
+		fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p)
+		os.Exit(1)
+	}
+	return Param{ps[1], ps[2]}
+}
+
+func main() {
+	flag.Usage = usage
+	flag.Parse()
+	if len(flag.Args()) <= 0 {
+		fmt.Fprintf(os.Stderr, "no files to parse provided\n")
+		usage()
+	}
+
+	endianness := ""
+	if *b32 {
+		endianness = "big-endian"
+	} else if *l32 {
+		endianness = "little-endian"
+	}
+
+	pack := ""
+	text := ""
+	cExtern := "/*\n#include <stdint.h>\n#include <stddef.h>\n"
+	for _, path := range flag.Args() {
+		file, err := os.Open(path)
+		if err != nil {
+			fmt.Fprintf(os.Stderr, err.Error())
+			os.Exit(1)
+		}
+		s := bufio.NewScanner(file)
+		for s.Scan() {
+			t := s.Text()
+			t = strings.TrimSpace(t)
+			t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `)
+			if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
+				pack = p[1]
+			}
+			nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t)
+			if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil {
+				continue
+			}
+
+			// Line must be of the form
+			//	func Open(path string, mode int, perm int) (fd int, err error)
+			// Split into name, in params, out params.
+			f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
+			if f == nil {
+				fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
+				os.Exit(1)
+			}
+			funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6]
+
+			// Split argument lists on comma.
+			in := parseParamList(inps)
+			out := parseParamList(outps)
+
+			inps = strings.Join(in, ", ")
+			outps = strings.Join(out, ", ")
+
+			// Try in vain to keep people from editing this file.
+			// The theory is that they jump into the middle of the file
+			// without reading the header.
+			text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
+
+			// Check if value return, err return available
+			errvar := ""
+			retvar := ""
+			rettype := ""
+			for _, param := range out {
+				p := parseParam(param)
+				if p.Type == "error" {
+					errvar = p.Name
+				} else {
+					retvar = p.Name
+					rettype = p.Type
+				}
+			}
+
+			// System call name.
+			if sysname == "" {
+				sysname = funct
+			}
+			sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`)
+			sysname = strings.ToLower(sysname) // All libc functions are lowercase.
+
+			cRettype := ""
+			if rettype == "unsafe.Pointer" {
+				cRettype = "uintptr_t"
+			} else if rettype == "uintptr" {
+				cRettype = "uintptr_t"
+			} else if regexp.MustCompile(`^_`).FindStringSubmatch(rettype) != nil {
+				cRettype = "uintptr_t"
+			} else if rettype == "int" {
+				cRettype = "int"
+			} else if rettype == "int32" {
+				cRettype = "int"
+			} else if rettype == "int64" {
+				cRettype = "long long"
+			} else if rettype == "uint32" {
+				cRettype = "unsigned int"
+			} else if rettype == "uint64" {
+				cRettype = "unsigned long long"
+			} else {
+				cRettype = "int"
+			}
+			if sysname == "exit" {
+				cRettype = "void"
+			}
+
+			// Change p.Types to c
+			var cIn []string
+			for _, param := range in {
+				p := parseParam(param)
+				if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
+					cIn = append(cIn, "uintptr_t")
+				} else if p.Type == "string" {
+					cIn = append(cIn, "uintptr_t")
+				} else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil {
+					cIn = append(cIn, "uintptr_t", "size_t")
+				} else if p.Type == "unsafe.Pointer" {
+					cIn = append(cIn, "uintptr_t")
+				} else if p.Type == "uintptr" {
+					cIn = append(cIn, "uintptr_t")
+				} else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil {
+					cIn = append(cIn, "uintptr_t")
+				} else if p.Type == "int" {
+					cIn = append(cIn, "int")
+				} else if p.Type == "int32" {
+					cIn = append(cIn, "int")
+				} else if p.Type == "int64" {
+					cIn = append(cIn, "long long")
+				} else if p.Type == "uint32" {
+					cIn = append(cIn, "unsigned int")
+				} else if p.Type == "uint64" {
+					cIn = append(cIn, "unsigned long long")
+				} else {
+					cIn = append(cIn, "int")
+				}
+			}
+
+			if funct != "fcntl" && funct != "FcntlInt" && funct != "readlen" && funct != "writelen" {
+				// Imports of system calls from libc
+				cExtern += fmt.Sprintf("%s %s", cRettype, sysname)
+				cIn := strings.Join(cIn, ", ")
+				cExtern += fmt.Sprintf("(%s);\n", cIn)
+			}
+
+			// So file name.
+			if *aix {
+				if modname == "" {
+					modname = "libc.a/shr_64.o"
+				} else {
+					fmt.Fprintf(os.Stderr, "%s: only syscall using libc are available\n", funct)
+					os.Exit(1)
+				}
+			}
+
+			strconvfunc := "C.CString"
+
+			// Go function header.
+			if outps != "" {
+				outps = fmt.Sprintf(" (%s)", outps)
+			}
+			if text != "" {
+				text += "\n"
+			}
+
+			text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outps)
+
+			// Prepare arguments to Syscall.
+			var args []string
+			n := 0
+			argN := 0
+			for _, param := range in {
+				p := parseParam(param)
+				if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
+					args = append(args, "C.uintptr_t(uintptr(unsafe.Pointer("+p.Name+")))")
+				} else if p.Type == "string" && errvar != "" {
+					text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name)
+					args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n))
+					n++
+				} else if p.Type == "string" {
+					fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n")
+					text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name)
+					args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n))
+					n++
+				} else if m := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); m != nil {
+					// Convert slice into pointer, length.
+					// Have to be careful not to take address of &a[0] if len == 0:
+					// pass nil in that case.
+					text += fmt.Sprintf("\tvar _p%d *%s\n", n, m[1])
+					text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name)
+					args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(unsafe.Pointer(_p%d)))", n))
+					n++
+					text += fmt.Sprintf("\tvar _p%d int\n", n)
+					text += fmt.Sprintf("\t_p%d = len(%s)\n", n, p.Name)
+					args = append(args, fmt.Sprintf("C.size_t(_p%d)", n))
+					n++
+				} else if p.Type == "int64" && endianness != "" {
+					if endianness == "big-endian" {
+						args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
+					} else {
+						args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
+					}
+					n++
+				} else if p.Type == "bool" {
+					text += fmt.Sprintf("\tvar _p%d uint32\n", n)
+					text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n)
+					args = append(args, fmt.Sprintf("_p%d", n))
+				} else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil {
+					args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name))
+				} else if p.Type == "unsafe.Pointer" {
+					args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name))
+				} else if p.Type == "int" {
+					if (argN == 2) && ((funct == "readlen") || (funct == "writelen")) {
+						args = append(args, fmt.Sprintf("C.size_t(%s)", p.Name))
+					} else if argN == 0 && funct == "fcntl" {
+						args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
+					} else if (argN == 2) && ((funct == "fcntl") || (funct == "FcntlInt")) {
+						args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
+					} else {
+						args = append(args, fmt.Sprintf("C.int(%s)", p.Name))
+					}
+				} else if p.Type == "int32" {
+					args = append(args, fmt.Sprintf("C.int(%s)", p.Name))
+				} else if p.Type == "int64" {
+					args = append(args, fmt.Sprintf("C.longlong(%s)", p.Name))
+				} else if p.Type == "uint32" {
+					args = append(args, fmt.Sprintf("C.uint(%s)", p.Name))
+				} else if p.Type == "uint64" {
+					args = append(args, fmt.Sprintf("C.ulonglong(%s)", p.Name))
+				} else if p.Type == "uintptr" {
+					args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
+				} else {
+					args = append(args, fmt.Sprintf("C.int(%s)", p.Name))
+				}
+				argN++
+			}
+
+			// Actual call.
+			arglist := strings.Join(args, ", ")
+			call := ""
+			if sysname == "exit" {
+				if errvar != "" {
+					call += "er :="
+				} else {
+					call += ""
+				}
+			} else if errvar != "" {
+				call += "r0,er :="
+			} else if retvar != "" {
+				call += "r0,_ :="
+			} else {
+				call += ""
+			}
+			call += fmt.Sprintf("C.%s(%s)", sysname, arglist)
+
+			// Assign return values.
+			body := ""
+			for i := 0; i < len(out); i++ {
+				p := parseParam(out[i])
+				reg := ""
+				if p.Name == "err" {
+					reg = "e1"
+				} else {
+					reg = "r0"
+				}
+				if reg != "e1" {
+					body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg)
+				}
+			}
+
+			// verify return
+			if sysname != "exit" && errvar != "" {
+				if regexp.MustCompile(`^uintptr`).FindStringSubmatch(cRettype) != nil {
+					body += "\tif (uintptr(r0) ==^uintptr(0) && er != nil) {\n"
+					body += fmt.Sprintf("\t\t%s = er\n", errvar)
+					body += "\t}\n"
+				} else {
+					body += "\tif (r0 ==-1 && er != nil) {\n"
+					body += fmt.Sprintf("\t\t%s = er\n", errvar)
+					body += "\t}\n"
+				}
+			} else if errvar != "" {
+				body += "\tif (er != nil) {\n"
+				body += fmt.Sprintf("\t\t%s = er\n", errvar)
+				body += "\t}\n"
+			}
+
+			text += fmt.Sprintf("\t%s\n", call)
+			text += body
+
+			text += "\treturn\n"
+			text += "}\n"
+		}
+		if err := s.Err(); err != nil {
+			fmt.Fprintf(os.Stderr, err.Error())
+			os.Exit(1)
+		}
+		file.Close()
+	}
+	imp := ""
+	if pack != "unix" {
+		imp = "import \"golang.org/x/sys/unix\"\n"
+
+	}
+	fmt.Printf(srcTemplate, cmdLine(), buildTags(), pack, cExtern, imp, text)
+}
+
+const srcTemplate = `// %s
+// Code generated by the command above; see README.md. DO NOT EDIT.
+
+// +build %s
+
+package %s
+
+
+%s
+*/
+import "C"
+import (
+	"unsafe"
+)
+
+
+%s
+
+%s
+`

+ 190 - 0
vendor/golang.org/x/sys/unix/mksysnum.go

@@ -0,0 +1,190 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build ignore
+
+// Generate system call table for DragonFly, NetBSD,
+// FreeBSD, OpenBSD or Darwin from master list
+// (for example, /usr/src/sys/kern/syscalls.master or
+// sys/syscall.h).
+package main
+
+import (
+	"bufio"
+	"fmt"
+	"io"
+	"io/ioutil"
+	"net/http"
+	"os"
+	"regexp"
+	"strings"
+)
+
+var (
+	goos, goarch string
+)
+
+// cmdLine returns this programs's commandline arguments
+func cmdLine() string {
+	return "go run mksysnum.go " + strings.Join(os.Args[1:], " ")
+}
+
+// buildTags returns build tags
+func buildTags() string {
+	return fmt.Sprintf("%s,%s", goarch, goos)
+}
+
+func checkErr(err error) {
+	if err != nil {
+		fmt.Fprintf(os.Stderr, "%v\n", err)
+		os.Exit(1)
+	}
+}
+
+// source string and substring slice for regexp
+type re struct {
+	str string   // source string
+	sub []string // matched sub-string
+}
+
+// Match performs regular expression match
+func (r *re) Match(exp string) bool {
+	r.sub = regexp.MustCompile(exp).FindStringSubmatch(r.str)
+	if r.sub != nil {
+		return true
+	}
+	return false
+}
+
+// fetchFile fetches a text file from URL
+func fetchFile(URL string) io.Reader {
+	resp, err := http.Get(URL)
+	checkErr(err)
+	defer resp.Body.Close()
+	body, err := ioutil.ReadAll(resp.Body)
+	checkErr(err)
+	return strings.NewReader(string(body))
+}
+
+// readFile reads a text file from path
+func readFile(path string) io.Reader {
+	file, err := os.Open(os.Args[1])
+	checkErr(err)
+	return file
+}
+
+func format(name, num, proto string) string {
+	name = strings.ToUpper(name)
+	// There are multiple entries for enosys and nosys, so comment them out.
+	nm := re{str: name}
+	if nm.Match(`^SYS_E?NOSYS$`) {
+		name = fmt.Sprintf("// %s", name)
+	}
+	if name == `SYS_SYS_EXIT` {
+		name = `SYS_EXIT`
+	}
+	return fmt.Sprintf("	%s = %s;  // %s\n", name, num, proto)
+}
+
+func main() {
+	// Get the OS (using GOOS_TARGET if it exist)
+	goos = os.Getenv("GOOS_TARGET")
+	if goos == "" {
+		goos = os.Getenv("GOOS")
+	}
+	// Get the architecture (using GOARCH_TARGET if it exists)
+	goarch = os.Getenv("GOARCH_TARGET")
+	if goarch == "" {
+		goarch = os.Getenv("GOARCH")
+	}
+	// Check if GOOS and GOARCH environment variables are defined
+	if goarch == "" || goos == "" {
+		fmt.Fprintf(os.Stderr, "GOARCH or GOOS not defined in environment\n")
+		os.Exit(1)
+	}
+
+	file := strings.TrimSpace(os.Args[1])
+	var syscalls io.Reader
+	if strings.HasPrefix(file, "https://") || strings.HasPrefix(file, "http://") {
+		// Download syscalls.master file
+		syscalls = fetchFile(file)
+	} else {
+		syscalls = readFile(file)
+	}
+
+	var text, line string
+	s := bufio.NewScanner(syscalls)
+	for s.Scan() {
+		t := re{str: line}
+		if t.Match(`^(.*)\\$`) {
+			// Handle continuation
+			line = t.sub[1]
+			line += strings.TrimLeft(s.Text(), " \t")
+		} else {
+			// New line
+			line = s.Text()
+		}
+		t = re{str: line}
+		if t.Match(`\\$`) {
+			continue
+		}
+		t = re{str: line}
+
+		switch goos {
+		case "dragonfly":
+			if t.Match(`^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$`) {
+				num, proto := t.sub[1], t.sub[2]
+				name := fmt.Sprintf("SYS_%s", t.sub[3])
+				text += format(name, num, proto)
+			}
+		case "freebsd":
+			if t.Match(`^([0-9]+)\s+\S+\s+(?:NO)?STD\s+({ \S+\s+(\w+).*)$`) {
+				num, proto := t.sub[1], t.sub[2]
+				name := fmt.Sprintf("SYS_%s", t.sub[3])
+				text += format(name, num, proto)
+			}
+		case "openbsd":
+			if t.Match(`^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$`) {
+				num, proto, name := t.sub[1], t.sub[3], t.sub[4]
+				text += format(name, num, proto)
+			}
+		case "netbsd":
+			if t.Match(`^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$`) {
+				num, proto, compat := t.sub[1], t.sub[6], t.sub[8]
+				name := t.sub[7] + "_" + t.sub[9]
+				if t.sub[11] != "" {
+					name = t.sub[7] + "_" + t.sub[11]
+				}
+				name = strings.ToUpper(name)
+				if compat == "" || compat == "13" || compat == "30" || compat == "50" {
+					text += fmt.Sprintf("	%s = %s;  // %s\n", name, num, proto)
+				}
+			}
+		case "darwin":
+			if t.Match(`^#define\s+SYS_(\w+)\s+([0-9]+)`) {
+				name, num := t.sub[1], t.sub[2]
+				name = strings.ToUpper(name)
+				text += fmt.Sprintf("	SYS_%s = %s;\n", name, num)
+			}
+		default:
+			fmt.Fprintf(os.Stderr, "unrecognized GOOS=%s\n", goos)
+			os.Exit(1)
+
+		}
+	}
+	err := s.Err()
+	checkErr(err)
+
+	fmt.Printf(template, cmdLine(), buildTags(), text)
+}
+
+const template = `// %s
+// Code generated by the command above; see README.md. DO NOT EDIT.
+
+// +build %s
+
+package unix
+
+const(
+%s)`

+ 19 - 6
vendor/golang.org/x/sys/unix/sockcmsg_unix.go

@@ -8,17 +8,30 @@
 
 
 package unix
 package unix
 
 
-import "unsafe"
+import (
+	"runtime"
+	"unsafe"
+)
 
 
 // Round the length of a raw sockaddr up to align it properly.
 // Round the length of a raw sockaddr up to align it properly.
 func cmsgAlignOf(salen int) int {
 func cmsgAlignOf(salen int) int {
 	salign := SizeofPtr
 	salign := SizeofPtr
-	// NOTE: It seems like 64-bit Darwin, DragonFly BSD and
-	// Solaris kernels still require 32-bit aligned access to
-	// network subsystem.
-	if darwin64Bit || dragonfly64Bit || solaris64Bit {
-		salign = 4
+
+	switch runtime.GOOS {
+	case "darwin", "dragonfly", "solaris":
+		// NOTE: It seems like 64-bit Darwin, DragonFly BSD and
+		// Solaris kernels still require 32-bit aligned access to
+		// network subsystem.
+		if SizeofPtr == 8 {
+			salign = 4
+		}
+	case "openbsd":
+		// OpenBSD armv7 requires 64-bit alignment.
+		if runtime.GOARCH == "arm" {
+			salign = 8
+		}
 	}
 	}
+
 	return (salen + salign - 1) & ^(salign - 1)
 	return (salen + salign - 1) & ^(salign - 1)
 }
 }
 
 

+ 8 - 8
vendor/golang.org/x/sys/unix/syscall_aix.go

@@ -13,10 +13,7 @@
 
 
 package unix
 package unix
 
 
-import (
-	"syscall"
-	"unsafe"
-)
+import "unsafe"
 
 
 /*
 /*
  * Wrapped
  * Wrapped
@@ -271,6 +268,13 @@ func Gettimeofday(tv *Timeval) (err error) {
 	return
 	return
 }
 }
 
 
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+	if raceenabled {
+		raceReleaseMerge(unsafe.Pointer(&ioSync))
+	}
+	return sendfile(outfd, infd, offset, count)
+}
+
 // TODO
 // TODO
 func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
 func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
 	return -1, ENOSYS
 	return -1, ENOSYS
@@ -385,10 +389,6 @@ func IoctlGetTermios(fd int, req uint) (*Termios, error) {
 
 
 //sys	fcntl(fd int, cmd int, arg int) (val int, err error)
 //sys	fcntl(fd int, cmd int, arg int) (val int, err error)
 
 
-func Flock(fd int, how int) (err error) {
-	return syscall.Flock(fd, how)
-}
-
 /*
 /*
  * Direct access
  * Direct access
  */
  */

+ 25 - 37
vendor/golang.org/x/sys/unix/syscall_darwin.go

@@ -108,17 +108,8 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (
 		return nil, err
 		return nil, err
 	}
 	}
 
 
-	_, _, e1 := Syscall6(
-		SYS_GETATTRLIST,
-		uintptr(unsafe.Pointer(_p0)),
-		uintptr(unsafe.Pointer(&attrList)),
-		uintptr(unsafe.Pointer(&attrBuf[0])),
-		uintptr(len(attrBuf)),
-		uintptr(options),
-		0,
-	)
-	if e1 != 0 {
-		return nil, e1
+	if err := getattrlist(_p0, unsafe.Pointer(&attrList), unsafe.Pointer(&attrBuf[0]), uintptr(len(attrBuf)), int(options)); err != nil {
+		return nil, err
 	}
 	}
 	size := *(*uint32)(unsafe.Pointer(&attrBuf[0]))
 	size := *(*uint32)(unsafe.Pointer(&attrBuf[0]))
 
 
@@ -151,6 +142,8 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (
 	return
 	return
 }
 }
 
 
+//sys getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error)
+
 //sysnb pipe() (r int, w int, err error)
 //sysnb pipe() (r int, w int, err error)
 
 
 func Pipe(p []int) (err error) {
 func Pipe(p []int) (err error) {
@@ -168,12 +161,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
 		_p0 = unsafe.Pointer(&buf[0])
 		_p0 = unsafe.Pointer(&buf[0])
 		bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
 		bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
 	}
 	}
-	r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(_p0), bufsize, uintptr(flags))
-	n = int(r0)
-	if e1 != 0 {
-		err = e1
-	}
-	return
+	return getfsstat(_p0, bufsize, flags)
 }
 }
 
 
 func xattrPointer(dest []byte) *byte {
 func xattrPointer(dest []byte) *byte {
@@ -298,21 +286,16 @@ func setattrlistTimes(path string, times []Timespec, flags int) error {
 	if flags&AT_SYMLINK_NOFOLLOW != 0 {
 	if flags&AT_SYMLINK_NOFOLLOW != 0 {
 		options |= FSOPT_NOFOLLOW
 		options |= FSOPT_NOFOLLOW
 	}
 	}
-	_, _, e1 := Syscall6(
-		SYS_SETATTRLIST,
-		uintptr(unsafe.Pointer(_p0)),
-		uintptr(unsafe.Pointer(&attrList)),
-		uintptr(unsafe.Pointer(&attributes)),
-		uintptr(unsafe.Sizeof(attributes)),
-		uintptr(options),
-		0,
-	)
-	if e1 != 0 {
-		return e1
-	}
-	return nil
+	return setattrlist(
+		_p0,
+		unsafe.Pointer(&attrList),
+		unsafe.Pointer(&attributes),
+		unsafe.Sizeof(attributes),
+		options)
 }
 }
 
 
+//sys setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error)
+
 func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error {
 func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error {
 	// Darwin doesn't support SYS_UTIMENSAT
 	// Darwin doesn't support SYS_UTIMENSAT
 	return ENOSYS
 	return ENOSYS
@@ -411,6 +394,18 @@ func Uname(uname *Utsname) error {
 	return nil
 	return nil
 }
 }
 
 
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+	if raceenabled {
+		raceReleaseMerge(unsafe.Pointer(&ioSync))
+	}
+	var length = int64(count)
+	err = sendfile(infd, outfd, *offset, &length, nil, 0)
+	written = int(length)
+	return
+}
+
+//sys	sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
+
 /*
 /*
  * Exposed directly
  * Exposed directly
  */
  */
@@ -435,12 +430,8 @@ func Uname(uname *Utsname) error {
 //sys	Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
 //sys	Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
 //sys	Flock(fd int, how int) (err error)
 //sys	Flock(fd int, how int) (err error)
 //sys	Fpathconf(fd int, name int) (val int, err error)
 //sys	Fpathconf(fd int, name int) (val int, err error)
-//sys	Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
-//sys	Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
-//sys	Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
 //sys	Fsync(fd int) (err error)
 //sys	Fsync(fd int) (err error)
 //sys	Ftruncate(fd int, length int64) (err error)
 //sys	Ftruncate(fd int, length int64) (err error)
-//sys	Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
 //sys	Getdtablesize() (size int)
 //sys	Getdtablesize() (size int)
 //sysnb	Getegid() (egid int)
 //sysnb	Getegid() (egid int)
 //sysnb	Geteuid() (uid int)
 //sysnb	Geteuid() (uid int)
@@ -460,7 +451,6 @@ func Uname(uname *Utsname) error {
 //sys	Link(path string, link string) (err error)
 //sys	Link(path string, link string) (err error)
 //sys	Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
 //sys	Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
 //sys	Listen(s int, backlog int) (err error)
 //sys	Listen(s int, backlog int) (err error)
-//sys	Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
 //sys	Mkdir(path string, mode uint32) (err error)
 //sys	Mkdir(path string, mode uint32) (err error)
 //sys	Mkdirat(dirfd int, path string, mode uint32) (err error)
 //sys	Mkdirat(dirfd int, path string, mode uint32) (err error)
 //sys	Mkfifo(path string, mode uint32) (err error)
 //sys	Mkfifo(path string, mode uint32) (err error)
@@ -492,8 +482,6 @@ func Uname(uname *Utsname) error {
 //sysnb	Setsid() (pid int, err error)
 //sysnb	Setsid() (pid int, err error)
 //sysnb	Settimeofday(tp *Timeval) (err error)
 //sysnb	Settimeofday(tp *Timeval) (err error)
 //sysnb	Setuid(uid int) (err error)
 //sysnb	Setuid(uid int) (err error)
-//sys	Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
-//sys	Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
 //sys	Symlink(path string, link string) (err error)
 //sys	Symlink(path string, link string) (err error)
 //sys	Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
 //sys	Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
 //sys	Sync() (err error)
 //sys	Sync() (err error)

+ 9 - 14
vendor/golang.org/x/sys/unix/syscall_darwin_386.go

@@ -8,7 +8,6 @@ package unix
 
 
 import (
 import (
 	"syscall"
 	"syscall"
-	"unsafe"
 )
 )
 
 
 func setTimespec(sec, nsec int64) Timespec {
 func setTimespec(sec, nsec int64) Timespec {
@@ -48,21 +47,17 @@ func (cmsg *Cmsghdr) SetLen(length int) {
 	cmsg.Len = uint32(length)
 	cmsg.Len = uint32(length)
 }
 }
 
 
-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
-	var length = uint64(count)
-
-	_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0)
-
-	written = int(length)
-
-	if e1 != 0 {
-		err = e1
-	}
-	return
-}
-
 func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
 func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
 
 
 // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
 // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
 // of darwin/386 the syscall is called sysctl instead of __sysctl.
 // of darwin/386 the syscall is called sysctl instead of __sysctl.
 const SYS___SYSCTL = SYS_SYSCTL
 const SYS___SYSCTL = SYS_SYSCTL
+
+//sys	Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
+//sys	Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
+//sys	Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
+//sys	Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
+//sys	getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
+//sys	Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
+//sys	Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
+//sys	Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64

+ 9 - 14
vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go

@@ -8,7 +8,6 @@ package unix
 
 
 import (
 import (
 	"syscall"
 	"syscall"
-	"unsafe"
 )
 )
 
 
 func setTimespec(sec, nsec int64) Timespec {
 func setTimespec(sec, nsec int64) Timespec {
@@ -48,21 +47,17 @@ func (cmsg *Cmsghdr) SetLen(length int) {
 	cmsg.Len = uint32(length)
 	cmsg.Len = uint32(length)
 }
 }
 
 
-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
-	var length = uint64(count)
-
-	_, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0)
-
-	written = int(length)
-
-	if e1 != 0 {
-		err = e1
-	}
-	return
-}
-
 func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
 func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
 
 
 // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
 // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
 // of darwin/amd64 the syscall is called sysctl instead of __sysctl.
 // of darwin/amd64 the syscall is called sysctl instead of __sysctl.
 const SYS___SYSCTL = SYS_SYSCTL
 const SYS___SYSCTL = SYS_SYSCTL
+
+//sys	Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
+//sys	Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
+//sys	Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
+//sys	Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
+//sys	getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
+//sys	Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
+//sys	Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
+//sys	Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64

+ 12 - 14
vendor/golang.org/x/sys/unix/syscall_darwin_arm.go

@@ -6,7 +6,6 @@ package unix
 
 
 import (
 import (
 	"syscall"
 	"syscall"
-	"unsafe"
 )
 )
 
 
 func setTimespec(sec, nsec int64) Timespec {
 func setTimespec(sec, nsec int64) Timespec {
@@ -46,21 +45,20 @@ func (cmsg *Cmsghdr) SetLen(length int) {
 	cmsg.Len = uint32(length)
 	cmsg.Len = uint32(length)
 }
 }
 
 
-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
-	var length = uint64(count)
-
-	_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0)
-
-	written = int(length)
-
-	if e1 != 0 {
-		err = e1
-	}
-	return
-}
-
 func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
 func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
 
 
 // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
 // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
 // of darwin/arm the syscall is called sysctl instead of __sysctl.
 // of darwin/arm the syscall is called sysctl instead of __sysctl.
 const SYS___SYSCTL = SYS_SYSCTL
 const SYS___SYSCTL = SYS_SYSCTL
+
+//sys	Fstat(fd int, stat *Stat_t) (err error)
+//sys	Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
+//sys	Fstatfs(fd int, stat *Statfs_t) (err error)
+//sys	getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT
+//sys	Lstat(path string, stat *Stat_t) (err error)
+//sys	Stat(path string, stat *Stat_t) (err error)
+//sys	Statfs(path string, stat *Statfs_t) (err error)
+
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
+	return 0, ENOSYS
+}

+ 12 - 14
vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go

@@ -8,7 +8,6 @@ package unix
 
 
 import (
 import (
 	"syscall"
 	"syscall"
-	"unsafe"
 )
 )
 
 
 func setTimespec(sec, nsec int64) Timespec {
 func setTimespec(sec, nsec int64) Timespec {
@@ -48,21 +47,20 @@ func (cmsg *Cmsghdr) SetLen(length int) {
 	cmsg.Len = uint32(length)
 	cmsg.Len = uint32(length)
 }
 }
 
 
-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
-	var length = uint64(count)
-
-	_, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0)
-
-	written = int(length)
-
-	if e1 != 0 {
-		err = e1
-	}
-	return
-}
-
 func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
 func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
 
 
 // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
 // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
 // of darwin/arm64 the syscall is called sysctl instead of __sysctl.
 // of darwin/arm64 the syscall is called sysctl instead of __sysctl.
 const SYS___SYSCTL = SYS_SYSCTL
 const SYS___SYSCTL = SYS_SYSCTL
+
+//sys	Fstat(fd int, stat *Stat_t) (err error)
+//sys	Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
+//sys	Fstatfs(fd int, stat *Statfs_t) (err error)
+//sys	getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT
+//sys	Lstat(path string, stat *Stat_t) (err error)
+//sys	Stat(path string, stat *Stat_t) (err error)
+//sys	Statfs(path string, stat *Statfs_t) (err error)
+
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
+	return 0, ENOSYS
+}

+ 31 - 0
vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go

@@ -0,0 +1,31 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin,go1.12
+
+package unix
+
+import "unsafe"
+
+// Implemented in the runtime package (runtime/sys_darwin.go)
+func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
+func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
+func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
+func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only
+func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
+func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
+
+//go:linkname syscall_syscall syscall.syscall
+//go:linkname syscall_syscall6 syscall.syscall6
+//go:linkname syscall_syscall6X syscall.syscall6X
+//go:linkname syscall_syscall9 syscall.syscall9
+//go:linkname syscall_rawSyscall syscall.rawSyscall
+//go:linkname syscall_rawSyscall6 syscall.rawSyscall6
+
+// Find the entry point for f. See comments in runtime/proc.go for the
+// function of the same name.
+//go:nosplit
+func funcPC(f func()) uintptr {
+	return **(**uintptr)(unsafe.Pointer(&f))
+}

+ 7 - 0
vendor/golang.org/x/sys/unix/syscall_dragonfly.go

@@ -234,6 +234,13 @@ func Uname(uname *Utsname) error {
 	return nil
 	return nil
 }
 }
 
 
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+	if raceenabled {
+		raceReleaseMerge(unsafe.Pointer(&ioSync))
+	}
+	return sendfile(outfd, infd, offset, count)
+}
+
 /*
 /*
  * Exposed directly
  * Exposed directly
  */
  */

+ 7 - 0
vendor/golang.org/x/sys/unix/syscall_freebsd.go

@@ -500,6 +500,13 @@ func convertFromDirents11(buf []byte, old []byte) int {
 	return dstPos
 	return dstPos
 }
 }
 
 
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+	if raceenabled {
+		raceReleaseMerge(unsafe.Pointer(&ioSync))
+	}
+	return sendfile(outfd, infd, offset, count)
+}
+
 /*
 /*
  * Exposed directly
  * Exposed directly
  */
  */

+ 52 - 0
vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go

@@ -0,0 +1,52 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build arm64,freebsd
+
+package unix
+
+import (
+	"syscall"
+	"unsafe"
+)
+
+func setTimespec(sec, nsec int64) Timespec {
+	return Timespec{Sec: sec, Nsec: nsec}
+}
+
+func setTimeval(sec, usec int64) Timeval {
+	return Timeval{Sec: sec, Usec: usec}
+}
+
+func SetKevent(k *Kevent_t, fd, mode, flags int) {
+	k.Ident = uint64(fd)
+	k.Filter = int16(mode)
+	k.Flags = uint16(flags)
+}
+
+func (iov *Iovec) SetLen(length int) {
+	iov.Len = uint64(length)
+}
+
+func (msghdr *Msghdr) SetControllen(length int) {
+	msghdr.Controllen = uint32(length)
+}
+
+func (cmsg *Cmsghdr) SetLen(length int) {
+	cmsg.Len = uint32(length)
+}
+
+func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+	var writtenOut uint64 = 0
+	_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)
+
+	written = int(writtenOut)
+
+	if e1 != 0 {
+		err = e1
+	}
+	return
+}
+
+func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)

+ 7 - 0
vendor/golang.org/x/sys/unix/syscall_linux.go

@@ -1360,6 +1360,13 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
 	return mount(source, target, fstype, flags, datap)
 	return mount(source, target, fstype, flags, datap)
 }
 }
 
 
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+	if raceenabled {
+		raceReleaseMerge(unsafe.Pointer(&ioSync))
+	}
+	return sendfile(outfd, infd, offset, count)
+}
+
 // Sendto
 // Sendto
 // Recvfrom
 // Recvfrom
 // Socketpair
 // Socketpair

+ 16 - 2
vendor/golang.org/x/sys/unix/syscall_linux_amd64.go

@@ -20,12 +20,26 @@ package unix
 //sysnb	Getgid() (gid int)
 //sysnb	Getgid() (gid int)
 //sysnb	Getrlimit(resource int, rlim *Rlimit) (err error)
 //sysnb	Getrlimit(resource int, rlim *Rlimit) (err error)
 //sysnb	Getuid() (uid int)
 //sysnb	Getuid() (uid int)
-//sysnb	InotifyInit() (fd int, err error)
+//sysnb	inotifyInit() (fd int, err error)
+
+func InotifyInit() (fd int, err error) {
+	// First try inotify_init1, because Android's seccomp policy blocks the latter.
+	fd, err = InotifyInit1(0)
+	if err == ENOSYS {
+		fd, err = inotifyInit()
+	}
+	return
+}
+
 //sys	Ioperm(from int, num int, on int) (err error)
 //sys	Ioperm(from int, num int, on int) (err error)
 //sys	Iopl(level int) (err error)
 //sys	Iopl(level int) (err error)
 //sys	Lchown(path string, uid int, gid int) (err error)
 //sys	Lchown(path string, uid int, gid int) (err error)
 //sys	Listen(s int, n int) (err error)
 //sys	Listen(s int, n int) (err error)
-//sys	Lstat(path string, stat *Stat_t) (err error)
+
+func Lstat(path string, stat *Stat_t) (err error) {
+	return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW)
+}
+
 //sys	Pause() (err error)
 //sys	Pause() (err error)
 //sys	Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
 //sys	Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
 //sys	Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
 //sys	Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64

+ 8 - 0
vendor/golang.org/x/sys/unix/syscall_linux_arm.go

@@ -257,3 +257,11 @@ func Poll(fds []PollFd, timeout int) (n int, err error) {
 	}
 	}
 	return poll(&fds[0], len(fds), timeout)
 	return poll(&fds[0], len(fds), timeout)
 }
 }
+
+//sys	armSyncFileRange(fd int, flags int, off int64, n int64) (err error) = SYS_ARM_SYNC_FILE_RANGE
+
+func SyncFileRange(fd int, off int64, n int64, flags int) error {
+	// The sync_file_range and arm_sync_file_range syscalls differ only in the
+	// order of their arguments.
+	return armSyncFileRange(fd, flags, off, n)
+}

+ 8 - 1
vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go

@@ -12,7 +12,6 @@ package unix
 //sys	EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
 //sys	EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
 //sys	Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
 //sys	Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
 //sys	Fchown(fd int, uid int, gid int) (err error)
 //sys	Fchown(fd int, uid int, gid int) (err error)
-//sys	Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
 //sys	Fstatfs(fd int, buf *Statfs_t) (err error)
 //sys	Fstatfs(fd int, buf *Statfs_t) (err error)
 //sys	Ftruncate(fd int, length int64) (err error)
 //sys	Ftruncate(fd int, length int64) (err error)
 //sysnb	Getegid() (egid int)
 //sysnb	Getegid() (egid int)
@@ -148,6 +147,7 @@ type stat_t struct {
 }
 }
 
 
 //sys	fstat(fd int, st *stat_t) (err error)
 //sys	fstat(fd int, st *stat_t) (err error)
+//sys	fstatat(dirfd int, path string, st *stat_t, flags int) (err error) = SYS_NEWFSTATAT
 //sys	lstat(path string, st *stat_t) (err error)
 //sys	lstat(path string, st *stat_t) (err error)
 //sys	stat(path string, st *stat_t) (err error)
 //sys	stat(path string, st *stat_t) (err error)
 
 
@@ -158,6 +158,13 @@ func Fstat(fd int, s *Stat_t) (err error) {
 	return
 	return
 }
 }
 
 
+func Fstatat(dirfd int, path string, s *Stat_t, flags int) (err error) {
+	st := &stat_t{}
+	err = fstatat(dirfd, path, st, flags)
+	fillStat_t(s, st)
+	return
+}
+
 func Lstat(path string, s *Stat_t) (err error) {
 func Lstat(path string, s *Stat_t) (err error) {
 	st := &stat_t{}
 	st := &stat_t{}
 	err = lstat(path, st)
 	err = lstat(path, st)

+ 7 - 0
vendor/golang.org/x/sys/unix/syscall_netbsd.go

@@ -244,6 +244,13 @@ func Uname(uname *Utsname) error {
 	return nil
 	return nil
 }
 }
 
 
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+	if raceenabled {
+		raceReleaseMerge(unsafe.Pointer(&ioSync))
+	}
+	return sendfile(outfd, infd, offset, count)
+}
+
 /*
 /*
  * Exposed directly
  * Exposed directly
  */
  */

+ 7 - 0
vendor/golang.org/x/sys/unix/syscall_openbsd.go

@@ -94,6 +94,13 @@ func Getwd() (string, error) {
 	return string(buf[:n]), nil
 	return string(buf[:n]), nil
 }
 }
 
 
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+	if raceenabled {
+		raceReleaseMerge(unsafe.Pointer(&ioSync))
+	}
+	return sendfile(outfd, infd, offset, count)
+}
+
 // TODO
 // TODO
 func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
 func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
 	return -1, ENOSYS
 	return -1, ENOSYS

+ 7 - 0
vendor/golang.org/x/sys/unix/syscall_solaris.go

@@ -585,6 +585,13 @@ func Poll(fds []PollFd, timeout int) (n int, err error) {
 	return poll(&fds[0], len(fds), timeout)
 	return poll(&fds[0], len(fds), timeout)
 }
 }
 
 
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+	if raceenabled {
+		raceReleaseMerge(unsafe.Pointer(&ioSync))
+	}
+	return sendfile(outfd, infd, offset, count)
+}
+
 /*
 /*
  * Exposed directly
  * Exposed directly
  */
  */

部分文件因为文件数量过多而无法显示