summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-04-02 19:38:52 +0200
committerDimitri Sokolyuk <demon@dim13.org>2018-04-02 19:38:52 +0200
commitd89304e29ce2d18d5d376183829321583123da38 (patch)
tree00cc01d00943faa9116c906e264f9b3618ba1e31
parenta1a91868a749d87a5292fcdb6387786d205d8f90 (diff)
update vendor
-rw-r--r--Gopkg.lock8
-rw-r--r--Gopkg.toml83
-rw-r--r--vendor/github.com/sarnowski/mitigation/mitigation_test.go173
-rw-r--r--vendor/golang.org/x/tools/.gitattributes10
-rw-r--r--vendor/golang.org/x/tools/.gitignore2
-rw-r--r--vendor/golang.org/x/tools/CONTRIBUTING.md31
-rw-r--r--vendor/golang.org/x/tools/README.md27
-rw-r--r--vendor/golang.org/x/tools/blog/blog.go15
-rw-r--r--vendor/golang.org/x/tools/cmd/getgo/LICENSE27
-rw-r--r--vendor/golang.org/x/tools/codereview.cfg1
-rw-r--r--vendor/golang.org/x/tools/present/code_test.go225
-rw-r--r--vendor/golang.org/x/tools/present/doc.go2
-rw-r--r--vendor/golang.org/x/tools/present/link_test.go40
-rw-r--r--vendor/golang.org/x/tools/present/style_test.go124
-rw-r--r--vendor/golang.org/x/tools/third_party/moduleloader/LICENSE22
-rw-r--r--vendor/golang.org/x/tools/third_party/typescript/LICENSE55
-rw-r--r--vendor/golang.org/x/tools/third_party/webcomponents/LICENSE27
17 files changed, 175 insertions, 697 deletions
diff --git a/Gopkg.lock b/Gopkg.lock
index 15ada43..5813b6a 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -10,8 +10,12 @@
[[projects]]
branch = "master"
name = "golang.org/x/tools"
- packages = ["blog","blog/atom","present"]
- revision = "ae8cc594552814363a7aeeb4f2825515a771fa38"
+ packages = [
+ "blog",
+ "blog/atom",
+ "present"
+ ]
+ revision = "ac136b6c2db7c4d43955e4bc7174db36dc0539c0"
[solve-meta]
analyzer-name = "dep"
diff --git a/Gopkg.toml b/Gopkg.toml
index 1937368..4349a42 100644
--- a/Gopkg.toml
+++ b/Gopkg.toml
@@ -1,69 +1,28 @@
-
-## Gopkg.toml example (these lines may be deleted)
-
-## "metadata" defines metadata about the project that could be used by other independent
-## systems. The metadata defined here will be ignored by dep.
-# [metadata]
-# key1 = "value that convey data to other systems"
-# system1-data = "value that is used by a system"
-# system2-data = "value that is used by another system"
-
-## "required" lists a set of packages (not projects) that must be included in
-## Gopkg.lock. This list is merged with the set of packages imported by the current
-## project. Use it when your project needs a package it doesn't explicitly import -
-## including "main" packages.
+# Gopkg.toml example
+#
+# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
+# for detailed Gopkg.toml documentation.
+#
# required = ["github.com/user/thing/cmd/thing"]
-
-## "ignored" lists a set of packages (not projects) that are ignored when
-## dep statically analyzes source code. Ignored packages can be in this project,
-## or in a dependency.
-# ignored = ["github.com/user/project/badpkg"]
-
-## Constraints are rules for how directly imported projects
-## may be incorporated into the depgraph. They are respected by
-## dep whether coming from the Gopkg.toml of the current project or a dependency.
-# [[constraint]]
-## Required: the root import path of the project being constrained.
-# name = "github.com/user/project"
+# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
-## Recommended: the version constraint to enforce for the project.
-## Only one of "branch", "version" or "revision" can be specified.
-# version = "1.0.0"
-# branch = "master"
-# revision = "abc123"
+# [[constraint]]
+# name = "github.com/user/project"
+# version = "1.0.0"
#
-## Optional: an alternate location (URL or import path) for the project's source.
-# source = "https://github.com/myfork/package.git"
+# [[constraint]]
+# name = "github.com/user/project2"
+# branch = "dev"
+# source = "github.com/myfork/project2"
#
-## "metadata" defines metadata about the dependency or override that could be used
-## by other independent systems. The metadata defined here will be ignored by dep.
-# [metadata]
-# key1 = "value that convey data to other systems"
-# system1-data = "value that is used by a system"
-# system2-data = "value that is used by another system"
-
-## Overrides have the same structure as [[constraint]], but supersede all
-## [[constraint]] declarations from all projects. Only [[override]] from
-## the current project's are applied.
-##
-## Overrides are a sledgehammer. Use them only as a last resort.
# [[override]]
-## Required: the root import path of the project being constrained.
-# name = "github.com/user/project"
+# name = "github.com/x/y"
+# version = "2.4.0"
#
-## Optional: specifying a version constraint override will cause all other
-## constraints on this project to be ignored; only the overridden constraint
-## need be satisfied.
-## Again, only one of "branch", "version" or "revision" can be specified.
-# version = "1.0.0"
-# branch = "master"
-# revision = "abc123"
-#
-## Optional: specifying an alternate source location as an override will
-## enforce that the alternate location is used for that project, regardless of
-## what source location any dependent projects specify.
-# source = "https://github.com/myfork/package.git"
-
+# [prune]
+# non-go = false
+# go-tests = true
+# unused-packages = true
[[constraint]]
@@ -73,3 +32,7 @@
[[constraint]]
branch = "master"
name = "golang.org/x/tools"
+
+[prune]
+ go-tests = true
+ unused-packages = true
diff --git a/vendor/github.com/sarnowski/mitigation/mitigation_test.go b/vendor/github.com/sarnowski/mitigation/mitigation_test.go
deleted file mode 100644
index 0fafeab..0000000
--- a/vendor/github.com/sarnowski/mitigation/mitigation_test.go
+++ /dev/null
@@ -1,173 +0,0 @@
-package mitigation
-
-import (
- "io/ioutil"
- "log"
- "net"
- "net/http"
- "os"
- "os/user"
- "runtime"
- "strconv"
- "syscall"
- "testing"
-)
-
-const (
- TEST_UID = 1000
- TEST_GID = 1000
-
- TEST_ROUTINES_COUNT = 100
-)
-
-// The test will only work when running as root.
-func TestCanActivate(t *testing.T) {
- if !CanActivate() {
- t.Fatal("Tests must run as root!")
- }
-}
-
-// The test will only work when running as root.
-func TestActivate(t *testing.T) {
- // create temporary directory to test chrooting
- tmp, err := ioutil.TempDir("", "mitigationtest")
- if err != nil {
- t.Fatal(err)
- }
- defer os.Remove(tmp)
- err = syscall.Chmod(tmp, 0755)
- if err != nil {
- t.Fatal("Could not change temporary directory permissions!")
- }
-
- // improve cpu usage to test for broken os implementations of setuid()
- runtime.GOMAXPROCS(2)
-
- // create some go routines as root to later test them
- var sync chan bool = make(chan bool)
- for i := 0; i < TEST_ROUTINES_COUNT; i++ {
- go func() {
- // no op
- sync <- true
- }()
- }
- for i := 0; i < TEST_ROUTINES_COUNT; i++ {
- <-sync
- }
-
- // modify environment
- err = os.Setenv("malicous_env", "bad string")
- if err != nil {
- t.Fatal("Cannot setup environment variables!")
- }
- if len(os.Environ()) == 0 {
- t.Fatal("Environ() or Setenv() are broken!")
- }
-
- // do it!
- Activate(TEST_UID, TEST_GID, tmp)
-
- // verify uids
- uid := syscall.Getuid()
- if uid != TEST_UID {
- t.Error("Failed to change UID")
- }
- euid := syscall.Geteuid()
- if euid != TEST_UID {
- t.Error("Failed to change EUID")
- }
-
- // verify gid
- gid := syscall.Getgid()
- if gid != TEST_GID {
- t.Error("Failed to change GID")
- }
-
- // verify groups
- gids, err := syscall.Getgroups()
- if err != nil {
- t.Fatal("Could not get group list")
- }
- if len(gids) > 1 {
- t.Error("Not all groups are dropped!")
- } else if len(gids) == 1 {
- if gids[0] != TEST_GID {
- t.Error("Not all foreign groups are dropped!")
- }
- }
-
- // verify directory
- dh, err := os.Open("/")
- if err != nil {
- t.Fatal("Cannot open my root directory", err)
- }
- files, err := dh.Readdir(-1)
- if err != nil {
- t.Fatal("Cannot read my root directory")
- }
- if len(files) > 0 {
- t.Error("Root not changed to empty temporary directory!")
- }
-
- // verify environment
- if len(os.Environ()) > 0 {
- t.Error("Environment variables found!")
- }
-
- // test setuid() behaviour
- var results chan int = make(chan int)
-
- // start multiple goroutines, in a good OS, all all routines
- // should be switched to the new user
- for i := 0; i < TEST_ROUTINES_COUNT; i++ {
- go func() {
- results <- syscall.Getuid()
- }()
- }
-
- // check the results
- for i := 0; i < TEST_ROUTINES_COUNT; i++ {
- uid := <-results
- if uid != TEST_UID {
- t.Error("false uid: ", uid, " (you are using an unsafe os, read the package documentation!)")
- break
- }
- }
-}
-
-func ExampleActivate() {
- // prepare application execution and allocate ressources with
- // root privileges (e.g. open port 80 for an http server)
- listener, _ := net.Listen("tcp", ":80")
-
-
- // on OpenBSD, the "www" user is dedicated to serve the
- // /var/www/htdocs directory in a chrooted way
- wwwUser, _ := user.Lookup("www")
- uid, _ := strconv.Atoi(wwwUser.Uid)
- gid, _ := strconv.Atoi(wwwUser.Gid)
-
- // now drop all privileges and chroot!
- Activate(uid, gid, "/var/www/htdocs")
-
-
- // The application is now chrooted and only runs with "www"
- // privileges.
- http.Serve(listener, http.FileServer(http.Dir("/")))
-}
-
-func ExampleCanActivate() {
- workDir := "/var/www"
-
- if CanActivate() {
- // activate the mitigation and reset work directory to "/"
- Activate(67, 67, workDir)
- workDir = "/"
- } else {
- // we can handle this but log a warning
- log.Println("WARNING: Cannot activate mitigation!")
- }
-
- // use "workDir" to address our files
- log.Println("Working directory: ", workDir)
-}
diff --git a/vendor/golang.org/x/tools/.gitattributes b/vendor/golang.org/x/tools/.gitattributes
deleted file mode 100644
index d2f212e..0000000
--- a/vendor/golang.org/x/tools/.gitattributes
+++ /dev/null
@@ -1,10 +0,0 @@
-# Treat all files in this repo as binary, with no git magic updating
-# line endings. Windows users contributing to Go will need to use a
-# modern version of git and editors capable of LF line endings.
-#
-# We'll prevent accidental CRLF line endings from entering the repo
-# via the git-review gofmt checks.
-#
-# See golang.org/issue/9281
-
-* -text
diff --git a/vendor/golang.org/x/tools/.gitignore b/vendor/golang.org/x/tools/.gitignore
deleted file mode 100644
index 5a9d62e..0000000
--- a/vendor/golang.org/x/tools/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-# Add no patterns to .gitignore except for files generated by the build.
-last-change
diff --git a/vendor/golang.org/x/tools/CONTRIBUTING.md b/vendor/golang.org/x/tools/CONTRIBUTING.md
deleted file mode 100644
index 88dff59..0000000
--- a/vendor/golang.org/x/tools/CONTRIBUTING.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# Contributing to Go
-
-Go is an open source project.
-
-It is the work of hundreds of contributors. We appreciate your help!
-
-
-## Filing issues
-
-When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions:
-
-1. What version of Go are you using (`go version`)?
-2. What operating system and processor architecture are you using?
-3. What did you do?
-4. What did you expect to see?
-5. What did you see instead?
-
-General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker.
-The gophers there will answer or ask you to file an issue if you've tripped over a bug.
-
-## Contributing code
-
-Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html)
-before sending patches.
-
-**We do not accept GitHub pull requests**
-(we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review).
-
-Unless otherwise noted, the Go source files are distributed under
-the BSD-style license found in the LICENSE file.
-
diff --git a/vendor/golang.org/x/tools/README.md b/vendor/golang.org/x/tools/README.md
deleted file mode 100644
index 20be9e1..0000000
--- a/vendor/golang.org/x/tools/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Go Tools
-
-This subrepository holds the source for various packages and tools that support
-the Go programming language.
-
-Some of the tools, `godoc` and `vet` for example, are included in binary Go
-distributions.
-
-Others, including the Go `guru` and the test coverage tool, can be fetched with
-`go get`.
-
-Packages include a type-checker for Go and an implementation of the
-Static Single Assignment form (SSA) representation for Go programs.
-
-## Download/Install
-
-The easiest way to install is to run `go get -u golang.org/x/tools/...`. You can
-also manually git clone the repository to `$GOPATH/src/golang.org/x/tools`.
-
-## Report Issues / Send Patches
-
-This repository uses Gerrit for code changes. To learn how to submit changes to
-this repository, see https://golang.org/doc/contribute.html.
-
-The main issue tracker for the tools repository is located at
-https://github.com/golang/go/issues. Prefix your issue with "x/tools/(your
-subdir):" in the subject line, so it is easy to find.
diff --git a/vendor/golang.org/x/tools/blog/blog.go b/vendor/golang.org/x/tools/blog/blog.go
index 23c8dc6..4055b1b 100644
--- a/vendor/golang.org/x/tools/blog/blog.go
+++ b/vendor/golang.org/x/tools/blog/blog.go
@@ -73,10 +73,17 @@ type Server struct {
func NewServer(cfg Config) (*Server, error) {
present.PlayEnabled = cfg.PlayEnabled
+ if notExist(cfg.TemplatePath) {
+ return nil, fmt.Errorf("template directory not found: %s", cfg.TemplatePath)
+ }
root := filepath.Join(cfg.TemplatePath, "root.tmpl")
parse := func(name string) (*template.Template, error) {
+ path := filepath.Join(cfg.TemplatePath, name)
+ if notExist(path) {
+ return nil, fmt.Errorf("template %s was not found in %s", name, cfg.TemplatePath)
+ }
t := template.New("").Funcs(funcMap)
- return t.ParseFiles(root, filepath.Join(cfg.TemplatePath, name))
+ return t.ParseFiles(root, path)
}
s := &Server{cfg: cfg}
@@ -422,3 +429,9 @@ type docsByTime []*Doc
func (s docsByTime) Len() int { return len(s) }
func (s docsByTime) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
func (s docsByTime) Less(i, j int) bool { return s[i].Time.After(s[j].Time) }
+
+// notExist reports whether the path exists or not.
+func notExist(path string) bool {
+ _, err := os.Stat(path)
+ return os.IsNotExist(err)
+}
diff --git a/vendor/golang.org/x/tools/cmd/getgo/LICENSE b/vendor/golang.org/x/tools/cmd/getgo/LICENSE
new file mode 100644
index 0000000..32017f8
--- /dev/null
+++ b/vendor/golang.org/x/tools/cmd/getgo/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2017 The Go Authors. 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.
diff --git a/vendor/golang.org/x/tools/codereview.cfg b/vendor/golang.org/x/tools/codereview.cfg
deleted file mode 100644
index 3f8b14b..0000000
--- a/vendor/golang.org/x/tools/codereview.cfg
+++ /dev/null
@@ -1 +0,0 @@
-issuerepo: golang/go
diff --git a/vendor/golang.org/x/tools/present/code_test.go b/vendor/golang.org/x/tools/present/code_test.go
deleted file mode 100644
index b01a4e3..0000000
--- a/vendor/golang.org/x/tools/present/code_test.go
+++ /dev/null
@@ -1,225 +0,0 @@
-// Copyright 2012 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 present
-
-import (
- "fmt"
- "html/template"
- "strings"
- "testing"
-)
-
-func TestParseCode(t *testing.T) {
- // Enable play but revert the change at the end.
- defer func(play bool) { PlayEnabled = play }(PlayEnabled)
- PlayEnabled = true
-
- helloTest := []byte(`
-package main
-
-import "fmt"
-
-func main() {
- fmt.Println("hello, test")
-}
-`)
- helloTestHTML := template.HTML(`
-<pre><span num="2">package main</span>
-<span num="3"></span>
-<span num="4">import &#34;fmt&#34;</span>
-<span num="5"></span>
-<span num="6">func main() {</span>
-<span num="7"> fmt.Println(&#34;hello, test&#34;)</span>
-<span num="8">}</span>
-</pre>
-`)
- helloTestHL := []byte(`
-package main
-
-import "fmt" // HLimport
-
-func main() { // HLfunc
- fmt.Println("hello, test") // HL
-}
-`)
- highlight := func(h template.HTML, s string) template.HTML {
- return template.HTML(strings.Replace(string(h), s, "<b>"+s+"</b>", -1))
- }
- read := func(b []byte, err error) func(string) ([]byte, error) {
- return func(string) ([]byte, error) { return b, err }
- }
-
- tests := []struct {
- name string
- readFile func(string) ([]byte, error)
- sourceFile string
- cmd string
- err string
- Code
- }{
- {
- name: "all code, no play",
- readFile: read(helloTest, nil),
- sourceFile: "main.go",
- cmd: ".code main.go",
- Code: Code{
- Ext: ".go",
- FileName: "main.go",
- Raw: helloTest,
- Text: helloTestHTML,
- },
- },
- {
- name: "all code, play",
- readFile: read(helloTest, nil),
- sourceFile: "main.go",
- cmd: ".play main.go",
- Code: Code{
- Ext: ".go",
- FileName: "main.go",
- Play: true,
- Raw: helloTest,
- Text: helloTestHTML,
- },
- },
- {
- name: "all code, highlighted",
- readFile: read(helloTestHL, nil),
- sourceFile: "main.go",
- cmd: ".code main.go",
- Code: Code{
- Ext: ".go",
- FileName: "main.go",
- Raw: helloTestHL,
- Text: highlight(helloTestHTML, "fmt.Println(&#34;hello, test&#34;)"),
- },
- },
- {
- name: "highlight only func",
- readFile: read(helloTestHL, nil),
- sourceFile: "main.go",
- cmd: ".code main.go HLfunc",
- Code: Code{
- Ext: ".go",
- FileName: "main.go",
- Play: false,
- Raw: []byte("package main\n\nimport \"fmt\" // HLimport\n\nfunc main() { // HLfunc\n\tfmt.Println(\"hello, test\") // HL\n}"),
- Text: highlight(helloTestHTML, "func main() {"),
- },
- },
- {
- name: "bad highlight syntax",
- readFile: read(helloTest, nil),
- sourceFile: "main.go",
- cmd: ".code main.go HL",
- err: "invalid highlight syntax",
- },
- {
- name: "error reading file",
- readFile: read(nil, fmt.Errorf("nope")),
- sourceFile: "main.go",
- cmd: ".code main.go",
- err: "main.go:0: nope",
- },
- {
- name: "from func main to the end",
- readFile: read(helloTest, nil),
- sourceFile: "main.go",
- cmd: ".code main.go /func main/,",
- Code: Code{
- Ext: ".go",
- FileName: "main.go",
- Play: false,
- Raw: []byte("func main() {\n\tfmt.Println(\"hello, test\")\n}"),
- Text: "<pre><span num=\"6\">func main() {</span>\n<span num=\"7\"> fmt.Println(&#34;hello, test&#34;)</span>\n<span num=\"8\">}</span>\n</pre>",
- },
- },
- {
- name: "just func main",
- readFile: read(helloTest, nil),
- sourceFile: "main.go",
- cmd: ".code main.go /func main/",
- Code: Code{
- Ext: ".go",
- FileName: "main.go",
- Play: false,
- Raw: []byte("func main() {"),
- Text: "<pre><span num=\"6\">func main() {</span>\n</pre>",
- },
- },
- {
- name: "bad address",
- readFile: read(helloTest, nil),
- sourceFile: "main.go",
- cmd: ".code main.go /function main/",
- err: "main.go:0: no match for function main",
- },
- {
- name: "all code with numbers",
- readFile: read(helloTest, nil),
- sourceFile: "main.go",
- cmd: ".code -numbers main.go",
- Code: Code{
- Ext: ".go",
- FileName: "main.go",
- Raw: helloTest,
- // Replacing the first "<pre>"
- Text: "<pre class=\"numbers\">" + helloTestHTML[6:],
- },
- },
- {
- name: "all code editable",
- readFile: read(helloTest, nil),
- sourceFile: "main.go",
- cmd: ".code -edit main.go",
- Code: Code{
- Ext: ".go",
- FileName: "main.go",
- Raw: helloTest,
- Text: "<pre contenteditable=\"true\" spellcheck=\"false\">" + helloTestHTML[6:],
- },
- },
- }
-
- trimHTML := func(t template.HTML) string { return strings.TrimSpace(string(t)) }
- trimBytes := func(b []byte) string { return strings.TrimSpace(string(b)) }
-
- for _, tt := range tests {
- ctx := &Context{tt.readFile}
- e, err := parseCode(ctx, tt.sourceFile, 0, tt.cmd)
- if err != nil {
- if tt.err == "" {
- t.Errorf("%s: unexpected error %v", tt.name, err)
- } else if !strings.Contains(err.Error(), tt.err) {
- t.Errorf("%s: expected error %s; got %v", tt.name, tt.err, err)
- }
- continue
- }
- if tt.err != "" {
- t.Errorf("%s: expected error %s; but got none", tt.name, tt.err)
- continue
- }
- c, ok := e.(Code)
- if !ok {
- t.Errorf("%s: expected a Code value; got %T", tt.name, e)
- continue
- }
- if c.FileName != tt.FileName {
- t.Errorf("%s: expected FileName %s; got %s", tt.name, tt.FileName, c.FileName)
- }
- if c.Ext != tt.Ext {
- t.Errorf("%s: expected Ext %s; got %s", tt.name, tt.Ext, c.Ext)
- }
- if c.Play != tt.Play {
- t.Errorf("%s: expected Play %v; got %v", tt.name, tt.Play, c.Play)
- }
- if got, wants := trimBytes(c.Raw), trimBytes(tt.Raw); got != wants {
- t.Errorf("%s: expected Raw \n%q\n; got \n%q\n", tt.name, wants, got)
- }
- if got, wants := trimHTML(c.Text), trimHTML(tt.Text); got != wants {
- t.Errorf("%s: expected Text \n%q\n; got \n%q\n", tt.name, wants, got)
- }
- }
-}
diff --git a/vendor/golang.org/x/tools/present/doc.go b/vendor/golang.org/x/tools/present/doc.go
index 1eae9c8..45039b6 100644
--- a/vendor/golang.org/x/tools/present/doc.go
+++ b/vendor/golang.org/x/tools/present/doc.go
@@ -117,7 +117,7 @@ a file name followed by an optional address that specifies what
section of the file to display. The address syntax is similar in
its simplest form to that of ed, but comes from sam and is more
general. See
- http://plan9.bell-labs.com/sys/doc/sam/sam.html Table II
+ https://plan9.io/sys/doc/sam/sam.html Table II
for full details. The displayed block is always rounded out to a
full line at both ends.
diff --git a/vendor/golang.org/x/tools/present/link_test.go b/vendor/golang.org/x/tools/present/link_test.go
deleted file mode 100644
index 334e72b..0000000
--- a/vendor/golang.org/x/tools/present/link_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2012 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 present
-
-import "testing"
-
-func TestInlineParsing(t *testing.T) {
- var tests = []struct {
- in string
- link string
- text string
- length int
- }{
- {"[[http://golang.org]]", "http://golang.org", "golang.org", 21},
- {"[[http://golang.org][]]", "http://golang.org", "http://golang.org", 23},
- {"[[http://golang.org]] this is ignored", "http://golang.org", "golang.org", 21},
- {"[[http://golang.org][link]]", "http://golang.org", "link", 27},
- {"[[http://golang.org][two words]]", "http://golang.org", "two words", 32},
- {"[[http://golang.org][*link*]]", "http://golang.org", "<b>link</b>", 29},
- {"[[http://bad[url]]", "", "", 0},
- {"[[http://golang.org][a [[link]] ]]", "http://golang.org", "a [[link", 31},
- {"[[http:// *spaces* .com]]", "", "", 0},
- {"[[http://bad`char.com]]", "", "", 0},
- {" [[http://google.com]]", "", "", 0},
- {"[[mailto:gopher@golang.org][Gopher]]", "mailto:gopher@golang.org", "Gopher", 36},
- {"[[mailto:gopher@golang.org]]", "mailto:gopher@golang.org", "gopher@golang.org", 28},
- }
-
- for i, test := range tests {
- link, length := parseInlineLink(test.in)
- if length == 0 && test.length == 0 {
- continue
- }
- if a := renderLink(test.link, test.text); length != test.length || link != a {
- t.Errorf("#%d: parseInlineLink(%q):\ngot\t%q, %d\nwant\t%q, %d", i, test.in, link, length, a, test.length)
- }
- }
-}
diff --git a/vendor/golang.org/x/tools/present/style_test.go b/vendor/golang.org/x/tools/present/style_test.go
deleted file mode 100644
index cef5a62..0000000
--- a/vendor/golang.org/x/tools/present/style_test.go
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright 2012 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 present
-
-import (
- "fmt"
- "reflect"
- "testing"
-)
-
-func TestSplit(t *testing.T) {
- var tests = []struct {
- in string
- out []string
- }{
- {"", []string{}},
- {" ", []string{" "}},
- {"abc", []string{"abc"}},
- {"abc def", []string{"abc", " ", "def"}},
- {"abc def ", []string{"abc", " ", "def", " "}},
- {"hey [[http://golang.org][Gophers]] around",
- []string{"hey", " ", "[[http://golang.org][Gophers]]", " ", "around"}},
- {"A [[http://golang.org/doc][two words]] link",
- []string{"A", " ", "[[http://golang.org/doc][two words]]", " ", "link"}},
- {"Visit [[http://golang.org/doc]] now",
- []string{"Visit", " ", "[[http://golang.org/doc]]", " ", "now"}},
- {"not [[http://golang.org/doc][a [[link]] ]] around",
- []string{"not", " ", "[[http://golang.org/doc][a [[link]]", " ", "]]", " ", "around"}},
- {"[[http://golang.org][foo bar]]",
- []string{"[[http://golang.org][foo bar]]"}},
- {"ends with [[http://golang.org][link]]",
- []string{"ends", " ", "with", " ", "[[http://golang.org][link]]"}},
- {"my talk ([[http://talks.golang.org/][slides here]])",
- []string{"my", " ", "talk", " ", "(", "[[http://talks.golang.org/][slides here]]", ")"}},
- }
- for _, test := range tests {
- out := split(test.in)
- if !reflect.DeepEqual(out, test.out) {
- t.Errorf("split(%q):\ngot\t%q\nwant\t%q", test.in, out, test.out)
- }
- }
-}
-
-func TestFont(t *testing.T) {
- var tests = []struct {
- in string
- out string
- }{
- {"", ""},
- {" ", " "},
- {"\tx", "\tx"},
- {"_a_", "<i>a</i>"},
- {"*a*", "<b>a</b>"},
- {"`a`", "<code>a</code>"},
- {"_a_b_", "<i>a b</i>"},
- {"_a__b_", "<i>a_b</i>"},
- {"_a___b_", "<i>a_ b</i>"},
- {"*a**b*?", "<b>a*b</b>?"},
- {"_a_<>_b_.", "<i>a <> b</i>."},
- {"(_a_)", "(<i>a</i>)"},
- {"((_a_), _b_, _c_).", "((<i>a</i>), <i>b</i>, <i>c</i>)."},
- {"(_a)", "(_a)"},
- {"(_a)", "(_a)"},
- {"_Why_use_scoped__ptr_? Use plain ***ptr* instead.", "<i>Why use scoped_ptr</i>? Use plain <b>*ptr</b> instead."},
- {"_hey_ [[http://golang.org][*Gophers*]] *around*",
- `<i>hey</i> <a href="http://golang.org" target="_blank"><b>Gophers</b></a> <b>around</b>`},
- {"_hey_ [[http://golang.org][so _many_ *Gophers*]] *around*",
- `<i>hey</i> <a href="http://golang.org" target="_blank">so <i>many</i> <b>Gophers</b></a> <b>around</b>`},
- {"Visit [[http://golang.org]] now",
- `Visit <a href="http://golang.org" target="_blank">golang.org</a> now`},
- {"my talk ([[http://talks.golang.org/][slides here]])",
- `my talk (<a href="http://talks.golang.org/" target="_blank">slides here</a>)`},
- {"Markup—_especially_italic_text_—can easily be overused.",
- `Markup—<i>especially italic text</i>—can easily be overused.`},
- {"`go`get`'s codebase", // ascii U+0027 ' before s
- `<code>go get</code>'s codebase`},
- {"`go`get`’s codebase", // unicode right single quote U+2019 ’ before s
- `<code>go get</code>’s codebase`},
- {"a_variable_name",
- `a_variable_name`},
- }
- for _, test := range tests {
- out := font(test.in)
- if out != test.out {
- t.Errorf("font(%q):\ngot\t%q\nwant\t%q", test.in, out, test.out)
- }
- }
-}
-
-func TestStyle(t *testing.T) {
- var tests = []struct {
- in string
- out string
- }{
- {"", ""},
- {" ", " "},
- {"\tx", "\tx"},
- {"_a_", "<i>a</i>"},
- {"*a*", "<b>a</b>"},
- {"`a`", "<code>a</code>"},
- {"_a_b_", "<i>a b</i>"},
- {"_a__b_", "<i>a_b</i>"},
- {"_a___b_", "<i>a_ b</i>"},
- {"*a**b*?", "<b>a*b</b>?"},
- {"_a_<>_b_.", "<i>a &lt;&gt; b</i>."},
- {"(_a_<>_b_)", "(<i>a &lt;&gt; b</i>)"},
- {"((_a_), _b_, _c_).", "((<i>a</i>), <i>b</i>, <i>c</i>)."},
- {"(_a)", "(_a)"},
- }
- for _, test := range tests {
- out := string(Style(test.in))
- if out != test.out {
- t.Errorf("style(%q):\ngot\t%q\nwant\t%q", test.in, out, test.out)
- }
- }
-}
-
-func ExampleStyle() {
- const s = "*Gophers* are _clearly_ > *cats*!"
- fmt.Println(Style(s))
- // Output: <b>Gophers</b> are <i>clearly</i> &gt; <b>cats</b>!
-}
diff --git a/vendor/golang.org/x/tools/third_party/moduleloader/LICENSE b/vendor/golang.org/x/tools/third_party/moduleloader/LICENSE
new file mode 100644
index 0000000..1723a22
--- /dev/null
+++ b/vendor/golang.org/x/tools/third_party/moduleloader/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2013-2016 Guy Bedford, Luke Hoban, Addy Osmani
+
+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 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. \ No newline at end of file
diff --git a/vendor/golang.org/x/tools/third_party/typescript/LICENSE b/vendor/golang.org/x/tools/third_party/typescript/LICENSE
new file mode 100644
index 0000000..e7259f8
--- /dev/null
+++ b/vendor/golang.org/x/tools/third_party/typescript/LICENSE
@@ -0,0 +1,55 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS \ No newline at end of file
diff --git a/vendor/golang.org/x/tools/third_party/webcomponents/LICENSE b/vendor/golang.org/x/tools/third_party/webcomponents/LICENSE
new file mode 100644
index 0000000..e648283
--- /dev/null
+++ b/vendor/golang.org/x/tools/third_party/webcomponents/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2015 The Polymer Authors. 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. \ No newline at end of file