├── BUILD
├── Gopkg.lock
├── Gopkg.toml
├── LICENSE
├── README.md
├── WORKSPACE
├── dep
├── BUILD
├── dep.bzl
└── update.sh.tpl
├── dep2bazel
├── BUILD
└── main.go
└── vendor
├── github.com
└── BurntSushi
│ └── toml
│ ├── .gitignore
│ ├── .travis.yml
│ ├── COMPATIBLE
│ ├── COPYING
│ ├── Makefile
│ ├── README.md
│ ├── _examples
│ ├── example.go
│ ├── example.toml
│ ├── hard.toml
│ ├── implicit.toml
│ ├── invalid-apples.toml
│ ├── invalid.toml
│ ├── readme1.toml
│ └── readme2.toml
│ ├── cmd
│ ├── toml-test-decoder
│ │ ├── COPYING
│ │ ├── README.md
│ │ └── main.go
│ ├── toml-test-encoder
│ │ ├── COPYING
│ │ ├── README.md
│ │ └── main.go
│ └── tomlv
│ │ ├── COPYING
│ │ ├── README.md
│ │ └── main.go
│ ├── decode.go
│ ├── decode_meta.go
│ ├── decode_test.go
│ ├── doc.go
│ ├── encode.go
│ ├── encode_test.go
│ ├── encoding_types.go
│ ├── encoding_types_1.1.go
│ ├── lex.go
│ ├── parse.go
│ ├── session.vim
│ ├── type_check.go
│ └── type_fields.go
└── golang.org
└── x
└── tools
├── .gitattributes
├── .gitignore
├── AUTHORS
├── CONTRIBUTING.md
├── CONTRIBUTORS
├── LICENSE
├── PATENTS
├── README.md
├── benchmark
└── parse
│ ├── parse.go
│ └── parse_test.go
├── blog
├── atom
│ └── atom.go
└── blog.go
├── cmd
├── benchcmp
│ ├── benchcmp.go
│ ├── benchcmp_test.go
│ ├── compare.go
│ ├── compare_test.go
│ └── doc.go
├── bundle
│ ├── .gitignore
│ ├── main.go
│ ├── main_test.go
│ └── testdata
│ │ ├── out.golden
│ │ └── src
│ │ ├── domain.name
│ │ └── importdecl
│ │ │ └── p.go
│ │ └── initial
│ │ ├── a.go
│ │ ├── b.go
│ │ └── c.go
├── callgraph
│ ├── main.go
│ ├── main_test.go
│ └── testdata
│ │ └── src
│ │ └── pkg
│ │ ├── pkg.go
│ │ └── pkg_test.go
├── compilebench
│ └── main.go
├── cover
│ ├── README
│ ├── cover.go
│ ├── cover_test.go
│ ├── doc.go
│ ├── func.go
│ ├── html.go
│ └── testdata
│ │ ├── main.go
│ │ └── test.go
├── digraph
│ ├── digraph.go
│ └── digraph_test.go
├── eg
│ └── eg.go
├── fiximports
│ ├── main.go
│ ├── main_test.go
│ └── testdata
│ │ └── src
│ │ ├── fruit.io
│ │ ├── banana
│ │ │ └── banana.go
│ │ ├── orange
│ │ │ └── orange.go
│ │ └── pear
│ │ │ └── pear.go
│ │ ├── new.com
│ │ └── one
│ │ │ └── one.go
│ │ ├── old.com
│ │ ├── bad
│ │ │ └── bad.go
│ │ └── one
│ │ │ └── one.go
│ │ └── titanic.biz
│ │ ├── bar
│ │ └── bar.go
│ │ └── foo
│ │ └── foo.go
├── getgo
│ ├── .dockerignore
│ ├── .gitignore
│ ├── Dockerfile
│ ├── LICENSE
│ ├── README.md
│ ├── download.go
│ ├── download_test.go
│ ├── main.go
│ ├── main_test.go
│ ├── make.bash
│ ├── path.go
│ ├── path_test.go
│ ├── server
│ │ ├── README.md
│ │ ├── app.yaml
│ │ └── main.go
│ ├── steps.go
│ ├── system.go
│ ├── system_unix.go
│ ├── system_windows.go
│ └── upload.bash
├── go-contrib-init
│ ├── contrib.go
│ └── contrib_test.go
├── godex
│ ├── doc.go
│ ├── gc.go
│ ├── gccgo.go
│ ├── godex.go
│ ├── isAlias18.go
│ ├── isAlias19.go
│ ├── print.go
│ ├── source.go
│ └── writetype.go
├── godoc
│ ├── README.godoc-app
│ ├── appinit.go
│ ├── autocert.go
│ ├── blog.go
│ ├── codewalk.go
│ ├── dl.go
│ ├── doc.go
│ ├── godoc19_test.go
│ ├── godoc_test.go
│ ├── handlers.go
│ ├── index.go
│ ├── main.go
│ ├── play.go
│ ├── remotesearch.go
│ ├── setup-godoc-app.bash
│ └── x.go
├── goimports
│ ├── doc.go
│ ├── goimports.go
│ ├── goimports_gc.go
│ └── goimports_not_gc.go
├── gomvpkg
│ └── main.go
├── gorename
│ ├── cgo_test.go
│ ├── gorename_test.go
│ └── main.go
├── gotype
│ ├── gotype.go
│ ├── sizesFor18.go
│ └── sizesFor19.go
├── goyacc
│ ├── doc.go
│ ├── testdata
│ │ └── expr
│ │ │ ├── README
│ │ │ ├── expr.y
│ │ │ └── main.go
│ └── yacc.go
├── guru
│ ├── callees.go
│ ├── callers.go
│ ├── callstack.go
│ ├── definition.go
│ ├── describe.go
│ ├── freevars.go
│ ├── guru.go
│ ├── guru_test.go
│ ├── implements.go
│ ├── isAlias18.go
│ ├── isAlias19.go
│ ├── main.go
│ ├── peers.go
│ ├── pointsto.go
│ ├── pos.go
│ ├── referrers.go
│ ├── serial
│ │ └── serial.go
│ ├── testdata
│ │ └── src
│ │ │ ├── README.txt
│ │ │ ├── alias
│ │ │ ├── alias.go
│ │ │ └── alias.golden
│ │ │ ├── calls-json
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── calls
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── definition-json
│ │ │ ├── main.go
│ │ │ ├── main.golden
│ │ │ ├── main19.go
│ │ │ ├── main19.golden
│ │ │ └── type.go
│ │ │ ├── describe-json
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── describe
│ │ │ ├── main.go
│ │ │ ├── main.golden
│ │ │ ├── main19.go
│ │ │ └── main19.golden
│ │ │ ├── freevars
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── implements-json
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── implements-methods-json
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── implements-methods
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── implements
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── imports
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── lib
│ │ │ ├── lib.go
│ │ │ └── sublib
│ │ │ │ └── sublib.go
│ │ │ ├── main
│ │ │ └── multi.go
│ │ │ ├── peers-json
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── peers
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── pointsto-json
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── pointsto
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── referrers-json
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── referrers
│ │ │ ├── ext_test.go
│ │ │ ├── int_test.go
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── reflection
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── softerrs
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── what-json
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ ├── what
│ │ │ ├── main.go
│ │ │ └── main.golden
│ │ │ └── whicherrs
│ │ │ ├── main.go
│ │ │ └── main.golden
│ ├── unit_test.go
│ ├── what.go
│ └── whicherrs.go
├── heapview
│ ├── client
│ │ ├── .clang-format
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── main.ts
│ │ ├── main_test.ts
│ │ ├── package.json
│ │ ├── testing
│ │ │ ├── karma.conf.js
│ │ │ └── test_main.js
│ │ ├── tsconfig.json
│ │ └── tslint.json
│ ├── internal
│ │ └── core
│ │ │ ├── mmapfile.go
│ │ │ ├── mmapfile_other.go
│ │ │ └── raw.go
│ └── main.go
├── html2article
│ └── conv.go
├── present
│ ├── appengine.go
│ ├── dir.go
│ ├── doc.go
│ ├── local.go
│ ├── play.go
│ ├── play_http.go
│ ├── play_socket.go
│ ├── static
│ │ ├── article.css
│ │ ├── dir.css
│ │ ├── dir.js
│ │ ├── favicon.ico
│ │ ├── jquery-ui.js
│ │ ├── notes.css
│ │ ├── notes.js
│ │ ├── slides.js
│ │ └── styles.css
│ └── templates
│ │ ├── action.tmpl
│ │ ├── article.tmpl
│ │ ├── dir.tmpl
│ │ └── slides.tmpl
├── ssadump
│ └── main.go
├── stress
│ └── stress.go
├── stringer
│ ├── endtoend_test.go
│ ├── golden_test.go
│ ├── importer18.go
│ ├── importer19.go
│ ├── stringer.go
│ ├── testdata
│ │ ├── cgo.go
│ │ ├── day.go
│ │ ├── gap.go
│ │ ├── num.go
│ │ ├── number.go
│ │ ├── prime.go
│ │ ├── unum.go
│ │ └── unum2.go
│ └── util_test.go
├── tip
│ ├── Dockerfile
│ ├── Makefile
│ ├── README
│ ├── cert.go
│ ├── godoc.go
│ ├── godoc.yaml
│ ├── talks.go
│ ├── talks.yaml
│ ├── tip-rc.yaml
│ ├── tip-service.yaml
│ ├── tip.go
│ └── tip_test.go
└── toolstash
│ ├── buildall
│ ├── cmp.go
│ └── main.go
├── codereview.cfg
├── container
└── intsets
│ ├── popcnt_amd64.go
│ ├── popcnt_amd64.s
│ ├── popcnt_gccgo.go
│ ├── popcnt_gccgo_c.c
│ ├── popcnt_generic.go
│ ├── sparse.go
│ ├── sparse_test.go
│ ├── util.go
│ └── util_test.go
├── cover
└── profile.go
├── go
├── ast
│ └── astutil
│ │ ├── enclosing.go
│ │ ├── enclosing_test.go
│ │ ├── imports.go
│ │ ├── imports_test.go
│ │ ├── rewrite.go
│ │ ├── rewrite_test.go
│ │ └── util.go
├── buildutil
│ ├── allpackages.go
│ ├── allpackages_test.go
│ ├── fakecontext.go
│ ├── overlay.go
│ ├── overlay_test.go
│ ├── tags.go
│ ├── tags_test.go
│ ├── util.go
│ ├── util_test.go
│ └── util_windows_test.go
├── callgraph
│ ├── callgraph.go
│ ├── cha
│ │ ├── cha.go
│ │ ├── cha_test.go
│ │ └── testdata
│ │ │ ├── func.go
│ │ │ ├── iface.go
│ │ │ └── recv.go
│ ├── rta
│ │ ├── rta.go
│ │ ├── rta_test.go
│ │ └── testdata
│ │ │ ├── func.go
│ │ │ ├── iface.go
│ │ │ └── rtype.go
│ ├── static
│ │ ├── static.go
│ │ └── static_test.go
│ └── util.go
├── gccgoexportdata
│ ├── gccgoexportdata.go
│ ├── gccgoexportdata_test.go
│ └── testdata
│ │ ├── errors.gox
│ │ ├── long.a
│ │ └── short.a
├── gcexportdata
│ ├── example_test.go
│ ├── gcexportdata.go
│ ├── gcexportdata_test.go
│ ├── importer.go
│ ├── main.go
│ └── testdata
│ │ └── errors-ae16.a
├── gcimporter15
│ ├── bexport.go
│ ├── bexport19_test.go
│ ├── bexport_test.go
│ ├── bimport.go
│ ├── exportdata.go
│ ├── gcimporter.go
│ ├── gcimporter_test.go
│ ├── isAlias18.go
│ ├── isAlias19.go
│ └── testdata
│ │ ├── a.go
│ │ ├── b.go
│ │ ├── exports.go
│ │ ├── issue15920.go
│ │ ├── issue20046.go
│ │ ├── p.go
│ │ └── versions
│ │ ├── test.go
│ │ ├── test_go1.7_0.a
│ │ └── test_go1.7_1.a
├── internal
│ └── gccgoimporter
│ │ ├── backdoor.go
│ │ ├── gccgoinstallation.go
│ │ ├── gccgoinstallation_test.go
│ │ ├── importer.go
│ │ ├── importer19_test.go
│ │ ├── importer_test.go
│ │ ├── parser.go
│ │ ├── parser_test.go
│ │ ├── testdata
│ │ ├── alias.gox
│ │ ├── complexnums.go
│ │ ├── complexnums.gox
│ │ ├── conversions.go
│ │ ├── conversions.gox
│ │ ├── escapeinfo.go
│ │ ├── escapeinfo.gox
│ │ ├── imports.go
│ │ ├── imports.gox
│ │ ├── pointer.go
│ │ ├── pointer.gox
│ │ ├── time.gox
│ │ └── unicode.gox
│ │ └── testenv_test.go
├── loader
│ ├── cgo.go
│ ├── cgo_pkgconfig.go
│ ├── doc.go
│ ├── example_test.go
│ ├── loader.go
│ ├── loader_test.go
│ ├── stdlib_test.go
│ ├── testdata
│ │ ├── a.go
│ │ ├── b.go
│ │ └── badpkgdecl.go
│ └── util.go
├── pointer
│ ├── TODO
│ ├── analysis.go
│ ├── api.go
│ ├── callgraph.go
│ ├── constraint.go
│ ├── doc.go
│ ├── example_test.go
│ ├── gen.go
│ ├── hvn.go
│ ├── intrinsics.go
│ ├── labels.go
│ ├── opt.go
│ ├── pointer_test.go
│ ├── print.go
│ ├── query.go
│ ├── query_test.go
│ ├── reflect.go
│ ├── solve.go
│ ├── stdlib_test.go
│ ├── testdata
│ │ ├── a_test.go
│ │ ├── another.go
│ │ ├── arrayreflect.go
│ │ ├── arrays.go
│ │ ├── channels.go
│ │ ├── chanreflect.go
│ │ ├── chanreflect1.go
│ │ ├── context.go
│ │ ├── conv.go
│ │ ├── extended.go
│ │ ├── finalizer.go
│ │ ├── flow.go
│ │ ├── fmtexcerpt.go
│ │ ├── func.go
│ │ ├── funcreflect.go
│ │ ├── hello.go
│ │ ├── interfaces.go
│ │ ├── issue9002.go
│ │ ├── mapreflect.go
│ │ ├── maps.go
│ │ ├── panic.go
│ │ ├── recur.go
│ │ ├── reflect.go
│ │ ├── rtti.go
│ │ ├── structreflect.go
│ │ ├── structs.go
│ │ └── timer.go
│ └── util.go
├── ssa
│ ├── blockopt.go
│ ├── builder.go
│ ├── builder_test.go
│ ├── const.go
│ ├── create.go
│ ├── doc.go
│ ├── dom.go
│ ├── emit.go
│ ├── example_test.go
│ ├── func.go
│ ├── identical.go
│ ├── identical_17.go
│ ├── identical_test.go
│ ├── interp
│ │ ├── external.go
│ │ ├── external_darwin.go
│ │ ├── external_unix.go
│ │ ├── interp.go
│ │ ├── interp_test.go
│ │ ├── map.go
│ │ ├── ops.go
│ │ ├── reflect.go
│ │ ├── testdata
│ │ │ ├── a_test.go
│ │ │ ├── b_test.go
│ │ │ ├── boundmeth.go
│ │ │ ├── c_test.go
│ │ │ ├── callstack.go
│ │ │ ├── complit.go
│ │ │ ├── coverage.go
│ │ │ ├── defer.go
│ │ │ ├── fieldprom.go
│ │ │ ├── ifaceconv.go
│ │ │ ├── ifaceprom.go
│ │ │ ├── initorder.go
│ │ │ ├── methprom.go
│ │ │ ├── mrvchain.go
│ │ │ ├── range.go
│ │ │ ├── recover.go
│ │ │ ├── reflect.go
│ │ │ └── static.go
│ │ └── value.go
│ ├── lift.go
│ ├── lvalue.go
│ ├── methods.go
│ ├── mode.go
│ ├── print.go
│ ├── sanity.go
│ ├── source.go
│ ├── source_test.go
│ ├── ssa.go
│ ├── ssautil
│ │ ├── load.go
│ │ ├── load_test.go
│ │ ├── switch.go
│ │ ├── switch_test.go
│ │ ├── testdata
│ │ │ └── switches.go
│ │ └── visit.go
│ ├── stdlib_test.go
│ ├── testdata
│ │ ├── objlookup.go
│ │ ├── structconv.go
│ │ └── valueforexpr.go
│ ├── testmain.go
│ ├── testmain_test.go
│ ├── util.go
│ └── wrappers.go
├── types
│ └── typeutil
│ │ ├── example_test.go
│ │ ├── imports.go
│ │ ├── imports_test.go
│ │ ├── map.go
│ │ ├── map_test.go
│ │ ├── methodsetcache.go
│ │ ├── ui.go
│ │ └── ui_test.go
└── vcs
│ ├── discovery.go
│ ├── env.go
│ ├── http.go
│ ├── vcs.go
│ └── vcs_test.go
├── godoc
├── README.md
├── analysis
│ ├── README
│ ├── analysis.go
│ ├── callgraph.go
│ ├── implements.go
│ ├── json.go
│ ├── peers.go
│ └── typeinfo.go
├── appengine.go
├── cmdline.go
├── cmdline_test.go
├── corpus.go
├── dirtrees.go
├── dl
│ ├── dl.go
│ ├── dl_test.go
│ └── tmpl.go
├── format.go
├── godoc.go
├── godoc17_test.go
├── godoc_test.go
├── index.go
├── index_test.go
├── linkify.go
├── meta.go
├── page.go
├── parser.go
├── pres.go
├── proxy
│ └── proxy.go
├── redirect
│ ├── hash.go
│ ├── redirect.go
│ └── redirect_test.go
├── search.go
├── server.go
├── short
│ ├── short.go
│ └── tmpl.go
├── snippet.go
├── spec.go
├── spot.go
├── static
│ ├── analysis
│ │ ├── call-eg.png
│ │ ├── call3.png
│ │ ├── callers1.png
│ │ ├── callers2.png
│ │ ├── chan1.png
│ │ ├── chan2a.png
│ │ ├── chan2b.png
│ │ ├── error1.png
│ │ ├── help.html
│ │ ├── ident-def.png
│ │ ├── ident-field.png
│ │ ├── ident-func.png
│ │ ├── ipcg-func.png
│ │ ├── ipcg-pkg.png
│ │ ├── typeinfo-pkg.png
│ │ └── typeinfo-src.png
│ ├── callgraph.html
│ ├── codewalk.html
│ ├── codewalkdir.html
│ ├── dirlist.html
│ ├── doc.go
│ ├── error.html
│ ├── example.html
│ ├── gen.go
│ ├── godoc.html
│ ├── godocs.js
│ ├── images
│ │ ├── minus.gif
│ │ ├── plus.gif
│ │ ├── treeview-black-line.gif
│ │ ├── treeview-black.gif
│ │ ├── treeview-default-line.gif
│ │ ├── treeview-default.gif
│ │ ├── treeview-gray-line.gif
│ │ └── treeview-gray.gif
│ ├── implements.html
│ ├── jquery.js
│ ├── jquery.treeview.css
│ ├── jquery.treeview.edit.js
│ ├── jquery.treeview.js
│ ├── makestatic.go
│ ├── methodset.html
│ ├── opensearch.xml
│ ├── package.html
│ ├── package.txt
│ ├── play.js
│ ├── playground.js
│ ├── search.html
│ ├── search.txt
│ ├── searchcode.html
│ ├── searchdoc.html
│ ├── searchtxt.html
│ ├── static.go
│ └── style.css
├── tab.go
├── template.go
├── util
│ ├── throttle.go
│ └── util.go
└── vfs
│ ├── emptyvfs.go
│ ├── emptyvfs_test.go
│ ├── gatefs
│ └── gatefs.go
│ ├── httpfs
│ └── httpfs.go
│ ├── mapfs
│ ├── mapfs.go
│ └── mapfs_test.go
│ ├── namespace.go
│ ├── os.go
│ ├── vfs.go
│ └── zipfs
│ ├── zipfs.go
│ └── zipfs_test.go
├── imports
├── fastwalk.go
├── fastwalk_dirent_fileno.go
├── fastwalk_dirent_ino.go
├── fastwalk_portable.go
├── fastwalk_test.go
├── fastwalk_unix.go
├── fix.go
├── fix_test.go
├── imports.go
├── mkindex.go
├── mkstdlib.go
├── sortimports.go
└── zstdlib.go
├── playground
├── appengine.go
├── appenginevm.go
├── common.go
├── local.go
└── socket
│ ├── socket.go
│ └── socket_test.go
├── present
├── args.go
├── caption.go
├── code.go
├── code_test.go
├── doc.go
├── html.go
├── iframe.go
├── image.go
├── link.go
├── link_test.go
├── parse.go
├── style.go
├── style_test.go
└── video.go
├── refactor
├── README
├── eg
│ ├── eg.go
│ ├── eg_test.go
│ ├── match.go
│ ├── rewrite.go
│ └── testdata
│ │ ├── A.template
│ │ ├── A1.go
│ │ ├── A1.golden
│ │ ├── A2.go
│ │ ├── A2.golden
│ │ ├── B.template
│ │ ├── B1.go
│ │ ├── B1.golden
│ │ ├── C.template
│ │ ├── C1.go
│ │ ├── C1.golden
│ │ ├── D.template
│ │ ├── D1.go
│ │ ├── D1.golden
│ │ ├── E.template
│ │ ├── E1.go
│ │ ├── E1.golden
│ │ ├── F.template
│ │ ├── F1.go
│ │ ├── F1.golden
│ │ ├── G.template
│ │ ├── G1.go
│ │ ├── G1.golden
│ │ ├── H.template
│ │ ├── H1.go
│ │ ├── H1.golden
│ │ ├── bad_type.template
│ │ ├── expr_type_mismatch.template
│ │ ├── no_after_return.template
│ │ ├── no_before.template
│ │ └── type_mismatch.template
├── importgraph
│ ├── graph.go
│ └── graph_test.go
├── rename
│ ├── check.go
│ ├── mvpkg.go
│ ├── mvpkg_test.go
│ ├── rename.go
│ ├── rename_test.go
│ ├── spec.go
│ └── util.go
└── satisfy
│ └── find.go
└── third_party
├── moduleloader
├── LICENSE
└── moduleloader.js
├── typescript
├── LICENSE
└── typescript.js
└── webcomponents
├── LICENSE
└── customelements.js
/BUILD:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/BUILD
--------------------------------------------------------------------------------
/Gopkg.lock:
--------------------------------------------------------------------------------
1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
2 |
3 |
4 | [[projects]]
5 | name = "github.com/BurntSushi/toml"
6 | packages = ["."]
7 | revision = "b26d9c308763d68093482582cea63d69be07a0f0"
8 | version = "v0.3.0"
9 |
10 | [[projects]]
11 | branch = "master"
12 | name = "golang.org/x/tools"
13 | packages = ["go/vcs"]
14 | revision = "25101aadb97aa42907eee6a238d6d26a6cb3c756"
15 |
16 | [solve-meta]
17 | analyzer-name = "dep"
18 | analyzer-version = 1
19 | inputs-digest = "501372a3d158acdb5352900d9d75f9948968dc9b5b46bd24224ad30582e90159"
20 | solver-name = "gps-cdcl"
21 | solver-version = 1
22 |
--------------------------------------------------------------------------------
/Gopkg.toml:
--------------------------------------------------------------------------------
1 |
2 | # Gopkg.toml example
3 | #
4 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
5 | # for detailed Gopkg.toml documentation.
6 | #
7 | # required = ["github.com/user/thing/cmd/thing"]
8 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
9 | #
10 | # [[constraint]]
11 | # name = "github.com/user/project"
12 | # version = "1.0.0"
13 | #
14 | # [[constraint]]
15 | # name = "github.com/user/project2"
16 | # branch = "dev"
17 | # source = "github.com/myfork/project2"
18 | #
19 | # [[override]]
20 | # name = "github.com/x/y"
21 | # version = "2.4.0"
22 |
23 |
24 | [[constraint]]
25 | name = "github.com/BurntSushi/toml"
26 | version = "0.3.0"
27 |
28 | [[constraint]]
29 | branch = "master"
30 | name = "golang.org/x/tools"
31 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Go [dep](https://github.com/golang/dep) rules for [Bazel](https://bazel.build/)
2 |
3 | See [go-dep-bazel-vscode-example](https://github.com/scele/go-dep-bazel-vscode-example) for an example project.
4 |
5 | ## Workspace rules
6 |
7 | Generate `Gopkg.lock` file with `dep init`, and add following rules to your `WORKSPACE` file:
8 |
9 | ```bzl
10 | http_archive(
11 | name = "com_github_scele_rules_go_dep",
12 | urls = ["https://github.com/scele/rules_go_dep/archive/4aa1bd3550191b39abded31bcf06d233b67fa8bb.tar.gz"],
13 | strip_prefix = "rules_go_dep-4aa1bd3550191b39abded31bcf06d233b67fa8bb",
14 | sha256 = "068d102168fdef7bb9da4f7c699df6b1b1ff25230f6a45e3b8da5e8ab15c6c36",
15 | )
16 |
17 | load("@com_github_scele_rules_go_dep//dep:dep.bzl", "dep_import")
18 |
19 | dep_import(
20 | name = "godeps",
21 | gopkg_lock = "//:Gopkg.lock",
22 | prefix = "github.com/my/project",
23 | # Optional: if you want to use checked-in Gopkg.bzl.
24 | gopkg_bzl = "//:Gopkg.bzl",
25 | )
26 | load("@godeps//:Gopkg.bzl", "go_deps")
27 | go_deps()
28 | ```
29 |
30 | This will load all go dependencies expressed in `Gopkg.lock` into your workspace.
31 |
32 | Using checked-in `Gopkg.bzl` can result in faster builds, since `Gopkg.bzl` does not need to be generated
33 | on the fly. If `gopkg_bzl` is used, then the checked-in `Gopkg.bzl` can be updated with:
34 |
35 | ```sh
36 | bazel run @godeps//:update
37 | ```
38 |
--------------------------------------------------------------------------------
/WORKSPACE:
--------------------------------------------------------------------------------
1 | workspace(name="com_github_scele_rules_go_dep")
2 |
3 | http_archive(
4 | name = "io_bazel_rules_go",
5 | url = "https://github.com/bazelbuild/rules_go/releases/download/0.9.0/rules_go-0.9.0.tar.gz",
6 | sha256 = "4d8d6244320dd751590f9100cf39fd7a4b75cd901e1f3ffdfd6f048328883695",
7 | )
8 |
9 | load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
10 | go_register_toolchains(go_version="1.9")
11 | go_rules_dependencies()
12 |
--------------------------------------------------------------------------------
/dep/BUILD:
--------------------------------------------------------------------------------
1 | filegroup(
2 | name = "all_rules",
3 | srcs = glob(["*.bzl"]),
4 | visibility = ["//visibility:public"],
5 | )
6 |
--------------------------------------------------------------------------------
/dep/update.sh.tpl:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | GOPKG_LOCK="%{gopkg_lock}"
5 | GOPKG_BZL="%{gopkg_bzl}"
6 | if [ -n "$GOPKG_BZL" ]; then
7 | GOPKG_BZL=$(dirname $(realpath "$GOPKG_LOCK"))/Gopkg.bzl
8 | fi
9 | GOPKG_BZL_TEMP="Gopkg.bzl.tmp"
10 | echo "Generating $GOPKG_BZL from $GOPKG_LOCK..."
11 |
12 | %{dep2bazel} \
13 | -build-file-generation "%{build_file_generation}" \
14 | -build-file-proto-mode "%{build_file_proto_mode}" \
15 | -go-prefix "%{go_prefix}" \
16 | -source-directory "%{workspace_root_path}" \
17 | -o $GOPKG_BZL_TEMP \
18 | $GOPKG_LOCK
19 |
20 | cp "$GOPKG_BZL_TEMP" "$GOPKG_BZL"
21 | echo "$GOPKG_BZL updated!"
22 |
--------------------------------------------------------------------------------
/dep2bazel/BUILD:
--------------------------------------------------------------------------------
1 | load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2 |
3 | go_library(
4 | name = "go_default_library",
5 | srcs = [
6 | "main.go",
7 | ],
8 | importpath = "github.com/scele/rules_go_dep/dep2bazel",
9 | visibility = ["//visibility:private"],
10 | )
11 |
12 | go_binary(
13 | name = "dep2bazel",
14 | embed = [":go_default_library"],
15 | importpath = "github.com/scele/rules_go_dep/dep2bazel",
16 | visibility = ["//visibility:public"],
17 | )
18 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/.gitignore:
--------------------------------------------------------------------------------
1 | TAGS
2 | tags
3 | .*.swp
4 | tomlcheck/tomlcheck
5 | toml.test
6 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | go:
3 | - 1.1
4 | - 1.2
5 | - 1.3
6 | - 1.4
7 | - 1.5
8 | - 1.6
9 | - tip
10 | install:
11 | - go install ./...
12 | - go get github.com/BurntSushi/toml-test
13 | script:
14 | - export PATH="$PATH:$HOME/gopath/bin"
15 | - make test
16 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/COMPATIBLE:
--------------------------------------------------------------------------------
1 | Compatible with TOML version
2 | [v0.4.0](https://github.com/toml-lang/toml/blob/v0.4.0/versions/en/toml-v0.4.0.md)
3 |
4 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/COPYING:
--------------------------------------------------------------------------------
1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2 | Version 2, December 2004
3 |
4 | Copyright (C) 2004 Sam Hocevar
5 |
6 | Everyone is permitted to copy and distribute verbatim or modified
7 | copies of this license document, and changing it is allowed as long
8 | as the name is changed.
9 |
10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12 |
13 | 0. You just DO WHAT THE FUCK YOU WANT TO.
14 |
15 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/Makefile:
--------------------------------------------------------------------------------
1 | install:
2 | go install ./...
3 |
4 | test: install
5 | go test -v
6 | toml-test toml-test-decoder
7 | toml-test -encoder toml-test-encoder
8 |
9 | fmt:
10 | gofmt -w *.go */*.go
11 | colcheck *.go */*.go
12 |
13 | tags:
14 | find ./ -name '*.go' -print0 | xargs -0 gotags > TAGS
15 |
16 | push:
17 | git push origin master
18 | git push github master
19 |
20 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/_examples/example.toml:
--------------------------------------------------------------------------------
1 | # This is a TOML document. Boom.
2 |
3 | title = "TOML Example"
4 |
5 | [owner]
6 | name = "Tom Preston-Werner"
7 | organization = "GitHub"
8 | bio = "GitHub Cofounder & CEO\nLikes tater tots and beer."
9 | dob = 1979-05-27T07:32:00Z # First class dates? Why not?
10 |
11 | [database]
12 | server = "192.168.1.1"
13 | ports = [ 8001, 8001, 8002 ]
14 | connection_max = 5000
15 | enabled = true
16 |
17 | [servers]
18 |
19 | # You can indent as you please. Tabs or spaces. TOML don't care.
20 | [servers.alpha]
21 | ip = "10.0.0.1"
22 | dc = "eqdc10"
23 |
24 | [servers.beta]
25 | ip = "10.0.0.2"
26 | dc = "eqdc10"
27 |
28 | [clients]
29 | data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it
30 |
31 | # Line breaks are OK when inside arrays
32 | hosts = [
33 | "alpha",
34 | "omega"
35 | ]
36 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/_examples/hard.toml:
--------------------------------------------------------------------------------
1 | # Test file for TOML
2 | # Only this one tries to emulate a TOML file written by a user of the kind of parser writers probably hate
3 | # This part you'll really hate
4 |
5 | [the]
6 | test_string = "You'll hate me after this - #" # " Annoying, isn't it?
7 |
8 | [the.hard]
9 | test_array = [ "] ", " # "] # ] There you go, parse this!
10 | test_array2 = [ "Test #11 ]proved that", "Experiment #9 was a success" ]
11 | # You didn't think it'd as easy as chucking out the last #, did you?
12 | another_test_string = " Same thing, but with a string #"
13 | harder_test_string = " And when \"'s are in the string, along with # \"" # "and comments are there too"
14 | # Things will get harder
15 |
16 | [the.hard.bit#]
17 | what? = "You don't think some user won't do that?"
18 | multi_line_array = [
19 | "]",
20 | # ] Oh yes I did
21 | ]
22 |
23 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/_examples/implicit.toml:
--------------------------------------------------------------------------------
1 | # [x] you
2 | # [x.y] don't
3 | # [x.y.z] need these
4 | [x.y.z.w] # for this to work
5 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/_examples/invalid-apples.toml:
--------------------------------------------------------------------------------
1 | # DO NOT WANT
2 | [fruit]
3 | type = "apple"
4 |
5 | [fruit.type]
6 | apple = "yes"
7 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/_examples/invalid.toml:
--------------------------------------------------------------------------------
1 | # This is an INVALID TOML document. Boom.
2 | # Can you spot the error without help?
3 |
4 | title = "TOML Example"
5 |
6 | [owner]
7 | name = "Tom Preston-Werner"
8 | organization = "GitHub"
9 | bio = "GitHub Cofounder & CEO\nLikes tater tots and beer."
10 | dob = 1979-05-27T7:32:00Z # First class dates? Why not?
11 |
12 | [database]
13 | server = "192.168.1.1"
14 | ports = [ 8001, 8001, 8002 ]
15 | connection_max = 5000
16 | enabled = true
17 |
18 | [servers]
19 | # You can indent as you please. Tabs or spaces. TOML don't care.
20 | [servers.alpha]
21 | ip = "10.0.0.1"
22 | dc = "eqdc10"
23 |
24 | [servers.beta]
25 | ip = "10.0.0.2"
26 | dc = "eqdc10"
27 |
28 | [clients]
29 | data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it
30 |
31 | # Line breaks are OK when inside arrays
32 | hosts = [
33 | "alpha",
34 | "omega"
35 | ]
36 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/_examples/readme1.toml:
--------------------------------------------------------------------------------
1 | Age = 25
2 | Cats = [ "Cauchy", "Plato" ]
3 | Pi = 3.14
4 | Perfection = [ 6, 28, 496, 8128 ]
5 | DOB = 1987-07-05T05:45:00Z
6 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/_examples/readme2.toml:
--------------------------------------------------------------------------------
1 | some_key_NAME = "wat"
2 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/cmd/toml-test-decoder/COPYING:
--------------------------------------------------------------------------------
1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2 | Version 2, December 2004
3 |
4 | Copyright (C) 2004 Sam Hocevar
5 |
6 | Everyone is permitted to copy and distribute verbatim or modified
7 | copies of this license document, and changing it is allowed as long
8 | as the name is changed.
9 |
10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12 |
13 | 0. You just DO WHAT THE FUCK YOU WANT TO.
14 |
15 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/cmd/toml-test-decoder/README.md:
--------------------------------------------------------------------------------
1 | # Implements the TOML test suite interface
2 |
3 | This is an implementation of the interface expected by
4 | [toml-test](https://github.com/BurntSushi/toml-test) for my
5 | [toml parser written in Go](https://github.com/BurntSushi/toml).
6 | In particular, it maps TOML data on `stdin` to a JSON format on `stdout`.
7 |
8 |
9 | Compatible with TOML version
10 | [v0.4.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md)
11 |
12 | Compatible with `toml-test` version
13 | [v0.2.0](https://github.com/BurntSushi/toml-test/tree/v0.2.0)
14 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/cmd/toml-test-encoder/COPYING:
--------------------------------------------------------------------------------
1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2 | Version 2, December 2004
3 |
4 | Copyright (C) 2004 Sam Hocevar
5 |
6 | Everyone is permitted to copy and distribute verbatim or modified
7 | copies of this license document, and changing it is allowed as long
8 | as the name is changed.
9 |
10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12 |
13 | 0. You just DO WHAT THE FUCK YOU WANT TO.
14 |
15 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/cmd/toml-test-encoder/README.md:
--------------------------------------------------------------------------------
1 | # Implements the TOML test suite interface for TOML encoders
2 |
3 | This is an implementation of the interface expected by
4 | [toml-test](https://github.com/BurntSushi/toml-test) for the
5 | [TOML encoder](https://github.com/BurntSushi/toml).
6 | In particular, it maps JSON data on `stdin` to a TOML format on `stdout`.
7 |
8 |
9 | Compatible with TOML version
10 | [v0.4.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md)
11 |
12 | Compatible with `toml-test` version
13 | [v0.2.0](https://github.com/BurntSushi/toml-test/tree/v0.2.0)
14 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/cmd/tomlv/COPYING:
--------------------------------------------------------------------------------
1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2 | Version 2, December 2004
3 |
4 | Copyright (C) 2004 Sam Hocevar
5 |
6 | Everyone is permitted to copy and distribute verbatim or modified
7 | copies of this license document, and changing it is allowed as long
8 | as the name is changed.
9 |
10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12 |
13 | 0. You just DO WHAT THE FUCK YOU WANT TO.
14 |
15 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/cmd/tomlv/README.md:
--------------------------------------------------------------------------------
1 | # TOML Validator
2 |
3 | If Go is installed, it's simple to try it out:
4 |
5 | ```bash
6 | go get github.com/BurntSushi/toml/cmd/tomlv
7 | tomlv some-toml-file.toml
8 | ```
9 |
10 | You can see the types of every key in a TOML file with:
11 |
12 | ```bash
13 | tomlv -types some-toml-file.toml
14 | ```
15 |
16 | At the moment, only one error message is reported at a time. Error messages
17 | include line numbers. No output means that the files given are valid TOML, or
18 | there is a bug in `tomlv`.
19 |
20 | Compatible with TOML version
21 | [v0.4.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md)
22 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/cmd/tomlv/main.go:
--------------------------------------------------------------------------------
1 | // Command tomlv validates TOML documents and prints each key's type.
2 | package main
3 |
4 | import (
5 | "flag"
6 | "fmt"
7 | "log"
8 | "os"
9 | "path"
10 | "strings"
11 | "text/tabwriter"
12 |
13 | "github.com/BurntSushi/toml"
14 | )
15 |
16 | var (
17 | flagTypes = false
18 | )
19 |
20 | func init() {
21 | log.SetFlags(0)
22 |
23 | flag.BoolVar(&flagTypes, "types", flagTypes,
24 | "When set, the types of every defined key will be shown.")
25 |
26 | flag.Usage = usage
27 | flag.Parse()
28 | }
29 |
30 | func usage() {
31 | log.Printf("Usage: %s toml-file [ toml-file ... ]\n",
32 | path.Base(os.Args[0]))
33 | flag.PrintDefaults()
34 |
35 | os.Exit(1)
36 | }
37 |
38 | func main() {
39 | if flag.NArg() < 1 {
40 | flag.Usage()
41 | }
42 | for _, f := range flag.Args() {
43 | var tmp interface{}
44 | md, err := toml.DecodeFile(f, &tmp)
45 | if err != nil {
46 | log.Fatalf("Error in '%s': %s", f, err)
47 | }
48 | if flagTypes {
49 | printTypes(md)
50 | }
51 | }
52 | }
53 |
54 | func printTypes(md toml.MetaData) {
55 | tabw := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
56 | for _, key := range md.Keys() {
57 | fmt.Fprintf(tabw, "%s%s\t%s\n",
58 | strings.Repeat(" ", len(key)-1), key, md.Type(key...))
59 | }
60 | tabw.Flush()
61 | }
62 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/doc.go:
--------------------------------------------------------------------------------
1 | /*
2 | Package toml provides facilities for decoding and encoding TOML configuration
3 | files via reflection. There is also support for delaying decoding with
4 | the Primitive type, and querying the set of keys in a TOML document with the
5 | MetaData type.
6 |
7 | The specification implemented: https://github.com/toml-lang/toml
8 |
9 | The sub-command github.com/BurntSushi/toml/cmd/tomlv can be used to verify
10 | whether a file is a valid TOML document. It can also be used to print the
11 | type of each key in a TOML document.
12 |
13 | Testing
14 |
15 | There are two important types of tests used for this package. The first is
16 | contained inside '*_test.go' files and uses the standard Go unit testing
17 | framework. These tests are primarily devoted to holistically testing the
18 | decoder and encoder.
19 |
20 | The second type of testing is used to verify the implementation's adherence
21 | to the TOML specification. These tests have been factored into their own
22 | project: https://github.com/BurntSushi/toml-test
23 |
24 | The reason the tests are in a separate project is so that they can be used by
25 | any implementation of TOML. Namely, it is language agnostic.
26 | */
27 | package toml
28 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/encoding_types.go:
--------------------------------------------------------------------------------
1 | // +build go1.2
2 |
3 | package toml
4 |
5 | // In order to support Go 1.1, we define our own TextMarshaler and
6 | // TextUnmarshaler types. For Go 1.2+, we just alias them with the
7 | // standard library interfaces.
8 |
9 | import (
10 | "encoding"
11 | )
12 |
13 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here
14 | // so that Go 1.1 can be supported.
15 | type TextMarshaler encoding.TextMarshaler
16 |
17 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined
18 | // here so that Go 1.1 can be supported.
19 | type TextUnmarshaler encoding.TextUnmarshaler
20 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/encoding_types_1.1.go:
--------------------------------------------------------------------------------
1 | // +build !go1.2
2 |
3 | package toml
4 |
5 | // These interfaces were introduced in Go 1.2, so we add them manually when
6 | // compiling for Go 1.1.
7 |
8 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here
9 | // so that Go 1.1 can be supported.
10 | type TextMarshaler interface {
11 | MarshalText() (text []byte, err error)
12 | }
13 |
14 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined
15 | // here so that Go 1.1 can be supported.
16 | type TextUnmarshaler interface {
17 | UnmarshalText(text []byte) error
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/session.vim:
--------------------------------------------------------------------------------
1 | au BufWritePost *.go silent!make tags > /dev/null 2>&1
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/.gitattributes:
--------------------------------------------------------------------------------
1 | # Treat all files in this repo as binary, with no git magic updating
2 | # line endings. Windows users contributing to Go will need to use a
3 | # modern version of git and editors capable of LF line endings.
4 | #
5 | # We'll prevent accidental CRLF line endings from entering the repo
6 | # via the git-review gofmt checks.
7 | #
8 | # See golang.org/issue/9281
9 |
10 | * -text
11 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/.gitignore:
--------------------------------------------------------------------------------
1 | # Add no patterns to .gitignore except for files generated by the build.
2 | last-change
3 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/AUTHORS:
--------------------------------------------------------------------------------
1 | # This source code refers to The Go Authors for copyright purposes.
2 | # The master list of authors is in the main Go distribution,
3 | # visible at http://tip.golang.org/AUTHORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Go
2 |
3 | Go is an open source project.
4 |
5 | It is the work of hundreds of contributors. We appreciate your help!
6 |
7 |
8 | ## Filing issues
9 |
10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions:
11 |
12 | 1. What version of Go are you using (`go version`)?
13 | 2. What operating system and processor architecture are you using?
14 | 3. What did you do?
15 | 4. What did you expect to see?
16 | 5. What did you see instead?
17 |
18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker.
19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug.
20 |
21 | ## Contributing code
22 |
23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html)
24 | before sending patches.
25 |
26 | **We do not accept GitHub pull requests**
27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review).
28 |
29 | Unless otherwise noted, the Go source files are distributed under
30 | the BSD-style license found in the LICENSE file.
31 |
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This source code was written by the Go contributors.
2 | # The master list of contributors is in the main Go distribution,
3 | # visible at http://tip.golang.org/CONTRIBUTORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/PATENTS:
--------------------------------------------------------------------------------
1 | Additional IP Rights Grant (Patents)
2 |
3 | "This implementation" means the copyrightable works distributed by
4 | Google as part of the Go project.
5 |
6 | Google hereby grants to You a perpetual, worldwide, non-exclusive,
7 | no-charge, royalty-free, irrevocable (except as stated in this section)
8 | patent license to make, have made, use, offer to sell, sell, import,
9 | transfer and otherwise run, modify and propagate the contents of this
10 | implementation of Go, where such license applies only to those patent
11 | claims, both currently owned or controlled by Google and acquired in
12 | the future, licensable by Google that are necessarily infringed by this
13 | implementation of Go. This grant does not include claims that would be
14 | infringed only as a consequence of further modification of this
15 | implementation. If you or your agent or exclusive licensee institute or
16 | order or agree to the institution of patent litigation against any
17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging
18 | that this implementation of Go or any code incorporated within this
19 | implementation of Go constitutes direct or contributory patent
20 | infringement, or inducement of patent infringement, then any patent
21 | rights granted to you under this License for this implementation of Go
22 | shall terminate as of the date such litigation is filed.
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/README.md:
--------------------------------------------------------------------------------
1 | # Go Tools
2 |
3 | This subrepository holds the source for various packages and tools that support
4 | the Go programming language.
5 |
6 | Some of the tools, `godoc` and `vet` for example, are included in binary Go
7 | distributions.
8 |
9 | Others, including the Go `guru` and the test coverage tool, can be fetched with
10 | `go get`.
11 |
12 | Packages include a type-checker for Go and an implementation of the
13 | Static Single Assignment form (SSA) representation for Go programs.
14 |
15 | ## Download/Install
16 |
17 | The easiest way to install is to run `go get -u golang.org/x/tools/...`. You can
18 | also manually git clone the repository to `$GOPATH/src/golang.org/x/tools`.
19 |
20 | ## Report Issues / Send Patches
21 |
22 | This repository uses Gerrit for code changes. To learn how to submit changes to
23 | this repository, see https://golang.org/doc/contribute.html.
24 |
25 | The main issue tracker for the tools repository is located at
26 | https://github.com/golang/go/issues. Prefix your issue with "x/tools/(your
27 | subdir):" in the subject line, so it is easy to find.
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/benchcmp/benchcmp_test.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "reflect"
5 | "testing"
6 |
7 | "golang.org/x/tools/benchmark/parse"
8 | )
9 |
10 | func TestSelectBest(t *testing.T) {
11 | have := parse.Set{
12 | "Benchmark1": []*parse.Benchmark{
13 | {
14 | Name: "Benchmark1",
15 | N: 10, NsPerOp: 100, Measured: parse.NsPerOp,
16 | Ord: 0,
17 | },
18 | {
19 | Name: "Benchmark1",
20 | N: 10, NsPerOp: 50, Measured: parse.NsPerOp,
21 | Ord: 3,
22 | },
23 | },
24 | "Benchmark2": []*parse.Benchmark{
25 | {
26 | Name: "Benchmark2",
27 | N: 10, NsPerOp: 60, Measured: parse.NsPerOp,
28 | Ord: 1,
29 | },
30 | {
31 | Name: "Benchmark2",
32 | N: 10, NsPerOp: 500, Measured: parse.NsPerOp,
33 | Ord: 2,
34 | },
35 | },
36 | }
37 |
38 | want := parse.Set{
39 | "Benchmark1": []*parse.Benchmark{
40 | {
41 | Name: "Benchmark1",
42 | N: 10, NsPerOp: 50, Measured: parse.NsPerOp,
43 | Ord: 0,
44 | },
45 | },
46 | "Benchmark2": []*parse.Benchmark{
47 | {
48 | Name: "Benchmark2",
49 | N: 10, NsPerOp: 60, Measured: parse.NsPerOp,
50 | Ord: 1,
51 | },
52 | },
53 | }
54 |
55 | selectBest(have)
56 | if !reflect.DeepEqual(want, have) {
57 | t.Errorf("filtered bench set incorrectly, want %v have %v", want, have)
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/benchcmp/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | /*
6 |
7 | The benchcmp command displays performance changes between benchmarks.
8 |
9 | Benchcmp parses the output of two 'go test' benchmark runs,
10 | correlates the results per benchmark, and displays the deltas.
11 |
12 | To measure the performance impact of a change, use 'go test'
13 | to run benchmarks before and after the change:
14 |
15 | go test -run=NONE -bench=. ./... > old.txt
16 | # make changes
17 | go test -run=NONE -bench=. ./... > new.txt
18 |
19 | Then feed the benchmark results to benchcmp:
20 |
21 | benchcmp old.txt new.txt
22 |
23 | Benchcmp will summarize and display the performance changes,
24 | in a format like this:
25 |
26 | $ benchcmp old.txt new.txt
27 | benchmark old ns/op new ns/op delta
28 | BenchmarkConcat 523 68.6 -86.88%
29 |
30 | benchmark old allocs new allocs delta
31 | BenchmarkConcat 3 1 -66.67%
32 |
33 | benchmark old bytes new bytes delta
34 | BenchmarkConcat 80 48 -40.00%
35 |
36 | */
37 | package main // import "golang.org/x/tools/cmd/benchcmp"
38 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/bundle/.gitignore:
--------------------------------------------------------------------------------
1 | testdata/out.got
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/bundle/testdata/out.golden:
--------------------------------------------------------------------------------
1 | // Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT.
2 | // $ bundle
3 |
4 | // The package doc comment
5 | //
6 |
7 | package dest
8 |
9 | import (
10 | "fmt"
11 | . "fmt"
12 | _ "fmt"
13 | renamedfmt "fmt"
14 | renamedfmt2 "fmt"
15 |
16 | "domain.name/importdecl"
17 | )
18 |
19 | // init functions are not renamed
20 | func init() { prefixfoo() }
21 |
22 | // Type S.
23 | type prefixS struct {
24 | prefixt
25 | u int
26 | } /* multi-line
27 | comment
28 | */
29 |
30 | // non-associated comment
31 |
32 | /*
33 | non-associated comment2
34 | */
35 |
36 | // Function bar.
37 | func prefixbar(s *prefixS) {
38 | fmt.Println(s.prefixt, s.u) // comment inside function
39 | }
40 |
41 | // file-end comment
42 |
43 | type prefixt int // type1
44 |
45 | // const1
46 | const prefixc = 1 // const2
47 |
48 | func prefixfoo() {
49 | fmt.Println(importdecl.F())
50 | }
51 |
52 | // zinit
53 | const (
54 | prefixz1 = iota // z1
55 | prefixz2 // z2
56 | ) // zend
57 |
58 | func prefixbaz() {
59 | renamedfmt.Println()
60 | renamedfmt2.Println()
61 | Println()
62 | }
63 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/bundle/testdata/src/domain.name/importdecl/p.go:
--------------------------------------------------------------------------------
1 | package importdecl
2 |
3 | func F() int { return 1 }
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/bundle/testdata/src/initial/a.go:
--------------------------------------------------------------------------------
1 | package initial
2 |
3 | import "fmt" // this comment should not be visible
4 |
5 | // init functions are not renamed
6 | func init() { foo() }
7 |
8 | // Type S.
9 | type S struct {
10 | t
11 | u int
12 | } /* multi-line
13 | comment
14 | */
15 |
16 | // non-associated comment
17 |
18 | /*
19 | non-associated comment2
20 | */
21 |
22 | // Function bar.
23 | func bar(s *S) {
24 | fmt.Println(s.t, s.u) // comment inside function
25 | }
26 |
27 | // file-end comment
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/bundle/testdata/src/initial/b.go:
--------------------------------------------------------------------------------
1 | // The package doc comment
2 | package initial
3 |
4 | import (
5 | "fmt"
6 |
7 | "domain.name/importdecl"
8 | )
9 |
10 | type t int // type1
11 |
12 | // const1
13 | const c = 1 // const2
14 |
15 | func foo() {
16 | fmt.Println(importdecl.F())
17 | }
18 |
19 | // zinit
20 | const (
21 | z1 = iota // z1
22 | z2 // z2
23 | ) // zend
24 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/bundle/testdata/src/initial/c.go:
--------------------------------------------------------------------------------
1 | package initial
2 |
3 | import _ "fmt"
4 | import renamedfmt "fmt"
5 | import renamedfmt2 "fmt"
6 | import . "fmt"
7 |
8 | func baz() {
9 | renamedfmt.Println()
10 | renamedfmt2.Println()
11 | Println()
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/callgraph/testdata/src/pkg/pkg.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | type I interface {
4 | f()
5 | }
6 |
7 | type C int
8 |
9 | func (C) f() {}
10 |
11 | type D int
12 |
13 | func (D) f() {}
14 |
15 | func main() {
16 | var i I = C(0)
17 | i.f() // dynamic call
18 |
19 | main2()
20 | }
21 |
22 | func main2() {
23 | var i I = D(0)
24 | i.f() // dynamic call
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/callgraph/testdata/src/pkg/pkg_test.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Don't import "testing", it adds a lot of callgraph edges.
4 |
5 | func Example() {
6 | C(0).f()
7 | }
8 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/cover/README:
--------------------------------------------------------------------------------
1 | NOTE: For Go releases 1.5 and later, this tool lives in the
2 | standard repository. The code here is not maintained.
3 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/cover/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | /*
6 | Cover is a program for analyzing the coverage profiles generated by
7 | 'go test -coverprofile=cover.out'.
8 |
9 | Cover is also used by 'go test -cover' to rewrite the source code with
10 | annotations to track which parts of each function are executed.
11 | It operates on one Go source file at a time, computing approximate
12 | basic block information by studying the source. It is thus more portable
13 | than binary-rewriting coverage tools, but also a little less capable.
14 | For instance, it does not probe inside && and || expressions, and can
15 | be mildly confused by single statements with multiple function literals.
16 |
17 | For usage information, please see:
18 | go help testflag
19 | go tool cover -help
20 |
21 | No longer maintained:
22 |
23 | For Go releases 1.5 and later, this tool lives in the
24 | standard repository. The code here is not maintained.
25 |
26 | */
27 | package main // import "golang.org/x/tools/cmd/cover"
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/fiximports/testdata/src/fruit.io/banana/banana.go:
--------------------------------------------------------------------------------
1 | package banana
2 |
3 | import (
4 | _ "old.com/one"
5 | _ "titanic.biz/bar"
6 | _ "titanic.biz/foo"
7 | )
8 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/fiximports/testdata/src/fruit.io/orange/orange.go:
--------------------------------------------------------------------------------
1 | package orange
2 |
3 | import _ "fruit.io/pear"
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/fiximports/testdata/src/fruit.io/pear/pear.go:
--------------------------------------------------------------------------------
1 | package pear
2 |
3 | import _ "fruit.io/banana"
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/fiximports/testdata/src/new.com/one/one.go:
--------------------------------------------------------------------------------
1 | package one // import "new.com/one"
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/fiximports/testdata/src/old.com/bad/bad.go:
--------------------------------------------------------------------------------
1 | // This ill-formed Go source file is here to ensure the tool is robust
2 | // against bad packages in the workspace.
3 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/fiximports/testdata/src/old.com/one/one.go:
--------------------------------------------------------------------------------
1 | package one // import "new.com/one"
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/fiximports/testdata/src/titanic.biz/bar/bar.go:
--------------------------------------------------------------------------------
1 | // This package is moving to new.com too.
2 | package bar // import "new.com/bar"
3 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/fiximports/testdata/src/titanic.biz/foo/foo.go:
--------------------------------------------------------------------------------
1 | // This package hasn't jumped ship yet.
2 | package foo
3 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/getgo/.dockerignore:
--------------------------------------------------------------------------------
1 | .git
2 | .dockerignore
3 | LICENSE
4 | README.md
5 | .gitignore
6 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/getgo/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | testgetgo
3 | getgo
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/getgo/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:latest
2 |
3 | ENV SHELL /bin/bash
4 | ENV HOME /root
5 | WORKDIR $HOME
6 |
7 | COPY . /go/src/golang.org/x/tools/cmd/getgo
8 |
9 | RUN ( \
10 | cd /go/src/golang.org/x/tools/cmd/getgo \
11 | && go build \
12 | && mv getgo /usr/local/bin/getgo \
13 | )
14 |
15 | # undo the adding of GOPATH to env for testing
16 | ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
17 | ENV GOPATH ""
18 |
19 | # delete /go and /usr/local/go for testing
20 | RUN rm -rf /go /usr/local/go
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/getgo/download_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !plan9
6 |
7 | package main
8 |
9 | import (
10 | "io/ioutil"
11 | "os"
12 | "path/filepath"
13 | "testing"
14 | )
15 |
16 | func TestDownloadGoVersion(t *testing.T) {
17 | if testing.Short() {
18 | t.Skipf("Skipping download in short mode")
19 | }
20 |
21 | tmpd, err := ioutil.TempDir("", "go")
22 | if err != nil {
23 | t.Fatal(err)
24 | }
25 | defer os.RemoveAll(tmpd)
26 |
27 | if err := downloadGoVersion("go1.8.1", "linux", "amd64", filepath.Join(tmpd, "go")); err != nil {
28 | t.Fatal(err)
29 | }
30 |
31 | // Ensure the VERSION file exists.
32 | vf := filepath.Join(tmpd, "go", "VERSION")
33 | if _, err := os.Stat(vf); os.IsNotExist(err) {
34 | t.Fatalf("file %s does not exist and should", vf)
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/getgo/make.bash:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Copyright 2017 The Go Authors. All rights reserved.
4 | # Use of this source code is governed by a BSD-style
5 | # license that can be found in the LICENSE file.
6 |
7 | set -e -o -x
8 |
9 | LDFLAGS="-X main.version=$(git describe --always --dirty='*')"
10 |
11 | GOOS=windows GOARCH=386 go build -o build/installer.exe -ldflags="$LDFLAGS"
12 | GOOS=linux GOARCH=386 go build -o build/installer_linux -ldflags="$LDFLAGS"
13 | GOOS=darwin GOARCH=386 go build -o build/installer_darwin -ldflags="$LDFLAGS"
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/getgo/server/README.md:
--------------------------------------------------------------------------------
1 | # getgo server
2 |
3 | ## Deployment
4 |
5 | ```
6 | gcloud app deploy --promote --project golang-org
7 | ```
8 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/getgo/server/app.yaml:
--------------------------------------------------------------------------------
1 | runtime: go
2 | service: get
3 | api_version: go1
4 |
5 | handlers:
6 | - url: /.*
7 | script: _go_app
8 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/getgo/system.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !plan9
6 |
7 | package main
8 |
9 | import (
10 | "bytes"
11 | "context"
12 | "os/exec"
13 | "runtime"
14 | "strings"
15 | )
16 |
17 | // arch contains either amd64 or 386.
18 | var arch = func() string {
19 | cmd := exec.Command("uname", "-m") // "x86_64"
20 | if runtime.GOOS == "windows" {
21 | cmd = exec.Command("powershell", "-command", "(Get-WmiObject -Class Win32_ComputerSystem).SystemType") // "x64-based PC"
22 | }
23 |
24 | out, err := cmd.Output()
25 | if err != nil {
26 | // a sensible default?
27 | return "amd64"
28 | }
29 | if bytes.Contains(out, []byte("64")) {
30 | return "amd64"
31 | }
32 | return "386"
33 | }()
34 |
35 | func findGo(ctx context.Context, cmd string) (string, error) {
36 | out, err := exec.CommandContext(ctx, cmd, "go").CombinedOutput()
37 | return strings.TrimSpace(string(out)), err
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/getgo/system_unix.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
6 |
7 | package main
8 |
9 | import (
10 | "context"
11 | "fmt"
12 | "os"
13 | "path/filepath"
14 | )
15 |
16 | const (
17 | envSeparator = ":"
18 | homeKey = "HOME"
19 | lineEnding = "\n"
20 | pathVar = "$PATH"
21 | )
22 |
23 | var installPath = func() string {
24 | home, err := getHomeDir()
25 | if err != nil {
26 | return "/usr/local/go"
27 | }
28 |
29 | return filepath.Join(home, ".go")
30 | }()
31 |
32 | func whichGo(ctx context.Context) (string, error) {
33 | return findGo(ctx, "which")
34 | }
35 |
36 | func isWindowsXP() bool {
37 | return false
38 | }
39 |
40 | func currentShell() string {
41 | return os.Getenv("SHELL")
42 | }
43 |
44 | func persistEnvChangesForSession() error {
45 | shellConfig, err := shellConfigFile()
46 | if err != nil {
47 | return err
48 | }
49 | fmt.Println()
50 | fmt.Printf("One more thing! Run `source %s` to persist the\n", shellConfig)
51 | fmt.Println("new environment variables to your current session, or open a")
52 | fmt.Println("new shell prompt.")
53 |
54 | return nil
55 | }
56 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/getgo/upload.bash:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Copyright 2017 The Go Authors. All rights reserved.
4 | # Use of this source code is governed by a BSD-style
5 | # license that can be found in the LICENSE file.
6 |
7 | if ! command -v gsutil 2>&1 > /dev/null; then
8 | echo "Install gsutil:"
9 | echo
10 | echo " https://cloud.google.com/storage/docs/gsutil_install#sdk-install"
11 | fi
12 |
13 | if [ ! -d build ]; then
14 | echo "Run make.bash first"
15 | fi
16 |
17 | set -e -o -x
18 |
19 | gsutil -m cp -a public-read build/* gs://golang/getgo
20 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/go-contrib-init/contrib_test.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "os"
5 | "runtime"
6 | "testing"
7 | )
8 |
9 | func TestExpandUser(t *testing.T) {
10 | env := "HOME"
11 | if runtime.GOOS == "windows" {
12 | env = "USERPROFILE"
13 | } else if runtime.GOOS == "plan9" {
14 | env = "home"
15 | }
16 |
17 | oldenv := os.Getenv(env)
18 | os.Setenv(env, "/home/gopher")
19 | defer os.Setenv(env, oldenv)
20 |
21 | tests := []struct {
22 | input string
23 | want string
24 | }{
25 | {input: "~/foo", want: "/home/gopher/foo"},
26 | {input: "${HOME}/foo", want: "/home/gopher/foo"},
27 | {input: "/~/foo", want: "/~/foo"},
28 | }
29 | for _, tt := range tests {
30 | got := expandUser(tt.input)
31 | if got != tt.want {
32 | t.Fatalf("want %q, but %q", tt.want, got)
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/godex/gc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // This file implements access to gc-generated export data.
6 |
7 | package main
8 |
9 | import "go/importer"
10 |
11 | func init() {
12 | register("gc", importer.For("gc", nil))
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/godex/gccgo.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // This file implements access to gccgo-generated export data.
6 |
7 | package main
8 |
9 | import (
10 | "go/importer"
11 | "go/types"
12 | )
13 |
14 | func init() {
15 | register("gccgo", importer.For("gccgo", nil))
16 | }
17 |
18 | // Print the extra gccgo compiler data for this package, if it exists.
19 | func (p *printer) printGccgoExtra(pkg *types.Package) {
20 | // Disabled for now.
21 | // TODO(gri) address this at some point.
22 |
23 | // if initdata, ok := initmap[pkg]; ok {
24 | // p.printf("/*\npriority %d\n", initdata.Priority)
25 |
26 | // p.printDecl("init", len(initdata.Inits), func() {
27 | // for _, init := range initdata.Inits {
28 | // p.printf("%s %s %d\n", init.Name, init.InitFunc, init.Priority)
29 | // }
30 | // })
31 |
32 | // p.print("*/\n")
33 | // }
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/godex/isAlias18.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !go1.9
6 |
7 | package main
8 |
9 | import "go/types"
10 |
11 | func isAlias(obj *types.TypeName) bool {
12 | return false // there are no type aliases before Go 1.9
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/godex/isAlias19.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.9
6 |
7 | package main
8 |
9 | import "go/types"
10 |
11 | func isAlias(obj *types.TypeName) bool {
12 | return obj.IsAlias()
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/godex/source.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // This file implements access to export data from source.
6 |
7 | package main
8 |
9 | import "go/types"
10 |
11 | func init() {
12 | register("source", sourceImporter{})
13 | }
14 |
15 | type sourceImporter struct{}
16 |
17 | func (sourceImporter) Import(path string) (*types.Package, error) {
18 | panic("unimplemented")
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/godoc/dl.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !appengine
6 |
7 | package main
8 |
9 | import "net/http"
10 |
11 | // Register a redirect handler for /dl/ to the golang.org download page.
12 | // This file will not be included when deploying godoc to golang.org.
13 |
14 | func init() {
15 | http.Handle("/dl/", http.RedirectHandler("https://golang.org/dl/", http.StatusFound))
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/godoc/godoc19_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.9
6 |
7 | package main_test
8 |
9 | func init() { isGo19 = true }
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/godoc/index.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package main
6 |
7 | import "strings"
8 |
9 | func indexDirectoryDefault(dir string) bool {
10 | return dir != "/pkg" && !strings.HasPrefix(dir, "/pkg/")
11 | }
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/godoc/play.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !appengine
6 |
7 | package main
8 |
9 | // This package registers "/compile" and "/share" handlers
10 | // that redirect to the golang.org playground.
11 | import _ "golang.org/x/tools/playground"
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/goimports/goimports_gc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build gc
6 |
7 | package main
8 |
9 | import (
10 | "flag"
11 | "runtime/trace"
12 | )
13 |
14 | var traceProfile = flag.String("trace", "", "trace profile output")
15 |
16 | func doTrace() func() {
17 | if *traceProfile != "" {
18 | bw, flush := bufferedFileWriter(*traceProfile)
19 | trace.Start(bw)
20 | return func() {
21 | flush()
22 | trace.Stop()
23 | }
24 | }
25 | return func() {}
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/goimports/goimports_not_gc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !gc
6 |
7 | package main
8 |
9 | func doTrace() func() {
10 | return func() {}
11 | }
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/gorename/cgo_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build cgo
6 |
7 | package main_test
8 |
9 | func init() {
10 | haveCGO = true
11 | }
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/gotype/sizesFor18.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !go1.9
6 |
7 | // This file contains a copy of the implementation of types.SizesFor
8 | // since this function is not available in go/types before Go 1.9.
9 |
10 | package main
11 |
12 | import "go/types"
13 |
14 | const defaultCompiler = "gc"
15 |
16 | var gcArchSizes = map[string]*types.StdSizes{
17 | "386": {4, 4},
18 | "arm": {4, 4},
19 | "arm64": {8, 8},
20 | "amd64": {8, 8},
21 | "amd64p32": {4, 8},
22 | "mips": {4, 4},
23 | "mipsle": {4, 4},
24 | "mips64": {8, 8},
25 | "mips64le": {8, 8},
26 | "ppc64": {8, 8},
27 | "ppc64le": {8, 8},
28 | "s390x": {8, 8},
29 | }
30 |
31 | func SizesFor(compiler, arch string) types.Sizes {
32 | if compiler != "gc" {
33 | return nil
34 | }
35 | s, ok := gcArchSizes[arch]
36 | if !ok {
37 | return nil
38 | }
39 | return s
40 | }
41 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/gotype/sizesFor19.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.9
6 |
7 | package main
8 |
9 | import "go/types"
10 |
11 | const defaultCompiler = "source"
12 |
13 | func SizesFor(compiler, arch string) types.Sizes {
14 | return types.SizesFor(compiler, arch)
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/goyacc/testdata/expr/README:
--------------------------------------------------------------------------------
1 | This directory contains a simple program demonstrating how to use
2 | the Go version of yacc.
3 |
4 | To build it:
5 |
6 | $ go generate
7 | $ go build
8 |
9 | or
10 |
11 | $ go generate
12 | $ go run expr.go
13 |
14 | The file main.go contains the "go generate" command to run yacc to
15 | create expr.go from expr.y. It also has the package doc comment,
16 | as godoc will not scan the .y file.
17 |
18 | The actual implementation is in expr.y.
19 |
20 | The program is not installed in the binary distributions of Go.
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/goyacc/testdata/expr/main.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // This file holds the go generate command to run yacc on the grammar in expr.y.
6 | // To build expr:
7 | // % go generate
8 | // % go build
9 |
10 | //go:generate goyacc -o expr.go -p "expr" expr.y
11 |
12 | // Expr is a simple expression evaluator that serves as a working example of
13 | // how to use Go's yacc implementation.
14 | package main
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/isAlias18.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !go1.9
6 |
7 | package main
8 |
9 | import "go/types"
10 |
11 | func isAlias(obj *types.TypeName) bool {
12 | return false // there are no type aliases before Go 1.9
13 | }
14 |
15 | const HasAlias = false
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/isAlias19.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.9
6 |
7 | package main
8 |
9 | import "go/types"
10 |
11 | func isAlias(obj *types.TypeName) bool {
12 | return obj.IsAlias()
13 | }
14 |
15 | const HasAlias = true
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/README.txt:
--------------------------------------------------------------------------------
1 | This is not a Go source file.
2 | Used by TestIssue14684.
3 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/alias/alias.go:
--------------------------------------------------------------------------------
1 | // Tests of Go 1.9 type aliases.
2 | // See go.tools/guru/guru_test.go for explanation.
3 | // See alias.golden for expected query results.
4 |
5 | package alias // @describe describe-pkg "alias"
6 |
7 | type I interface { // @implements implements-I "I"
8 | f()
9 | }
10 |
11 | type N int
12 |
13 | func (N) f() {}
14 |
15 | type M = N // @describe describe-def-M "M"
16 | var m M // @describe describe-ref-M "M"
17 |
18 | type O N // @describe describe-O "O"
19 |
20 | type P = struct{ N } // @describe describe-P "N"
21 |
22 | type U = undefined // @describe describe-U "U"
23 | type _ = undefined // @describe describe-undefined "undefined"
24 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/alias/alias.golden:
--------------------------------------------------------------------------------
1 | -------- @describe describe-pkg --------
2 | definition of package "alias"
3 | type I interface{f()}
4 | method (I) f()
5 | type M = N
6 | method (N) f()
7 | type N int
8 | method (N) f()
9 | type O int
10 | type P = struct{N}
11 | method (struct{N}) f()
12 | type U = invalid type
13 | var m N
14 |
15 | -------- @implements implements-I --------
16 | interface type I
17 | is implemented by basic type N
18 |
19 | -------- @describe describe-def-M --------
20 | alias of type N (size 8, align 8)
21 | defined as int
22 | Methods:
23 | method (N) f()
24 |
25 | -------- @describe describe-ref-M --------
26 | alias of type N (size 8, align 8)
27 | defined as int
28 | Methods:
29 | method (N) f()
30 |
31 | -------- @describe describe-O --------
32 | definition of type O (size 8, align 8)
33 | No methods.
34 |
35 | -------- @describe describe-P --------
36 | type struct{N} (size 8, align 8)
37 | Methods:
38 | method (struct{N}) f()
39 | Fields:
40 | N N
41 |
42 | -------- @describe describe-U --------
43 | alias of type invalid type
44 |
45 | -------- @describe describe-undefined --------
46 | identifier
47 |
48 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/calls-json/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of call-graph queries, -format=json.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See calls-json.golden for expected query results.
6 |
7 | func call(f func()) {
8 | f() // @callees @callees-f "f"
9 | }
10 |
11 | func main() {
12 | call(func() {
13 | // @callers callers-main.anon "^"
14 | // @callstack callstack-main.anon "^"
15 | })
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/calls-json/main.golden:
--------------------------------------------------------------------------------
1 | -------- @callees @callees-f --------
2 | {
3 | "pos": "testdata/src/calls-json/main.go:8:3",
4 | "desc": "dynamic function call",
5 | "callees": [
6 | {
7 | "name": "calls-json.main$1",
8 | "pos": "testdata/src/calls-json/main.go:12:7"
9 | }
10 | ]
11 | }
12 | -------- @callstack callstack-main.anon --------
13 | {
14 | "pos": "testdata/src/calls-json/main.go:12:7",
15 | "target": "calls-json.main$1",
16 | "callers": [
17 | {
18 | "pos": "testdata/src/calls-json/main.go:8:3",
19 | "desc": "dynamic function call",
20 | "caller": "calls-json.call"
21 | },
22 | {
23 | "pos": "testdata/src/calls-json/main.go:12:6",
24 | "desc": "static function call",
25 | "caller": "calls-json.main"
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/definition-json/main19.go:
--------------------------------------------------------------------------------
1 | package definition
2 |
3 | import "nosuchpkg"
4 |
5 | var _ nosuchpkg.T // @definition qualified-nopkg "nosuchpkg"
6 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/definition-json/main19.golden:
--------------------------------------------------------------------------------
1 | -------- @definition qualified-nopkg --------
2 | {
3 | "objpos": "testdata/src/definition-json/main19.go:3:8",
4 | "desc": "package nosuchpkg"
5 | }
6 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/definition-json/type.go:
--------------------------------------------------------------------------------
1 | package definition
2 |
3 | type W int
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/describe-json/main.go:
--------------------------------------------------------------------------------
1 | package describe // @describe pkgdecl "describe"
2 |
3 | // Tests of 'describe' query, -format=json.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See describe-json.golden for expected query results.
6 |
7 | func main() {
8 | var s struct{ x [3]int }
9 | p := &s.x[0] // @describe desc-val-p "p"
10 | _ = p
11 |
12 | var i I = C(0)
13 | if i == nil {
14 | i = new(D)
15 | }
16 | print(i) // @describe desc-val-i "\\bi\\b"
17 |
18 | go main() // @describe desc-stmt "go"
19 | }
20 |
21 | type I interface {
22 | f()
23 | }
24 |
25 | type C int // @describe desc-type-C "C"
26 | type D struct{}
27 |
28 | func (c C) f() {}
29 | func (d *D) f() {}
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/describe/main19.go:
--------------------------------------------------------------------------------
1 | package describe
2 |
3 | // The behavior of "describe" on a non-existent import changed
4 | // when go/types started returning fake packages, so this test
5 | // is executed only under go1.9.
6 |
7 | import (
8 | "nosuchpkg" // @describe badimport1 "nosuchpkg"
9 | nosuchpkg2 "nosuchpkg" // @describe badimport2 "nosuchpkg2"
10 | )
11 |
12 | var _ nosuchpkg.T
13 | var _ nosuchpkg2.T
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/describe/main19.golden:
--------------------------------------------------------------------------------
1 | -------- @describe badimport1 --------
2 | import of package "nosuchpkg"
3 |
4 | -------- @describe badimport2 --------
5 | reference to package "nosuchpkg"
6 |
7 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/freevars/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of 'freevars' query.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See freevars.golden for expected query results.
6 |
7 | // TODO(adonovan): it's hard to test this query in a single line of gofmt'd code.
8 |
9 | type T struct {
10 | a, b int
11 | }
12 |
13 | type S struct {
14 | x int
15 | t T
16 | }
17 |
18 | func f(int) {}
19 |
20 | func main() {
21 | type C int
22 | x := 1
23 | const exp = 6
24 | if y := 2; x+y+int(C(3)) != exp { // @freevars fv1 "if.*{"
25 | panic("expected 6")
26 | }
27 |
28 | var s S
29 |
30 | for x, y := range "foo" {
31 | println(s.x + s.t.a + s.t.b + x + int(y)) // @freevars fv2 "print.*y."
32 | }
33 |
34 | f(x) // @freevars fv3 "f.x."
35 |
36 | loop: // @freevars fv-def-label "loop:"
37 | for {
38 | break loop // @freevars fv-ref-label "break loop"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/freevars/main.golden:
--------------------------------------------------------------------------------
1 | -------- @freevars fv1 --------
2 | Free identifiers:
3 | type C
4 | const exp int
5 | var x int
6 |
7 | -------- @freevars fv2 --------
8 | Free identifiers:
9 | var s.t.a int
10 | var s.t.b int
11 | var s.x int
12 | var x int
13 | var y rune
14 |
15 | -------- @freevars fv3 --------
16 | Free identifiers:
17 | var x int
18 |
19 | -------- @freevars fv-def-label --------
20 | No free identifiers.
21 |
22 | -------- @freevars fv-ref-label --------
23 | Free identifiers:
24 | label loop
25 |
26 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/implements-json/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of 'implements' query, -output=json.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See implements.golden for expected query results.
6 |
7 | func main() {
8 | }
9 |
10 | type E interface{} // @implements E "E"
11 |
12 | type F interface { // @implements F "F"
13 | f()
14 | }
15 |
16 | type FG interface { // @implements FG "FG"
17 | f()
18 | g() []int // @implements slice "..int"
19 | }
20 |
21 | type C int // @implements C "C"
22 | type D struct{}
23 |
24 | func (c *C) f() {} // @implements starC ".C"
25 | func (d D) f() {} // @implements D "D"
26 |
27 | func (d *D) g() []int { return nil } // @implements starD ".D"
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/implements-methods-json/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of 'implements' query applied to methods, -output=json.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See implements-methods.golden for expected query results.
6 |
7 | import _ "lib"
8 |
9 | func main() {
10 | }
11 |
12 | type F interface {
13 | f() // @implements F.f "f"
14 | }
15 |
16 | type FG interface {
17 | f() // @implements FG.f "f"
18 | g() []int // @implements FG.g "g"
19 | }
20 |
21 | type C int
22 | type D struct{}
23 |
24 | func (c *C) f() {} // @implements *C.f "f"
25 | func (d D) f() {} // @implements D.f "f"
26 |
27 | func (d *D) g() []int { return nil } // @implements *D.g "g"
28 |
29 | type sorter []int
30 |
31 | func (sorter) Len() int { return 0 } // @implements Len "Len"
32 | func (sorter) Less(i, j int) bool { return false }
33 | func (sorter) Swap(i, j int) {}
34 |
35 | type I interface {
36 | Method(*int) *int // @implements I.Method "Method"
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/implements-methods/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of 'implements' query applied to methods.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See implements-methods.golden for expected query results.
6 |
7 | import _ "lib"
8 |
9 | func main() {
10 | }
11 |
12 | type F interface {
13 | f() // @implements F.f "f"
14 | }
15 |
16 | type FG interface {
17 | f() // @implements FG.f "f"
18 | g() []int // @implements FG.g "g"
19 | }
20 |
21 | type C int
22 | type D struct{}
23 |
24 | func (c *C) f() {} // @implements *C.f "f"
25 | func (d D) f() {} // @implements D.f "f"
26 |
27 | func (d *D) g() []int { return nil } // @implements *D.g "g"
28 |
29 | type sorter []int
30 |
31 | func (sorter) Len() int { return 0 } // @implements Len "Len"
32 | func (sorter) Less(i, j int) bool { return false }
33 | func (sorter) Swap(i, j int) {}
34 |
35 | type I interface {
36 | Method(*int) *int // @implements I.Method "Method"
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/implements-methods/main.golden:
--------------------------------------------------------------------------------
1 | -------- @implements F.f --------
2 | abstract method func (F).f()
3 | is implemented by method (*C).f
4 | is implemented by method (D).f
5 | is implemented by method (FG).f
6 |
7 | -------- @implements FG.f --------
8 | abstract method func (FG).f()
9 | is implemented by method (*D).f
10 | implements method (F).f
11 |
12 | -------- @implements FG.g --------
13 | abstract method func (FG).g() []int
14 | is implemented by method (*D).g
15 |
16 | -------- @implements *C.f --------
17 | concrete method func (*C).f()
18 | implements method (F).f
19 |
20 | -------- @implements D.f --------
21 | concrete method func (D).f()
22 | implements method (F).f
23 | concrete method func (D).f()
24 | implements method (FG).f
25 |
26 | -------- @implements *D.g --------
27 | concrete method func (*D).g() []int
28 | implements method (FG).g
29 |
30 | -------- @implements Len --------
31 | concrete method func (sorter).Len() int
32 | implements method (lib.Sorter).Len
33 |
34 | -------- @implements I.Method --------
35 | abstract method func (I).Method(*int) *int
36 | is implemented by method (lib.Type).Method
37 |
38 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/implements/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of 'implements' query.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See implements.golden for expected query results.
6 |
7 | import _ "lib"
8 |
9 | func main() {
10 | }
11 |
12 | type E interface{} // @implements E "E"
13 |
14 | type F interface { // @implements F "F"
15 | f()
16 | }
17 |
18 | type FG interface { // @implements FG "FG"
19 | f()
20 | g() []int // @implements slice "..int"
21 | }
22 |
23 | type C int // @implements C "C"
24 | type D struct{}
25 |
26 | func (c *C) f() {} // @implements starC ".C"
27 | func (d D) f() {} // @implements D "D"
28 |
29 | func (d *D) g() []int { return nil } // @implements starD ".D"
30 |
31 | type sorter []int // @implements sorter "sorter"
32 |
33 | func (sorter) Len() int { return 0 }
34 | func (sorter) Less(i, j int) bool { return false }
35 | func (sorter) Swap(i, j int) {}
36 |
37 | type I interface { // @implements I "I"
38 | Method(*int) *int
39 | }
40 |
41 | func _() {
42 | var d D
43 | _ = d // @implements var_d "d"
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/implements/main.golden:
--------------------------------------------------------------------------------
1 | -------- @implements E --------
2 | empty interface type E
3 |
4 | -------- @implements F --------
5 | interface type F
6 | is implemented by pointer type *C
7 | is implemented by struct type D
8 | is implemented by interface type FG
9 |
10 | -------- @implements FG --------
11 | interface type FG
12 | is implemented by pointer type *D
13 | implements F
14 |
15 | -------- @implements slice --------
16 | slice type []int implements only interface{}
17 |
18 | -------- @implements C --------
19 | pointer type *C
20 | implements F
21 |
22 | -------- @implements starC --------
23 | pointer type *C
24 | implements F
25 |
26 | -------- @implements D --------
27 | struct type D
28 | implements F
29 | pointer type *D
30 | implements FG
31 |
32 | -------- @implements starD --------
33 | pointer type *D
34 | implements F
35 | implements FG
36 |
37 | -------- @implements sorter --------
38 | slice type sorter
39 | implements lib.Sorter
40 |
41 | -------- @implements I --------
42 | interface type I
43 | is implemented by basic type lib.Type
44 |
45 | -------- @implements var_d --------
46 | struct type D
47 | implements F
48 | pointer type *D
49 | implements FG
50 |
51 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/imports/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "lib" // @describe ref-pkg-import "lib"
5 | "lib/sublib" // @describe ref-pkg-import2 "sublib"
6 | )
7 |
8 | // Tests that import another package. (To make the tests run quickly,
9 | // we avoid using imports in all the other tests. Remember, each
10 | // query causes parsing and typechecking of the whole program.)
11 | //
12 | // See go.tools/guru/guru_test.go for explanation.
13 | // See imports.golden for expected query results.
14 |
15 | var a int
16 |
17 | func main() {
18 | const c = lib.Const // @describe ref-const "Const"
19 | lib.Func() // @describe ref-func "Func"
20 | lib.Var++ // @describe ref-var "Var"
21 | var t lib.Type // @describe ref-type "Type"
22 | p := t.Method(&a) // @describe ref-method "Method"
23 |
24 | print(*p + 1) // @pointsto p "p "
25 |
26 | var _ lib.Type // @describe ref-pkg "lib"
27 |
28 | _ = sublib.C
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/lib/lib.go:
--------------------------------------------------------------------------------
1 | package lib
2 |
3 | type Type int
4 |
5 | func (Type) Method(x *int) *int {
6 | return x
7 | }
8 |
9 | func Func() {
10 | }
11 |
12 | const Const = 3
13 |
14 | var Var = 0
15 |
16 | type Sorter interface {
17 | Len() int
18 | Less(i, j int) bool
19 | Swap(i, j int)
20 | }
21 |
22 | type Outer struct {
23 | A int
24 | b int
25 | inner
26 | }
27 |
28 | type inner struct {
29 | C bool
30 | d string
31 | recursive
32 | }
33 |
34 | type recursive struct {
35 | E bool
36 | *inner
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/lib/sublib/sublib.go:
--------------------------------------------------------------------------------
1 | package sublib
2 |
3 | const C = 0
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/main/multi.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | func g(x int) {
4 | }
5 |
6 | func f() {
7 | x := 1
8 | g(x) // "g(x)" is the selection for multiple queries
9 | }
10 |
11 | func main() {
12 | f()
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/peers-json/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of channel 'peers' query, -format=json.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See peers-json.golden for expected query results.
6 |
7 | func main() {
8 | chA := make(chan *int)
9 | <-chA
10 | select {
11 | case <-chA: // @peers peer-recv-chA "<-"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/peers-json/main.golden:
--------------------------------------------------------------------------------
1 | -------- @peers peer-recv-chA --------
2 | {
3 | "pos": "testdata/src/peers-json/main.go:11:7",
4 | "type": "chan *int",
5 | "allocs": [
6 | "testdata/src/peers-json/main.go:8:13"
7 | ],
8 | "receives": [
9 | "testdata/src/peers-json/main.go:9:2",
10 | "testdata/src/peers-json/main.go:11:7"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/peers/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of channel 'peers' query.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See peers.golden for expected query results.
6 |
7 | var a2 int
8 |
9 | func main() {
10 | chA := make(chan *int)
11 | a1 := 1
12 | chA <- &a1
13 |
14 | chA2 := make(chan *int, 2)
15 | if a2 == 0 {
16 | chA = chA2
17 | }
18 |
19 | chB := make(chan *int)
20 | b := 3
21 | chB <- &b
22 |
23 | <-chA // @pointsto pointsto-chA "chA"
24 | <-chA2 // @pointsto pointsto-chA2 "chA2"
25 | <-chB // @pointsto pointsto-chB "chB"
26 |
27 | select {
28 | case rA := <-chA: // @peers peer-recv-chA "<-"
29 | _ = rA // @pointsto pointsto-rA "rA"
30 | case rB := <-chB: // @peers peer-recv-chB "<-"
31 | _ = rB // @pointsto pointsto-rB "rB"
32 |
33 | case <-chA: // @peers peer-recv-chA' "<-"
34 |
35 | case chA2 <- &a2: // @peers peer-send-chA' "<-"
36 | }
37 |
38 | for range chA {
39 | }
40 |
41 | close(chA) // @peers peer-close-chA "chA"
42 |
43 | chC := make(chan *int)
44 | (close)(chC) // @peers peer-close-chC "chC"
45 |
46 | close := func(ch chan *int) chan *int {
47 | return ch
48 | }
49 |
50 | close(chC) <- &b // @peers peer-send-chC "chC"
51 | <-close(chC) // @peers peer-recv-chC "chC"
52 | }
53 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/pointsto-json/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of 'pointsto' queries, -format=json.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See pointsto-json.golden for expected query results.
6 |
7 | func main() { //
8 | var s struct{ x [3]int }
9 | p := &s.x[0] // @pointsto val-p "p"
10 | _ = p
11 |
12 | var i I = C(0)
13 | if i == nil {
14 | i = new(D)
15 | }
16 | print(i) // @pointsto val-i "\\bi\\b"
17 | }
18 |
19 | type I interface {
20 | f()
21 | }
22 |
23 | type C int
24 | type D struct{}
25 |
26 | func (c C) f() {}
27 | func (d *D) f() {}
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/pointsto-json/main.golden:
--------------------------------------------------------------------------------
1 | -------- @pointsto val-p --------
2 | [
3 | {
4 | "type": "*int",
5 | "labels": [
6 | {
7 | "pos": "testdata/src/pointsto-json/main.go:8:6",
8 | "desc": "s.x[*]"
9 | }
10 | ]
11 | }
12 | ]
13 | -------- @pointsto val-i --------
14 | [
15 | {
16 | "type": "*D",
17 | "namepos": "testdata/src/pointsto-json/main.go:24:6",
18 | "labels": [
19 | {
20 | "pos": "testdata/src/pointsto-json/main.go:14:10",
21 | "desc": "new"
22 | }
23 | ]
24 | },
25 | {
26 | "type": "C",
27 | "namepos": "testdata/src/pointsto-json/main.go:23:6"
28 | }
29 | ]
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/referrers-json/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of 'referrers' query.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See referrers.golden for expected query results.
6 |
7 | import "lib"
8 |
9 | type s struct {
10 | f int
11 | }
12 |
13 | func main() {
14 | var v lib.Type = lib.Const // @referrers ref-package "lib"
15 | _ = v.Method // @referrers ref-method "Method"
16 | _ = v.Method
17 | v++ //@referrers ref-local "v"
18 | v++
19 |
20 | _ = s{}.f // @referrers ref-field "f"
21 |
22 | var s2 s
23 | s2.f = 1
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/referrers/ext_test.go:
--------------------------------------------------------------------------------
1 | package main_test
2 |
3 | import (
4 | "lib"
5 | renamed "referrers" // package has name "main", path "referrers", local name "renamed"
6 | )
7 |
8 | func _() {
9 | // This reference should be found by the ref-method query.
10 | _ = (lib.Type).Method // ref from external test package
11 | var _ renamed.T
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/referrers/int_test.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "lib"
4 |
5 | func _() {
6 | // This reference should be found by the ref-method query.
7 | _ = (lib.Type).Method // ref from internal test package
8 | }
9 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/referrers/main.go:
--------------------------------------------------------------------------------
1 | package main // @referrers package-decl "main"
2 |
3 | // Tests of 'referrers' query.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See referrers.golden for expected query results.
6 |
7 | import "lib"
8 |
9 | type s struct { // @referrers type " s "
10 | f int
11 | }
12 |
13 | type T int
14 |
15 | func main() {
16 | var v lib.Type = lib.Const // @referrers ref-package "lib"
17 | _ = v.Method // @referrers ref-method "Method"
18 | _ = v.Method
19 | v++ //@referrers ref-local "v"
20 | v++
21 |
22 | _ = s{}.f // @referrers ref-field "f"
23 |
24 | var s2 s
25 | s2.f = 1
26 | }
27 |
28 | // Test //line directives:
29 |
30 | type U int // @referrers ref-type-U "U"
31 |
32 | //line nosuchfile.y:123
33 | var u1 U
34 | var u2 U
35 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/reflection/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // This is a test of 'pointsto', but we split it into a separate file
4 | // so that pointsto.go doesn't have to import "reflect" each time.
5 |
6 | import "reflect"
7 |
8 | var a int
9 | var b bool
10 |
11 | func main() {
12 | m := make(map[*int]*bool)
13 | m[&a] = &b
14 |
15 | mrv := reflect.ValueOf(m)
16 | if a > 0 {
17 | mrv = reflect.ValueOf(&b)
18 | }
19 | if a > 0 {
20 | mrv = reflect.ValueOf(&a)
21 | }
22 |
23 | _ = mrv // @pointsto mrv "mrv"
24 | p1 := mrv.Interface() // @pointsto p1 "p1"
25 | p2 := mrv.MapKeys() // @pointsto p2 "p2"
26 | p3 := p2[0] // @pointsto p3 "p3"
27 | p4 := reflect.TypeOf(p1) // @pointsto p4 "p4"
28 |
29 | _, _, _, _ = p1, p2, p3, p4
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/reflection/main.golden:
--------------------------------------------------------------------------------
1 | -------- @pointsto mrv --------
2 | this reflect.Value may contain these dynamic types:
3 | *bool, may point to:
4 | reflection.b
5 | *int, may point to:
6 | reflection.a
7 | map[*int]*bool, may point to:
8 | makemap
9 |
10 | -------- @pointsto p1 --------
11 | this interface{} may contain these dynamic types:
12 | *bool, may point to:
13 | reflection.b
14 | *int, may point to:
15 | reflection.a
16 | map[*int]*bool, may point to:
17 | makemap
18 |
19 | -------- @pointsto p2 --------
20 | this []reflect.Value may point to these objects:
21 |
22 |
23 | -------- @pointsto p3 --------
24 | this reflect.Value may contain these dynamic types:
25 | *int, may point to:
26 | reflection.a
27 |
28 | -------- @pointsto p4 --------
29 | this reflect.Type may contain these dynamic types:
30 | *reflect.rtype, may point to:
31 | *bool
32 | *int
33 | map[*int]*bool
34 |
35 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/softerrs/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of various queries on a program containing only "soft" errors.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See main.golden for expected query results.
6 |
7 | func _() {
8 | var i int // "unused var" is a soft error
9 | }
10 |
11 | func f() {} // @callers softerrs-callers-f "f"
12 |
13 | func main() {
14 | f() // @describe softerrs-describe-f "f"
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/softerrs/main.golden:
--------------------------------------------------------------------------------
1 | -------- @callers softerrs-callers-f --------
2 | softerrs.f is called from these 1 sites:
3 | static function call from softerrs.main
4 |
5 | -------- @describe softerrs-describe-f --------
6 | reference to func f()
7 | defined here
8 |
9 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/what-json/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "lib"
4 |
5 | // Tests of 'what' queries, -format=json.
6 | // See go.tools/guru/guru_test.go for explanation.
7 | // See what-json.golden for expected query results.
8 |
9 | func main() {
10 | f() // @what call "f"
11 | }
12 |
13 | var _ lib.Var // @what pkg "lib"
14 | type _ lib.T
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/what/main.go:
--------------------------------------------------------------------------------
1 | package main // @what pkgdecl "main"
2 |
3 | // Tests of 'what' queries.
4 | // See go.tools/guru/guru_test.go for explanation.
5 | // See what.golden for expected query results.
6 |
7 | func main() {
8 | f() // @what call "f"
9 | var ch chan int // @what var "var"
10 | <-ch // @what recv "ch"
11 | }
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/what/main.golden:
--------------------------------------------------------------------------------
1 | -------- @what pkgdecl --------
2 | identifier
3 | source file
4 | modes: [definition describe freevars implements pointsto referrers whicherrs]
5 | srcdir: testdata/src
6 | import path: what
7 |
8 | -------- @what call --------
9 | identifier
10 | function call
11 | expression statement
12 | block
13 | function declaration
14 | source file
15 | modes: [callees callers callstack definition describe freevars implements pointsto referrers whicherrs]
16 | srcdir: testdata/src
17 | import path: what
18 |
19 | -------- @what var --------
20 | variable declaration
21 | variable declaration statement
22 | block
23 | function declaration
24 | source file
25 | modes: [callers callstack describe freevars pointsto whicherrs]
26 | srcdir: testdata/src
27 | import path: what
28 |
29 | -------- @what recv --------
30 | identifier
31 | unary <- operation
32 | expression statement
33 | block
34 | function declaration
35 | source file
36 | modes: [callers callstack definition describe freevars implements peers pointsto referrers whicherrs]
37 | srcdir: testdata/src
38 | import path: what
39 | ch
40 | ch
41 |
42 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/whicherrs/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | type errType string
4 |
5 | const constErr errType = "blah"
6 |
7 | func (et errType) Error() string {
8 | return string(et)
9 | }
10 |
11 | var errVar error = errType("foo")
12 |
13 | func genErr(i int) error {
14 | switch i {
15 | case 0:
16 | return constErr
17 | case 1:
18 | return errVar
19 | default:
20 | return nil
21 | }
22 | }
23 |
24 | func unreachable() {
25 | err := errVar // @whicherrs func-dead "err"
26 | _ = err
27 | }
28 |
29 | func main() {
30 | err := genErr(0) // @whicherrs localerrs "err"
31 | _ = err
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/guru/testdata/src/whicherrs/main.golden:
--------------------------------------------------------------------------------
1 | -------- @whicherrs func-dead --------
2 |
3 | Error: pointer analysis did not find expression (dead code?)
4 | -------- @whicherrs localerrs --------
5 | this error may point to these globals:
6 | errVar
7 | this error may contain these constants:
8 | constErr
9 | this error may contain these dynamic types:
10 | errType
11 |
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/heapview/client/.clang-format:
--------------------------------------------------------------------------------
1 | BasedOnStyle: Google
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/heapview/client/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules/
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/heapview/client/main_test.ts:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | import {HamburgerElement, HeadingElement, SidebarElement, main} from './main';
6 |
7 | describe('main', () => {
8 | it('sets the document\'s title', () => {
9 | main();
10 | expect(document.title).toBe('Go Heap Viewer');
11 | });
12 |
13 | it('has a heading', () => {
14 | main();
15 | expect(document.querySelector(HeadingElement.NAME)).toBeDefined();
16 | });
17 |
18 | it('has a sidebar', () => {
19 | main();
20 | const hamburger = document.querySelector(HamburgerElement.NAME);
21 | const sidebar =
22 | document.querySelector(SidebarElement.NAME) as SidebarElement;
23 | expect(sidebar.style.display).toBe('none');
24 |
25 | // Click on the hamburger. Sidebar should then be visible.
26 | hamburger.dispatchEvent(new Event('click'));
27 | expect(sidebar.style.display).toBe('block');
28 | })
29 | });
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/heapview/client/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "//": [
3 | "Copyright 2016 The Go Authors. All rights reserved.",
4 | "Use of this source code is governed by a BSD-style",
5 | "license that can be found in the LICENSE file.",
6 |
7 | "This file exists to help import typescript typings",
8 | "for web features used in this project. Neither the",
9 | "typings nor node or npm are required to do development",
10 | "on the code in this project.",
11 |
12 | "If you do have npm installed, use the `npm i` command",
13 | "in this directory to install the typings."
14 | ],
15 | "private": true,
16 | "name": "@golangtools/heapview",
17 | "version": "0.0.0",
18 | "devDependencies": {
19 | "@types/webcomponents.js": "latest",
20 | "@types/whatwg-fetch": "latest",
21 | "@types/jasmine": "latest",
22 |
23 | "jasmine-core": "latest",
24 | "karma": "latest",
25 | "karma-jasmine": "latest",
26 | "karma-chrome-launcher": "latest",
27 |
28 | "clang-format": "latest"
29 | },
30 | "scripts": {
31 | "test": "karma start testing/karma.conf.js",
32 | "format": "find . | grep '\\(test_main\\.js\\|\\.ts\\)$' | xargs clang-format -i",
33 | "lint": "tslint --project ."
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/heapview/client/testing/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | module.exports = config => {
6 | config.set({
7 | frameworks: ['jasmine'],
8 | basePath: '../../../..',
9 | files: [
10 | 'third_party/webcomponents/customelements.js',
11 | 'third_party/typescript/typescript.js',
12 | 'third_party/moduleloader/moduleloader.js',
13 | 'cmd/heapview/client/testing/test_main.js',
14 | {pattern: 'cmd/heapview/client/**/*.ts', included: false},
15 | ],
16 | browsers: ['Chrome'],
17 | plugins: [
18 | 'karma-jasmine',
19 | 'karma-chrome-launcher'
20 | ],
21 | })
22 | }
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/heapview/client/testing/test_main.js:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Configure module loader.
6 | System.transpiler = 'typescript'
7 | System.typescriptOptions = {
8 | target: ts.ScriptTarget.ES2015
9 | };
10 | System.locate = (load) => load.name + '.ts';
11 |
12 | // Determine set of test files.
13 | var tests = [];
14 | for (var file in window.__karma__.files) {
15 | if (window.__karma__.files.hasOwnProperty(file)) {
16 | if (/_test\.ts$/.test(file)) {
17 | tests.push(file.slice(0, -3));
18 | }
19 | }
20 | }
21 |
22 | // Steal loaded callback so we can block until we're
23 | // done loading all test modules.
24 | var loadedCallback = window.__karma__.loaded.bind(window.__karma__);
25 | window.__karma__.loaded = () => {};
26 |
27 | // Load all test modules, and then call loadedCallback.
28 | var promises = [];
29 | for (var i = 0; i < tests.length; i++) {
30 | promises.push(System.import(tests[i]));
31 | }
32 | Promise.all(promises).then(loadedCallback);
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/heapview/client/tsconfig.json:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // This file contains configuration for the Typescript
6 | // compiler if you're running it locally for typechecking
7 | // and other tooling. The Typescript compiler is
8 | // not necessary to do development on this project.
9 |
10 | {
11 | "compilerOptions": {
12 | "noEmit": true,
13 | "strictNullChecks": true,
14 | "target": "es2015"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/heapview/client/tslint.json:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // This tslint file is based on a configuration used at
6 | // Google.
7 |
8 | {
9 | "rules": {
10 | "class-name": true,
11 | "forin": true,
12 | "interface-name": [true, "never-prefix"],
13 | "jsdoc-format": true,
14 | "label-position": true,
15 | "label-undefined": true,
16 | "new-parens": true,
17 | "no-angle-bracket-type-assertion": true,
18 | "no-construct": true,
19 | "no-debugger": true,
20 | "no-namespace": [true, "allow-declarations"],
21 | "no-reference": true,
22 | "no-require-imports": true,
23 | "no-unused-expression": true,
24 | "no-unused-variable": true,
25 | "no-use-before-declare": true,
26 | "no-var-keyword": true,
27 | "semicolon": [true, "always"],
28 | "switch-default": true,
29 | "triple-equals": [true, "allow-null-check"],
30 | "use-isnan": true,
31 | "variable-name": [
32 | true,
33 | "check-format",
34 | "ban-keywords",
35 | "allow-leading-underscore",
36 | "allow-trailing-underscore",
37 | "allow-pascal-case"
38 | ]
39 | }
40 | }
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/heapview/internal/core/mmapfile_other.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !darwin,!linux
6 |
7 | package core
8 |
9 | // TODO(matloob): perhaps use the more portable golang.org/x/exp/mmap
10 | // instead of the mmap code in mmapfile.go.
11 |
12 | type mmapFile struct{}
13 |
14 | func (m *mmapFile) Close() error { return nil }
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/present/appengine.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build appengine
6 |
7 | package main
8 |
9 | import (
10 | "mime"
11 |
12 | "golang.org/x/tools/present"
13 | )
14 |
15 | func init() {
16 | initTemplates("./present/")
17 | present.PlayEnabled = true
18 | initPlayground("./present/", nil)
19 |
20 | // App Engine has no /etc/mime.types
21 | mime.AddExtensionType(".svg", "image/svg+xml")
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/present/play.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package main
6 |
7 | import (
8 | "bytes"
9 | "fmt"
10 | "io/ioutil"
11 | "net/http"
12 | "path/filepath"
13 | "time"
14 |
15 | "golang.org/x/tools/godoc/static"
16 | )
17 |
18 | var scripts = []string{"jquery.js", "jquery-ui.js", "playground.js", "play.js"}
19 |
20 | // playScript registers an HTTP handler at /play.js that serves all the
21 | // scripts specified by the variable above, and appends a line that
22 | // initializes the playground with the specified transport.
23 | func playScript(root, transport string) {
24 | modTime := time.Now()
25 | var buf bytes.Buffer
26 | for _, p := range scripts {
27 | if s, ok := static.Files[p]; ok {
28 | buf.WriteString(s)
29 | continue
30 | }
31 | b, err := ioutil.ReadFile(filepath.Join(root, "static", p))
32 | if err != nil {
33 | panic(err)
34 | }
35 | buf.Write(b)
36 | }
37 | fmt.Fprintf(&buf, "\ninitPlayground(new %v());\n", transport)
38 | b := buf.Bytes()
39 | http.HandleFunc("/play.js", func(w http.ResponseWriter, r *http.Request) {
40 | w.Header().Set("Content-type", "application/javascript")
41 | http.ServeContent(w, r, "", modTime, bytes.NewReader(b))
42 | })
43 | }
44 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/present/play_http.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build appengine appenginevm
6 |
7 | package main
8 |
9 | import (
10 | "net/url"
11 |
12 | "golang.org/x/tools/present"
13 |
14 | _ "golang.org/x/tools/playground"
15 | )
16 |
17 | func initPlayground(basepath string, origin *url.URL) {
18 | playScript(basepath, "HTTPTransport")
19 | }
20 |
21 | func playable(c present.Code) bool {
22 | return present.PlayEnabled && c.Play && c.Ext == ".go"
23 | }
24 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/present/play_socket.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !appengine,!appenginevm
6 |
7 | package main
8 |
9 | import (
10 | "net/http"
11 | "net/url"
12 | "runtime"
13 |
14 | "golang.org/x/tools/playground/socket"
15 | "golang.org/x/tools/present"
16 | )
17 |
18 | func initPlayground(basepath string, origin *url.URL) {
19 | if present.PlayEnabled {
20 | if *nativeClient {
21 | socket.RunScripts = false
22 | socket.Environ = func() []string {
23 | if runtime.GOARCH == "amd64" {
24 | return environ("GOOS=nacl", "GOARCH=amd64p32")
25 | }
26 | return environ("GOOS=nacl")
27 | }
28 | }
29 | playScript(basepath, "SocketTransport")
30 | http.Handle("/socket", socket.NewHandler(origin))
31 | }
32 | }
33 |
34 | func playable(c present.Code) bool {
35 | return present.PlayEnabled && c.Play
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/present/static/dir.js:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // copied from $GOROOT/doc/godocs.js
6 |
7 | function bindEvent(el, e, fn) {
8 | if (el.addEventListener){
9 | el.addEventListener(e, fn, false);
10 | } else if (el.attachEvent){
11 | el.attachEvent('on'+e, fn);
12 | }
13 | }
14 |
15 | function godocs_bindSearchEvents() {
16 | var search = document.getElementById('search');
17 | if (!search) {
18 | // no search box (index disabled)
19 | return;
20 | }
21 | function clearInactive() {
22 | if (search.className == "inactive") {
23 | search.value = "";
24 | search.className = "";
25 | }
26 | }
27 | function restoreInactive() {
28 | if (search.value !== "") {
29 | return;
30 | }
31 | if (search.type != "search") {
32 | search.value = search.getAttribute("placeholder");
33 | }
34 | search.className = "inactive";
35 | }
36 | restoreInactive();
37 | bindEvent(search, 'focus', clearInactive);
38 | bindEvent(search, 'blur', restoreInactive);
39 | }
40 |
41 | bindEvent(window, 'load', godocs_bindSearchEvents);
42 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/present/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/cmd/present/static/favicon.ico
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/present/static/notes.css:
--------------------------------------------------------------------------------
1 | p {
2 | margin: 10px;
3 | }
4 |
5 | #presenter-slides {
6 | display: block;
7 | margin-top: -10px;
8 | margin-left: -17px;
9 | position: fixed;
10 | border: 0;
11 | width : 146%;
12 | height: 750px;
13 |
14 | transform: scale(0.7, 0.7);
15 | transform-origin: top left;
16 | -moz-transform: scale(0.7);
17 | -moz-transform-origin: top left;
18 | -o-transform: scale(0.7);
19 | -o-transform-origin: top left;
20 | -webkit-transform: scale(0.7);
21 | -webkit-transform-origin: top left;
22 | }
23 |
24 | #presenter-notes {
25 | margin-top: -180px;
26 | font-family: 'Open Sans', Arial, sans-serif;
27 | height: 30%;
28 | width: 100%;
29 | overflow: scroll;
30 | position: fixed;
31 | top: 706px;
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/stringer/importer18.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !go1.9
6 |
7 | package main
8 |
9 | import (
10 | "go/importer"
11 | "go/types"
12 | )
13 |
14 | func defaultImporter() types.Importer {
15 | return importer.Default()
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/stringer/importer19.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.9
6 |
7 | package main
8 |
9 | import (
10 | "go/importer"
11 | "go/types"
12 | )
13 |
14 | func defaultImporter() types.Importer {
15 | return importer.For("source", nil)
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/stringer/testdata/cgo.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Import "C" shouldn't be imported.
6 |
7 | package main
8 |
9 | /*
10 | #define HELLO 1
11 | */
12 | import "C"
13 |
14 | import "fmt"
15 |
16 | type Cgo uint32
17 |
18 | const (
19 | // MustScanSubDirs indicates that events were coalesced hierarchically.
20 | MustScanSubDirs Cgo = 1 << iota
21 | )
22 |
23 | func main() {
24 | _ = C.HELLO
25 | ck(MustScanSubDirs, "MustScanSubDirs")
26 | }
27 |
28 | func ck(day Cgo, str string) {
29 | if fmt.Sprint(day) != str {
30 | panic("cgo.go: " + str)
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/stringer/testdata/day.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Simple test: enumeration of type int starting at 0.
6 |
7 | package main
8 |
9 | import "fmt"
10 |
11 | type Day int
12 |
13 | const (
14 | Monday Day = iota
15 | Tuesday
16 | Wednesday
17 | Thursday
18 | Friday
19 | Saturday
20 | Sunday
21 | )
22 |
23 | func main() {
24 | ck(Monday, "Monday")
25 | ck(Tuesday, "Tuesday")
26 | ck(Wednesday, "Wednesday")
27 | ck(Thursday, "Thursday")
28 | ck(Friday, "Friday")
29 | ck(Saturday, "Saturday")
30 | ck(Sunday, "Sunday")
31 | ck(-127, "Day(-127)")
32 | ck(127, "Day(127)")
33 | }
34 |
35 | func ck(day Day, str string) {
36 | if fmt.Sprint(day) != str {
37 | panic("day.go: " + str)
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/stringer/testdata/gap.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Gaps and an offset.
6 |
7 | package main
8 |
9 | import "fmt"
10 |
11 | type Gap int
12 |
13 | const (
14 | Two Gap = 2
15 | Three Gap = 3
16 | Five Gap = 5
17 | Six Gap = 6
18 | Seven Gap = 7
19 | Eight Gap = 8
20 | Nine Gap = 9
21 | Eleven Gap = 11
22 | )
23 |
24 | func main() {
25 | ck(0, "Gap(0)")
26 | ck(1, "Gap(1)")
27 | ck(Two, "Two")
28 | ck(Three, "Three")
29 | ck(4, "Gap(4)")
30 | ck(Five, "Five")
31 | ck(Six, "Six")
32 | ck(Seven, "Seven")
33 | ck(Eight, "Eight")
34 | ck(Nine, "Nine")
35 | ck(10, "Gap(10)")
36 | ck(Eleven, "Eleven")
37 | ck(12, "Gap(12)")
38 | }
39 |
40 | func ck(gap Gap, str string) {
41 | if fmt.Sprint(gap) != str {
42 | panic("gap.go: " + str)
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/stringer/testdata/num.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Signed integers spanning zero.
6 |
7 | package main
8 |
9 | import "fmt"
10 |
11 | type Num int
12 |
13 | const (
14 | m_2 Num = -2 + iota
15 | m_1
16 | m0
17 | m1
18 | m2
19 | )
20 |
21 | func main() {
22 | ck(-3, "Num(-3)")
23 | ck(m_2, "m_2")
24 | ck(m_1, "m_1")
25 | ck(m0, "m0")
26 | ck(m1, "m1")
27 | ck(m2, "m2")
28 | ck(3, "Num(3)")
29 | }
30 |
31 | func ck(num Num, str string) {
32 | if fmt.Sprint(num) != str {
33 | panic("num.go: " + str)
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/stringer/testdata/number.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Enumeration with an offset.
6 | // Also includes a duplicate.
7 |
8 | package main
9 |
10 | import "fmt"
11 |
12 | type Number int
13 |
14 | const (
15 | _ Number = iota
16 | One
17 | Two
18 | Three
19 | AnotherOne = One // Duplicate; note that AnotherOne doesn't appear below.
20 | )
21 |
22 | func main() {
23 | ck(One, "One")
24 | ck(Two, "Two")
25 | ck(Three, "Three")
26 | ck(AnotherOne, "One")
27 | ck(127, "Number(127)")
28 | }
29 |
30 | func ck(num Number, str string) {
31 | if fmt.Sprint(num) != str {
32 | panic("number.go: " + str)
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/stringer/testdata/prime.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Enough gaps to trigger a map implementation of the method.
6 | // Also includes a duplicate to test that it doesn't cause problems
7 |
8 | package main
9 |
10 | import "fmt"
11 |
12 | type Prime int
13 |
14 | const (
15 | p2 Prime = 2
16 | p3 Prime = 3
17 | p5 Prime = 5
18 | p7 Prime = 7
19 | p77 Prime = 7 // Duplicate; note that p77 doesn't appear below.
20 | p11 Prime = 11
21 | p13 Prime = 13
22 | p17 Prime = 17
23 | p19 Prime = 19
24 | p23 Prime = 23
25 | p29 Prime = 29
26 | p37 Prime = 31
27 | p41 Prime = 41
28 | p43 Prime = 43
29 | )
30 |
31 | func main() {
32 | ck(0, "Prime(0)")
33 | ck(1, "Prime(1)")
34 | ck(p2, "p2")
35 | ck(p3, "p3")
36 | ck(4, "Prime(4)")
37 | ck(p5, "p5")
38 | ck(p7, "p7")
39 | ck(p77, "p7")
40 | ck(p11, "p11")
41 | ck(p13, "p13")
42 | ck(p17, "p17")
43 | ck(p19, "p19")
44 | ck(p23, "p23")
45 | ck(p29, "p29")
46 | ck(p37, "p37")
47 | ck(p41, "p41")
48 | ck(p43, "p43")
49 | ck(44, "Prime(44)")
50 | }
51 |
52 | func ck(prime Prime, str string) {
53 | if fmt.Sprint(prime) != str {
54 | panic("prime.go: " + str)
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/stringer/testdata/unum.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Unsigned integers spanning zero.
6 |
7 | package main
8 |
9 | import "fmt"
10 |
11 | type Unum uint8
12 |
13 | const (
14 | m_2 Unum = iota + 253
15 | m_1
16 | )
17 |
18 | const (
19 | m0 Unum = iota
20 | m1
21 | m2
22 | )
23 |
24 | func main() {
25 | ck(^Unum(0)-3, "Unum(252)")
26 | ck(m_2, "m_2")
27 | ck(m_1, "m_1")
28 | ck(m0, "m0")
29 | ck(m1, "m1")
30 | ck(m2, "m2")
31 | ck(3, "Unum(3)")
32 | }
33 |
34 | func ck(unum Unum, str string) {
35 | if fmt.Sprint(unum) != str {
36 | panic("unum.go: " + str)
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/stringer/testdata/unum2.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Unsigned integers - check maximum size
6 |
7 | package main
8 |
9 | import "fmt"
10 |
11 | type Unum2 uint8
12 |
13 | const (
14 | Zero Unum2 = iota
15 | One
16 | Two
17 | )
18 |
19 | func main() {
20 | ck(Zero, "Zero")
21 | ck(One, "One")
22 | ck(Two, "Two")
23 | ck(3, "Unum2(3)")
24 | ck(255, "Unum2(255)")
25 | }
26 |
27 | func ck(unum Unum2, str string) {
28 | if fmt.Sprint(unum) != str {
29 | panic("unum.go: " + str)
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/tip/Makefile:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Go Authors. All rights reserved.
2 | # Use of this source code is governed by a BSD-style
3 | # license that can be found in the LICENSE file.
4 |
5 | VERSION=v2
6 |
7 | update-deps:
8 | go install golang.org/x/build/cmd/gitlock
9 | gitlock --update=Dockerfile --ignore=NONE golang.org/x/tools/cmd/tip
10 |
11 | docker-prod: Dockerfile
12 | docker build -f Dockerfile --tag=gcr.io/symbolic-datum-552/tip:$(VERSION) .
13 | docker-dev: Dockerfile
14 | docker build -f Dockerfile --tag=gcr.io/go-dashboard-dev/tip:$(VERSION) .
15 |
16 | push-prod: docker-prod
17 | gcloud docker -- push gcr.io/symbolic-datum-552/tip:$(VERSION)
18 | push-dev: docker-dev
19 | gcloud docker -- push gcr.io/go-dashboard-dev/tip:$(VERSION)
20 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/tip/README:
--------------------------------------------------------------------------------
1 | ============================================================
2 | Old instructions, only valid for talks.golang.org:
3 | ============================================================
4 |
5 | 1. Deploy the app.
6 |
7 | To deploy tip.golang.org:
8 | (See Kubernetes instruction below.)
9 |
10 | To deploy talks.golang.org:
11 | $ gcloud --project golang-org app deploy --no-promote talks.yaml
12 |
13 | 2. Wait until the deployed version is serving requests.
14 |
15 | 3. Go to the developer console and upgrade the default version.
16 | https://console.developers.google.com/appengine/versions?project=golang-org&moduleId=tip
17 |
18 | 4. Clean up any old versions (they continue to use at least one instance).
19 |
20 | ============================================================
21 | New Kubernetes instructions, for tip.golang.org:
22 | ============================================================
23 |
24 | Kubernetes instructions:
25 |
26 | * build & push images (see Makefile for helpers)
27 | * create/update resources:
28 | - kubectl create -f tip-rc.yaml
29 | - kubectl create -f tip-service.yaml
30 |
31 | TODO(bradfitz): flesh out these instructions as I gain experience
32 | with updating this over time. Also: move talks.golang.org to GKE too?
33 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/tip/godoc.yaml:
--------------------------------------------------------------------------------
1 | module: tip
2 | runtime: custom
3 | vm: true
4 |
5 | manual_scaling:
6 | instances: 4
7 |
8 | env_variables:
9 | TIP_BUILDER: 'godoc'
10 |
11 | health_check:
12 | enable_health_check: True
13 | check_interval_sec: 5
14 | timeout_sec: 4
15 | unhealthy_threshold: 2
16 | healthy_threshold: 2
17 | restart_threshold: 240
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/tip/talks.yaml:
--------------------------------------------------------------------------------
1 | service: talks
2 | runtime: custom
3 | env: flex
4 |
5 | manual_scaling:
6 | instances: 1
7 |
8 | env_variables:
9 | TIP_BUILDER: 'talks'
10 |
11 | health_check:
12 | enable_health_check: False
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/tip/tip-rc.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: ReplicationController
3 | metadata:
4 | name: tipgodoc
5 | spec:
6 | replicas: 1
7 | selector:
8 | app: tipgodoc
9 | template:
10 | metadata:
11 | name: tipgodoc
12 | labels:
13 | app: tipgodoc
14 | spec:
15 | volumes:
16 | - name: cache-volume
17 | emptyDir: {}
18 | containers:
19 | - name: gitmirror
20 | image: gcr.io/symbolic-datum-552/tip:v2
21 | imagePullPolicy: Always
22 | command: ["/go/bin/tip", "--autocert=tip.golang.org", "--autocert-bucket=golang-tip-autocert"]
23 | env:
24 | - name: TMPDIR
25 | value: /build
26 | - name: TIP_BUILDER
27 | value: godoc
28 | volumeMounts:
29 | - mountPath: /build
30 | name: cache-volume
31 | ports:
32 | - containerPort: 8080
33 | - containerPort: 443
34 | resources:
35 | requests:
36 | cpu: "1"
37 | memory: "2Gi"
38 | limits:
39 | cpu: "2"
40 | memory: "4Gi"
41 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/tip/tip-service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: tipgodoc
5 | spec:
6 | ports:
7 | - port: 80
8 | targetPort: 8080
9 | name: http
10 | - port: 443
11 | targetPort: 443
12 | name: https
13 | selector:
14 | app: tipgodoc
15 | type: LoadBalancer
16 | loadBalancerIP: 130.211.180.236
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/cmd/tip/tip_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by the Apache 2.0
3 | // license that can be found in the LICENSE file.
4 |
5 | package main
6 |
7 | import (
8 | "net/http/httptest"
9 | "testing"
10 | )
11 |
12 | func TestTipRedirects(t *testing.T) {
13 | mux := newServeMux(&Proxy{builder: &godocBuilder{}})
14 | req := httptest.NewRequest("GET", "http://example.com/foo?bar=baz", nil)
15 | req.Header.Set("X-Forwarded-Proto", "http")
16 | w := httptest.NewRecorder()
17 | mux.ServeHTTP(w, req)
18 | if w.Code != 302 {
19 | t.Errorf("expected Code to be 302, got %d", w.Code)
20 | }
21 | want := "https://example.com/foo?bar=baz"
22 | if loc := w.Header().Get("Location"); loc != want {
23 | t.Errorf("Location header: got %s, want %s", loc, want)
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/codereview.cfg:
--------------------------------------------------------------------------------
1 | issuerepo: golang/go
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/container/intsets/popcnt_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build amd64,!appengine,!gccgo
6 |
7 | package intsets
8 |
9 | func popcnt(x word) int
10 | func havePOPCNT() bool
11 |
12 | var hasPOPCNT = havePOPCNT()
13 |
14 | // popcount returns the population count (number of set bits) of x.
15 | func popcount(x word) int {
16 | if hasPOPCNT {
17 | return popcnt(x)
18 | }
19 | return popcountTable(x) // faster than Hacker's Delight
20 | }
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/container/intsets/popcnt_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build amd64,!appengine,!gccgo
6 |
7 | #include "textflag.h"
8 |
9 | // func havePOPCNT() bool
10 | TEXT ·havePOPCNT(SB),4,$0
11 | MOVQ $1, AX
12 | CPUID
13 | SHRQ $23, CX
14 | ANDQ $1, CX
15 | MOVB CX, ret+0(FP)
16 | RET
17 |
18 | // func popcnt(word) int
19 | TEXT ·popcnt(SB),NOSPLIT,$0-8
20 | XORQ AX, AX
21 | MOVQ x+0(FP), SI
22 | // POPCNT (SI), AX is not recognized by Go assembler,
23 | // so we assemble it ourselves.
24 | BYTE $0xf3
25 | BYTE $0x48
26 | BYTE $0x0f
27 | BYTE $0xb8
28 | BYTE $0xc6
29 | MOVQ AX, ret+8(FP)
30 | RET
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/container/intsets/popcnt_gccgo.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build gccgo
6 |
7 | package intsets
8 |
9 | func popcount(x word) int
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/container/intsets/popcnt_gccgo_c.c:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build gccgo
6 |
7 | #include
8 | #include
9 | #include
10 |
11 | #define _STRINGIFY2_(x) #x
12 | #define _STRINGIFY_(x) _STRINGIFY2_(x)
13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__)
14 |
15 | extern intptr_t popcount(uintptr_t x) __asm__(GOSYM_PREFIX GOPKGPATH ".popcount");
16 |
17 | intptr_t popcount(uintptr_t x) {
18 | return __builtin_popcountl((unsigned long)(x));
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/container/intsets/popcnt_generic.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !amd64 appengine
6 | // +build !gccgo
7 |
8 | package intsets
9 |
10 | import "runtime"
11 |
12 | // We compared three algorithms---Hacker's Delight, table lookup,
13 | // and AMD64's SSE4.1 hardware POPCNT---on a 2.67GHz Xeon X5550.
14 | //
15 | // % GOARCH=amd64 go test -run=NONE -bench=Popcount
16 | // POPCNT 5.12 ns/op
17 | // Table 8.53 ns/op
18 | // HackersDelight 9.96 ns/op
19 | //
20 | // % GOARCH=386 go test -run=NONE -bench=Popcount
21 | // Table 10.4 ns/op
22 | // HackersDelight 5.23 ns/op
23 | //
24 | // (AMD64's ABM1 hardware supports ntz and nlz too,
25 | // but they aren't critical.)
26 |
27 | // popcount returns the population count (number of set bits) of x.
28 | func popcount(x word) int {
29 | if runtime.GOARCH == "386" {
30 | return popcountHD(uint32(x))
31 | }
32 | return popcountTable(x)
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ast/astutil/util.go:
--------------------------------------------------------------------------------
1 | package astutil
2 |
3 | import "go/ast"
4 |
5 | // Unparen returns e with any enclosing parentheses stripped.
6 | func Unparen(e ast.Expr) ast.Expr {
7 | for {
8 | p, ok := e.(*ast.ParenExpr)
9 | if !ok {
10 | return e
11 | }
12 | e = p.X
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/buildutil/tags_test.go:
--------------------------------------------------------------------------------
1 | package buildutil_test
2 |
3 | import (
4 | "flag"
5 | "go/build"
6 | "reflect"
7 | "testing"
8 |
9 | "golang.org/x/tools/go/buildutil"
10 | )
11 |
12 | func TestTags(t *testing.T) {
13 | f := flag.NewFlagSet("TestTags", flag.PanicOnError)
14 | var ctxt build.Context
15 | f.Var((*buildutil.TagsFlag)(&ctxt.BuildTags), "tags", buildutil.TagsFlagDoc)
16 | f.Parse([]string{"-tags", ` 'one'"two" 'three "four"'`, "rest"})
17 |
18 | // BuildTags
19 | want := []string{"one", "two", "three \"four\""}
20 | if !reflect.DeepEqual(ctxt.BuildTags, want) {
21 | t.Errorf("BuildTags = %q, want %q", ctxt.BuildTags, want)
22 | }
23 |
24 | // Args()
25 | if want := []string{"rest"}; !reflect.DeepEqual(f.Args(), want) {
26 | t.Errorf("f.Args() = %q, want %q", f.Args(), want)
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/buildutil/util_windows_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package buildutil_test
6 |
7 | import (
8 | "fmt"
9 | "go/build"
10 | "path/filepath"
11 | "runtime"
12 | "strings"
13 | "testing"
14 |
15 | "golang.org/x/tools/go/buildutil"
16 | )
17 |
18 | func testContainingPackageCaseFold(file, want string) error {
19 | bp, err := buildutil.ContainingPackage(&build.Default, ".", file)
20 | if err != nil {
21 | return err
22 | }
23 | if got := bp.ImportPath; got != want {
24 | return fmt.Errorf("ContainingPackage(%q) = %s, want %s", file, got, want)
25 | }
26 | return nil
27 | }
28 |
29 | func TestContainingPackageCaseFold(t *testing.T) {
30 | path := filepath.Join(runtime.GOROOT(), `src\fmt\print.go`)
31 | err := testContainingPackageCaseFold(path, "fmt")
32 | if err != nil {
33 | t.Error(err)
34 | }
35 | vol := filepath.VolumeName(path)
36 | if len(vol) != 2 || vol[1] != ':' {
37 | t.Fatalf("GOROOT path has unexpected volume name: %v", vol)
38 | }
39 | rest := path[len(vol):]
40 | err = testContainingPackageCaseFold(strings.ToUpper(vol)+rest, "fmt")
41 | if err != nil {
42 | t.Error(err)
43 | }
44 | err = testContainingPackageCaseFold(strings.ToLower(vol)+rest, "fmt")
45 | if err != nil {
46 | t.Error(err)
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/callgraph/cha/testdata/func.go:
--------------------------------------------------------------------------------
1 | //+build ignore
2 |
3 | package main
4 |
5 | // Test of dynamic function calls; no interfaces.
6 |
7 | func A(int) {}
8 |
9 | var (
10 | B = func(int) {}
11 | C = func(int) {}
12 | )
13 |
14 | func f() {
15 | pfn := B
16 | pfn(0) // calls A, B, C, even though A is not even address-taken
17 | }
18 |
19 | // WANT:
20 | // Dynamic calls
21 | // f --> A
22 | // f --> init$1
23 | // f --> init$2
24 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/callgraph/cha/testdata/iface.go:
--------------------------------------------------------------------------------
1 | //+build ignore
2 |
3 | package main
4 |
5 | // Test of interface calls. None of the concrete types are ever
6 | // instantiated or converted to interfaces.
7 |
8 | type I interface {
9 | f()
10 | }
11 |
12 | type J interface {
13 | f()
14 | g()
15 | }
16 |
17 | type C int // implements I
18 |
19 | func (*C) f()
20 |
21 | type D int // implements I and J
22 |
23 | func (*D) f()
24 | func (*D) g()
25 |
26 | func one(i I, j J) {
27 | i.f() // calls *C and *D
28 | }
29 |
30 | func two(i I, j J) {
31 | j.f() // calls *D (but not *C, even though it defines method f)
32 | }
33 |
34 | func three(i I, j J) {
35 | j.g() // calls *D
36 | }
37 |
38 | func four(i I, j J) {
39 | Jf := J.f
40 | if unknown {
41 | Jf = nil // suppress SSA constant propagation
42 | }
43 | Jf(nil) // calls *D
44 | }
45 |
46 | func five(i I, j J) {
47 | jf := j.f
48 | if unknown {
49 | jf = nil // suppress SSA constant propagation
50 | }
51 | jf() // calls *D
52 | }
53 |
54 | var unknown bool
55 |
56 | // WANT:
57 | // Dynamic calls
58 | // (J).f$bound --> (*D).f
59 | // (J).f$thunk --> (*D).f
60 | // five --> (J).f$bound
61 | // four --> (J).f$thunk
62 | // one --> (*C).f
63 | // one --> (*D).f
64 | // three --> (*D).g
65 | // two --> (*D).f
66 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/callgraph/cha/testdata/recv.go:
--------------------------------------------------------------------------------
1 | //+build ignore
2 |
3 | package main
4 |
5 | type I interface {
6 | f()
7 | }
8 |
9 | type J interface {
10 | g()
11 | }
12 |
13 | type C int // C and *C implement I; *C implements J
14 |
15 | func (C) f()
16 | func (*C) g()
17 |
18 | type D int // *D implements I and J
19 |
20 | func (*D) f()
21 | func (*D) g()
22 |
23 | func f(i I) {
24 | i.f() // calls C, *C, *D
25 | }
26 |
27 | func g(j J) {
28 | j.g() // calls *C, *D
29 | }
30 |
31 | // WANT:
32 | // Dynamic calls
33 | // f --> (*C).f
34 | // f --> (*D).f
35 | // f --> (C).f
36 | // g --> (*C).g
37 | // g --> (*D).g
38 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/callgraph/rta/testdata/func.go:
--------------------------------------------------------------------------------
1 | //+build ignore
2 |
3 | package main
4 |
5 | // Test of dynamic function calls.
6 | // No interfaces, so no runtime/reflect types.
7 |
8 | func A1() {
9 | A2(0)
10 | }
11 |
12 | func A2(int) {} // not address-taken
13 |
14 | func B() {} // unreachable
15 |
16 | var (
17 | C = func(int) {}
18 | D = func(int) {}
19 | )
20 |
21 | func main() {
22 | A1()
23 |
24 | pfn := C
25 | pfn(0) // calls C and D but not A2 (same sig but not address-taken)
26 | }
27 |
28 | // WANT:
29 | // Dynamic calls
30 | // main --> init$1
31 | // main --> init$2
32 | // Reachable functions
33 | // A1
34 | // A2
35 | // init$1
36 | // init$2
37 | // Reflect types
38 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/callgraph/rta/testdata/rtype.go:
--------------------------------------------------------------------------------
1 | //+build ignore
2 |
3 | package main
4 |
5 | // Test of runtime types (types for which descriptors are needed).
6 |
7 | func use(interface{})
8 |
9 | type A byte // neither A nor byte are runtime types
10 |
11 | type B struct{ x uint } // B and uint are runtime types, but not the struct
12 |
13 | func main() {
14 | var x int // not a runtime type
15 | print(x)
16 |
17 | var y string // runtime type due to interface conversion
18 | use(y)
19 |
20 | use(struct{ uint64 }{}) // struct is a runtime type
21 |
22 | use(new(B)) // *B is a runtime type
23 | }
24 |
25 | // WANT:
26 | // Dynamic calls
27 | // Reachable functions
28 | // use
29 | // Reflect types
30 | // *B
31 | // B
32 | // string
33 | // struct{uint64}
34 | // uint
35 | // uint64
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/callgraph/static/static.go:
--------------------------------------------------------------------------------
1 | // Package static computes the call graph of a Go program containing
2 | // only static call edges.
3 | package static // import "golang.org/x/tools/go/callgraph/static"
4 |
5 | import (
6 | "golang.org/x/tools/go/callgraph"
7 | "golang.org/x/tools/go/ssa"
8 | "golang.org/x/tools/go/ssa/ssautil"
9 | )
10 |
11 | // CallGraph computes the call graph of the specified program
12 | // considering only static calls.
13 | //
14 | func CallGraph(prog *ssa.Program) *callgraph.Graph {
15 | cg := callgraph.New(nil) // TODO(adonovan) eliminate concept of rooted callgraph
16 |
17 | // TODO(adonovan): opt: use only a single pass over the ssa.Program.
18 | // TODO(adonovan): opt: this is slower than RTA (perhaps because
19 | // the lower precision means so many edges are allocated)!
20 | for f := range ssautil.AllFunctions(prog) {
21 | fnode := cg.CreateNode(f)
22 | for _, b := range f.Blocks {
23 | for _, instr := range b.Instrs {
24 | if site, ok := instr.(ssa.CallInstruction); ok {
25 | if g := site.Common().StaticCallee(); g != nil {
26 | gnode := cg.CreateNode(g)
27 | callgraph.AddEdge(fnode, site, gnode)
28 | }
29 | }
30 | }
31 | }
32 | }
33 |
34 | return cg
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gccgoexportdata/testdata/errors.gox:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/go/gccgoexportdata/testdata/errors.gox
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gccgoexportdata/testdata/long.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/go/gccgoexportdata/testdata/long.a
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gccgoexportdata/testdata/short.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/go/gccgoexportdata/testdata/short.a
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata_test.go:
--------------------------------------------------------------------------------
1 | package gcexportdata_test
2 |
3 | import (
4 | "go/token"
5 | "go/types"
6 | "log"
7 | "os"
8 | "testing"
9 |
10 | "golang.org/x/tools/go/gcexportdata"
11 | )
12 |
13 | // Test to ensure that gcexportdata can read files produced by App
14 | // Engine Go runtime v1.6.
15 | func TestAppEngine16(t *testing.T) {
16 | // Open and read the file.
17 | f, err := os.Open("testdata/errors-ae16.a")
18 | if err != nil {
19 | t.Fatal(err)
20 | }
21 | defer f.Close()
22 | r, err := gcexportdata.NewReader(f)
23 | if err != nil {
24 | log.Fatalf("reading export data: %v", err)
25 | }
26 |
27 | // Decode the export data.
28 | fset := token.NewFileSet()
29 | imports := make(map[string]*types.Package)
30 | pkg, err := gcexportdata.Read(r, fset, imports, "errors")
31 | if err != nil {
32 | log.Fatal(err)
33 | }
34 |
35 | // Print package information.
36 | got := pkg.Scope().Lookup("New").Type().String()
37 | want := "func(text string) error"
38 | if got != want {
39 | t.Errorf("New.Type = %s, want %s", got, want)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gcexportdata/testdata/errors-ae16.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/go/gcexportdata/testdata/errors-ae16.a
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gcimporter15/isAlias18.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !go1.9
6 |
7 | package gcimporter
8 |
9 | import "go/types"
10 |
11 | func isAlias(obj *types.TypeName) bool {
12 | return false // there are no type aliases before Go 1.9
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gcimporter15/isAlias19.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.9
6 |
7 | package gcimporter
8 |
9 | import "go/types"
10 |
11 | func isAlias(obj *types.TypeName) bool {
12 | return obj.IsAlias()
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gcimporter15/testdata/a.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Input for TestIssue13566
6 |
7 | package a
8 |
9 | import "encoding/json"
10 |
11 | type A struct {
12 | a *A
13 | json json.RawMessage
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gcimporter15/testdata/b.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Input for TestIssue13566
6 |
7 | package b
8 |
9 | import "./a"
10 |
11 | type A a.A
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gcimporter15/testdata/issue15920.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package p
6 |
7 | // The underlying type of Error is the underlying type of error.
8 | // Make sure we can import this again without problems.
9 | type Error error
10 |
11 | func F() Error { return nil }
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gcimporter15/testdata/issue20046.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package p
6 |
7 | var V interface {
8 | M()
9 | }
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gcimporter15/testdata/p.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Input for TestIssue15517
6 |
7 | package p
8 |
9 | const C = 0
10 |
11 | var V int
12 |
13 | func F() {}
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gcimporter15/testdata/versions/test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // To create a test case for a new export format version,
6 | // build this package with the latest compiler and store
7 | // the resulting .a file appropriately named in the versions
8 | // directory. The VersionHandling test will pick it up.
9 | //
10 | // In the testdata/versions:
11 | //
12 | // go build -o test_go1.$X_$Y.a test.go
13 | //
14 | // with $X = Go version and $Y = export format version.
15 | //
16 | // Make sure this source is extended such that it exercises
17 | // whatever export format change has taken place.
18 |
19 | package test
20 |
21 | // Any release before and including Go 1.7 didn't encode
22 | // the package for a blank struct field.
23 | type BlankField struct {
24 | _ int
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gcimporter15/testdata/versions/test_go1.7_0.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/go/gcimporter15/testdata/versions/test_go1.7_0.a
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/gcimporter15/testdata/versions/test_go1.7_1.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/go/gcimporter15/testdata/versions/test_go1.7_1.a
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/backdoor.go:
--------------------------------------------------------------------------------
1 | package gccgoimporter
2 |
3 | // This file opens a back door to the parser for golang.org/x/tools/go/gccgoexportdata.
4 |
5 | import (
6 | "go/types"
7 | "io"
8 | )
9 |
10 | // Parse reads and parses gccgo export data from in and constructs a
11 | // Package, inserting it into the imports map.
12 | func Parse(in io.Reader, imports map[string]*types.Package, path string) (_ *types.Package, err error) {
13 | var p parser
14 | p.init(path, in, imports)
15 | defer func() {
16 | switch x := recover().(type) {
17 | case nil:
18 | // success
19 | case importError:
20 | err = x
21 | default:
22 | panic(x) // resume unexpected panic
23 | }
24 | }()
25 | pkg := p.parsePackage()
26 | imports[path] = pkg
27 | return pkg, err
28 | }
29 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/importer19_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.9
6 |
7 | package gccgoimporter
8 |
9 | var aliasTests = []importerTest{
10 | {pkgpath: "alias", name: "IntAlias2", want: "type IntAlias2 = Int"},
11 | }
12 |
13 | func init() {
14 | importerTests = append(importerTests, aliasTests...)
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/alias.gox:
--------------------------------------------------------------------------------
1 | v1;
2 | package alias;
3 | pkgpath alias;
4 | type >>>) < type 114>; M2 () ; }>>;
5 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/complexnums.go:
--------------------------------------------------------------------------------
1 | package complexnums
2 |
3 | const NN = -1 - 1i
4 | const NP = -1 + 1i
5 | const PN = 1 - 1i
6 | const PP = 1 + 1i
7 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/complexnums.gox:
--------------------------------------------------------------------------------
1 | v1;
2 | package complexnums;
3 | pkgpath complexnums;
4 | priority 1;
5 | const NN = -0.1E1-0.1E1i ;
6 | const NP = -0.1E1+0.1E1i ;
7 | const PN = 0.1E1-0.1E1i ;
8 | const PP = 0.1E1+0.1E1i ;
9 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/conversions.go:
--------------------------------------------------------------------------------
1 | package conversions
2 |
3 | type Units string
4 |
5 | const Bits = Units("bits")
6 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/conversions.gox:
--------------------------------------------------------------------------------
1 | v2;
2 | package conversions;
3 | prefix go;
4 | package conversions go.conversions go.conversions;
5 | const Bits > = convert(, "bits");
6 | type ;
7 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/escapeinfo.go:
--------------------------------------------------------------------------------
1 | // Test case for escape info in export data. To compile and extract .gox file:
2 | // gccgo -fgo-optimize-allocs -c escapeinfo.go
3 | // objcopy -j .go_export escapeinfo.o escapeinfo.gox
4 |
5 | package escapeinfo
6 |
7 | type T struct{ data []byte }
8 |
9 | func NewT(data []byte) *T {
10 | return &T{data}
11 | }
12 |
13 | func (*T) Read(p []byte) {}
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/escapeinfo.gox:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/escapeinfo.gox
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/imports.go:
--------------------------------------------------------------------------------
1 | package imports
2 |
3 | import "fmt"
4 |
5 | var Hello = fmt.Sprintf("Hello, world")
6 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/imports.gox:
--------------------------------------------------------------------------------
1 | v1;
2 | package imports;
3 | pkgpath imports;
4 | priority 7;
5 | import fmt fmt "fmt";
6 | init imports imports..import 7 math math..import 1 runtime runtime..import 1 strconv strconv..import 2 io io..import 3 reflect reflect..import 3 syscall syscall..import 3 time time..import 4 os os..import 5 fmt fmt..import 6;
7 | var Hello ;
8 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/pointer.go:
--------------------------------------------------------------------------------
1 | package pointer
2 |
3 | type Int8Ptr *int8
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/pointer.gox:
--------------------------------------------------------------------------------
1 | v1;
2 | package pointer;
3 | pkgpath pointer;
4 | type >>;
5 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/time.gox:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/time.gox
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/unicode.gox:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/go/internal/gccgoimporter/testdata/unicode.gox
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/internal/gccgoimporter/testenv_test.go:
--------------------------------------------------------------------------------
1 | package gccgoimporter
2 |
3 | // This file contains testing utilities copied from $GOROOT/src/internal/testenv/testenv.go.
4 |
5 | import (
6 | "runtime"
7 | "strings"
8 | "testing"
9 | )
10 |
11 | // HasGoBuild reports whether the current system can build programs with ``go build''
12 | // and then run them with os.StartProcess or exec.Command.
13 | func HasGoBuild() bool {
14 | switch runtime.GOOS {
15 | case "android", "nacl":
16 | return false
17 | case "darwin":
18 | if strings.HasPrefix(runtime.GOARCH, "arm") {
19 | return false
20 | }
21 | }
22 | return true
23 | }
24 |
25 | // MustHaveGoBuild checks that the current system can build programs with ``go build''
26 | // and then run them with os.StartProcess or exec.Command.
27 | // If not, MustHaveGoBuild calls t.Skip with an explanation.
28 | func MustHaveGoBuild(t *testing.T) {
29 | if !HasGoBuild() {
30 | t.Skipf("skipping test: 'go build' not available on %s/%s", runtime.GOOS, runtime.GOARCH)
31 | }
32 | }
33 |
34 | var testenv = struct {
35 | HasGoBuild func() bool
36 | MustHaveGoBuild func(*testing.T)
37 | }{
38 | HasGoBuild: HasGoBuild,
39 | MustHaveGoBuild: MustHaveGoBuild,
40 | }
41 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/loader/cgo_pkgconfig.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package loader
6 |
7 | import (
8 | "errors"
9 | "fmt"
10 | "go/build"
11 | "os/exec"
12 | "strings"
13 | )
14 |
15 | // pkgConfig runs pkg-config with the specified arguments and returns the flags it prints.
16 | func pkgConfig(mode string, pkgs []string) (flags []string, err error) {
17 | cmd := exec.Command("pkg-config", append([]string{mode}, pkgs...)...)
18 | out, err := cmd.CombinedOutput()
19 | if err != nil {
20 | s := fmt.Sprintf("%s failed: %v", strings.Join(cmd.Args, " "), err)
21 | if len(out) > 0 {
22 | s = fmt.Sprintf("%s: %s", s, out)
23 | }
24 | return nil, errors.New(s)
25 | }
26 | if len(out) > 0 {
27 | flags = strings.Fields(string(out))
28 | }
29 | return
30 | }
31 |
32 | // pkgConfigFlags calls pkg-config if needed and returns the cflags
33 | // needed to build the package.
34 | func pkgConfigFlags(p *build.Package) (cflags []string, err error) {
35 | if len(p.CgoPkgConfig) == 0 {
36 | return nil, nil
37 | }
38 | return pkgConfig("--cflags", p.CgoPkgConfig)
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/loader/testdata/a.go:
--------------------------------------------------------------------------------
1 | package P
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/loader/testdata/b.go:
--------------------------------------------------------------------------------
1 | package P
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/loader/testdata/badpkgdecl.go:
--------------------------------------------------------------------------------
1 | // this file has no package decl
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/TODO:
--------------------------------------------------------------------------------
1 | -*- text -*-
2 |
3 | Pointer analysis to-do list
4 | ===========================
5 |
6 | CONSTRAINT GENERATION:
7 | - support reflection:
8 | - a couple of operators are missing
9 | - reflect.Values may contain lvalues (CanAddr)
10 | - implement native intrinsics. These vary by platform.
11 | - add to pts(a.panic) a label representing all runtime panics, e.g.
12 | runtime.{TypeAssertionError,errorString,errorCString}.
13 |
14 | OPTIMISATIONS
15 | - pre-solver:
16 | pointer equivalence: extend HVN to HRU
17 | location equivalence
18 | - solver: HCD, LCD.
19 | - experiment with map+slice worklist in lieu of bitset.
20 | It may have faster insert.
21 |
22 | MISC:
23 | - Test on all platforms.
24 | Currently we assume these go/build tags: linux, amd64, !cgo.
25 |
26 | MAINTAINABILITY
27 | - Think about ways to make debugging this code easier. PTA logs
28 | routinely exceed a million lines and require training to read.
29 |
30 | BUGS:
31 | - There's a crash bug in stdlib_test + reflection, rVCallConstraint.
32 |
33 |
34 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/print.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package pointer
6 |
7 | import "fmt"
8 |
9 | func (c *addrConstraint) String() string {
10 | return fmt.Sprintf("addr n%d <- {&n%d}", c.dst, c.src)
11 | }
12 |
13 | func (c *copyConstraint) String() string {
14 | return fmt.Sprintf("copy n%d <- n%d", c.dst, c.src)
15 | }
16 |
17 | func (c *loadConstraint) String() string {
18 | return fmt.Sprintf("load n%d <- n%d[%d]", c.dst, c.src, c.offset)
19 | }
20 |
21 | func (c *storeConstraint) String() string {
22 | return fmt.Sprintf("store n%d[%d] <- n%d", c.dst, c.offset, c.src)
23 | }
24 |
25 | func (c *offsetAddrConstraint) String() string {
26 | return fmt.Sprintf("offsetAddr n%d <- n%d.#%d", c.dst, c.src, c.offset)
27 | }
28 |
29 | func (c *typeFilterConstraint) String() string {
30 | return fmt.Sprintf("typeFilter n%d <- n%d.(%s)", c.dst, c.src, c.typ)
31 | }
32 |
33 | func (c *untagConstraint) String() string {
34 | return fmt.Sprintf("untag n%d <- n%d.(%s)", c.dst, c.src, c.typ)
35 | }
36 |
37 | func (c *invokeConstraint) String() string {
38 | return fmt.Sprintf("invoke n%d.%s(n%d ...)", c.iface, c.method.Name(), c.params)
39 | }
40 |
41 | func (n nodeid) String() string {
42 | return fmt.Sprintf("n%d", n)
43 | }
44 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/a_test.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package a
4 |
5 | // This test exercises the synthesis of testmain packages for tests.
6 | // The test framework doesn't directly let us perform negative
7 | // assertions (i.e. that TestingQuux isn't called, or that its
8 | // parameter's PTS is empty) so this test is rather roundabout.
9 |
10 | import "testing"
11 |
12 | func log(f func(*testing.T)) {
13 | // The PTS of f is the set of called tests. TestingQuux is not present.
14 | print(f) // @pointsto main.Test | main.TestFoo
15 | }
16 |
17 | func Test(t *testing.T) {
18 | // Don't assert @pointsto(t) since its label contains a fragile line number.
19 | log(Test)
20 | }
21 |
22 | func TestFoo(t *testing.T) {
23 | // Don't assert @pointsto(t) since its label contains a fragile line number.
24 | log(TestFoo)
25 | }
26 |
27 | func TestingQuux(t *testing.T) {
28 | // We can't assert @pointsto(t) since this is dead code.
29 | log(TestingQuux)
30 | }
31 |
32 | func BenchmarkFoo(b *testing.B) {
33 | }
34 |
35 | func ExampleBar() {
36 | }
37 |
38 | // Excludes TestingQuux.
39 | // @calls testing.tRunner -> main.Test
40 | // @calls testing.tRunner -> main.TestFoo
41 | // @calls testing.runExample -> main.ExampleBar
42 | // @calls (*testing.B).runN -> main.BenchmarkFoo
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/another.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package main
4 |
5 | var unknown bool
6 |
7 | type S string
8 |
9 | func incr(x int) int { return x + 1 }
10 |
11 | func main() {
12 | var i interface{}
13 | i = 1
14 | if unknown {
15 | i = S("foo")
16 | }
17 | if unknown {
18 | i = (func(int, int))(nil) // NB type compares equal to that below.
19 | }
20 | // Look, the test harness can handle equal-but-not-String-equal
21 | // types because we parse types and using a typemap.
22 | if unknown {
23 | i = (func(x int, y int))(nil)
24 | }
25 | if unknown {
26 | i = incr
27 | }
28 | print(i) // @types int | S | func(int, int) | func(int) int
29 |
30 | // NB, an interface may never directly alias any global
31 | // labels, even though it may contain pointers that do.
32 | print(i) // @pointsto makeinterface:func(x int) int | makeinterface:func(x int, y int) | makeinterface:func(int, int) | makeinterface:int | makeinterface:main.S
33 | print(i.(func(int) int)) // @pointsto main.incr
34 |
35 | print() // regression test for crash
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/chanreflect1.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package main
4 |
5 | import "reflect"
6 |
7 | //
8 | // This test is very sensitive to line-number perturbations!
9 |
10 | // Test of channels with reflection.
11 |
12 | var a, b int
13 |
14 | func chanreflect1() {
15 | ch := make(chan *int, 0)
16 | crv := reflect.ValueOf(ch)
17 | crv.Send(reflect.ValueOf(&a))
18 | print(crv.Interface()) // @types chan *int
19 | print(crv.Interface().(chan *int)) // @pointsto makechan@testdata/chanreflect.go:15:12
20 | print(<-ch) // @pointsto main.a
21 | }
22 |
23 | func chanreflect2() {
24 | ch := make(chan *int, 0)
25 | ch <- &b
26 | crv := reflect.ValueOf(ch)
27 | r, _ := crv.Recv()
28 | print(r.Interface()) // @types *int
29 | print(r.Interface().(*int)) // @pointsto main.b
30 | }
31 |
32 | func main() {
33 | chanreflect1()
34 | chanreflect2()
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/context.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package main
4 |
5 | // Test of context-sensitive treatment of certain function calls,
6 | // e.g. static calls to simple accessor methods.
7 |
8 | var a, b int
9 |
10 | type T struct{ x *int }
11 |
12 | func (t *T) SetX(x *int) { t.x = x }
13 | func (t *T) GetX() *int { return t.x }
14 |
15 | func context1() {
16 | var t1, t2 T
17 | t1.SetX(&a)
18 | t2.SetX(&b)
19 | print(t1.GetX()) // @pointsto main.a
20 | print(t2.GetX()) // @pointsto main.b
21 | }
22 |
23 | func context2() {
24 | id := func(x *int) *int {
25 | print(x) // @pointsto main.a | main.b
26 | return x
27 | }
28 | print(id(&a)) // @pointsto main.a
29 | print(id(&b)) // @pointsto main.b
30 |
31 | // Same again, but anon func has free vars.
32 | var c int // @line context2c
33 | id2 := func(x *int) (*int, *int) {
34 | print(x) // @pointsto main.a | main.b
35 | return x, &c
36 | }
37 | p, q := id2(&a)
38 | print(p) // @pointsto main.a
39 | print(q) // @pointsto c@context2c:6
40 | r, s := id2(&b)
41 | print(r) // @pointsto main.b
42 | print(s) // @pointsto c@context2c:6
43 | }
44 |
45 | func main() {
46 | context1()
47 | context2()
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/extended.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package main
4 |
5 | var a int
6 |
7 | type t struct {
8 | a *map[string]chan *int
9 | }
10 |
11 | func fn() []t {
12 | m := make(map[string]chan *int)
13 | m[""] = make(chan *int, 1)
14 | m[""] <- &a
15 | return []t{t{a: &m}}
16 | }
17 |
18 | func main() {
19 | x := fn()
20 | print(x) // @pointstoquery <-(*x[i].a)[key] main.a
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/flow.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package main
4 |
5 | // Demonstration of directionality of flow edges.
6 |
7 | func f1() {}
8 | func f2() {}
9 |
10 | var somepred bool
11 |
12 | // Tracking functions.
13 | func flow1() {
14 | s := f1
15 | p := f2
16 | q := p
17 | r := q
18 | if somepred {
19 | r = s
20 | }
21 | print(s) // @pointsto main.f1
22 | print(p) // @pointsto main.f2
23 | print(q) // @pointsto main.f2
24 | print(r) // @pointsto main.f1 | main.f2
25 | }
26 |
27 | // Tracking concrete types in interfaces.
28 | func flow2() {
29 | var s interface{} = 1
30 | var p interface{} = "foo"
31 | q := p
32 | r := q
33 | if somepred {
34 | r = s
35 | }
36 | print(s) // @types int
37 | print(p) // @types string
38 | print(q) // @types string
39 | print(r) // @types int | string
40 | }
41 |
42 | var g1, g2 int
43 |
44 | // Tracking addresses of globals.
45 | func flow3() {
46 | s := &g1
47 | p := &g2
48 | q := p
49 | r := q
50 | if somepred {
51 | r = s
52 | }
53 | print(s) // @pointsto main.g1
54 | print(p) // @pointsto main.g2
55 | print(q) // @pointsto main.g2
56 | print(r) // @pointsto main.g2 | main.g1
57 | }
58 |
59 | func main() {
60 | flow1()
61 | flow2()
62 | flow3()
63 | }
64 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/fmtexcerpt.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | // This is a slice of the fmt package.
4 |
5 | package main
6 |
7 | type pp struct {
8 | field interface{}
9 | }
10 |
11 | func newPrinter() *pp {
12 | return new(pp)
13 | }
14 |
15 | func Fprintln(a ...interface{}) {
16 | p := newPrinter()
17 | p.doPrint(a, true, true)
18 | }
19 |
20 | func Println(a ...interface{}) {
21 | Fprintln(a...)
22 | }
23 |
24 | func (p *pp) doPrint(a []interface{}, addspace, addnewline bool) {
25 | print(a[0]) // @types S | string
26 | stringer := a[0].(interface {
27 | String() string
28 | })
29 |
30 | stringer.String()
31 | print(stringer) // @types S
32 | }
33 |
34 | type S int
35 |
36 | func (S) String() string { return "" }
37 |
38 | func main() {
39 | Println("Hello, World!", S(0))
40 | }
41 |
42 | // @calls (*main.pp).doPrint -> (main.S).String
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/hello.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package main
4 |
5 | import (
6 | "fmt"
7 | "os"
8 | )
9 |
10 | type S int
11 |
12 | var theS S
13 |
14 | func (s *S) String() string {
15 | print(s) // @pointsto main.theS
16 | return ""
17 | }
18 |
19 | func main() {
20 | // os.Args is considered intrinsically allocated,
21 | // but may also be set explicitly (e.g. on Windows), hence '...'.
22 | print(os.Args) // @pointsto | ...
23 | fmt.Println("Hello, World!", &theS)
24 | }
25 |
26 | // @calls main.main -> fmt.Println
27 | // @calls (*fmt.pp).handleMethods -> (*main.S).String
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/issue9002.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | func main() {
4 | // Regression test for golang issue 9002.
5 | //
6 | // The two-result "value,ok" receive operation generated a
7 | // too-wide constraint loading (value int, ok bool), not bool,
8 | // from the channel.
9 | //
10 | // This bug manifested itself in an out-of-bounds array access
11 | // when the makechan object was the highest-numbered node, as in
12 | // this program.
13 | //
14 | // In more realistic programs it silently resulted in bogus
15 | // constraints.
16 | _, _ = <-make(chan int)
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/panic.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package main
4 |
5 | // Test of value flow from panic() to recover().
6 | // We model them as stores/loads of a global location.
7 | // We ignore concrete panic types originating from the runtime.
8 |
9 | var someval int
10 |
11 | type myPanic struct{}
12 |
13 | func f(int) {}
14 |
15 | func g() string { return "" }
16 |
17 | func deadcode() {
18 | panic(123) // not reached
19 | }
20 |
21 | func main() {
22 | switch someval {
23 | case 0:
24 | panic("oops")
25 | case 1:
26 | panic(myPanic{})
27 | case 2:
28 | panic(f)
29 | case 3:
30 | panic(g)
31 | }
32 | ex := recover()
33 | print(ex) // @types myPanic | string | func(int) | func() string
34 | print(ex.(func(int))) // @pointsto main.f
35 | print(ex.(func() string)) // @pointsto main.g
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/recur.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package main
4 |
5 | // Analysis abstraction of recursive calls is finite.
6 |
7 | func main() {
8 | main()
9 | }
10 |
11 | // @calls main.main -> main.main
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/rtti.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Regression test for guru crash
4 | // https://code.google.com/p/go/issues/detail?id=6605
5 | //
6 | // Using reflection, methods may be called on types that are not the
7 | // operand of any ssa.MakeInterface instruction. In this example,
8 | // (Y).F is called by deriving the type Y from *Y. Prior to the fix,
9 | // no RTTI (or method set) for type Y was included in the program, so
10 | // the F() call would crash.
11 |
12 | import "reflect"
13 |
14 | var a int
15 |
16 | type X struct{}
17 |
18 | func (X) F() *int {
19 | return &a
20 | }
21 |
22 | type I interface {
23 | F() *int
24 | }
25 |
26 | func main() {
27 | type Y struct{ X }
28 | print(reflect.Indirect(reflect.ValueOf(new(Y))).Interface().(I).F()) // @pointsto main.a
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/structreflect.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package main
4 |
5 | import "reflect"
6 |
7 | type A struct {
8 | f *int
9 | g interface{}
10 | h bool
11 | }
12 |
13 | var dyn string
14 |
15 | func reflectTypeFieldByName() {
16 | f, _ := reflect.TypeOf(A{}).FieldByName("f")
17 | print(f.Type) // @pointsto *int
18 |
19 | g, _ := reflect.TypeOf(A{}).FieldByName("g")
20 | print(g.Type) // @pointsto interface{}
21 | print(reflect.Zero(g.Type)) // @pointsto
22 | print(reflect.Zero(g.Type)) // @types interface{}
23 |
24 | print(reflect.Zero(g.Type).Interface()) // @pointsto
25 | print(reflect.Zero(g.Type).Interface()) // @types
26 |
27 | h, _ := reflect.TypeOf(A{}).FieldByName("h")
28 | print(h.Type) // @pointsto bool
29 |
30 | missing, _ := reflect.TypeOf(A{}).FieldByName("missing")
31 | print(missing.Type) // @pointsto
32 |
33 | dyn, _ := reflect.TypeOf(A{}).FieldByName(dyn)
34 | print(dyn.Type) // @pointsto *int | bool | interface{}
35 | }
36 |
37 | func reflectTypeField() {
38 | fld := reflect.TypeOf(A{}).Field(0)
39 | print(fld.Type) // @pointsto *int | bool | interface{}
40 | }
41 |
42 | func main() {
43 | reflectTypeFieldByName()
44 | reflectTypeField()
45 | }
46 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/pointer/testdata/timer.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package main
4 |
5 | import "time"
6 |
7 | func after() {}
8 |
9 | func main() {
10 | // @calls time.startTimer -> time.sendTime
11 | ticker := time.NewTicker(1)
12 | <-ticker.C
13 |
14 | // @calls time.startTimer -> time.sendTime
15 | timer := time.NewTimer(time.Second)
16 | <-timer.C
17 |
18 | // @calls time.startTimer -> time.goFunc
19 | // @calls time.goFunc -> main.after
20 | timer = time.AfterFunc(time.Second, after)
21 | <-timer.C
22 | }
23 |
24 | // @calls time.sendTime -> time.Now
25 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ssa/identical.go:
--------------------------------------------------------------------------------
1 | // +build go1.8
2 |
3 | package ssa
4 |
5 | import "go/types"
6 |
7 | var structTypesIdentical = types.IdenticalIgnoreTags
8 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ssa/identical_17.go:
--------------------------------------------------------------------------------
1 | // +build !go1.8
2 |
3 | package ssa
4 |
5 | import "go/types"
6 |
7 | var structTypesIdentical = types.Identical
8 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ssa/identical_test.go:
--------------------------------------------------------------------------------
1 | //+build go1.8
2 |
3 | package ssa_test
4 |
5 | import "testing"
6 |
7 | func TestValueForExprStructConv(t *testing.T) {
8 | testValueForExpr(t, "testdata/structconv.go")
9 | }
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ssa/interp/external_darwin.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build darwin
6 |
7 | package interp
8 |
9 | import "syscall"
10 |
11 | func init() {
12 | externals["syscall.Sysctl"] = ext۰syscall۰Sysctl
13 |
14 | fillStat = func(st *syscall.Stat_t, stat structure) {
15 | stat[0] = st.Dev
16 | stat[1] = st.Mode
17 | stat[2] = st.Nlink
18 | stat[3] = st.Ino
19 | stat[4] = st.Uid
20 | stat[5] = st.Gid
21 | stat[6] = st.Rdev
22 | // TODO(adonovan): fix: copy Timespecs.
23 | // stat[8] = st.Atim
24 | // stat[9] = st.Mtim
25 | // stat[10] = st.Ctim
26 | stat[12] = st.Size
27 | stat[13] = st.Blocks
28 | stat[14] = st.Blksize
29 | }
30 | }
31 |
32 | func ext۰syscall۰Sysctl(fr *frame, args []value) value {
33 | r, err := syscall.Sysctl(args[0].(string))
34 | return tuple{r, wrapError(err)}
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ssa/interp/testdata/a_test.go:
--------------------------------------------------------------------------------
1 | package a
2 |
3 | import "testing"
4 |
5 | func TestFoo(t *testing.T) {
6 | t.Error("foo")
7 | }
8 |
9 | func TestBar(t *testing.T) {
10 | t.Error("bar")
11 | }
12 |
13 | func BenchmarkWiz(b *testing.B) {
14 | b.Error("wiz")
15 | }
16 |
17 | // Don't test Examples since that testing package needs pipe(2) for that.
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ssa/interp/testdata/b_test.go:
--------------------------------------------------------------------------------
1 | package b
2 |
3 | import "testing"
4 |
5 | func NotATest(t *testing.T) {
6 | t.Error("foo")
7 | }
8 |
9 | func NotABenchmark(b *testing.B) {
10 | b.Error("wiz")
11 | }
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ssa/interp/testdata/c_test.go:
--------------------------------------------------------------------------------
1 | package c_test
2 |
3 | import (
4 | "os"
5 | "testing"
6 | )
7 |
8 | func TestC(t *testing.T) {
9 | println("TestC")
10 | }
11 |
12 | func TestMain(m *testing.M) {
13 | println("TestMain start")
14 | code := m.Run()
15 | println("TestMain end")
16 | os.Exit(code)
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ssa/interp/testdata/defer.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of defer. (Deferred recover() belongs is recover.go.)
4 |
5 | import "fmt"
6 |
7 | func deferMutatesResults(noArgReturn bool) (a, b int) {
8 | defer func() {
9 | if a != 1 || b != 2 {
10 | panic(fmt.Sprint(a, b))
11 | }
12 | a, b = 3, 4
13 | }()
14 | if noArgReturn {
15 | a, b = 1, 2
16 | return
17 | }
18 | return 1, 2
19 | }
20 |
21 | func init() {
22 | a, b := deferMutatesResults(true)
23 | if a != 3 || b != 4 {
24 | panic(fmt.Sprint(a, b))
25 | }
26 | a, b = deferMutatesResults(false)
27 | if a != 3 || b != 4 {
28 | panic(fmt.Sprint(a, b))
29 | }
30 | }
31 |
32 | // We concatenate init blocks to make a single function, but we must
33 | // run defers at the end of each block, not the combined function.
34 | var deferCount = 0
35 |
36 | func init() {
37 | deferCount = 1
38 | defer func() {
39 | deferCount++
40 | }()
41 | // defer runs HERE
42 | }
43 |
44 | func init() {
45 | // Strictly speaking the spec says deferCount may be 0 or 2
46 | // since the relative order of init blocks is unspecified.
47 | if deferCount != 2 {
48 | panic(deferCount) // defer call has not run!
49 | }
50 | }
51 |
52 | func main() {
53 | }
54 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ssa/interp/testdata/ifaceprom.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Test of promotion of methods of an interface embedded within a
4 | // struct. In particular, this test exercises that the correct
5 | // method is called.
6 |
7 | type I interface {
8 | one() int
9 | two() string
10 | }
11 |
12 | type S struct {
13 | I
14 | }
15 |
16 | type impl struct{}
17 |
18 | func (impl) one() int {
19 | return 1
20 | }
21 |
22 | func (impl) two() string {
23 | return "two"
24 | }
25 |
26 | func main() {
27 | var s S
28 | s.I = impl{}
29 | if one := s.I.one(); one != 1 {
30 | panic(one)
31 | }
32 | if one := s.one(); one != 1 {
33 | panic(one)
34 | }
35 | closOne := s.I.one
36 | if one := closOne(); one != 1 {
37 | panic(one)
38 | }
39 | closOne = s.one
40 | if one := closOne(); one != 1 {
41 | panic(one)
42 | }
43 |
44 | if two := s.I.two(); two != "two" {
45 | panic(two)
46 | }
47 | if two := s.two(); two != "two" {
48 | panic(two)
49 | }
50 | closTwo := s.I.two
51 | if two := closTwo(); two != "two" {
52 | panic(two)
53 | }
54 | closTwo = s.two
55 | if two := closTwo(); two != "two" {
56 | panic(two)
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ssa/interp/testdata/range.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of range loops.
4 |
5 | import "fmt"
6 |
7 | // Range over string.
8 | func init() {
9 | if x := len("Hello, 世界"); x != 13 { // bytes
10 | panic(x)
11 | }
12 | var indices []int
13 | var runes []rune
14 | for i, r := range "Hello, 世界" {
15 | runes = append(runes, r)
16 | indices = append(indices, i)
17 | }
18 | if x := fmt.Sprint(runes); x != "[72 101 108 108 111 44 32 19990 30028]" {
19 | panic(x)
20 | }
21 | if x := fmt.Sprint(indices); x != "[0 1 2 3 4 5 6 7 10]" {
22 | panic(x)
23 | }
24 | s := ""
25 | for _, r := range runes {
26 | s = fmt.Sprintf("%s%c", s, r)
27 | }
28 | if s != "Hello, 世界" {
29 | panic(s)
30 | }
31 |
32 | var x int
33 | for range "Hello, 世界" {
34 | x++
35 | }
36 | if x != len(indices) {
37 | panic(x)
38 | }
39 | }
40 |
41 | // Regression test for range of pointer to named array type.
42 | func init() {
43 | type intarr [3]int
44 | ia := intarr{1, 2, 3}
45 | var count int
46 | for _, x := range &ia {
47 | count += x
48 | }
49 | if count != 6 {
50 | panic(count)
51 | }
52 | }
53 |
54 | func main() {
55 | }
56 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ssa/interp/testdata/recover.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | // Tests of panic/recover.
4 |
5 | import "fmt"
6 |
7 | func fortyTwo() (r int) {
8 | r = 42
9 | // The next two statements simulate a 'return' statement.
10 | defer func() { recover() }()
11 | panic(nil)
12 | }
13 |
14 | func zero() int {
15 | defer func() { recover() }()
16 | panic(1)
17 | }
18 |
19 | func zeroEmpty() (int, string) {
20 | defer func() { recover() }()
21 | panic(1)
22 | }
23 |
24 | func main() {
25 | if r := fortyTwo(); r != 42 {
26 | panic(r)
27 | }
28 | if r := zero(); r != 0 {
29 | panic(r)
30 | }
31 | if r, s := zeroEmpty(); r != 0 || s != "" {
32 | panic(fmt.Sprint(r, s))
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ssa/interp/testdata/reflect.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "reflect"
4 |
5 | func main() {
6 | // Regression test for issue 9462.
7 | got := reflect.SliceOf(reflect.TypeOf(byte(0))).String()
8 | if got != "[]uint8" && got != "[]byte" { // result varies by toolchain
9 | println("BUG: " + got)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/ssa/testdata/structconv.go:
--------------------------------------------------------------------------------
1 | //+build ignore
2 |
3 | // This file is the input to TestValueForExprStructConv in identical_test.go,
4 | // which uses the same framework as TestValueForExpr does in source_test.go.
5 | //
6 | // In Go 1.8, struct conversions are permitted even when the struct types have
7 | // different tags. This wasn't permitted in earlier versions of Go, so this file
8 | // exists separately from valueforexpr.go to just test this behavior in Go 1.8
9 | // and later.
10 |
11 | package main
12 |
13 | type t1 struct {
14 | x int
15 | }
16 | type t2 struct {
17 | x int `tag`
18 | }
19 |
20 | func main() {
21 | var tv1 t1
22 | var tv2 t2 = /*@ChangeType*/ (t2(tv1))
23 | _ = tv2
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/types/typeutil/imports.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package typeutil
6 |
7 | import "go/types"
8 |
9 | // Dependencies returns all dependencies of the specified packages.
10 | //
11 | // Dependent packages appear in topological order: if package P imports
12 | // package Q, Q appears earlier than P in the result.
13 | // The algorithm follows import statements in the order they
14 | // appear in the source code, so the result is a total order.
15 | //
16 | func Dependencies(pkgs ...*types.Package) []*types.Package {
17 | var result []*types.Package
18 | seen := make(map[*types.Package]bool)
19 | var visit func(pkgs []*types.Package)
20 | visit = func(pkgs []*types.Package) {
21 | for _, p := range pkgs {
22 | if !seen[p] {
23 | seen[p] = true
24 | visit(p.Imports())
25 | result = append(result, p)
26 | }
27 | }
28 | }
29 | visit(pkgs)
30 | return result
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/go/vcs/env.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package vcs
6 |
7 | import (
8 | "os"
9 | "strings"
10 | )
11 |
12 | // envForDir returns a copy of the environment
13 | // suitable for running in the given directory.
14 | // The environment is the current process's environment
15 | // but with an updated $PWD, so that an os.Getwd in the
16 | // child will be faster.
17 | func envForDir(dir string) []string {
18 | env := os.Environ()
19 | // Internally we only use rooted paths, so dir is rooted.
20 | // Even if dir is not rooted, no harm done.
21 | return mergeEnvLists([]string{"PWD=" + dir}, env)
22 | }
23 |
24 | // mergeEnvLists merges the two environment lists such that
25 | // variables with the same name in "in" replace those in "out".
26 | func mergeEnvLists(in, out []string) []string {
27 | NextVar:
28 | for _, inkv := range in {
29 | k := strings.SplitAfterN(inkv, "=", 2)[0]
30 | for i, outkv := range out {
31 | if strings.HasPrefix(outkv, k) {
32 | out[i] = inkv
33 | continue NextVar
34 | }
35 | }
36 | out = append(out, inkv)
37 | }
38 | return out
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/README.md:
--------------------------------------------------------------------------------
1 | # godoc
2 |
3 | This directory contains most of the code for running a godoc server. The
4 | executable lives at golang.org/x/tools/cmd/godoc.
5 |
6 | ## Development mode
7 |
8 | In production, CSS/JS/template assets need to be compiled into the godoc
9 | binary. It can be tedious to recompile assets every time, but you can pass a
10 | flag to load CSS/JS/templates from disk every time a page loads:
11 |
12 | ```
13 | godoc -templates=$GOPATH/src/golang.org/x/tools/godoc/static -http=:6060
14 | ```
15 |
16 | ## Recompiling static assets
17 |
18 | The files that live at `static/style.css`, `static/jquery.js` and so on are not
19 | present in the final binary. They are placed into `static/static.go` by running
20 | `go generate`. So to compile a change and test it in your browser:
21 |
22 | 1) Make changes to e.g. `static/style.css`.
23 |
24 | 2) Run `go generate golang.org/x/tools/godoc/static` so `static/static.go` picks
25 | up the change.
26 |
27 | 3) Run `go install golang.org/x/tools/cmd/godoc` so the compiled `godoc` binary
28 | picks up the change.
29 |
30 | 4) Run `godoc -http=:6060` and view your changes in the browser. You may need
31 | to disable your browser's cache to avoid reloading a stale file.
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/appengine.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build appengine
6 |
7 | package godoc
8 |
9 | import "google.golang.org/appengine"
10 |
11 | func init() {
12 | onAppengine = !appengine.IsDevAppServer()
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/godoc17_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build go1.7
6 |
7 | package godoc
8 |
9 | import (
10 | "bytes"
11 | "fmt"
12 | "testing"
13 | )
14 |
15 | // Verify that scanIdentifier isn't quadratic.
16 | // This doesn't actually measure and fail on its own, but it was previously
17 | // very obvious when running by hand.
18 | //
19 | // TODO: if there's a reliable and non-flaky way to test this, do so.
20 | // Maybe count user CPU time instead of wall time? But that's not easy
21 | // to do portably in Go.
22 | func TestStructField(t *testing.T) {
23 | for _, n := range []int{10, 100, 1000, 10000} {
24 | n := n
25 | t.Run(fmt.Sprint(n), func(t *testing.T) {
26 | var buf bytes.Buffer
27 | fmt.Fprintf(&buf, "package foo\n\ntype T struct {\n")
28 | for i := 0; i < n; i++ {
29 | fmt.Fprintf(&buf, "\t// Field%d is foo.\n\tField%d int\n\n", i, i)
30 | }
31 | fmt.Fprintf(&buf, "}\n")
32 | linkifySource(t, buf.Bytes())
33 | })
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/call-eg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/call-eg.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/call3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/call3.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/callers1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/callers1.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/callers2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/callers2.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/chan1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/chan1.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/chan2a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/chan2a.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/chan2b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/chan2b.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/error1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/error1.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/ident-def.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/ident-def.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/ident-field.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/ident-field.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/ident-func.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/ident-func.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/ipcg-func.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/ipcg-func.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/ipcg-pkg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/ipcg-pkg.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/typeinfo-pkg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/typeinfo-pkg.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/analysis/typeinfo-src.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/analysis/typeinfo-src.png
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/callgraph.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
▹ Internal call graph
4 |
5 |
6 |
▾ Internal call graph
7 |
8 | This viewer shows the portion of the internal call
9 | graph of this package that is reachable from this function.
10 | See the package's call
11 | graph for more information.
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/codewalkdir.html:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 | {{range .}}
9 |
10 | {{$name_html := html .Name}}
11 | {{$name_html}} |
12 | |
13 | {{html .Title}} |
14 |
15 | {{end}}
16 |
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/dirlist.html:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 | File |
11 | |
12 | Bytes |
13 | |
14 | Modified |
15 |
16 |
17 | .. |
18 |
19 | {{range .}}
20 |
21 | {{$name_html := fileInfoName . | html}}
22 | {{$name_html}} |
23 | |
24 | {{html .Size}} |
25 | |
26 | {{fileInfoTime . | html}} |
27 |
28 | {{end}}
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Package static exports a map of static file content that supports the godoc
6 | // user interface. The map should be used with the mapfs package, see
7 | // golang.org/x/tools/godoc/vfs/mapfs.
8 | package static // import "golang.org/x/tools/godoc/static"
9 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/error.html:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 | {{html .}}
9 |
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
▹ Example{{example_suffix .Name}}
4 |
5 |
6 |
▾ Example{{example_suffix .Name}}
7 | {{with .Doc}}
{{html .}}
{{end}}
8 | {{$output := .Output}}
9 | {{with .Play}}
10 |
21 | {{else}}
22 |
Code:
23 |
{{.Code}}
24 | {{with .Output}}
25 |
Output:
26 |
{{html .}}
27 | {{end}}
28 | {{end}}
29 |
30 |
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/gen.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package static
6 |
7 | //go:generate go run makestatic.go
8 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/images/minus.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/images/minus.gif
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/images/plus.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/images/plus.gif
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/images/treeview-black-line.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/images/treeview-black-line.gif
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/images/treeview-black.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/images/treeview-black.gif
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/images/treeview-default-line.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/images/treeview-default-line.gif
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/images/treeview-default.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/images/treeview-default.gif
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/images/treeview-gray-line.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/images/treeview-gray-line.gif
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/images/treeview-gray.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scele/rules_go_dep/204ed9afe68682cfe8fbdd1401158fbaa5a14397/vendor/golang.org/x/tools/godoc/static/images/treeview-gray.gif
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/implements.html:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
▾ Implements
7 |
...
8 |
9 |
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/methodset.html:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
▾ Method set
7 |
...
8 |
9 |
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/opensearch.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | godoc
4 | The Go Programming Language
5 | go golang
6 |
7 |
8 | /favicon.ico
9 | UTF-8
10 | UTF-8
11 |
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/search.html:
--------------------------------------------------------------------------------
1 |
6 | {{with .Alert}}
7 |
8 | {{html .}}
9 |
10 | {{end}}
11 | {{with .Alt}}
12 |
13 | Did you mean:
14 | {{range .Alts}}
15 | {{html .}}
16 | {{end}}
17 |
18 | {{end}}
19 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/searchdoc.html:
--------------------------------------------------------------------------------
1 |
6 | {{range $key, $val := .Idents}}
7 | {{if $val}}
8 | {{$key.Name}}
9 | {{range $val}}
10 | {{$pkg_html := pkgLink .Path | html}}
11 | {{if eq "Packages" $key.Name}}
12 | {{html .Path}}
13 | {{else}}
14 | {{$doc_html := docLink .Path .Name| html}}
15 | {{html .Package}}.{{.Name}}
16 | {{end}}
17 | {{if .Doc}}
18 | {{comment_html .Doc}}
19 | {{else}}
20 | No documentation available
21 | {{end}}
22 | {{end}}
23 | {{end}}
24 | {{end}}
25 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/static/searchtxt.html:
--------------------------------------------------------------------------------
1 |
6 | {{$query_url := urlquery .Query}}
7 | {{with .Textual}}
8 | {{if $.Complete}}
9 | {{html $.Found}} textual occurrences
10 | {{else}}
11 | More than {{html $.Found}} textual occurrences
12 |
13 | Not all files or lines containing "{{html $.Query}}" are shown.
14 |
15 | {{end}}
16 |
17 |
18 | {{range .}}
19 | {{$file := .Filename}}
20 |
21 |
22 | {{$file}}:
23 | |
24 | |
25 | {{len .Lines}} |
26 | |
27 |
28 | {{range .Lines}}
29 | {{html .}}
30 | {{end}}
31 | {{if not $.Complete}}
32 | ...
33 | {{end}}
34 | |
35 |
36 | {{end}}
37 | {{if not $.Complete}}
38 | ... |
39 | {{end}}
40 |
41 |
42 | {{end}}
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/godoc/vfs/vfs.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Package vfs defines types for abstract file system access and provides an
6 | // implementation accessing the file system of the underlying OS.
7 | package vfs // import "golang.org/x/tools/godoc/vfs"
8 |
9 | import (
10 | "io"
11 | "io/ioutil"
12 | "os"
13 | )
14 |
15 | // The FileSystem interface specifies the methods godoc is using
16 | // to access the file system for which it serves documentation.
17 | type FileSystem interface {
18 | Opener
19 | Lstat(path string) (os.FileInfo, error)
20 | Stat(path string) (os.FileInfo, error)
21 | ReadDir(path string) ([]os.FileInfo, error)
22 | String() string
23 | }
24 |
25 | // Opener is a minimal virtual filesystem that can only open regular files.
26 | type Opener interface {
27 | Open(name string) (ReadSeekCloser, error)
28 | }
29 |
30 | // A ReadSeekCloser can Read, Seek, and Close.
31 | type ReadSeekCloser interface {
32 | io.Reader
33 | io.Seeker
34 | io.Closer
35 | }
36 |
37 | // ReadFile reads the file named by path from fs and returns the contents.
38 | func ReadFile(fs Opener, path string) ([]byte, error) {
39 | rc, err := fs.Open(path)
40 | if err != nil {
41 | return nil, err
42 | }
43 | defer rc.Close()
44 | return ioutil.ReadAll(rc)
45 | }
46 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/imports/fastwalk_dirent_fileno.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build freebsd openbsd netbsd
6 |
7 | package imports
8 |
9 | import "syscall"
10 |
11 | func direntInode(dirent *syscall.Dirent) uint64 {
12 | return uint64(dirent.Fileno)
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/imports/fastwalk_dirent_ino.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build linux darwin
6 | // +build !appengine
7 |
8 | package imports
9 |
10 | import "syscall"
11 |
12 | func direntInode(dirent *syscall.Dirent) uint64 {
13 | return uint64(dirent.Ino)
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/imports/fastwalk_portable.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build appengine !linux,!darwin,!freebsd,!openbsd,!netbsd
6 |
7 | package imports
8 |
9 | import (
10 | "io/ioutil"
11 | "os"
12 | )
13 |
14 | // readDir calls fn for each directory entry in dirName.
15 | // It does not descend into directories or follow symlinks.
16 | // If fn returns a non-nil error, readDir returns with that error
17 | // immediately.
18 | func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error {
19 | fis, err := ioutil.ReadDir(dirName)
20 | if err != nil {
21 | return err
22 | }
23 | for _, fi := range fis {
24 | if err := fn(dirName, fi.Name(), fi.Mode()&os.ModeType); err != nil {
25 | return err
26 | }
27 | }
28 | return nil
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/playground/appengine.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build appengine
6 |
7 | package playground
8 |
9 | import (
10 | "net/http"
11 |
12 | "appengine"
13 | "appengine/urlfetch"
14 | )
15 |
16 | func init() {
17 | onAppengine = !appengine.IsDevAppServer()
18 | }
19 |
20 | func client(r *http.Request) *http.Client {
21 | return urlfetch.Client(appengine.NewContext(r))
22 | }
23 |
24 | func report(r *http.Request, err error) {
25 | appengine.NewContext(r).Errorf("%v", err)
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/playground/appenginevm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build appenginevm
6 |
7 | package playground
8 |
9 | func init() {
10 | onAppengine = true
11 | }
12 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/playground/local.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !appengine
6 |
7 | package playground
8 |
9 | import (
10 | "log"
11 | "net/http"
12 | )
13 |
14 | func client(r *http.Request) *http.Client {
15 | return http.DefaultClient
16 | }
17 |
18 | func report(r *http.Request, err error) {
19 | log.Println(err)
20 | }
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/present/caption.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package present
6 |
7 | import "strings"
8 |
9 | func init() {
10 | Register("caption", parseCaption)
11 | }
12 |
13 | type Caption struct {
14 | Text string
15 | }
16 |
17 | func (c Caption) TemplateName() string { return "caption" }
18 |
19 | func parseCaption(_ *Context, _ string, _ int, text string) (Elem, error) {
20 | text = strings.TrimSpace(strings.TrimPrefix(text, ".caption"))
21 | return Caption{text}, nil
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/present/html.go:
--------------------------------------------------------------------------------
1 | package present
2 |
3 | import (
4 | "errors"
5 | "html/template"
6 | "path/filepath"
7 | "strings"
8 | )
9 |
10 | func init() {
11 | Register("html", parseHTML)
12 | }
13 |
14 | func parseHTML(ctx *Context, fileName string, lineno int, text string) (Elem, error) {
15 | p := strings.Fields(text)
16 | if len(p) != 2 {
17 | return nil, errors.New("invalid .html args")
18 | }
19 | name := filepath.Join(filepath.Dir(fileName), p[1])
20 | b, err := ctx.ReadFile(name)
21 | if err != nil {
22 | return nil, err
23 | }
24 | return HTML{template.HTML(b)}, nil
25 | }
26 |
27 | type HTML struct {
28 | template.HTML
29 | }
30 |
31 | func (s HTML) TemplateName() string { return "html" }
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/present/iframe.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package present
6 |
7 | import (
8 | "fmt"
9 | "strings"
10 | )
11 |
12 | func init() {
13 | Register("iframe", parseIframe)
14 | }
15 |
16 | type Iframe struct {
17 | URL string
18 | Width int
19 | Height int
20 | }
21 |
22 | func (i Iframe) TemplateName() string { return "iframe" }
23 |
24 | func parseIframe(ctx *Context, fileName string, lineno int, text string) (Elem, error) {
25 | args := strings.Fields(text)
26 | i := Iframe{URL: args[1]}
27 | a, err := parseArgs(fileName, lineno, args[2:])
28 | if err != nil {
29 | return nil, err
30 | }
31 | switch len(a) {
32 | case 0:
33 | // no size parameters
34 | case 2:
35 | if v, ok := a[0].(int); ok {
36 | i.Height = v
37 | }
38 | if v, ok := a[1].(int); ok {
39 | i.Width = v
40 | }
41 | default:
42 | return nil, fmt.Errorf("incorrect iframe invocation: %q", text)
43 | }
44 | return i, nil
45 | }
46 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/present/image.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package present
6 |
7 | import (
8 | "fmt"
9 | "strings"
10 | )
11 |
12 | func init() {
13 | Register("image", parseImage)
14 | }
15 |
16 | type Image struct {
17 | URL string
18 | Width int
19 | Height int
20 | }
21 |
22 | func (i Image) TemplateName() string { return "image" }
23 |
24 | func parseImage(ctx *Context, fileName string, lineno int, text string) (Elem, error) {
25 | args := strings.Fields(text)
26 | img := Image{URL: args[1]}
27 | a, err := parseArgs(fileName, lineno, args[2:])
28 | if err != nil {
29 | return nil, err
30 | }
31 | switch len(a) {
32 | case 0:
33 | // no size parameters
34 | case 2:
35 | // If a parameter is empty (underscore) or invalid
36 | // leave the field set to zero. The "image" action
37 | // template will then omit that img tag attribute and
38 | // the browser will calculate the value to preserve
39 | // the aspect ratio.
40 | if v, ok := a[0].(int); ok {
41 | img.Height = v
42 | }
43 | if v, ok := a[1].(int); ok {
44 | img.Width = v
45 | }
46 | default:
47 | return nil, fmt.Errorf("incorrect image invocation: %q", text)
48 | }
49 | return img, nil
50 | }
51 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/present/video.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package present
6 |
7 | import (
8 | "fmt"
9 | "strings"
10 | )
11 |
12 | func init() {
13 | Register("video", parseVideo)
14 | }
15 |
16 | type Video struct {
17 | URL string
18 | SourceType string
19 | Width int
20 | Height int
21 | }
22 |
23 | func (v Video) TemplateName() string { return "video" }
24 |
25 | func parseVideo(ctx *Context, fileName string, lineno int, text string) (Elem, error) {
26 | args := strings.Fields(text)
27 | vid := Video{URL: args[1], SourceType: args[2]}
28 | a, err := parseArgs(fileName, lineno, args[3:])
29 | if err != nil {
30 | return nil, err
31 | }
32 | switch len(a) {
33 | case 0:
34 | // no size parameters
35 | case 2:
36 | // If a parameter is empty (underscore) or invalid
37 | // leave the field set to zero. The "video" action
38 | // template will then omit that vid tag attribute and
39 | // the browser will calculate the value to preserve
40 | // the aspect ratio.
41 | if v, ok := a[0].(int); ok {
42 | vid.Height = v
43 | }
44 | if v, ok := a[1].(int); ok {
45 | vid.Width = v
46 | }
47 | default:
48 | return nil, fmt.Errorf("incorrect video invocation: %q", text)
49 | }
50 | return vid, nil
51 | }
52 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/README:
--------------------------------------------------------------------------------
1 | golang.org/x/tools/refactor: libraries for refactoring tools.
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/A.template:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package template
4 |
5 | // Basic test of type-aware expression refactoring.
6 |
7 | import (
8 | "errors"
9 | "fmt"
10 | )
11 |
12 | func before(s string) error { return fmt.Errorf("%s", s) }
13 | func after(s string) error { return errors.New(s) }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/A1.golden:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package A1
4 |
5 | import (
6 | "errors"
7 | . "fmt"
8 | myfmt "fmt"
9 | "os"
10 | "strings"
11 | )
12 |
13 | func example(n int) {
14 | x := "foo" + strings.Repeat("\t", n)
15 | // Match, despite named import.
16 | errors.New(x)
17 |
18 | // Match, despite dot import.
19 | errors.New(x)
20 |
21 | // Match: multiple matches in same function are possible.
22 | errors.New(x)
23 |
24 | // No match: wildcarded operand has the wrong type.
25 | myfmt.Errorf("%s", 3)
26 |
27 | // No match: function operand doesn't match.
28 | myfmt.Printf("%s", x)
29 |
30 | // No match again, dot import.
31 | Printf("%s", x)
32 |
33 | // Match.
34 | myfmt.Fprint(os.Stderr, errors.New(x+"foo"))
35 |
36 | // No match: though this literally matches the template,
37 | // fmt doesn't resolve to a package here.
38 | var fmt struct{ Errorf func(string, string) }
39 | fmt.Errorf("%s", x)
40 |
41 | // Recursive matching:
42 |
43 | // Match: both matches are well-typed, so both succeed.
44 | errors.New(errors.New(x + "foo").Error())
45 |
46 | // Outer match succeeds, inner doesn't: 3 has wrong type.
47 | errors.New(myfmt.Errorf("%s", 3).Error())
48 |
49 | // Inner match succeeds, outer doesn't: the inner replacement
50 | // has the wrong type (error not string).
51 | myfmt.Errorf("%s", errors.New(x+"foo"))
52 | }
53 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/A2.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package A2
4 |
5 | // This refactoring causes addition of "errors" import.
6 | // TODO(adonovan): fix: it should also remove "fmt".
7 |
8 | import myfmt "fmt"
9 |
10 | func example(n int) {
11 | myfmt.Errorf("%s", "")
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/A2.golden:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package A2
4 |
5 | // This refactoring causes addition of "errors" import.
6 | // TODO(adonovan): fix: it should also remove "fmt".
7 |
8 | import (
9 | "errors"
10 | myfmt "fmt"
11 | )
12 |
13 | func example(n int) {
14 | errors.New("")
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/B.template:
--------------------------------------------------------------------------------
1 | package template
2 |
3 | // Basic test of expression refactoring.
4 | // (Types are not important in this case; it could be done with gofmt -r.)
5 |
6 | import "time"
7 |
8 | func before(t time.Time) time.Duration { return time.Now().Sub(t) }
9 | func after(t time.Time) time.Duration { return time.Since(t) }
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/B1.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package B1
4 |
5 | import "time"
6 |
7 | var startup = time.Now()
8 |
9 | func example() time.Duration {
10 | before := time.Now()
11 | time.Sleep(1)
12 | return time.Now().Sub(before)
13 | }
14 |
15 | func msSinceStartup() int64 {
16 | return int64(time.Now().Sub(startup) / time.Millisecond)
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/B1.golden:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package B1
4 |
5 | import "time"
6 |
7 | var startup = time.Now()
8 |
9 | func example() time.Duration {
10 | before := time.Now()
11 | time.Sleep(1)
12 | return time.Since(before)
13 | }
14 |
15 | func msSinceStartup() int64 {
16 | return int64(time.Since(startup) / time.Millisecond)
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/C.template:
--------------------------------------------------------------------------------
1 | package template
2 |
3 | // Test of repeated use of wildcard in pattern.
4 |
5 | // NB: multiple patterns would be required to handle variants such as
6 | // s[:len(s)], s[x:len(s)], etc, since a wildcard can't match nothing at all.
7 | // TODO(adonovan): support multiple templates in a single pass.
8 |
9 | func before(s string) string { return s[:len(s)] }
10 | func after(s string) string { return s }
11 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/C1.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package C1
4 |
5 | import "strings"
6 |
7 | func example() {
8 | x := "foo"
9 | println(x[:len(x)])
10 |
11 | // Match, but the transformation is not sound w.r.t. possible side effects.
12 | println(strings.Repeat("*", 3)[:len(strings.Repeat("*", 3))])
13 |
14 | // No match, since second use of wildcard doesn't match first.
15 | println(strings.Repeat("*", 3)[:len(strings.Repeat("*", 2))])
16 |
17 | // Recursive match demonstrating bottom-up rewrite:
18 | // only after the inner replacement occurs does the outer syntax match.
19 | println((x[:len(x)])[:len(x[:len(x)])])
20 | // -> (x[:len(x)])
21 | // -> x
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/C1.golden:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package C1
4 |
5 | import "strings"
6 |
7 | func example() {
8 | x := "foo"
9 | println(x)
10 |
11 | // Match, but the transformation is not sound w.r.t. possible side effects.
12 | println(strings.Repeat("*", 3))
13 |
14 | // No match, since second use of wildcard doesn't match first.
15 | println(strings.Repeat("*", 3)[:len(strings.Repeat("*", 2))])
16 |
17 | // Recursive match demonstrating bottom-up rewrite:
18 | // only after the inner replacement occurs does the outer syntax match.
19 | println(x)
20 | // -> (x[:len(x)])
21 | // -> x
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/D.template:
--------------------------------------------------------------------------------
1 | package template
2 |
3 | import "fmt"
4 |
5 | // Test of semantic (not syntactic) matching of basic literals.
6 |
7 | func before() (int, error) { return fmt.Println(123, "a") }
8 | func after() (int, error) { return fmt.Println(456, "!") }
9 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/D1.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package D1
4 |
5 | import "fmt"
6 |
7 | func example() {
8 | fmt.Println(123, "a") // match
9 | fmt.Println(0x7b, `a`) // match
10 | fmt.Println(0173, "\x61") // match
11 | fmt.Println(100+20+3, "a"+"") // no match: constant expressions, but not basic literals
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/D1.golden:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package D1
4 |
5 | import "fmt"
6 |
7 | func example() {
8 | fmt.Println(456, "!") // match
9 | fmt.Println(456, "!") // match
10 | fmt.Println(456, "!") // match
11 | fmt.Println(100+20+3, "a"+"") // no match: constant expressions, but not basic literals
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/E.template:
--------------------------------------------------------------------------------
1 | package template
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "os"
7 | )
8 |
9 | // Replace call to void function by call to non-void function.
10 |
11 | func before(x interface{}) { log.Fatal(x) }
12 | func after(x interface{}) { fmt.Fprintf(os.Stderr, "warning: %v", x) }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/E1.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package E1
4 |
5 | import "log"
6 |
7 | func example() {
8 | log.Fatal("oops") // match
9 | }
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/E1.golden:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package E1
4 |
5 | import (
6 | "fmt"
7 | "log"
8 | "os"
9 | )
10 |
11 | func example() {
12 | fmt.Fprintf(os.Stderr, "warning: %v", "oops") // match
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/F.template:
--------------------------------------------------------------------------------
1 | package templates
2 |
3 | // Test
4 |
5 | import "sync"
6 |
7 | func before(s sync.RWMutex) { s.Lock() }
8 | func after(s sync.RWMutex) { s.RLock() }
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/F1.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package F1
4 |
5 | import "sync"
6 |
7 | func example(n int) {
8 | var x struct {
9 | mutex sync.RWMutex
10 | }
11 |
12 | var y struct {
13 | sync.RWMutex
14 | }
15 |
16 | type l struct {
17 | sync.RWMutex
18 | }
19 |
20 | var z struct {
21 | l
22 | }
23 |
24 | var a struct {
25 | *l
26 | }
27 |
28 | var b struct{ Lock func() }
29 |
30 | // Match
31 | x.mutex.Lock()
32 |
33 | // Match
34 | y.Lock()
35 |
36 | // Match indirect
37 | z.Lock()
38 |
39 | // Should be no match however currently matches due to:
40 | // https://golang.org/issue/8584
41 | // Will start failing when this is fixed then just change golden to
42 | // No match pointer indirect
43 | // a.Lock()
44 | a.Lock()
45 |
46 | // No match
47 | b.Lock()
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/F1.golden:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package F1
4 |
5 | import "sync"
6 |
7 | func example(n int) {
8 | var x struct {
9 | mutex sync.RWMutex
10 | }
11 |
12 | var y struct {
13 | sync.RWMutex
14 | }
15 |
16 | type l struct {
17 | sync.RWMutex
18 | }
19 |
20 | var z struct {
21 | l
22 | }
23 |
24 | var a struct {
25 | *l
26 | }
27 |
28 | var b struct{ Lock func() }
29 |
30 | // Match
31 | x.mutex.RLock()
32 |
33 | // Match
34 | y.RLock()
35 |
36 | // Match indirect
37 | z.RLock()
38 |
39 | // Should be no match however currently matches due to:
40 | // https://golang.org/issue/8584
41 | // Will start failing when this is fixed then just change golden to
42 | // No match pointer indirect
43 | // a.Lock()
44 | a.RLock()
45 |
46 | // No match
47 | b.Lock()
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/G.template:
--------------------------------------------------------------------------------
1 | package templates
2 |
3 | import (
4 | "go/ast" // defines many unencapsulated structs
5 | "go/token"
6 | )
7 |
8 | func before(from, to token.Pos) ast.BadExpr { return ast.BadExpr{From: from, To: to} }
9 | func after(from, to token.Pos) ast.BadExpr { return ast.BadExpr{from, to} }
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/G1.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package G1
4 |
5 | import "go/ast"
6 |
7 | func example() {
8 | _ = ast.BadExpr{From: 123, To: 456} // match
9 | _ = ast.BadExpr{123, 456} // no match
10 | _ = ast.BadExpr{From: 123} // no match
11 | _ = ast.BadExpr{To: 456} // no match
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/G1.golden:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package G1
4 |
5 | import "go/ast"
6 |
7 | func example() {
8 | _ = ast.BadExpr{123, 456} // match
9 | _ = ast.BadExpr{123, 456} // no match
10 | _ = ast.BadExpr{From: 123} // no match
11 | _ = ast.BadExpr{To: 456} // no match
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/H.template:
--------------------------------------------------------------------------------
1 | package templates
2 |
3 | import (
4 | "go/ast" // defines many unencapsulated structs
5 | "go/token"
6 | )
7 |
8 | func before(from, to token.Pos) ast.BadExpr { return ast.BadExpr{from, to} }
9 | func after(from, to token.Pos) ast.BadExpr { return ast.BadExpr{From: from, To: to} }
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/H1.go:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package H1
4 |
5 | import "go/ast"
6 |
7 | func example() {
8 | _ = ast.BadExpr{From: 123, To: 456} // no match
9 | _ = ast.BadExpr{123, 456} // match
10 | _ = ast.BadExpr{From: 123} // no match
11 | _ = ast.BadExpr{To: 456} // no match
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/H1.golden:
--------------------------------------------------------------------------------
1 | // +build ignore
2 |
3 | package H1
4 |
5 | import "go/ast"
6 |
7 | func example() {
8 | _ = ast.BadExpr{From: 123, To: 456} // no match
9 | _ = ast.BadExpr{From: 123, To: 456} // match
10 | _ = ast.BadExpr{From: 123} // no match
11 | _ = ast.BadExpr{To: 456} // no match
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/bad_type.template:
--------------------------------------------------------------------------------
1 | package template
2 |
3 | // Test in which replacement has a different type.
4 |
5 | const shouldFail = "int is not a safe replacement for string"
6 |
7 | func before() interface{} { return "three" }
8 | func after() interface{} { return 3 }
9 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/expr_type_mismatch.template:
--------------------------------------------------------------------------------
1 | package template
2 |
3 | import (
4 | "crypto/x509"
5 | "fmt"
6 | )
7 |
8 | // This test demonstrates a false negative: according to the language
9 | // rules this replacement should be ok, but types.Assignable doesn't work
10 | // in the expected way (elementwise assignability) for tuples.
11 | // Perhaps that's even a type-checker bug?
12 | const shouldFail = "(n int, err error) is not a safe replacement for (key interface{}, err error)"
13 |
14 | func before() (interface{}, error) { return x509.ParsePKCS8PrivateKey(nil) }
15 | func after() (interface{}, error) { return fmt.Print() }
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/no_after_return.template:
--------------------------------------------------------------------------------
1 | package template
2 |
3 | const shouldFail = "after: must contain a single statement"
4 |
5 | func before() int { return 0 }
6 | func after() int { println(); return 0 }
7 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/no_before.template:
--------------------------------------------------------------------------------
1 | package template
2 |
3 | const shouldFail = "no 'before' func found in template"
4 |
5 | func Before() {}
6 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/refactor/eg/testdata/type_mismatch.template:
--------------------------------------------------------------------------------
1 | package template
2 |
3 | const shouldFail = "different signatures"
4 |
5 | func before() int { return 0 }
6 | func after() string { return "" }
7 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/tools/third_party/moduleloader/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013-2016 Guy Bedford, Luke Hoban, Addy Osmani
2 |
3 | Permission is hereby granted, free of charge, to any person
4 | obtaining a copy of this software and associated documentation
5 | files (the "Software"), to deal in the Software without
6 | restriction, including without limitation the rights to use,
7 | copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the
9 | Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------