From f8de18d3f045147635f4d3c761c15085ef68cbfa Mon Sep 17 00:00:00 2001 From: Mark Bates Date: Mon, 25 Feb 2019 10:01:43 -0500 Subject: [PATCH] Fixes #33 (#37) --- cmd/auth.go | 4 +- genny/auth/auth.go | 8 +- go.mod | 20 +- go.sum | 208 +- vendor/github.com/fatih/structs/.gitignore | 23 - vendor/github.com/fatih/structs/.travis.yml | 11 - vendor/github.com/fatih/structs/LICENSE | 21 - vendor/github.com/fatih/structs/README.md | 163 - vendor/github.com/fatih/structs/field.go | 141 - vendor/github.com/fatih/structs/structs.go | 586 - vendor/github.com/fatih/structs/tags.go | 32 - .../gobuffalo/buffalo-plugins/LICENSE | 21 - .../buffalo-plugins/plugins/command.go | 18 - .../buffalo-plugins/plugins/plugins.go | 148 - .../buffalo-plugins/plugins/version.go | 3 - .../github.com/gobuffalo/buffalo/LICENSE.txt | 8 - .../github.com/gobuffalo/buffalo/meta/app.go | 154 - .../github.com/gobuffalo/buffalo/meta/tags.go | 30 - vendor/github.com/gobuffalo/envy/.env | 5 - vendor/github.com/gobuffalo/envy/.gitignore | 29 - vendor/github.com/gobuffalo/envy/.travis.yml | 14 - vendor/github.com/gobuffalo/envy/LICENSE.txt | 8 - vendor/github.com/gobuffalo/envy/README.md | 93 - vendor/github.com/gobuffalo/envy/envy.go | 223 - vendor/github.com/gobuffalo/envy/go.mod | 8 - vendor/github.com/gobuffalo/envy/go.sum | 8 - vendor/github.com/gobuffalo/flect/.gitignore | 28 - vendor/github.com/gobuffalo/flect/.travis.yml | 16 - vendor/github.com/gobuffalo/flect/LICENSE.txt | 8 - vendor/github.com/gobuffalo/flect/README.md | 36 - vendor/github.com/gobuffalo/flect/acronyms.go | 148 - vendor/github.com/gobuffalo/flect/camelize.go | 44 - .../github.com/gobuffalo/flect/capitalize.go | 27 - .../github.com/gobuffalo/flect/dasherize.go | 34 - vendor/github.com/gobuffalo/flect/flect.go | 84 - vendor/github.com/gobuffalo/flect/go.mod | 7 - vendor/github.com/gobuffalo/flect/go.sum | 6 - vendor/github.com/gobuffalo/flect/ident.go | 86 - .../github.com/gobuffalo/flect/lower_upper.go | 13 - .../github.com/gobuffalo/flect/name/char.go | 24 - .../github.com/gobuffalo/flect/name/file.go | 28 - .../github.com/gobuffalo/flect/name/ident.go | 13 - .../github.com/gobuffalo/flect/name/join.go | 20 - vendor/github.com/gobuffalo/flect/name/key.go | 14 - .../github.com/gobuffalo/flect/name/name.go | 49 - .../gobuffalo/flect/name/os_path.go | 21 - .../gobuffalo/flect/name/package.go | 42 - .../gobuffalo/flect/name/param_id.go | 24 - .../gobuffalo/flect/name/resource.go | 24 - .../gobuffalo/flect/name/tablize.go | 17 - vendor/github.com/gobuffalo/flect/name/url.go | 5 - .../gobuffalo/flect/name/var_case.go | 33 - .../github.com/gobuffalo/flect/ordinalize.go | 43 - .../github.com/gobuffalo/flect/pascalize.go | 25 - .../gobuffalo/flect/plural_rules.go | 238 - .../github.com/gobuffalo/flect/pluralize.go | 49 - vendor/github.com/gobuffalo/flect/rule.go | 10 - .../gobuffalo/flect/singular_rules.go | 122 - .../github.com/gobuffalo/flect/singularize.go | 44 - vendor/github.com/gobuffalo/flect/titleize.go | 31 - .../github.com/gobuffalo/flect/underscore.go | 34 - .../gobuffalo/genny/.codeclimate.yml | 14 - vendor/github.com/gobuffalo/genny/.gitignore | 29 - .../gobuffalo/genny/.gometalinter.json | 3 - .../gobuffalo/genny/.goreleaser.yml | 28 - vendor/github.com/gobuffalo/genny/.travis.yml | 18 - vendor/github.com/gobuffalo/genny/LICENSE.txt | 8 - vendor/github.com/gobuffalo/genny/Makefile | 46 - vendor/github.com/gobuffalo/genny/README.md | 20 - .../github.com/gobuffalo/genny/SHOULDERS.md | 108 - vendor/github.com/gobuffalo/genny/confirm.go | 15 - vendor/github.com/gobuffalo/genny/disk.go | 97 - .../github.com/gobuffalo/genny/dry_runner.go | 37 - vendor/github.com/gobuffalo/genny/file.go | 52 - vendor/github.com/gobuffalo/genny/force.go | 73 - .../github.com/gobuffalo/genny/generator.go | 78 - vendor/github.com/gobuffalo/genny/go.mod | 27 - vendor/github.com/gobuffalo/genny/go.sum | 109 - vendor/github.com/gobuffalo/genny/group.go | 30 - vendor/github.com/gobuffalo/genny/helpers.go | 46 - vendor/github.com/gobuffalo/genny/logger.go | 18 - .../genny/movinglater/attrs/attrs.go | 54 - .../genny/movinglater/attrs/named_attrs.go | 45 - .../genny/movinglater/attrs/parse.go | 57 - .../genny/movinglater/gotools/add_import.go | 52 - .../movinglater/gotools/add_inside_block.go | 79 - .../genny/movinglater/gotools/append.go | 22 - .../movinglater/gotools/change_import.go | 34 - .../genny/movinglater/gotools/files.go | 36 - .../genny/movinglater/gotools/fmt.go | 40 - .../genny/movinglater/gotools/get.go | 25 - .../movinglater/gotools/goimports/LICENSE | 27 - .../movinglater/gotools/goimports/README.md | 5 - .../gotools/goimports/goimports.go | 116 - .../movinglater/gotools/gomods/gomods.go | 32 - .../genny/movinglater/gotools/gomods/init.go | 39 - .../genny/movinglater/gotools/gomods/tidy.go | 24 - .../genny/movinglater/gotools/gotools.go | 1 - .../genny/movinglater/gotools/package.go | 20 - .../genny/movinglater/gotools/parsed_file.go | 76 - .../movinglater/gotools/replace_block_body.go | 27 - .../genny/movinglater/gotools/templates.go | 52 - .../genny/movinglater/plushgen/plush.go | 27 - vendor/github.com/gobuffalo/genny/replacer.go | 20 - vendor/github.com/gobuffalo/genny/results.go | 19 - vendor/github.com/gobuffalo/genny/runner.go | 218 - .../github.com/gobuffalo/genny/transformer.go | 37 - vendor/github.com/gobuffalo/genny/version.go | 3 - .../github.com/gobuffalo/genny/wet_runner.go | 86 - .../.gometalinter.json | 3 - .../github_flavored_markdown/.travis.yml | 16 - .../github_flavored_markdown/Makefile | 40 - .../github_flavored_markdown/README.md | 32 - .../gobuffalo/github_flavored_markdown/go.mod | 19 - .../gobuffalo/github_flavored_markdown/go.sum | 33 - .../internal/russross/blackfriday/.gitignore | 8 - .../internal/russross/blackfriday/.travis.yml | 30 - .../internal/russross/blackfriday/LICENSE.txt | 29 - .../internal/russross/blackfriday/README.md | 363 - .../internal/russross/blackfriday/block.go | 1450 --- .../internal/russross/blackfriday/doc.go | 32 - .../internal/russross/blackfriday/html.go | 950 -- .../internal/russross/blackfriday/inline.go | 1154 -- .../internal/russross/blackfriday/latex.go | 332 - .../internal/russross/blackfriday/markdown.go | 931 -- .../russross/blackfriday/smartypants.go | 430 - .../github_flavored_markdown/main.go | 332 - .../github_flavored_markdown/shoulders.md | 36 - .../github_flavored_markdown/version.go | 3 - .../gobuffalo/packr/.codeclimate.yml | 20 - vendor/github.com/gobuffalo/packr/.gitignore | 33 - .../gobuffalo/packr/.goreleaser.yml | 25 - vendor/github.com/gobuffalo/packr/.travis.yml | 16 - vendor/github.com/gobuffalo/packr/LICENSE.txt | 8 - vendor/github.com/gobuffalo/packr/Makefile | 36 - vendor/github.com/gobuffalo/packr/README.md | 196 - vendor/github.com/gobuffalo/packr/box.go | 204 - vendor/github.com/gobuffalo/packr/env.go | 39 - vendor/github.com/gobuffalo/packr/file.go | 15 - .../github.com/gobuffalo/packr/file_info.go | 38 - vendor/github.com/gobuffalo/packr/go.mod | 13 - vendor/github.com/gobuffalo/packr/go.sum | 18 - vendor/github.com/gobuffalo/packr/packr.go | 74 - .../gobuffalo/packr/physical_file.go | 13 - .../github.com/gobuffalo/packr/shoulders.md | 24 - vendor/github.com/gobuffalo/packr/version.go | 3 - .../gobuffalo/packr/virtual_file.go | 57 - vendor/github.com/gobuffalo/packr/walk.go | 63 - .../gobuffalo/plush/.codeclimate.yml | 22 - vendor/github.com/gobuffalo/plush/.gitignore | 32 - vendor/github.com/gobuffalo/plush/.travis.yml | 12 - vendor/github.com/gobuffalo/plush/LICENSE.txt | 8 - vendor/github.com/gobuffalo/plush/README.md | 397 - .../gobuffalo/plush/ast/array_literal.go | 28 - .../gobuffalo/plush/ast/assign_expression.go | 22 - vendor/github.com/gobuffalo/plush/ast/ast.go | 38 - .../gobuffalo/plush/ast/block_statement.go | 22 - .../github.com/gobuffalo/plush/ast/boolean.go | 12 - .../gobuffalo/plush/ast/call_expression.go | 47 - .../plush/ast/expression_statement.go | 15 - .../gobuffalo/plush/ast/float_literal.go | 12 - .../gobuffalo/plush/ast/for_expression.go | 31 - .../gobuffalo/plush/ast/function_literal.go | 31 - .../gobuffalo/plush/ast/hash_literal.go | 28 - .../gobuffalo/plush/ast/html_literal.go | 16 - .../gobuffalo/plush/ast/identifier.go | 23 - .../gobuffalo/plush/ast/if_expression.go | 47 - .../gobuffalo/plush/ast/index_expression.go | 25 - .../gobuffalo/plush/ast/infix_expression.go | 32 - .../gobuffalo/plush/ast/integer_literal.go | 12 - .../gobuffalo/plush/ast/let_statement.go | 29 - .../gobuffalo/plush/ast/prefix_expression.go | 24 - .../github.com/gobuffalo/plush/ast/program.go | 25 - .../gobuffalo/plush/ast/return_statement.go | 30 - .../gobuffalo/plush/ast/string_literal.go | 12 - vendor/github.com/gobuffalo/plush/compiler.go | 754 -- .../gobuffalo/plush/content_helper.go | 57 - vendor/github.com/gobuffalo/plush/context.go | 97 - vendor/github.com/gobuffalo/plush/forms.go | 70 - .../github.com/gobuffalo/plush/helper_map.go | 55 - vendor/github.com/gobuffalo/plush/helpers.go | 155 - .../github.com/gobuffalo/plush/iterators.go | 89 - .../github.com/gobuffalo/plush/lexer/lexer.go | 337 - .../gobuffalo/plush/markdown_helper.go | 20 - .../gobuffalo/plush/parser/errors.go | 9 - .../gobuffalo/plush/parser/parser.go | 715 - .../gobuffalo/plush/parser/precedences.go | 34 - vendor/github.com/gobuffalo/plush/plush.go | 93 - vendor/github.com/gobuffalo/plush/template.go | 70 - .../github.com/gobuffalo/plush/token/const.go | 64 - .../github.com/gobuffalo/plush/token/token.go | 32 - .../gobuffalo/plush/user_function.go | 31 - vendor/github.com/gobuffalo/tags/.gitignore | 30 - vendor/github.com/gobuffalo/tags/.travis.yml | 9 - vendor/github.com/gobuffalo/tags/LICENSE.txt | 9 - vendor/github.com/gobuffalo/tags/README.md | 43 - .../gobuffalo/tags/form/bootstrap/common.go | 77 - .../gobuffalo/tags/form/bootstrap/form.go | 73 - .../gobuffalo/tags/form/bootstrap/form_for.go | 131 - .../gobuffalo/tags/form/checkbox_tag.go | 56 - .../gobuffalo/tags/form/file_tag.go | 14 - vendor/github.com/gobuffalo/tags/form/form.go | 55 - .../gobuffalo/tags/form/form_for.go | 271 - .../gobuffalo/tags/form/input_tag.go | 40 - .../gobuffalo/tags/form/radio_button_tag.go | 51 - .../gobuffalo/tags/form/select_options.go | 32 - .../gobuffalo/tags/form/select_tag.go | 153 - .../gobuffalo/tags/form/selectable.go | 10 - .../gobuffalo/tags/form/submit_tag.go | 10 - .../gobuffalo/tags/form/text_area_tag.go | 21 - vendor/github.com/gobuffalo/tags/misc.go | 19 - vendor/github.com/gobuffalo/tags/options.go | 29 - .../github.com/gobuffalo/tags/pagination.go | 276 - vendor/github.com/gobuffalo/tags/shoulders.md | 34 - vendor/github.com/gobuffalo/tags/tag.go | 192 - vendor/github.com/gobuffalo/tags/version.go | 3 - vendor/github.com/gobuffalo/uuid/.travis.yml | 23 - vendor/github.com/gobuffalo/uuid/LICENSE | 20 - vendor/github.com/gobuffalo/uuid/README.md | 78 - vendor/github.com/gobuffalo/uuid/codec.go | 206 - vendor/github.com/gobuffalo/uuid/generator.go | 266 - vendor/github.com/gobuffalo/uuid/sql.go | 78 - vendor/github.com/gobuffalo/uuid/uuid.go | 161 - .../github.com/gobuffalo/validate/.gitignore | 29 - .../github.com/gobuffalo/validate/.travis.yml | 8 - .../github.com/gobuffalo/validate/LICENSE.txt | 22 - .../github.com/gobuffalo/validate/README.md | 123 - .../github.com/gobuffalo/validate/validate.go | 153 - .../validate/validators/bytes_are_present.go | 27 - .../gobuffalo/validate/validators/common.go | 20 - .../validate/validators/email_is_present.go | 59 - .../validate/validators/func_validator.go | 25 - .../validators/int_array_is_present.go | 27 - .../validators/int_is_greater_than.go | 28 - .../validate/validators/int_is_less_than.go | 28 - .../validate/validators/int_is_present.go | 27 - .../validate/validators/regex_match.go | 31 - .../validate/validators/string_inclusion.go | 34 - .../validate/validators/string_is_present.go | 28 - .../validators/string_length_in_range.go | 31 - .../validate/validators/strings_match.go | 25 - .../validate/validators/time_after_time.go | 31 - .../validators/time_is_before_time.go | 30 - .../validate/validators/time_is_present.go | 29 - .../validate/validators/url_is_present.go | 40 - .../validate/validators/uuid_is_present.go | 30 - .../inconshreveable/mousetrap/LICENSE | 13 - .../inconshreveable/mousetrap/README.md | 23 - .../inconshreveable/mousetrap/trap_others.go | 15 - .../inconshreveable/mousetrap/trap_windows.go | 98 - .../mousetrap/trap_windows_1.4.go | 46 - vendor/github.com/joho/godotenv/.gitignore | 1 - vendor/github.com/joho/godotenv/.travis.yml | 8 - vendor/github.com/joho/godotenv/LICENCE | 23 - vendor/github.com/joho/godotenv/README.md | 163 - vendor/github.com/joho/godotenv/godotenv.go | 346 - .../go-windows-terminal-sequences/README.md | 40 - .../go-windows-terminal-sequences/license | 9 - .../sequences.go | 36 - .../github.com/markbates/inflect/.gitignore | 29 - .../markbates/inflect/.gometalinter.json | 3 - vendor/github.com/markbates/inflect/.hgignore | 1 - .../github.com/markbates/inflect/.travis.yml | 26 - vendor/github.com/markbates/inflect/LICENCE | 7 - vendor/github.com/markbates/inflect/Makefile | 46 - vendor/github.com/markbates/inflect/README.md | 214 - vendor/github.com/markbates/inflect/go.mod | 6 - vendor/github.com/markbates/inflect/go.sum | 10 - .../github.com/markbates/inflect/helpers.go | 19 - .../github.com/markbates/inflect/inflect.go | 890 -- .../markbates/inflect/inflections.json | 4 - vendor/github.com/markbates/inflect/name.go | 163 - .../github.com/markbates/inflect/shoulders.md | 12 - .../github.com/markbates/inflect/version.go | 3 - vendor/github.com/markbates/oncer/.gitignore | 29 - vendor/github.com/markbates/oncer/LICENSE | 21 - vendor/github.com/markbates/oncer/Makefile | 40 - .../github.com/markbates/oncer/deprecate.go | 34 - vendor/github.com/markbates/oncer/go.mod | 7 - vendor/github.com/markbates/oncer/go.sum | 6 - vendor/github.com/markbates/oncer/oncer.go | 26 - .../microcosm-cc/bluemonday/.coveralls.yml | 1 - .../microcosm-cc/bluemonday/.travis.yml | 21 - .../microcosm-cc/bluemonday/CONTRIBUTING.md | 51 - .../microcosm-cc/bluemonday/CREDITS.md | 6 - .../microcosm-cc/bluemonday/LICENSE.md | 28 - .../microcosm-cc/bluemonday/Makefile | 42 - .../microcosm-cc/bluemonday/README.md | 350 - .../github.com/microcosm-cc/bluemonday/doc.go | 104 - .../microcosm-cc/bluemonday/helpers.go | 297 - .../microcosm-cc/bluemonday/policies.go | 253 - .../microcosm-cc/bluemonday/policy.go | 552 - .../microcosm-cc/bluemonday/sanitize.go | 581 - vendor/github.com/serenize/snaker/.travis.yml | 8 - vendor/github.com/serenize/snaker/LICENSE.txt | 19 - vendor/github.com/serenize/snaker/README.md | 25 - vendor/github.com/serenize/snaker/snaker.go | 150 - vendor/github.com/sergi/go-diff/AUTHORS | 25 - vendor/github.com/sergi/go-diff/CONTRIBUTORS | 32 - vendor/github.com/sergi/go-diff/LICENSE | 20 - .../sergi/go-diff/diffmatchpatch/diff.go | 1344 -- .../go-diff/diffmatchpatch/diffmatchpatch.go | 46 - .../sergi/go-diff/diffmatchpatch/match.go | 160 - .../sergi/go-diff/diffmatchpatch/mathutil.go | 23 - .../sergi/go-diff/diffmatchpatch/patch.go | 556 - .../go-diff/diffmatchpatch/stringutil.go | 88 - .../shurcooL/highlight_diff/.travis.yml | 16 - .../shurcooL/highlight_diff/README.md | 22 - .../shurcooL/highlight_diff/main.go | 179 - .../shurcooL/highlight_go/.travis.yml | 16 - .../shurcooL/highlight_go/README.md | 18 - .../github.com/shurcooL/highlight_go/main.go | 127 - .../github.com/shurcooL/octicon/.travis.yml | 16 - vendor/github.com/shurcooL/octicon/README.md | 18 - vendor/github.com/shurcooL/octicon/doc.go | 11 - .../github.com/shurcooL/octicon/generate.go | 165 - vendor/github.com/shurcooL/octicon/octicon.go | 10821 ---------------- .../sanitized_anchor_name/.travis.yml | 16 - .../shurcooL/sanitized_anchor_name/LICENSE | 21 - .../shurcooL/sanitized_anchor_name/README.md | 36 - .../shurcooL/sanitized_anchor_name/main.go | 29 - vendor/github.com/sirupsen/logrus/.gitignore | 1 - vendor/github.com/sirupsen/logrus/.travis.yml | 51 - .../github.com/sirupsen/logrus/CHANGELOG.md | 153 - vendor/github.com/sirupsen/logrus/LICENSE | 21 - vendor/github.com/sirupsen/logrus/README.md | 461 - vendor/github.com/sirupsen/logrus/alt_exit.go | 64 - .../github.com/sirupsen/logrus/appveyor.yml | 14 - vendor/github.com/sirupsen/logrus/doc.go | 26 - vendor/github.com/sirupsen/logrus/entry.go | 300 - vendor/github.com/sirupsen/logrus/exported.go | 198 - .../github.com/sirupsen/logrus/formatter.go | 51 - vendor/github.com/sirupsen/logrus/go.mod | 10 - vendor/github.com/sirupsen/logrus/go.sum | 12 - vendor/github.com/sirupsen/logrus/hooks.go | 34 - .../sirupsen/logrus/json_formatter.go | 104 - vendor/github.com/sirupsen/logrus/logger.go | 367 - vendor/github.com/sirupsen/logrus/logrus.go | 150 - .../sirupsen/logrus/terminal_appengine.go | 13 - .../sirupsen/logrus/terminal_bsd.go | 17 - .../logrus/terminal_check_appengine.go | 11 - .../sirupsen/logrus/terminal_check_js.go | 11 - .../logrus/terminal_check_notappengine.go | 19 - .../sirupsen/logrus/terminal_check_windows.go | 20 - .../sirupsen/logrus/terminal_linux.go | 21 - .../sirupsen/logrus/terminal_windows.go | 18 - .../sirupsen/logrus/text_formatter.go | 249 - vendor/github.com/sirupsen/logrus/writer.go | 62 - .../sourcegraph/annotate/.travis.yml | 4 - .../github.com/sourcegraph/annotate/LICENSE | 28 - .../github.com/sourcegraph/annotate/Makefile | 9 - .../github.com/sourcegraph/annotate/README.md | 10 - .../sourcegraph/annotate/annotate.go | 159 - .../sourcegraph/annotate/benchmark.txt | 3 - .../sourcegraph/syntaxhighlight/.travis.yml | 14 - .../sourcegraph/syntaxhighlight/LICENSE | 28 - .../sourcegraph/syntaxhighlight/Makefile | 5 - .../sourcegraph/syntaxhighlight/README.md | 68 - .../sourcegraph/syntaxhighlight/benchmark.txt | 3 - .../sourcegraph/syntaxhighlight/highlight.go | 295 - .../sourcegraph/syntaxhighlight/keywords.go | 177 - .../syntaxhighlight/kind_gostring.go | 16 - vendor/github.com/spf13/cobra/.gitignore | 36 - vendor/github.com/spf13/cobra/.mailmap | 3 - vendor/github.com/spf13/cobra/.travis.yml | 21 - vendor/github.com/spf13/cobra/LICENSE.txt | 174 - vendor/github.com/spf13/cobra/README.md | 736 -- vendor/github.com/spf13/cobra/args.go | 89 - .../spf13/cobra/bash_completions.go | 584 - .../spf13/cobra/bash_completions.md | 221 - vendor/github.com/spf13/cobra/cobra.go | 200 - vendor/github.com/spf13/cobra/command.go | 1517 --- .../github.com/spf13/cobra/command_notwin.go | 5 - vendor/github.com/spf13/cobra/command_win.go | 20 - .../github.com/spf13/cobra/zsh_completions.go | 126 - vendor/github.com/spf13/pflag/.gitignore | 2 - vendor/github.com/spf13/pflag/.travis.yml | 21 - vendor/github.com/spf13/pflag/LICENSE | 28 - vendor/github.com/spf13/pflag/README.md | 296 - vendor/github.com/spf13/pflag/bool.go | 94 - vendor/github.com/spf13/pflag/bool_slice.go | 147 - vendor/github.com/spf13/pflag/bytes.go | 209 - vendor/github.com/spf13/pflag/count.go | 96 - vendor/github.com/spf13/pflag/duration.go | 86 - .../github.com/spf13/pflag/duration_slice.go | 128 - vendor/github.com/spf13/pflag/flag.go | 1224 -- vendor/github.com/spf13/pflag/float32.go | 88 - vendor/github.com/spf13/pflag/float64.go | 84 - vendor/github.com/spf13/pflag/golangflag.go | 105 - vendor/github.com/spf13/pflag/int.go | 84 - vendor/github.com/spf13/pflag/int16.go | 88 - vendor/github.com/spf13/pflag/int32.go | 88 - vendor/github.com/spf13/pflag/int64.go | 84 - vendor/github.com/spf13/pflag/int8.go | 88 - vendor/github.com/spf13/pflag/int_slice.go | 128 - vendor/github.com/spf13/pflag/ip.go | 94 - vendor/github.com/spf13/pflag/ip_slice.go | 148 - vendor/github.com/spf13/pflag/ipmask.go | 122 - vendor/github.com/spf13/pflag/ipnet.go | 98 - vendor/github.com/spf13/pflag/string.go | 80 - vendor/github.com/spf13/pflag/string_array.go | 103 - vendor/github.com/spf13/pflag/string_slice.go | 149 - vendor/github.com/spf13/pflag/uint.go | 88 - vendor/github.com/spf13/pflag/uint16.go | 88 - vendor/github.com/spf13/pflag/uint32.go | 88 - vendor/github.com/spf13/pflag/uint64.go | 88 - vendor/github.com/spf13/pflag/uint8.go | 88 - vendor/github.com/spf13/pflag/uint_slice.go | 126 - vendor/golang.org/x/crypto/AUTHORS | 3 - vendor/golang.org/x/crypto/CONTRIBUTORS | 3 - vendor/golang.org/x/crypto/LICENSE | 27 - vendor/golang.org/x/crypto/PATENTS | 22 - .../x/crypto/ssh/terminal/terminal.go | 951 -- .../golang.org/x/crypto/ssh/terminal/util.go | 114 - .../x/crypto/ssh/terminal/util_bsd.go | 12 - .../x/crypto/ssh/terminal/util_linux.go | 10 - .../x/crypto/ssh/terminal/util_plan9.go | 58 - .../x/crypto/ssh/terminal/util_solaris.go | 124 - .../x/crypto/ssh/terminal/util_windows.go | 103 - vendor/golang.org/x/net/AUTHORS | 3 - vendor/golang.org/x/net/CONTRIBUTORS | 3 - vendor/golang.org/x/net/LICENSE | 27 - vendor/golang.org/x/net/PATENTS | 22 - vendor/golang.org/x/net/html/atom/atom.go | 78 - vendor/golang.org/x/net/html/atom/gen.go | 712 - vendor/golang.org/x/net/html/atom/table.go | 783 -- vendor/golang.org/x/net/html/const.go | 112 - vendor/golang.org/x/net/html/doc.go | 106 - vendor/golang.org/x/net/html/doctype.go | 156 - vendor/golang.org/x/net/html/entity.go | 2253 ---- vendor/golang.org/x/net/html/escape.go | 258 - vendor/golang.org/x/net/html/foreign.go | 226 - vendor/golang.org/x/net/html/node.go | 220 - vendor/golang.org/x/net/html/parse.go | 2317 ---- vendor/golang.org/x/net/html/render.go | 271 - vendor/golang.org/x/net/html/token.go | 1219 -- vendor/golang.org/x/sys/AUTHORS | 3 - vendor/golang.org/x/sys/CONTRIBUTORS | 3 - vendor/golang.org/x/sys/LICENSE | 27 - vendor/golang.org/x/sys/PATENTS | 22 - vendor/golang.org/x/sys/unix/.gitignore | 2 - vendor/golang.org/x/sys/unix/README.md | 173 - .../golang.org/x/sys/unix/affinity_linux.go | 124 - vendor/golang.org/x/sys/unix/aliases.go | 14 - vendor/golang.org/x/sys/unix/asm_darwin_386.s | 29 - .../golang.org/x/sys/unix/asm_darwin_amd64.s | 29 - vendor/golang.org/x/sys/unix/asm_darwin_arm.s | 30 - .../golang.org/x/sys/unix/asm_darwin_arm64.s | 30 - .../x/sys/unix/asm_dragonfly_amd64.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_386.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_amd64.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_arm.s | 29 - vendor/golang.org/x/sys/unix/asm_linux_386.s | 65 - .../golang.org/x/sys/unix/asm_linux_amd64.s | 57 - vendor/golang.org/x/sys/unix/asm_linux_arm.s | 56 - .../golang.org/x/sys/unix/asm_linux_arm64.s | 52 - .../golang.org/x/sys/unix/asm_linux_mips64x.s | 56 - .../golang.org/x/sys/unix/asm_linux_mipsx.s | 54 - .../golang.org/x/sys/unix/asm_linux_ppc64x.s | 56 - .../golang.org/x/sys/unix/asm_linux_s390x.s | 56 - vendor/golang.org/x/sys/unix/asm_netbsd_386.s | 29 - .../golang.org/x/sys/unix/asm_netbsd_amd64.s | 29 - vendor/golang.org/x/sys/unix/asm_netbsd_arm.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_386.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_amd64.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_arm.s | 29 - .../golang.org/x/sys/unix/asm_solaris_amd64.s | 17 - .../golang.org/x/sys/unix/bluetooth_linux.go | 35 - vendor/golang.org/x/sys/unix/cap_freebsd.go | 195 - vendor/golang.org/x/sys/unix/constants.go | 13 - vendor/golang.org/x/sys/unix/dev_aix_ppc.go | 27 - vendor/golang.org/x/sys/unix/dev_aix_ppc64.go | 29 - vendor/golang.org/x/sys/unix/dev_darwin.go | 24 - vendor/golang.org/x/sys/unix/dev_dragonfly.go | 30 - vendor/golang.org/x/sys/unix/dev_freebsd.go | 30 - vendor/golang.org/x/sys/unix/dev_linux.go | 42 - vendor/golang.org/x/sys/unix/dev_netbsd.go | 29 - vendor/golang.org/x/sys/unix/dev_openbsd.go | 29 - vendor/golang.org/x/sys/unix/dirent.go | 17 - vendor/golang.org/x/sys/unix/endian_big.go | 9 - vendor/golang.org/x/sys/unix/endian_little.go | 9 - vendor/golang.org/x/sys/unix/env_unix.go | 31 - .../x/sys/unix/errors_freebsd_386.go | 227 - .../x/sys/unix/errors_freebsd_amd64.go | 227 - .../x/sys/unix/errors_freebsd_arm.go | 226 - vendor/golang.org/x/sys/unix/fcntl.go | 32 - .../x/sys/unix/fcntl_linux_32bit.go | 13 - vendor/golang.org/x/sys/unix/gccgo.go | 62 - vendor/golang.org/x/sys/unix/gccgo_c.c | 39 - .../x/sys/unix/gccgo_linux_amd64.go | 20 - vendor/golang.org/x/sys/unix/ioctl.go | 30 - vendor/golang.org/x/sys/unix/mkall.sh | 198 - vendor/golang.org/x/sys/unix/mkerrors.sh | 652 - vendor/golang.org/x/sys/unix/mkpost.go | 98 - vendor/golang.org/x/sys/unix/mksyscall.pl | 341 - vendor/golang.org/x/sys/unix/mksyscall_aix.pl | 385 - .../x/sys/unix/mksyscall_solaris.pl | 289 - .../golang.org/x/sys/unix/mksysctl_openbsd.pl | 264 - .../golang.org/x/sys/unix/mksysnum_darwin.pl | 39 - .../x/sys/unix/mksysnum_dragonfly.pl | 50 - .../golang.org/x/sys/unix/mksysnum_freebsd.pl | 50 - .../golang.org/x/sys/unix/mksysnum_netbsd.pl | 58 - .../golang.org/x/sys/unix/mksysnum_openbsd.pl | 50 - .../golang.org/x/sys/unix/openbsd_pledge.go | 95 - vendor/golang.org/x/sys/unix/pagesize_unix.go | 15 - vendor/golang.org/x/sys/unix/race.go | 30 - vendor/golang.org/x/sys/unix/race0.go | 25 - .../golang.org/x/sys/unix/sockcmsg_linux.go | 36 - vendor/golang.org/x/sys/unix/sockcmsg_unix.go | 104 - vendor/golang.org/x/sys/unix/str.go | 26 - vendor/golang.org/x/sys/unix/syscall.go | 54 - vendor/golang.org/x/sys/unix/syscall_aix.go | 564 - .../golang.org/x/sys/unix/syscall_aix_ppc.go | 34 - .../x/sys/unix/syscall_aix_ppc64.go | 34 - vendor/golang.org/x/sys/unix/syscall_bsd.go | 624 - .../golang.org/x/sys/unix/syscall_darwin.go | 700 - .../x/sys/unix/syscall_darwin_386.go | 68 - .../x/sys/unix/syscall_darwin_amd64.go | 68 - .../x/sys/unix/syscall_darwin_arm.go | 66 - .../x/sys/unix/syscall_darwin_arm64.go | 68 - .../x/sys/unix/syscall_dragonfly.go | 523 - .../x/sys/unix/syscall_dragonfly_amd64.go | 52 - .../golang.org/x/sys/unix/syscall_freebsd.go | 535 - .../x/sys/unix/syscall_freebsd_386.go | 52 - .../x/sys/unix/syscall_freebsd_amd64.go | 52 - .../x/sys/unix/syscall_freebsd_arm.go | 52 - vendor/golang.org/x/sys/unix/syscall_linux.go | 1628 --- .../x/sys/unix/syscall_linux_386.go | 385 - .../x/sys/unix/syscall_linux_amd64.go | 162 - .../x/sys/unix/syscall_linux_amd64_gc.go | 13 - .../x/sys/unix/syscall_linux_arm.go | 259 - .../x/sys/unix/syscall_linux_arm64.go | 212 - .../golang.org/x/sys/unix/syscall_linux_gc.go | 14 - .../x/sys/unix/syscall_linux_gc_386.go | 16 - .../x/sys/unix/syscall_linux_gccgo_386.go | 30 - .../x/sys/unix/syscall_linux_gccgo_arm.go | 20 - .../x/sys/unix/syscall_linux_mips64x.go | 214 - .../x/sys/unix/syscall_linux_mipsx.go | 233 - .../x/sys/unix/syscall_linux_ppc64x.go | 138 - .../x/sys/unix/syscall_linux_riscv64.go | 212 - .../x/sys/unix/syscall_linux_s390x.go | 324 - .../x/sys/unix/syscall_linux_sparc64.go | 146 - .../golang.org/x/sys/unix/syscall_netbsd.go | 597 - .../x/sys/unix/syscall_netbsd_386.go | 33 - .../x/sys/unix/syscall_netbsd_amd64.go | 33 - .../x/sys/unix/syscall_netbsd_arm.go | 33 - .../golang.org/x/sys/unix/syscall_openbsd.go | 368 - .../x/sys/unix/syscall_openbsd_386.go | 33 - .../x/sys/unix/syscall_openbsd_amd64.go | 37 - .../x/sys/unix/syscall_openbsd_arm.go | 33 - .../golang.org/x/sys/unix/syscall_solaris.go | 730 -- .../x/sys/unix/syscall_solaris_amd64.go | 23 - vendor/golang.org/x/sys/unix/syscall_unix.go | 394 - .../golang.org/x/sys/unix/syscall_unix_gc.go | 15 - vendor/golang.org/x/sys/unix/timestruct.go | 82 - vendor/golang.org/x/sys/unix/types_aix.go | 236 - vendor/golang.org/x/sys/unix/types_darwin.go | 277 - .../golang.org/x/sys/unix/types_dragonfly.go | 263 - vendor/golang.org/x/sys/unix/types_freebsd.go | 385 - vendor/golang.org/x/sys/unix/types_netbsd.go | 287 - vendor/golang.org/x/sys/unix/types_openbsd.go | 265 - vendor/golang.org/x/sys/unix/types_solaris.go | 266 - vendor/golang.org/x/sys/unix/xattr_bsd.go | 231 - .../golang.org/x/sys/unix/zerrors_aix_ppc.go | 1372 -- .../x/sys/unix/zerrors_aix_ppc64.go | 1373 -- .../x/sys/unix/zerrors_darwin_386.go | 1783 --- .../x/sys/unix/zerrors_darwin_amd64.go | 1783 --- .../x/sys/unix/zerrors_darwin_arm.go | 1783 --- .../x/sys/unix/zerrors_darwin_arm64.go | 1783 --- .../x/sys/unix/zerrors_dragonfly_amd64.go | 1650 --- .../x/sys/unix/zerrors_freebsd_386.go | 1793 --- .../x/sys/unix/zerrors_freebsd_amd64.go | 1794 --- .../x/sys/unix/zerrors_freebsd_arm.go | 1802 --- .../x/sys/unix/zerrors_linux_386.go | 2675 ---- .../x/sys/unix/zerrors_linux_amd64.go | 2675 ---- .../x/sys/unix/zerrors_linux_arm.go | 2681 ---- .../x/sys/unix/zerrors_linux_arm64.go | 2666 ---- .../x/sys/unix/zerrors_linux_mips.go | 2682 ---- .../x/sys/unix/zerrors_linux_mips64.go | 2682 ---- .../x/sys/unix/zerrors_linux_mips64le.go | 2682 ---- .../x/sys/unix/zerrors_linux_mipsle.go | 2682 ---- .../x/sys/unix/zerrors_linux_ppc64.go | 2735 ---- .../x/sys/unix/zerrors_linux_ppc64le.go | 2735 ---- .../x/sys/unix/zerrors_linux_riscv64.go | 2662 ---- .../x/sys/unix/zerrors_linux_s390x.go | 2735 ---- .../x/sys/unix/zerrors_linux_sparc64.go | 2142 --- .../x/sys/unix/zerrors_netbsd_386.go | 1772 --- .../x/sys/unix/zerrors_netbsd_amd64.go | 1762 --- .../x/sys/unix/zerrors_netbsd_arm.go | 1751 --- .../x/sys/unix/zerrors_openbsd_386.go | 1654 --- .../x/sys/unix/zerrors_openbsd_amd64.go | 1761 --- .../x/sys/unix/zerrors_openbsd_arm.go | 1656 --- .../x/sys/unix/zerrors_solaris_amd64.go | 1532 --- .../golang.org/x/sys/unix/zptrace386_linux.go | 80 - .../golang.org/x/sys/unix/zptracearm_linux.go | 41 - .../x/sys/unix/zptracemips_linux.go | 50 - .../x/sys/unix/zptracemipsle_linux.go | 50 - .../golang.org/x/sys/unix/zsyscall_aix_ppc.go | 1519 --- .../x/sys/unix/zsyscall_aix_ppc64.go | 1519 --- .../x/sys/unix/zsyscall_darwin_386.go | 1769 --- .../x/sys/unix/zsyscall_darwin_amd64.go | 1769 --- .../x/sys/unix/zsyscall_darwin_arm.go | 1769 --- .../x/sys/unix/zsyscall_darwin_arm64.go | 1769 --- .../x/sys/unix/zsyscall_dragonfly_amd64.go | 1508 --- .../x/sys/unix/zsyscall_freebsd_386.go | 1935 --- .../x/sys/unix/zsyscall_freebsd_amd64.go | 1935 --- .../x/sys/unix/zsyscall_freebsd_arm.go | 1935 --- .../x/sys/unix/zsyscall_linux_386.go | 2131 --- .../x/sys/unix/zsyscall_linux_amd64.go | 2298 ---- .../x/sys/unix/zsyscall_linux_arm.go | 2233 ---- .../x/sys/unix/zsyscall_linux_arm64.go | 2140 --- .../x/sys/unix/zsyscall_linux_mips.go | 2311 ---- .../x/sys/unix/zsyscall_linux_mips64.go | 2282 ---- .../x/sys/unix/zsyscall_linux_mips64le.go | 2282 ---- .../x/sys/unix/zsyscall_linux_mipsle.go | 2311 ---- .../x/sys/unix/zsyscall_linux_ppc64.go | 2345 ---- .../x/sys/unix/zsyscall_linux_ppc64le.go | 2345 ---- .../x/sys/unix/zsyscall_linux_riscv64.go | 2140 --- .../x/sys/unix/zsyscall_linux_s390x.go | 2115 --- .../x/sys/unix/zsyscall_linux_sparc64.go | 2172 ---- .../x/sys/unix/zsyscall_netbsd_386.go | 1653 --- .../x/sys/unix/zsyscall_netbsd_amd64.go | 1653 --- .../x/sys/unix/zsyscall_netbsd_arm.go | 1653 --- .../x/sys/unix/zsyscall_openbsd_386.go | 1508 --- .../x/sys/unix/zsyscall_openbsd_amd64.go | 1508 --- .../x/sys/unix/zsyscall_openbsd_arm.go | 1508 --- .../x/sys/unix/zsyscall_solaris_amd64.go | 1697 --- .../x/sys/unix/zsysctl_openbsd_386.go | 270 - .../x/sys/unix/zsysctl_openbsd_amd64.go | 257 - .../x/sys/unix/zsysctl_openbsd_arm.go | 270 - .../x/sys/unix/zsysnum_darwin_386.go | 436 - .../x/sys/unix/zsysnum_darwin_amd64.go | 436 - .../x/sys/unix/zsysnum_darwin_arm.go | 436 - .../x/sys/unix/zsysnum_darwin_arm64.go | 436 - .../x/sys/unix/zsysnum_dragonfly_amd64.go | 315 - .../x/sys/unix/zsysnum_freebsd_386.go | 403 - .../x/sys/unix/zsysnum_freebsd_amd64.go | 403 - .../x/sys/unix/zsysnum_freebsd_arm.go | 403 - .../x/sys/unix/zsysnum_linux_386.go | 392 - .../x/sys/unix/zsysnum_linux_amd64.go | 344 - .../x/sys/unix/zsysnum_linux_arm.go | 363 - .../x/sys/unix/zsysnum_linux_arm64.go | 287 - .../x/sys/unix/zsysnum_linux_mips.go | 377 - .../x/sys/unix/zsysnum_linux_mips64.go | 337 - .../x/sys/unix/zsysnum_linux_mips64le.go | 337 - .../x/sys/unix/zsysnum_linux_mipsle.go | 377 - .../x/sys/unix/zsysnum_linux_ppc64.go | 375 - .../x/sys/unix/zsysnum_linux_ppc64le.go | 375 - .../x/sys/unix/zsysnum_linux_riscv64.go | 286 - .../x/sys/unix/zsysnum_linux_s390x.go | 337 - .../x/sys/unix/zsysnum_linux_sparc64.go | 348 - .../x/sys/unix/zsysnum_netbsd_386.go | 274 - .../x/sys/unix/zsysnum_netbsd_amd64.go | 274 - .../x/sys/unix/zsysnum_netbsd_arm.go | 274 - .../x/sys/unix/zsysnum_openbsd_386.go | 207 - .../x/sys/unix/zsysnum_openbsd_amd64.go | 218 - .../x/sys/unix/zsysnum_openbsd_arm.go | 213 - .../golang.org/x/sys/unix/ztypes_aix_ppc.go | 345 - .../golang.org/x/sys/unix/ztypes_aix_ppc64.go | 354 - .../x/sys/unix/ztypes_darwin_386.go | 489 - .../x/sys/unix/ztypes_darwin_amd64.go | 499 - .../x/sys/unix/ztypes_darwin_arm.go | 490 - .../x/sys/unix/ztypes_darwin_arm64.go | 499 - .../x/sys/unix/ztypes_dragonfly_amd64.go | 469 - .../x/sys/unix/ztypes_freebsd_386.go | 536 - .../x/sys/unix/ztypes_freebsd_amd64.go | 539 - .../x/sys/unix/ztypes_freebsd_arm.go | 539 - .../golang.org/x/sys/unix/ztypes_linux_386.go | 1967 --- .../x/sys/unix/ztypes_linux_amd64.go | 1989 --- .../golang.org/x/sys/unix/ztypes_linux_arm.go | 1957 --- .../x/sys/unix/ztypes_linux_arm64.go | 1968 --- .../x/sys/unix/ztypes_linux_mips.go | 1962 --- .../x/sys/unix/ztypes_linux_mips64.go | 1970 --- .../x/sys/unix/ztypes_linux_mips64le.go | 1970 --- .../x/sys/unix/ztypes_linux_mipsle.go | 1962 --- .../x/sys/unix/ztypes_linux_ppc64.go | 1978 --- .../x/sys/unix/ztypes_linux_ppc64le.go | 1978 --- .../x/sys/unix/ztypes_linux_riscv64.go | 1995 --- .../x/sys/unix/ztypes_linux_s390x.go | 1995 --- .../x/sys/unix/ztypes_linux_sparc64.go | 690 - .../x/sys/unix/ztypes_netbsd_386.go | 458 - .../x/sys/unix/ztypes_netbsd_amd64.go | 465 - .../x/sys/unix/ztypes_netbsd_arm.go | 463 - .../x/sys/unix/ztypes_openbsd_386.go | 467 - .../x/sys/unix/ztypes_openbsd_amd64.go | 467 - .../x/sys/unix/ztypes_openbsd_arm.go | 460 - .../x/sys/unix/ztypes_solaris_amd64.go | 442 - vendor/golang.org/x/sys/windows/aliases.go | 13 - .../x/sys/windows/asm_windows_386.s | 13 - .../x/sys/windows/asm_windows_amd64.s | 13 - .../x/sys/windows/asm_windows_arm.s | 11 - .../golang.org/x/sys/windows/dll_windows.go | 378 - .../golang.org/x/sys/windows/env_windows.go | 29 - vendor/golang.org/x/sys/windows/eventlog.go | 20 - .../golang.org/x/sys/windows/exec_windows.go | 97 - .../x/sys/windows/memory_windows.go | 26 - vendor/golang.org/x/sys/windows/mksyscall.go | 7 - vendor/golang.org/x/sys/windows/race.go | 30 - vendor/golang.org/x/sys/windows/race0.go | 25 - .../x/sys/windows/security_windows.go | 478 - vendor/golang.org/x/sys/windows/service.go | 183 - vendor/golang.org/x/sys/windows/str.go | 22 - vendor/golang.org/x/sys/windows/syscall.go | 74 - .../x/sys/windows/syscall_windows.go | 1205 -- .../golang.org/x/sys/windows/types_windows.go | 1469 --- .../x/sys/windows/types_windows_386.go | 22 - .../x/sys/windows/types_windows_amd64.go | 22 - .../x/sys/windows/types_windows_arm.go | 22 - .../x/sys/windows/zsyscall_windows.go | 2700 ---- vendor/golang.org/x/tools/AUTHORS | 3 - vendor/golang.org/x/tools/CONTRIBUTORS | 3 - vendor/golang.org/x/tools/LICENSE | 27 - vendor/golang.org/x/tools/PATENTS | 22 - .../x/tools/go/ast/astutil/enclosing.go | 627 - .../x/tools/go/ast/astutil/imports.go | 471 - .../x/tools/go/ast/astutil/rewrite.go | 477 - .../golang.org/x/tools/go/ast/astutil/util.go | 14 - vendor/golang.org/x/tools/imports/fix.go | 1141 -- vendor/golang.org/x/tools/imports/imports.go | 310 - vendor/golang.org/x/tools/imports/mkindex.go | 173 - vendor/golang.org/x/tools/imports/mkstdlib.go | 108 - .../golang.org/x/tools/imports/sortimports.go | 230 - vendor/golang.org/x/tools/imports/zstdlib.go | 9970 -------------- .../x/tools/internal/fastwalk/fastwalk.go | 191 - .../fastwalk/fastwalk_dirent_fileno.go | 13 - .../internal/fastwalk/fastwalk_dirent_ino.go | 14 - .../internal/fastwalk/fastwalk_portable.go | 29 - .../tools/internal/fastwalk/fastwalk_unix.go | 123 - vendor/modules.txt | 86 - 729 files changed, 217 insertions(+), 262105 deletions(-) delete mode 100644 vendor/github.com/fatih/structs/.gitignore delete mode 100644 vendor/github.com/fatih/structs/.travis.yml delete mode 100644 vendor/github.com/fatih/structs/LICENSE delete mode 100644 vendor/github.com/fatih/structs/README.md delete mode 100644 vendor/github.com/fatih/structs/field.go delete mode 100644 vendor/github.com/fatih/structs/structs.go delete mode 100644 vendor/github.com/fatih/structs/tags.go delete mode 100644 vendor/github.com/gobuffalo/buffalo-plugins/LICENSE delete mode 100644 vendor/github.com/gobuffalo/buffalo-plugins/plugins/command.go delete mode 100644 vendor/github.com/gobuffalo/buffalo-plugins/plugins/plugins.go delete mode 100644 vendor/github.com/gobuffalo/buffalo-plugins/plugins/version.go delete mode 100644 vendor/github.com/gobuffalo/buffalo/LICENSE.txt delete mode 100644 vendor/github.com/gobuffalo/buffalo/meta/app.go delete mode 100644 vendor/github.com/gobuffalo/buffalo/meta/tags.go delete mode 100644 vendor/github.com/gobuffalo/envy/.env delete mode 100644 vendor/github.com/gobuffalo/envy/.gitignore delete mode 100644 vendor/github.com/gobuffalo/envy/.travis.yml delete mode 100644 vendor/github.com/gobuffalo/envy/LICENSE.txt delete mode 100644 vendor/github.com/gobuffalo/envy/README.md delete mode 100644 vendor/github.com/gobuffalo/envy/envy.go delete mode 100644 vendor/github.com/gobuffalo/envy/go.mod delete mode 100644 vendor/github.com/gobuffalo/envy/go.sum delete mode 100644 vendor/github.com/gobuffalo/flect/.gitignore delete mode 100644 vendor/github.com/gobuffalo/flect/.travis.yml delete mode 100644 vendor/github.com/gobuffalo/flect/LICENSE.txt delete mode 100644 vendor/github.com/gobuffalo/flect/README.md delete mode 100644 vendor/github.com/gobuffalo/flect/acronyms.go delete mode 100644 vendor/github.com/gobuffalo/flect/camelize.go delete mode 100644 vendor/github.com/gobuffalo/flect/capitalize.go delete mode 100644 vendor/github.com/gobuffalo/flect/dasherize.go delete mode 100644 vendor/github.com/gobuffalo/flect/flect.go delete mode 100644 vendor/github.com/gobuffalo/flect/go.mod delete mode 100644 vendor/github.com/gobuffalo/flect/go.sum delete mode 100644 vendor/github.com/gobuffalo/flect/ident.go delete mode 100644 vendor/github.com/gobuffalo/flect/lower_upper.go delete mode 100644 vendor/github.com/gobuffalo/flect/name/char.go delete mode 100644 vendor/github.com/gobuffalo/flect/name/file.go delete mode 100644 vendor/github.com/gobuffalo/flect/name/ident.go delete mode 100644 vendor/github.com/gobuffalo/flect/name/join.go delete mode 100644 vendor/github.com/gobuffalo/flect/name/key.go delete mode 100644 vendor/github.com/gobuffalo/flect/name/name.go delete mode 100644 vendor/github.com/gobuffalo/flect/name/os_path.go delete mode 100644 vendor/github.com/gobuffalo/flect/name/package.go delete mode 100644 vendor/github.com/gobuffalo/flect/name/param_id.go delete mode 100644 vendor/github.com/gobuffalo/flect/name/resource.go delete mode 100644 vendor/github.com/gobuffalo/flect/name/tablize.go delete mode 100644 vendor/github.com/gobuffalo/flect/name/url.go delete mode 100644 vendor/github.com/gobuffalo/flect/name/var_case.go delete mode 100644 vendor/github.com/gobuffalo/flect/ordinalize.go delete mode 100644 vendor/github.com/gobuffalo/flect/pascalize.go delete mode 100644 vendor/github.com/gobuffalo/flect/plural_rules.go delete mode 100644 vendor/github.com/gobuffalo/flect/pluralize.go delete mode 100644 vendor/github.com/gobuffalo/flect/rule.go delete mode 100644 vendor/github.com/gobuffalo/flect/singular_rules.go delete mode 100644 vendor/github.com/gobuffalo/flect/singularize.go delete mode 100644 vendor/github.com/gobuffalo/flect/titleize.go delete mode 100644 vendor/github.com/gobuffalo/flect/underscore.go delete mode 100644 vendor/github.com/gobuffalo/genny/.codeclimate.yml delete mode 100644 vendor/github.com/gobuffalo/genny/.gitignore delete mode 100644 vendor/github.com/gobuffalo/genny/.gometalinter.json delete mode 100644 vendor/github.com/gobuffalo/genny/.goreleaser.yml delete mode 100644 vendor/github.com/gobuffalo/genny/.travis.yml delete mode 100644 vendor/github.com/gobuffalo/genny/LICENSE.txt delete mode 100644 vendor/github.com/gobuffalo/genny/Makefile delete mode 100644 vendor/github.com/gobuffalo/genny/README.md delete mode 100644 vendor/github.com/gobuffalo/genny/SHOULDERS.md delete mode 100644 vendor/github.com/gobuffalo/genny/confirm.go delete mode 100644 vendor/github.com/gobuffalo/genny/disk.go delete mode 100644 vendor/github.com/gobuffalo/genny/dry_runner.go delete mode 100644 vendor/github.com/gobuffalo/genny/file.go delete mode 100644 vendor/github.com/gobuffalo/genny/force.go delete mode 100644 vendor/github.com/gobuffalo/genny/generator.go delete mode 100644 vendor/github.com/gobuffalo/genny/go.mod delete mode 100644 vendor/github.com/gobuffalo/genny/go.sum delete mode 100644 vendor/github.com/gobuffalo/genny/group.go delete mode 100644 vendor/github.com/gobuffalo/genny/helpers.go delete mode 100644 vendor/github.com/gobuffalo/genny/logger.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/attrs/attrs.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/attrs/named_attrs.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/attrs/parse.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/add_import.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/add_inside_block.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/append.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/change_import.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/files.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/fmt.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/get.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/goimports/LICENSE delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/goimports/README.md delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/goimports/goimports.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/gomods/gomods.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/gomods/init.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/gomods/tidy.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/gotools.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/package.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/parsed_file.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/replace_block_body.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/gotools/templates.go delete mode 100644 vendor/github.com/gobuffalo/genny/movinglater/plushgen/plush.go delete mode 100644 vendor/github.com/gobuffalo/genny/replacer.go delete mode 100644 vendor/github.com/gobuffalo/genny/results.go delete mode 100644 vendor/github.com/gobuffalo/genny/runner.go delete mode 100644 vendor/github.com/gobuffalo/genny/transformer.go delete mode 100644 vendor/github.com/gobuffalo/genny/version.go delete mode 100644 vendor/github.com/gobuffalo/genny/wet_runner.go delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/.gometalinter.json delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/.travis.yml delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/Makefile delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/README.md delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/go.mod delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/go.sum delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/.gitignore delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/.travis.yml delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/LICENSE.txt delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/README.md delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/block.go delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/doc.go delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/html.go delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/inline.go delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/latex.go delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/markdown.go delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/smartypants.go delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/main.go delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/shoulders.md delete mode 100644 vendor/github.com/gobuffalo/github_flavored_markdown/version.go delete mode 100644 vendor/github.com/gobuffalo/packr/.codeclimate.yml delete mode 100644 vendor/github.com/gobuffalo/packr/.gitignore delete mode 100644 vendor/github.com/gobuffalo/packr/.goreleaser.yml delete mode 100644 vendor/github.com/gobuffalo/packr/.travis.yml delete mode 100644 vendor/github.com/gobuffalo/packr/LICENSE.txt delete mode 100644 vendor/github.com/gobuffalo/packr/Makefile delete mode 100644 vendor/github.com/gobuffalo/packr/README.md delete mode 100644 vendor/github.com/gobuffalo/packr/box.go delete mode 100644 vendor/github.com/gobuffalo/packr/env.go delete mode 100644 vendor/github.com/gobuffalo/packr/file.go delete mode 100644 vendor/github.com/gobuffalo/packr/file_info.go delete mode 100644 vendor/github.com/gobuffalo/packr/go.mod delete mode 100644 vendor/github.com/gobuffalo/packr/go.sum delete mode 100644 vendor/github.com/gobuffalo/packr/packr.go delete mode 100644 vendor/github.com/gobuffalo/packr/physical_file.go delete mode 100644 vendor/github.com/gobuffalo/packr/shoulders.md delete mode 100644 vendor/github.com/gobuffalo/packr/version.go delete mode 100644 vendor/github.com/gobuffalo/packr/virtual_file.go delete mode 100644 vendor/github.com/gobuffalo/packr/walk.go delete mode 100644 vendor/github.com/gobuffalo/plush/.codeclimate.yml delete mode 100644 vendor/github.com/gobuffalo/plush/.gitignore delete mode 100644 vendor/github.com/gobuffalo/plush/.travis.yml delete mode 100644 vendor/github.com/gobuffalo/plush/LICENSE.txt delete mode 100644 vendor/github.com/gobuffalo/plush/README.md delete mode 100644 vendor/github.com/gobuffalo/plush/ast/array_literal.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/assign_expression.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/ast.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/block_statement.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/boolean.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/call_expression.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/expression_statement.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/float_literal.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/for_expression.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/function_literal.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/hash_literal.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/html_literal.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/identifier.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/if_expression.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/index_expression.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/infix_expression.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/integer_literal.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/let_statement.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/prefix_expression.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/program.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/return_statement.go delete mode 100644 vendor/github.com/gobuffalo/plush/ast/string_literal.go delete mode 100644 vendor/github.com/gobuffalo/plush/compiler.go delete mode 100644 vendor/github.com/gobuffalo/plush/content_helper.go delete mode 100644 vendor/github.com/gobuffalo/plush/context.go delete mode 100644 vendor/github.com/gobuffalo/plush/forms.go delete mode 100644 vendor/github.com/gobuffalo/plush/helper_map.go delete mode 100644 vendor/github.com/gobuffalo/plush/helpers.go delete mode 100644 vendor/github.com/gobuffalo/plush/iterators.go delete mode 100644 vendor/github.com/gobuffalo/plush/lexer/lexer.go delete mode 100644 vendor/github.com/gobuffalo/plush/markdown_helper.go delete mode 100644 vendor/github.com/gobuffalo/plush/parser/errors.go delete mode 100644 vendor/github.com/gobuffalo/plush/parser/parser.go delete mode 100644 vendor/github.com/gobuffalo/plush/parser/precedences.go delete mode 100644 vendor/github.com/gobuffalo/plush/plush.go delete mode 100644 vendor/github.com/gobuffalo/plush/template.go delete mode 100644 vendor/github.com/gobuffalo/plush/token/const.go delete mode 100644 vendor/github.com/gobuffalo/plush/token/token.go delete mode 100644 vendor/github.com/gobuffalo/plush/user_function.go delete mode 100644 vendor/github.com/gobuffalo/tags/.gitignore delete mode 100644 vendor/github.com/gobuffalo/tags/.travis.yml delete mode 100644 vendor/github.com/gobuffalo/tags/LICENSE.txt delete mode 100644 vendor/github.com/gobuffalo/tags/README.md delete mode 100644 vendor/github.com/gobuffalo/tags/form/bootstrap/common.go delete mode 100644 vendor/github.com/gobuffalo/tags/form/bootstrap/form.go delete mode 100644 vendor/github.com/gobuffalo/tags/form/bootstrap/form_for.go delete mode 100644 vendor/github.com/gobuffalo/tags/form/checkbox_tag.go delete mode 100644 vendor/github.com/gobuffalo/tags/form/file_tag.go delete mode 100644 vendor/github.com/gobuffalo/tags/form/form.go delete mode 100644 vendor/github.com/gobuffalo/tags/form/form_for.go delete mode 100644 vendor/github.com/gobuffalo/tags/form/input_tag.go delete mode 100644 vendor/github.com/gobuffalo/tags/form/radio_button_tag.go delete mode 100644 vendor/github.com/gobuffalo/tags/form/select_options.go delete mode 100644 vendor/github.com/gobuffalo/tags/form/select_tag.go delete mode 100644 vendor/github.com/gobuffalo/tags/form/selectable.go delete mode 100644 vendor/github.com/gobuffalo/tags/form/submit_tag.go delete mode 100644 vendor/github.com/gobuffalo/tags/form/text_area_tag.go delete mode 100644 vendor/github.com/gobuffalo/tags/misc.go delete mode 100644 vendor/github.com/gobuffalo/tags/options.go delete mode 100644 vendor/github.com/gobuffalo/tags/pagination.go delete mode 100644 vendor/github.com/gobuffalo/tags/shoulders.md delete mode 100644 vendor/github.com/gobuffalo/tags/tag.go delete mode 100644 vendor/github.com/gobuffalo/tags/version.go delete mode 100644 vendor/github.com/gobuffalo/uuid/.travis.yml delete mode 100644 vendor/github.com/gobuffalo/uuid/LICENSE delete mode 100644 vendor/github.com/gobuffalo/uuid/README.md delete mode 100644 vendor/github.com/gobuffalo/uuid/codec.go delete mode 100644 vendor/github.com/gobuffalo/uuid/generator.go delete mode 100644 vendor/github.com/gobuffalo/uuid/sql.go delete mode 100644 vendor/github.com/gobuffalo/uuid/uuid.go delete mode 100644 vendor/github.com/gobuffalo/validate/.gitignore delete mode 100644 vendor/github.com/gobuffalo/validate/.travis.yml delete mode 100644 vendor/github.com/gobuffalo/validate/LICENSE.txt delete mode 100644 vendor/github.com/gobuffalo/validate/README.md delete mode 100644 vendor/github.com/gobuffalo/validate/validate.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/bytes_are_present.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/common.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/email_is_present.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/func_validator.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/int_array_is_present.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/int_is_greater_than.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/int_is_less_than.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/int_is_present.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/regex_match.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/string_inclusion.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/string_is_present.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/string_length_in_range.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/strings_match.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/time_after_time.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/time_is_before_time.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/time_is_present.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/url_is_present.go delete mode 100644 vendor/github.com/gobuffalo/validate/validators/uuid_is_present.go delete mode 100644 vendor/github.com/inconshreveable/mousetrap/LICENSE delete mode 100644 vendor/github.com/inconshreveable/mousetrap/README.md delete mode 100644 vendor/github.com/inconshreveable/mousetrap/trap_others.go delete mode 100644 vendor/github.com/inconshreveable/mousetrap/trap_windows.go delete mode 100644 vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go delete mode 100644 vendor/github.com/joho/godotenv/.gitignore delete mode 100644 vendor/github.com/joho/godotenv/.travis.yml delete mode 100644 vendor/github.com/joho/godotenv/LICENCE delete mode 100644 vendor/github.com/joho/godotenv/README.md delete mode 100644 vendor/github.com/joho/godotenv/godotenv.go delete mode 100644 vendor/github.com/konsorten/go-windows-terminal-sequences/README.md delete mode 100644 vendor/github.com/konsorten/go-windows-terminal-sequences/license delete mode 100644 vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go delete mode 100644 vendor/github.com/markbates/inflect/.gitignore delete mode 100644 vendor/github.com/markbates/inflect/.gometalinter.json delete mode 100644 vendor/github.com/markbates/inflect/.hgignore delete mode 100644 vendor/github.com/markbates/inflect/.travis.yml delete mode 100644 vendor/github.com/markbates/inflect/LICENCE delete mode 100644 vendor/github.com/markbates/inflect/Makefile delete mode 100644 vendor/github.com/markbates/inflect/README.md delete mode 100644 vendor/github.com/markbates/inflect/go.mod delete mode 100644 vendor/github.com/markbates/inflect/go.sum delete mode 100644 vendor/github.com/markbates/inflect/helpers.go delete mode 100644 vendor/github.com/markbates/inflect/inflect.go delete mode 100644 vendor/github.com/markbates/inflect/inflections.json delete mode 100644 vendor/github.com/markbates/inflect/name.go delete mode 100644 vendor/github.com/markbates/inflect/shoulders.md delete mode 100644 vendor/github.com/markbates/inflect/version.go delete mode 100644 vendor/github.com/markbates/oncer/.gitignore delete mode 100644 vendor/github.com/markbates/oncer/LICENSE delete mode 100644 vendor/github.com/markbates/oncer/Makefile delete mode 100644 vendor/github.com/markbates/oncer/deprecate.go delete mode 100644 vendor/github.com/markbates/oncer/go.mod delete mode 100644 vendor/github.com/markbates/oncer/go.sum delete mode 100644 vendor/github.com/markbates/oncer/oncer.go delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/.coveralls.yml delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/.travis.yml delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/CONTRIBUTING.md delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/CREDITS.md delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/LICENSE.md delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/Makefile delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/README.md delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/doc.go delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/helpers.go delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/policies.go delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/policy.go delete mode 100644 vendor/github.com/microcosm-cc/bluemonday/sanitize.go delete mode 100644 vendor/github.com/serenize/snaker/.travis.yml delete mode 100644 vendor/github.com/serenize/snaker/LICENSE.txt delete mode 100644 vendor/github.com/serenize/snaker/README.md delete mode 100644 vendor/github.com/serenize/snaker/snaker.go delete mode 100644 vendor/github.com/sergi/go-diff/AUTHORS delete mode 100644 vendor/github.com/sergi/go-diff/CONTRIBUTORS delete mode 100644 vendor/github.com/sergi/go-diff/LICENSE delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/diffmatchpatch.go delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/match.go delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/mathutil.go delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/patch.go delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go delete mode 100644 vendor/github.com/shurcooL/highlight_diff/.travis.yml delete mode 100644 vendor/github.com/shurcooL/highlight_diff/README.md delete mode 100644 vendor/github.com/shurcooL/highlight_diff/main.go delete mode 100644 vendor/github.com/shurcooL/highlight_go/.travis.yml delete mode 100644 vendor/github.com/shurcooL/highlight_go/README.md delete mode 100644 vendor/github.com/shurcooL/highlight_go/main.go delete mode 100644 vendor/github.com/shurcooL/octicon/.travis.yml delete mode 100644 vendor/github.com/shurcooL/octicon/README.md delete mode 100644 vendor/github.com/shurcooL/octicon/doc.go delete mode 100644 vendor/github.com/shurcooL/octicon/generate.go delete mode 100644 vendor/github.com/shurcooL/octicon/octicon.go delete mode 100644 vendor/github.com/shurcooL/sanitized_anchor_name/.travis.yml delete mode 100644 vendor/github.com/shurcooL/sanitized_anchor_name/LICENSE delete mode 100644 vendor/github.com/shurcooL/sanitized_anchor_name/README.md delete mode 100644 vendor/github.com/shurcooL/sanitized_anchor_name/main.go delete mode 100644 vendor/github.com/sirupsen/logrus/.gitignore delete mode 100644 vendor/github.com/sirupsen/logrus/.travis.yml delete mode 100644 vendor/github.com/sirupsen/logrus/CHANGELOG.md delete mode 100644 vendor/github.com/sirupsen/logrus/LICENSE delete mode 100644 vendor/github.com/sirupsen/logrus/README.md delete mode 100644 vendor/github.com/sirupsen/logrus/alt_exit.go delete mode 100644 vendor/github.com/sirupsen/logrus/appveyor.yml delete mode 100644 vendor/github.com/sirupsen/logrus/doc.go delete mode 100644 vendor/github.com/sirupsen/logrus/entry.go delete mode 100644 vendor/github.com/sirupsen/logrus/exported.go delete mode 100644 vendor/github.com/sirupsen/logrus/formatter.go delete mode 100644 vendor/github.com/sirupsen/logrus/go.mod delete mode 100644 vendor/github.com/sirupsen/logrus/go.sum delete mode 100644 vendor/github.com/sirupsen/logrus/hooks.go delete mode 100644 vendor/github.com/sirupsen/logrus/json_formatter.go delete mode 100644 vendor/github.com/sirupsen/logrus/logger.go delete mode 100644 vendor/github.com/sirupsen/logrus/logrus.go delete mode 100644 vendor/github.com/sirupsen/logrus/terminal_appengine.go delete mode 100644 vendor/github.com/sirupsen/logrus/terminal_bsd.go delete mode 100644 vendor/github.com/sirupsen/logrus/terminal_check_appengine.go delete mode 100644 vendor/github.com/sirupsen/logrus/terminal_check_js.go delete mode 100644 vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go delete mode 100644 vendor/github.com/sirupsen/logrus/terminal_check_windows.go delete mode 100644 vendor/github.com/sirupsen/logrus/terminal_linux.go delete mode 100644 vendor/github.com/sirupsen/logrus/terminal_windows.go delete mode 100644 vendor/github.com/sirupsen/logrus/text_formatter.go delete mode 100644 vendor/github.com/sirupsen/logrus/writer.go delete mode 100644 vendor/github.com/sourcegraph/annotate/.travis.yml delete mode 100644 vendor/github.com/sourcegraph/annotate/LICENSE delete mode 100644 vendor/github.com/sourcegraph/annotate/Makefile delete mode 100644 vendor/github.com/sourcegraph/annotate/README.md delete mode 100644 vendor/github.com/sourcegraph/annotate/annotate.go delete mode 100644 vendor/github.com/sourcegraph/annotate/benchmark.txt delete mode 100644 vendor/github.com/sourcegraph/syntaxhighlight/.travis.yml delete mode 100644 vendor/github.com/sourcegraph/syntaxhighlight/LICENSE delete mode 100644 vendor/github.com/sourcegraph/syntaxhighlight/Makefile delete mode 100644 vendor/github.com/sourcegraph/syntaxhighlight/README.md delete mode 100644 vendor/github.com/sourcegraph/syntaxhighlight/benchmark.txt delete mode 100644 vendor/github.com/sourcegraph/syntaxhighlight/highlight.go delete mode 100644 vendor/github.com/sourcegraph/syntaxhighlight/keywords.go delete mode 100644 vendor/github.com/sourcegraph/syntaxhighlight/kind_gostring.go delete mode 100644 vendor/github.com/spf13/cobra/.gitignore delete mode 100644 vendor/github.com/spf13/cobra/.mailmap delete mode 100644 vendor/github.com/spf13/cobra/.travis.yml delete mode 100644 vendor/github.com/spf13/cobra/LICENSE.txt delete mode 100644 vendor/github.com/spf13/cobra/README.md delete mode 100644 vendor/github.com/spf13/cobra/args.go delete mode 100644 vendor/github.com/spf13/cobra/bash_completions.go delete mode 100644 vendor/github.com/spf13/cobra/bash_completions.md delete mode 100644 vendor/github.com/spf13/cobra/cobra.go delete mode 100644 vendor/github.com/spf13/cobra/command.go delete mode 100644 vendor/github.com/spf13/cobra/command_notwin.go delete mode 100644 vendor/github.com/spf13/cobra/command_win.go delete mode 100644 vendor/github.com/spf13/cobra/zsh_completions.go delete mode 100644 vendor/github.com/spf13/pflag/.gitignore delete mode 100644 vendor/github.com/spf13/pflag/.travis.yml delete mode 100644 vendor/github.com/spf13/pflag/LICENSE delete mode 100644 vendor/github.com/spf13/pflag/README.md delete mode 100644 vendor/github.com/spf13/pflag/bool.go delete mode 100644 vendor/github.com/spf13/pflag/bool_slice.go delete mode 100644 vendor/github.com/spf13/pflag/bytes.go delete mode 100644 vendor/github.com/spf13/pflag/count.go delete mode 100644 vendor/github.com/spf13/pflag/duration.go delete mode 100644 vendor/github.com/spf13/pflag/duration_slice.go delete mode 100644 vendor/github.com/spf13/pflag/flag.go delete mode 100644 vendor/github.com/spf13/pflag/float32.go delete mode 100644 vendor/github.com/spf13/pflag/float64.go delete mode 100644 vendor/github.com/spf13/pflag/golangflag.go delete mode 100644 vendor/github.com/spf13/pflag/int.go delete mode 100644 vendor/github.com/spf13/pflag/int16.go delete mode 100644 vendor/github.com/spf13/pflag/int32.go delete mode 100644 vendor/github.com/spf13/pflag/int64.go delete mode 100644 vendor/github.com/spf13/pflag/int8.go delete mode 100644 vendor/github.com/spf13/pflag/int_slice.go delete mode 100644 vendor/github.com/spf13/pflag/ip.go delete mode 100644 vendor/github.com/spf13/pflag/ip_slice.go delete mode 100644 vendor/github.com/spf13/pflag/ipmask.go delete mode 100644 vendor/github.com/spf13/pflag/ipnet.go delete mode 100644 vendor/github.com/spf13/pflag/string.go delete mode 100644 vendor/github.com/spf13/pflag/string_array.go delete mode 100644 vendor/github.com/spf13/pflag/string_slice.go delete mode 100644 vendor/github.com/spf13/pflag/uint.go delete mode 100644 vendor/github.com/spf13/pflag/uint16.go delete mode 100644 vendor/github.com/spf13/pflag/uint32.go delete mode 100644 vendor/github.com/spf13/pflag/uint64.go delete mode 100644 vendor/github.com/spf13/pflag/uint8.go delete mode 100644 vendor/github.com/spf13/pflag/uint_slice.go delete mode 100644 vendor/golang.org/x/crypto/AUTHORS delete mode 100644 vendor/golang.org/x/crypto/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/crypto/LICENSE delete mode 100644 vendor/golang.org/x/crypto/PATENTS delete mode 100644 vendor/golang.org/x/crypto/ssh/terminal/terminal.go delete mode 100644 vendor/golang.org/x/crypto/ssh/terminal/util.go delete mode 100644 vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go delete mode 100644 vendor/golang.org/x/crypto/ssh/terminal/util_linux.go delete mode 100644 vendor/golang.org/x/crypto/ssh/terminal/util_plan9.go delete mode 100644 vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go delete mode 100644 vendor/golang.org/x/crypto/ssh/terminal/util_windows.go delete mode 100644 vendor/golang.org/x/net/AUTHORS delete mode 100644 vendor/golang.org/x/net/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/net/LICENSE delete mode 100644 vendor/golang.org/x/net/PATENTS delete mode 100644 vendor/golang.org/x/net/html/atom/atom.go delete mode 100644 vendor/golang.org/x/net/html/atom/gen.go delete mode 100644 vendor/golang.org/x/net/html/atom/table.go delete mode 100644 vendor/golang.org/x/net/html/const.go delete mode 100644 vendor/golang.org/x/net/html/doc.go delete mode 100644 vendor/golang.org/x/net/html/doctype.go delete mode 100644 vendor/golang.org/x/net/html/entity.go delete mode 100644 vendor/golang.org/x/net/html/escape.go delete mode 100644 vendor/golang.org/x/net/html/foreign.go delete mode 100644 vendor/golang.org/x/net/html/node.go delete mode 100644 vendor/golang.org/x/net/html/parse.go delete mode 100644 vendor/golang.org/x/net/html/render.go delete mode 100644 vendor/golang.org/x/net/html/token.go delete mode 100644 vendor/golang.org/x/sys/AUTHORS delete mode 100644 vendor/golang.org/x/sys/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/sys/LICENSE delete mode 100644 vendor/golang.org/x/sys/PATENTS delete mode 100644 vendor/golang.org/x/sys/unix/.gitignore delete mode 100644 vendor/golang.org/x/sys/unix/README.md delete mode 100644 vendor/golang.org/x/sys/unix/affinity_linux.go delete mode 100644 vendor/golang.org/x/sys/unix/aliases.go delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_arm.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_arm64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_freebsd_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_freebsd_arm.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_linux_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_linux_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_linux_arm.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_linux_arm64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_linux_mips64x.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_linux_mipsx.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_linux_s390x.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_netbsd_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_netbsd_arm.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_openbsd_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_openbsd_arm.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_solaris_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/bluetooth_linux.go delete mode 100644 vendor/golang.org/x/sys/unix/cap_freebsd.go delete mode 100644 vendor/golang.org/x/sys/unix/constants.go delete mode 100644 vendor/golang.org/x/sys/unix/dev_aix_ppc.go delete mode 100644 vendor/golang.org/x/sys/unix/dev_aix_ppc64.go delete mode 100644 vendor/golang.org/x/sys/unix/dev_darwin.go delete mode 100644 vendor/golang.org/x/sys/unix/dev_dragonfly.go delete mode 100644 vendor/golang.org/x/sys/unix/dev_freebsd.go delete mode 100644 vendor/golang.org/x/sys/unix/dev_linux.go delete mode 100644 vendor/golang.org/x/sys/unix/dev_netbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/dev_openbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/dirent.go delete mode 100644 vendor/golang.org/x/sys/unix/endian_big.go delete mode 100644 vendor/golang.org/x/sys/unix/endian_little.go delete mode 100644 vendor/golang.org/x/sys/unix/env_unix.go delete mode 100644 vendor/golang.org/x/sys/unix/errors_freebsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/errors_freebsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/fcntl.go delete mode 100644 vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go delete mode 100644 vendor/golang.org/x/sys/unix/gccgo.go delete mode 100644 vendor/golang.org/x/sys/unix/gccgo_c.c delete mode 100644 vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/ioctl.go delete mode 100644 vendor/golang.org/x/sys/unix/mkall.sh delete mode 100644 vendor/golang.org/x/sys/unix/mkerrors.sh delete mode 100644 vendor/golang.org/x/sys/unix/mkpost.go delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall.pl delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall_aix.pl delete mode 100644 vendor/golang.org/x/sys/unix/mksyscall_solaris.pl delete mode 100644 vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl delete mode 100644 vendor/golang.org/x/sys/unix/mksysnum_darwin.pl delete mode 100644 vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl delete mode 100644 vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl delete mode 100644 vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl delete mode 100644 vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl delete mode 100644 vendor/golang.org/x/sys/unix/openbsd_pledge.go delete mode 100644 vendor/golang.org/x/sys/unix/pagesize_unix.go delete mode 100644 vendor/golang.org/x/sys/unix/race.go delete mode 100644 vendor/golang.org/x/sys/unix/race0.go delete mode 100644 vendor/golang.org/x/sys/unix/sockcmsg_linux.go delete mode 100644 vendor/golang.org/x/sys/unix/sockcmsg_unix.go delete mode 100644 vendor/golang.org/x/sys/unix/str.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_aix.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_aix_ppc.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_bsd.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_386.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_dragonfly.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_freebsd.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_freebsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_386.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_arm64.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_gc.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_s390x.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_netbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_netbsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_solaris.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_unix.go delete mode 100644 vendor/golang.org/x/sys/unix/syscall_unix_gc.go delete mode 100644 vendor/golang.org/x/sys/unix/timestruct.go delete mode 100644 vendor/golang.org/x/sys/unix/types_aix.go delete mode 100644 vendor/golang.org/x/sys/unix/types_darwin.go delete mode 100644 vendor/golang.org/x/sys/unix/types_dragonfly.go delete mode 100644 vendor/golang.org/x/sys/unix/types_freebsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_netbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_openbsd.go delete mode 100644 vendor/golang.org/x/sys/unix/types_solaris.go delete mode 100644 vendor/golang.org/x/sys/unix/xattr_bsd.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_darwin_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_mips.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zptrace386_linux.go delete mode 100644 vendor/golang.org/x/sys/unix/zptracearm_linux.go delete mode 100644 vendor/golang.org/x/sys/unix/zptracemips_linux.go delete mode 100644 vendor/golang.org/x/sys/unix/zptracemipsle_linux.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_darwin_386.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_386.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_mips.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go delete mode 100644 vendor/golang.org/x/sys/windows/aliases.go delete mode 100644 vendor/golang.org/x/sys/windows/asm_windows_386.s delete mode 100644 vendor/golang.org/x/sys/windows/asm_windows_amd64.s delete mode 100644 vendor/golang.org/x/sys/windows/asm_windows_arm.s delete mode 100644 vendor/golang.org/x/sys/windows/dll_windows.go delete mode 100644 vendor/golang.org/x/sys/windows/env_windows.go delete mode 100644 vendor/golang.org/x/sys/windows/eventlog.go delete mode 100644 vendor/golang.org/x/sys/windows/exec_windows.go delete mode 100644 vendor/golang.org/x/sys/windows/memory_windows.go delete mode 100644 vendor/golang.org/x/sys/windows/mksyscall.go delete mode 100644 vendor/golang.org/x/sys/windows/race.go delete mode 100644 vendor/golang.org/x/sys/windows/race0.go delete mode 100644 vendor/golang.org/x/sys/windows/security_windows.go delete mode 100644 vendor/golang.org/x/sys/windows/service.go delete mode 100644 vendor/golang.org/x/sys/windows/str.go delete mode 100644 vendor/golang.org/x/sys/windows/syscall.go delete mode 100644 vendor/golang.org/x/sys/windows/syscall_windows.go delete mode 100644 vendor/golang.org/x/sys/windows/types_windows.go delete mode 100644 vendor/golang.org/x/sys/windows/types_windows_386.go delete mode 100644 vendor/golang.org/x/sys/windows/types_windows_amd64.go delete mode 100644 vendor/golang.org/x/sys/windows/types_windows_arm.go delete mode 100644 vendor/golang.org/x/sys/windows/zsyscall_windows.go delete mode 100644 vendor/golang.org/x/tools/AUTHORS delete mode 100644 vendor/golang.org/x/tools/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/tools/LICENSE delete mode 100644 vendor/golang.org/x/tools/PATENTS delete mode 100644 vendor/golang.org/x/tools/go/ast/astutil/enclosing.go delete mode 100644 vendor/golang.org/x/tools/go/ast/astutil/imports.go delete mode 100644 vendor/golang.org/x/tools/go/ast/astutil/rewrite.go delete mode 100644 vendor/golang.org/x/tools/go/ast/astutil/util.go delete mode 100644 vendor/golang.org/x/tools/imports/fix.go delete mode 100644 vendor/golang.org/x/tools/imports/imports.go delete mode 100644 vendor/golang.org/x/tools/imports/mkindex.go delete mode 100644 vendor/golang.org/x/tools/imports/mkstdlib.go delete mode 100644 vendor/golang.org/x/tools/imports/sortimports.go delete mode 100644 vendor/golang.org/x/tools/imports/zstdlib.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go delete mode 100644 vendor/modules.txt diff --git a/cmd/auth.go b/cmd/auth.go index 3565ef7..e87b33f 100644 --- a/cmd/auth.go +++ b/cmd/auth.go @@ -5,7 +5,7 @@ import ( "github.com/gobuffalo/buffalo-auth/genny/auth" "github.com/gobuffalo/genny" - "github.com/gobuffalo/genny/movinglater/gotools" + "github.com/gobuffalo/gogen" "github.com/spf13/cobra" ) @@ -25,7 +25,7 @@ var authCmd = &cobra.Command{ return err } - if err := r.WithNew(gotools.GoFmt(r.Root)); err != nil { + if err := r.WithNew(gogen.Fmt(r.Root)); err != nil { return err } diff --git a/genny/auth/auth.go b/genny/auth/auth.go index 046701a..5fa959a 100644 --- a/genny/auth/auth.go +++ b/genny/auth/auth.go @@ -6,13 +6,13 @@ import ( "strings" "time" + "github.com/gobuffalo/attrs" "github.com/gobuffalo/genny" - "github.com/gobuffalo/genny/movinglater/attrs" - "github.com/gobuffalo/genny/movinglater/gotools" - "github.com/gobuffalo/genny/movinglater/plushgen" + "github.com/gobuffalo/gogen" "github.com/gobuffalo/meta" "github.com/gobuffalo/packr" "github.com/gobuffalo/plush" + "github.com/gobuffalo/plushgen" "github.com/pkg/errors" ) @@ -71,7 +71,7 @@ func New(args []string) (*genny.Generator, error) { return err } - gf, err = gotools.AddInsideBlock( + gf, err = gogen.AddInsideBlock( gf, `if app == nil {`, `app.Use(SetCurrentUser)`, diff --git a/go.mod b/go.mod index 7eb5761..446d3c0 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,20 @@ module github.com/gobuffalo/buffalo-auth require ( - github.com/gobuffalo/buffalo-plugins v1.11.0 - github.com/gobuffalo/genny v0.0.0-20190112155932-f31a84fcacf5 - github.com/gobuffalo/meta v0.0.0-20181127070345-0d7e59dd540b - github.com/gobuffalo/packr v1.21.9 - github.com/gobuffalo/packr/v2 v2.0.0-rc.14 - github.com/gobuffalo/plush v3.7.32+incompatible + github.com/fatih/structs v1.1.0 // indirect + github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd + github.com/gobuffalo/buffalo-plugins v1.13.0 + github.com/gobuffalo/genny v0.0.0-20190219203444-c95082806342 + github.com/gobuffalo/github_flavored_markdown v1.0.7 // indirect + github.com/gobuffalo/gogen v0.0.0-20190224213239-1c6076128bbc + github.com/gobuffalo/meta v0.0.0-20190207205153-50a99e08b8cf + github.com/gobuffalo/packr v1.22.0 + github.com/gobuffalo/packr/v2 v2.0.1 + github.com/gobuffalo/plush v3.7.33+incompatible + github.com/gobuffalo/plushgen v0.0.0-20190224160205-347ea233336e + github.com/gobuffalo/uuid v2.0.5+incompatible // indirect + github.com/gobuffalo/validate v2.0.3+incompatible // indirect github.com/pkg/errors v0.8.1 + github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 // indirect github.com/spf13/cobra v0.0.3 ) diff --git a/go.sum b/go.sum index 6549271..78e47e0 100644 --- a/go.sum +++ b/go.sum @@ -1,23 +1,46 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.36.0/go.mod h1:RUoy9p/M4ge0HzT8L+SDZ8jg+Q6fth0CiBuhFJpSV40= +dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= +dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= +dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= +dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= +git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/ajg/form v0.0.0-20160822230020-523a5da1a92f/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2iZY63YTKWo0= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dustin/go-humanize v0.0.0-20180713052910-9f541cc9db5d/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/gobuffalo/attrs v0.0.0-20190219185331-f338c9388485/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd h1:hSkbZ9XSyjyBirMeqSqUrK+9HboWrweVlzRNqoBi2d4= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/buffalo v0.12.8-0.20181004233540-fac9bb505aa8/go.mod h1:sLyT7/dceRXJUxSsE813JTQtA3Eb1vjxWfo/N//vXIY= github.com/gobuffalo/buffalo v0.13.0/go.mod h1:Mjn1Ba9wpIbpbrD+lIDMy99pQ0H0LiddMIIDGse7qT4= github.com/gobuffalo/buffalo-plugins v1.0.2/go.mod h1:pOp/uF7X3IShFHyobahTkTLZaeUXwb0GrUTb9ngJWTs= @@ -33,9 +56,12 @@ github.com/gobuffalo/buffalo-plugins v1.8.2/go.mod h1:9te6/VjEQ7pKp7lXlDIMqzxgGp github.com/gobuffalo/buffalo-plugins v1.8.3/go.mod h1:IAWq6vjZJVXebIq2qGTLOdlXzmpyTZ5iJG5b59fza5U= github.com/gobuffalo/buffalo-plugins v1.9.4/go.mod h1:grCV6DGsQlVzQwk6XdgcL3ZPgLm9BVxlBmXPMF8oBHI= github.com/gobuffalo/buffalo-plugins v1.10.0/go.mod h1:4osg8d9s60txLuGwXnqH+RCjPHj9K466cDFRl3PErHI= -github.com/gobuffalo/buffalo-plugins v1.11.0 h1:yZ6USaSdAKpogRS8DZJgeG7/CTPGmyhplwifphmmegw= github.com/gobuffalo/buffalo-plugins v1.11.0/go.mod h1:rtIvAYRjYibgmWhnjKmo7OadtnxuMG5ZQLr25ozAzjg= +github.com/gobuffalo/buffalo-plugins v1.12.0/go.mod h1:kw4Mj2vQXqe4X5TI36PEQgswbL30heGQwJEeDKd1v+4= +github.com/gobuffalo/buffalo-plugins v1.13.0 h1:clD8gJTpT1OGizjYbqDFjtqKSvK5D4PcmiIVHU/lLLw= +github.com/gobuffalo/buffalo-plugins v1.13.0/go.mod h1:Y9nH2VwHVkeKhmdM380ulNXmhhD5On81nRVeD+WlDTQ= github.com/gobuffalo/buffalo-pop v1.0.5/go.mod h1:Fw/LfFDnSmB/vvQXPvcXEjzP98Tc+AudyNWUBWKCwQ8= +github.com/gobuffalo/depgen v0.0.0-20190219190223-ba8c93fa0c2c/go.mod h1:CE/HUV4vDCXtJayRf6WoMWgezb1yH4QHg8GNK8FL0JI= github.com/gobuffalo/envy v1.6.4/go.mod h1:Abh+Jfw475/NWtYMEt+hnJWRiC8INKWibIMyNt1w2Mc= github.com/gobuffalo/envy v1.6.5/go.mod h1:N+GkhhZ/93bGZc6ZKhJLP6+m+tCNPKwgSpH9kaifseQ= github.com/gobuffalo/envy v1.6.6/go.mod h1:N+GkhhZ/93bGZc6ZKhJLP6+m+tCNPKwgSpH9kaifseQ= @@ -44,6 +70,10 @@ github.com/gobuffalo/envy v1.6.8/go.mod h1:N+GkhhZ/93bGZc6ZKhJLP6+m+tCNPKwgSpH9k github.com/gobuffalo/envy v1.6.9/go.mod h1:N+GkhhZ/93bGZc6ZKhJLP6+m+tCNPKwgSpH9kaifseQ= github.com/gobuffalo/envy v1.6.10/go.mod h1:X0CFllQjTV5ogsnUrg+Oks2yTI+PU2dGYBJOEI2D1Uo= github.com/gobuffalo/envy v1.6.11/go.mod h1:Fiq52W7nrHGDggFPhn2ZCcHw4u/rqXkqo+i7FB6EAcg= +github.com/gobuffalo/envy v1.6.12/go.mod h1:qJNrJhKkZpEW0glh5xP2syQHH5kgdmgsKss2Kk8PTP0= +github.com/gobuffalo/envy v1.6.13/go.mod h1:w9DJppgl51JwUFWWd/M/6/otrPtWV3WYMa+NNLunqKA= +github.com/gobuffalo/envy v1.6.15 h1:OsV5vOpHYUpP7ZLS6sem1y40/lNX1BZj+ynMiRi21lQ= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= github.com/gobuffalo/events v1.0.3/go.mod h1:Txo8WmqScapa7zimEQIwgiJBvMECMe9gJjsKNPN3uZw= github.com/gobuffalo/events v1.0.7/go.mod h1:z8txf6H9jWhQ5Scr7YPLWg/cgXBRj8Q4uYI+rsVCCSQ= github.com/gobuffalo/events v1.0.8/go.mod h1:A5KyqT1sA+3GJiBE4QKZibse9mtOcI9nw8gGrDdqYGs= @@ -52,8 +82,9 @@ github.com/gobuffalo/events v1.1.4/go.mod h1:09/YRRgZHEOts5Isov+g9X2xajxdvOAcUuA github.com/gobuffalo/events v1.1.5/go.mod h1:3YUSzgHfYctSjEjLCWbkXP6djH2M+MLaVRzb4ymbAK0= github.com/gobuffalo/events v1.1.7/go.mod h1:6fGqxH2ing5XMb3EYRq9LEkVlyPGs4oO/eLzh+S8CxY= github.com/gobuffalo/events v1.1.8/go.mod h1:UFy+W6X6VbCWS8k2iT81HYX65dMtiuVycMy04cplt/8= -github.com/gobuffalo/events v1.1.9 h1:ukq5ys/h0TuiX7eLJyZBD1dJOy0r19JTEYmgXKG9j+Y= github.com/gobuffalo/events v1.1.9/go.mod h1:/0nf8lMtP5TkgNbzYxR6Bl4GzBy5s5TebgNTdRfRbPM= +github.com/gobuffalo/events v1.2.0 h1:YovlMNcwNTfIm/3OdB+KemDOm8yUz4XIH+4kbMhGXWw= +github.com/gobuffalo/events v1.2.0/go.mod h1:pxvpvsKXKZNPtHuIxUV3K+g+KP5o4forzaeFj++bh68= github.com/gobuffalo/fizz v1.0.12/go.mod h1:C0sltPxpYK8Ftvf64kbsQa2yiCZY4RZviurNxXdAKwc= github.com/gobuffalo/flect v0.0.0-20180907193754-dc14d8acaf9f/go.mod h1:rCiQgmAE4axgBNl3jZWzS5rETRYTGOsrixTRaCPzNdA= github.com/gobuffalo/flect v0.0.0-20181002182613-4571df4b1daf/go.mod h1:rCiQgmAE4axgBNl3jZWzS5rETRYTGOsrixTRaCPzNdA= @@ -64,8 +95,11 @@ github.com/gobuffalo/flect v0.0.0-20181024204909-8f6be1a8c6c2/go.mod h1:rCiQgmAE github.com/gobuffalo/flect v0.0.0-20181104133451-1f6e9779237a/go.mod h1:rCiQgmAE4axgBNl3jZWzS5rETRYTGOsrixTRaCPzNdA= github.com/gobuffalo/flect v0.0.0-20181114183036-47375f6d8328/go.mod h1:0HvNbHdfh+WOvDSIASqJOSxTOWSxCCUF++k/Y53v9rI= github.com/gobuffalo/flect v0.0.0-20181210151238-24a2b68e0316/go.mod h1:en58vff74S9b99Eg42Dr+/9yPu437QjlNsO/hBYPuOk= -github.com/gobuffalo/flect v0.0.0-20190104192022-4af577e09bf2 h1:51NF9n6h4nGMooU5ALB+uJCM0UOmcWjAegIZb/ePtoE= github.com/gobuffalo/flect v0.0.0-20190104192022-4af577e09bf2/go.mod h1:en58vff74S9b99Eg42Dr+/9yPu437QjlNsO/hBYPuOk= +github.com/gobuffalo/flect v0.0.0-20190117212819-a62e61d96794/go.mod h1:397QT6v05LkZkn07oJXXT6y9FCfwC8Pug0WA2/2mE9k= +github.com/gobuffalo/flect v0.0.0-20190205211104-b2cb381e56e0/go.mod h1:397QT6v05LkZkn07oJXXT6y9FCfwC8Pug0WA2/2mE9k= +github.com/gobuffalo/flect v0.1.0 h1:EJvbvZlo9exJk5UK02lz5pTs3XEpIM5/4o691KfvtkM= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= github.com/gobuffalo/genny v0.0.0-20180924032338-7af3a40f2252/go.mod h1:tUTQOogrr7tAQnhajMSH6rv1BVev34H2sa1xNHMy94g= github.com/gobuffalo/genny v0.0.0-20181003150629-3786a0744c5d/go.mod h1:WAd8HmjMVrnkAZbmfgH5dLBUchsZfqzp/WS5sQz+uTM= github.com/gobuffalo/genny v0.0.0-20181005145118-318a41a134cc/go.mod h1:WAd8HmjMVrnkAZbmfgH5dLBUchsZfqzp/WS5sQz+uTM= @@ -88,11 +122,20 @@ github.com/gobuffalo/genny v0.0.0-20181206121324-d6fb8a0dbe36/go.mod h1:wpNSANu9 github.com/gobuffalo/genny v0.0.0-20181207164119-84844398a37d/go.mod h1:y0ysCHGGQf2T3vOhCrGHheYN54Y/REj0ayd0Suf4C/8= github.com/gobuffalo/genny v0.0.0-20181211165820-e26c8466f14d/go.mod h1:sHnK+ZSU4e2feXP3PA29ouij6PUEiN+RCwECjCTB3yM= github.com/gobuffalo/genny v0.0.0-20190104222617-a71664fc38e7/go.mod h1:QPsQ1FnhEsiU8f+O0qKWXz2RE4TiDqLVChWkBuh1WaY= -github.com/gobuffalo/genny v0.0.0-20190112155932-f31a84fcacf5 h1:boQS3dA9PxhyufJEWIILrG6pJQbDnpwP2rFyvWacdoY= github.com/gobuffalo/genny v0.0.0-20190112155932-f31a84fcacf5/go.mod h1:CIaHCrSIuJ4il6ka3Hub4DR4adDrGoXGEEt2FbBxoIo= +github.com/gobuffalo/genny v0.0.0-20190124191459-3310289fa4b4/go.mod h1:yIRqxhZV2sAzb+B3iPUMLauTRrYP8tJUlZ1zV9teKik= +github.com/gobuffalo/genny v0.0.0-20190131150032-1045e97d19fb/go.mod h1:yIRqxhZV2sAzb+B3iPUMLauTRrYP8tJUlZ1zV9teKik= +github.com/gobuffalo/genny v0.0.0-20190131190646-008a76242145/go.mod h1:NJvPZJxb9M4z790P6N2SMZKSUYpASpEvLuUWnHGKzb4= +github.com/gobuffalo/genny v0.0.0-20190219203444-c95082806342 h1:ewzWZ+TT9/3wYSnUPQRU7YFzqWAx4dgUXdgvJVTVLCA= +github.com/gobuffalo/genny v0.0.0-20190219203444-c95082806342/go.mod h1:3BLT+Vs94EEz3fKR8WWOkYpL6c1tdJcZUNCe3LZAnvQ= +github.com/gobuffalo/gitgen v0.0.0-20190219185555-91c2c5f0aad5/go.mod h1:ZzGIrxBvCJEluaU4i3CN0GFlu1Qmb3yK8ziV02evJ1E= github.com/gobuffalo/github_flavored_markdown v1.0.4/go.mod h1:uRowCdK+q8d/RF0Kt3/DSalaIXbb0De/dmTqMQdkQ4I= github.com/gobuffalo/github_flavored_markdown v1.0.5/go.mod h1:U0643QShPF+OF2tJvYNiYDLDGDuQmJZXsf/bHOJPsMY= +github.com/gobuffalo/github_flavored_markdown v1.0.7 h1:Vjvz4wqOnviiLEfTh5bh270b3lhpJiwwQEWOWmHMwY8= github.com/gobuffalo/github_flavored_markdown v1.0.7/go.mod h1:w93Pd9Lz6LvyQXEG6DktTPHkOtCbr+arAD5mkwMzXLI= +github.com/gobuffalo/gogen v0.0.0-20190219194924-d32a17ad9761/go.mod h1:v47C8sid+ZM2qK+YpQ2MGJKssKAqyTsH1wl/pTCPdz8= +github.com/gobuffalo/gogen v0.0.0-20190224213239-1c6076128bbc h1:GjmMs2PLx+rH9In421AR1RkHV5AG9lLnRpIPhWauvoI= +github.com/gobuffalo/gogen v0.0.0-20190224213239-1c6076128bbc/go.mod h1:tQqPADZKflmJCR4FHRHYNPP79cXPICyxUiUHyhuXtqg= github.com/gobuffalo/httptest v1.0.2/go.mod h1:7T1IbSrg60ankme0aDLVnEY0h056g9M1/ZvpVThtB7E= github.com/gobuffalo/licenser v0.0.0-20180924033006-eae28e638a42/go.mod h1:Ubo90Np8gpsSZqNScZZkVXXAo5DGhTb+WYFIjlnog8w= github.com/gobuffalo/licenser v0.0.0-20181025145548-437d89de4f75/go.mod h1:x3lEpYxkRG/XtGCUNkio+6RZ/dlOvLzTI9M1auIwFcw= @@ -106,15 +149,22 @@ github.com/gobuffalo/logger v0.0.0-20181027144941-73d08d2bb969/go.mod h1:7uGg2du github.com/gobuffalo/logger v0.0.0-20181027193913-9cf4dd0efe46/go.mod h1:7uGg2duHKpWnN4+YmyKBdLXfhopkAdVM6H3nKbyFbz8= github.com/gobuffalo/logger v0.0.0-20181109185836-3feeab578c17/go.mod h1:oNErH0xLe+utO+OW8ptXMSA5DkiSEDW1u3zGIt8F9Ew= github.com/gobuffalo/logger v0.0.0-20181117211126-8e9b89b7c264/go.mod h1:5etB91IE0uBlw9k756fVKZJdS+7M7ejVhmpXXiSFj0I= +github.com/gobuffalo/logger v0.0.0-20181127160119-5b956e21995c h1:Z/ppYX6EtPEysbW4VEGz2dO+4F4VTthWp2sWRUCANdU= github.com/gobuffalo/logger v0.0.0-20181127160119-5b956e21995c/go.mod h1:+HxKANrR9VGw9yN3aOAppJKvhO05ctDi63w4mDnKv2U= github.com/gobuffalo/makr v1.1.5/go.mod h1:Y+o0btAH1kYAMDJW/TX3+oAXEu0bmSLLoC9mIFxtzOw= github.com/gobuffalo/mapi v1.0.0/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.1 h1:JRuTiZzDEZhBHkFiHTxJkYRT6CbYuL0K/rn+1byJoEA= github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= github.com/gobuffalo/meta v0.0.0-20181018155829-df62557efcd3/go.mod h1:XTTOhwMNryif3x9LkTTBO/Llrveezd71u3quLd0u7CM= github.com/gobuffalo/meta v0.0.0-20181018192820-8c6cef77dab3/go.mod h1:E94EPzx9NERGCY69UWlcj6Hipf2uK/vnfrF4QD0plVE= github.com/gobuffalo/meta v0.0.0-20181025145500-3a985a084b0a/go.mod h1:YDAKBud2FP7NZdruCSlmTmDOZbVSa6bpK7LJ/A/nlKg= github.com/gobuffalo/meta v0.0.0-20181114191255-b130ebedd2f7/go.mod h1:K6cRZ29ozr4Btvsqkjvg5nDFTLOgTqf03KA70Ks0ypE= github.com/gobuffalo/meta v0.0.0-20181127070345-0d7e59dd540b/go.mod h1:RLO7tMvE0IAKAM8wny1aN12pvEKn7EtkBLkUZR00Qf8= +github.com/gobuffalo/meta v0.0.0-20190120163247-50bbb1fa260d/go.mod h1:KKsH44nIK2gA8p0PJmRT9GvWJUdphkDUA8AJEvFWiqM= +github.com/gobuffalo/meta v0.0.0-20190121163014-ecaa953cbfb3/go.mod h1:KLfkGnS+Tucc+iTkUcAUBtxpwOJGfhw2pHRLddPxMQY= +github.com/gobuffalo/meta v0.0.0-20190126124307-c8fb6f4eb5a9/go.mod h1:zoh6GLgkk9+iI/62dST4amAuVAczZrBXoAk/t64n7Ew= +github.com/gobuffalo/meta v0.0.0-20190207205153-50a99e08b8cf h1:fdauN7x9jhuIi9zPVf1b5iKh8fhfWH8nomfjVEBASnU= +github.com/gobuffalo/meta v0.0.0-20190207205153-50a99e08b8cf/go.mod h1:+VGfK9Jm9I7oJyFeJzIT6omCPvrDktzAtpHJKaieugY= github.com/gobuffalo/mw-basicauth v1.0.3/go.mod h1:dg7+ilMZOKnQFHDefUzUHufNyTswVUviCBgF244C1+0= github.com/gobuffalo/mw-contenttype v0.0.0-20180802152300-74f5a47f4d56/go.mod h1:7EvcmzBbeCvFtQm5GqF9ys6QnCxz2UM1x0moiWLq1No= github.com/gobuffalo/mw-csrf v0.0.0-20180802151833-446ff26e108b/go.mod h1:sbGtb8DmDZuDUQoxjr8hG1ZbLtZboD9xsn6p77ppcHo= @@ -131,6 +181,7 @@ github.com/gobuffalo/packd v0.0.0-20181111195323-b2e760a5f0ff/go.mod h1:Yf2toFaI github.com/gobuffalo/packd v0.0.0-20181114190715-f25c5d2471d7/go.mod h1:Yf2toFaISlyQrr5TfO3h6DB9pl9mZRmyvBGQb/aQ/pI= github.com/gobuffalo/packd v0.0.0-20181124090624-311c6248e5fb/go.mod h1:Foenia9ZvITEvG05ab6XpiD5EfBHPL8A6hush8SJ0o8= github.com/gobuffalo/packd v0.0.0-20181207120301-c49825f8f6f4/go.mod h1:LYc0TGKFBBFTRC9dg2pcRcMqGCTMD7T2BIMP7OBuQAA= +github.com/gobuffalo/packd v0.0.0-20181212173646-eca3b8fd6687 h1:uZ+G4JprR0UEq0aHZs+6eP7TEZuFfrIkmQWejIBV/QQ= github.com/gobuffalo/packd v0.0.0-20181212173646-eca3b8fd6687/go.mod h1:LYc0TGKFBBFTRC9dg2pcRcMqGCTMD7T2BIMP7OBuQAA= github.com/gobuffalo/packr v1.13.7/go.mod h1:KkinLIn/n6+3tVXMwg6KkNvWwVsrRAz4ph+jgpk3Z24= github.com/gobuffalo/packr v1.15.0/go.mod h1:t5gXzEhIviQwVlNx/+3SfS07GS+cZ2hn76WLzPp6MGI= @@ -138,15 +189,19 @@ github.com/gobuffalo/packr v1.15.1/go.mod h1:IeqicJ7jm8182yrVmNbM6PR4g79SjN9tZLH github.com/gobuffalo/packr v1.19.0/go.mod h1:MstrNkfCQhd5o+Ct4IJ0skWlxN8emOq8DsoT1G98VIU= github.com/gobuffalo/packr v1.20.0/go.mod h1:JDytk1t2gP+my1ig7iI4NcVaXr886+N0ecUga6884zw= github.com/gobuffalo/packr v1.21.0/go.mod h1:H00jGfj1qFKxscFJSw8wcL4hpQtPe1PfU2wa6sg/SR0= -github.com/gobuffalo/packr v1.21.9/go.mod h1:GC76q6nMzRtR+AEN/VV4w0z2/4q7SOaEmXh3Ooa8sOE= +github.com/gobuffalo/packr v1.22.0 h1:/YVd/GRGsu0QuoCJtlcWSVllobs4q3Xvx3nqxTvPyN0= +github.com/gobuffalo/packr v1.22.0/go.mod h1:Qr3Wtxr3+HuQEwWqlLnNW4t1oTvK+7Gc/Rnoi/lDFvA= github.com/gobuffalo/packr/v2 v2.0.0-rc.8/go.mod h1:y60QCdzwuMwO2R49fdQhsjCPv7tLQFR0ayzxxla9zes= github.com/gobuffalo/packr/v2 v2.0.0-rc.9/go.mod h1:fQqADRfZpEsgkc7c/K7aMew3n4aF1Kji7+lIZeR98Fc= github.com/gobuffalo/packr/v2 v2.0.0-rc.10/go.mod h1:4CWWn4I5T3v4c1OsJ55HbHlUEKNWMITG5iIkdr4Px4w= github.com/gobuffalo/packr/v2 v2.0.0-rc.11/go.mod h1:JoieH/3h3U4UmatmV93QmqyPUdf4wVM9HELaHEu+3fk= github.com/gobuffalo/packr/v2 v2.0.0-rc.12/go.mod h1:FV1zZTsVFi1DSCboO36Xgs4pzCZBjB/tDV9Cz/lSaR8= github.com/gobuffalo/packr/v2 v2.0.0-rc.13/go.mod h1:2Mp7GhBFMdJlOK8vGfl7SYtfMP3+5roE39ejlfjw0rA= -github.com/gobuffalo/packr/v2 v2.0.0-rc.14 h1:K41dNilNHDbDgCL3UE6K02JGuN89pjvD9oG99X7Om2s= github.com/gobuffalo/packr/v2 v2.0.0-rc.14/go.mod h1:06otbrNvDKO1eNQ3b8hst+1010UooI2MFg+B2Ze4MV8= +github.com/gobuffalo/packr/v2 v2.0.0-rc.15/go.mod h1:IMe7H2nJvcKXSF90y4X1rjYIRlNMJYCxEhssBXNZwWs= +github.com/gobuffalo/packr/v2 v2.0.0/go.mod h1:7McfLpSxaPUoSQm7gYpTZRQSK63mX8EKzzYSEFKvfkM= +github.com/gobuffalo/packr/v2 v2.0.1 h1:2jz0jiCa634BwBZkF7NJNWHD7nGsztQDV7gmM2jJhLs= +github.com/gobuffalo/packr/v2 v2.0.1/go.mod h1:tp5/5A2e67F1lUGTiNadtA2ToP045+mvkWzaqMCsZr4= github.com/gobuffalo/plush v3.7.16+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= github.com/gobuffalo/plush v3.7.20+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= github.com/gobuffalo/plush v3.7.21+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= @@ -155,11 +210,14 @@ github.com/gobuffalo/plush v3.7.23+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5s github.com/gobuffalo/plush v3.7.30+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= github.com/gobuffalo/plush v3.7.31+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= github.com/gobuffalo/plush v3.7.32+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= +github.com/gobuffalo/plush v3.7.33+incompatible h1:wpCuypoZo1UlvYsLx+ERYpo0YhF+DSo2SSanVgRpMOg= +github.com/gobuffalo/plush v3.7.33+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= github.com/gobuffalo/plushgen v0.0.0-20181128164830-d29dcb966cb2/go.mod h1:r9QwptTFnuvSaSRjpSp4S2/4e2D3tJhARYbvEBcKSb4= github.com/gobuffalo/plushgen v0.0.0-20181203163832-9fc4964505c2/go.mod h1:opEdT33AA2HdrIwK1aibqnTJDVVKXC02Bar/GT1YRVs= github.com/gobuffalo/plushgen v0.0.0-20181207152837-eedb135bd51b/go.mod h1:Lcw7HQbEVm09sAQrCLzIxuhFbB3nAgp4c55E+UlynR0= -github.com/gobuffalo/plushgen v0.0.0-20190104222512-177cd2b872b3 h1:y+xgpBg0jHuTTDOE65FahfUgugBDpOp4C0RXXtGiSB0= github.com/gobuffalo/plushgen v0.0.0-20190104222512-177cd2b872b3/go.mod h1:tYxCozi8X62bpZyKXYHw1ncx2ZtT2nFvG42kuLwYjoc= +github.com/gobuffalo/plushgen v0.0.0-20190224160205-347ea233336e h1:gwRkPtLLJWnlQntPo67SybgmuOJBHLQoc+WUlQEXZRs= +github.com/gobuffalo/plushgen v0.0.0-20190224160205-347ea233336e/go.mod h1:tYxCozi8X62bpZyKXYHw1ncx2ZtT2nFvG42kuLwYjoc= github.com/gobuffalo/pop v4.8.2+incompatible/go.mod h1:DwBz3SD5SsHpTZiTubcsFWcVDpJWGsxjVjMPnkiThWg= github.com/gobuffalo/pop v4.8.3+incompatible/go.mod h1:DwBz3SD5SsHpTZiTubcsFWcVDpJWGsxjVjMPnkiThWg= github.com/gobuffalo/pop v4.8.4+incompatible/go.mod h1:DwBz3SD5SsHpTZiTubcsFWcVDpJWGsxjVjMPnkiThWg= @@ -176,69 +234,104 @@ github.com/gobuffalo/release v1.1.3/go.mod h1:CuXc5/m+4zuq8idoDt1l4va0AXAn/OSs08 github.com/gobuffalo/release v1.1.6/go.mod h1:18naWa3kBsqO0cItXZNJuefCKOENpbbUIqRL1g+p6z0= github.com/gobuffalo/shoulders v1.0.1/go.mod h1:V33CcVmaQ4gRUmHKwq1fiTXuf8Gp/qjQBUL5tHPmvbA= github.com/gobuffalo/syncx v0.0.0-20181120191700-98333ab04150/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/gobuffalo/syncx v0.0.0-20181120194010-558ac7de985f h1:S5EeH1reN93KR0L6TQvkRpu9YggCYXrUqFh1iEgvdC0= github.com/gobuffalo/syncx v0.0.0-20181120194010-558ac7de985f/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gobuffalo/tags v2.0.11+incompatible/go.mod h1:9XmhOkyaB7UzvuY4UoZO4s67q8/xRMVJEaakauVQYeY= github.com/gobuffalo/tags v2.0.14+incompatible/go.mod h1:9XmhOkyaB7UzvuY4UoZO4s67q8/xRMVJEaakauVQYeY= +github.com/gobuffalo/tags v2.0.15+incompatible h1:qc5hMXPsXD+zYPSlNgqzlpVW7z/+GJEVCqn245BEUIY= github.com/gobuffalo/tags v2.0.15+incompatible/go.mod h1:9XmhOkyaB7UzvuY4UoZO4s67q8/xRMVJEaakauVQYeY= github.com/gobuffalo/uuid v2.0.3+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= github.com/gobuffalo/uuid v2.0.4+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= +github.com/gobuffalo/uuid v2.0.5+incompatible h1:c5uWRuEnYggYCrT9AJm0U2v1QTG7OVDAvxhj8tIV5Gc= github.com/gobuffalo/uuid v2.0.5+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= +github.com/gobuffalo/validate v2.0.3+incompatible h1:6f4JCEz11Zi6iIlexMv7Jz10RBPvgI795AOaubtCwTE= github.com/gobuffalo/validate v2.0.3+incompatible/go.mod h1:N+EtDe0J8252BgfzQUChBgfd6L93m9weay53EWFVsMM= github.com/gobuffalo/x v0.0.0-20181003152136-452098b06085/go.mod h1:WevpGD+5YOreDJznWevcn8NTmQEW5STSBgIkpkjzqXc= github.com/gobuffalo/x v0.0.0-20181007152206-913e47c59ca7/go.mod h1:9rDPXaB3kXdKWzMc4odGQQdG2e2DIEmANy5aSJ9yesY= github.com/gofrs/uuid v3.1.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= +github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/pat v0.0.0-20180118222023-199c85a7f6d1/go.mod h1:YeAe0gNeiNT5hoiZRI4yiOky6jVdNvfO2N6Kav/HmxY= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.1.2/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w= github.com/gorilla/sessions v1.1.3/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= github.com/jackc/pgx v3.2.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= +github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0/go.mod h1:IiEW3SEiiErVyFdH8NTuWjSifiEQKUoyK3LNqr2kCHU= github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/karrick/godirwalk v1.7.5/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46shStcFDJ34= github.com/karrick/godirwalk v1.7.7/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46shStcFDJ34= github.com/karrick/godirwalk v1.7.8 h1:VfG72pyIxgtC7+3X9CMHI0AOl4LwyRAg98WAgsvffi8= github.com/karrick/godirwalk v1.7.8/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46shStcFDJ34= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/markbates/deplist v1.0.4/go.mod h1:gRRbPbbuA8TmMiRvaOzUlRfzfjeCCBqX2A6arxN01MM= github.com/markbates/deplist v1.0.5/go.mod h1:gRRbPbbuA8TmMiRvaOzUlRfzfjeCCBqX2A6arxN01MM= github.com/markbates/going v1.0.2/go.mod h1:UWCk3zm0UKefHZ7l8BNqi26UyiEMniznk8naLdTcy6c= +github.com/markbates/going v1.0.3/go.mod h1:fQiT6v6yQar9UD6bd/D4Z5Afbk9J6BBVBtLiyY4gp2o= github.com/markbates/grift v1.0.4/go.mod h1:wbmtW74veyx+cgfwFhlnnMWqhoz55rnHR47oMXzsyVs= github.com/markbates/hmax v1.0.0/go.mod h1:cOkR9dktiESxIMu+65oc/r/bdY4bE8zZw3OLhLx0X2c= github.com/markbates/inflect v1.0.0/go.mod h1:oTeZL2KHA7CUX6X+fovmK9OvIOFuqu0TwdQrZjLTh88= github.com/markbates/inflect v1.0.1/go.mod h1:uv3UVNBe5qBIfCm8O8Q+DW+S1EopeyINj+Ikhc7rnCk= github.com/markbates/inflect v1.0.3/go.mod h1:1fR9+pO2KHEO9ZRtto13gDwwZaAKstQzferVeWqbgNs= +github.com/markbates/inflect v1.0.4 h1:5fh1gzTFhfae06u3hzHYO9xe3l3v3nW5Pwt3naLTP5g= github.com/markbates/inflect v1.0.4/go.mod h1:1fR9+pO2KHEO9ZRtto13gDwwZaAKstQzferVeWqbgNs= github.com/markbates/oncer v0.0.0-20180924031910-e862a676800b/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/oncer v0.0.0-20180924034138-723ad0170a46/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/oncer v0.0.0-20181014194634-05fccaae8fc4/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2 h1:JgVTCPf0uBVcUSWpyXmGpgOc62nK5HWUBKAGc3Qqa5k= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/refresh v1.4.10/go.mod h1:NDPHvotuZmTmesXxr95C9bjlw1/0frJwtME2dzcVKhc= github.com/markbates/safe v1.0.0/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/markbates/sigtx v1.0.0/go.mod h1:QF1Hv6Ic6Ca6W+T+DL0Y/ypborFKyvUY9HmuCD4VeTc= github.com/markbates/willie v1.0.9/go.mod h1:fsrFVWl91+gXpx/6dv715j7i11fYPfZ9ZGfH0DQzY7w= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/microcosm-cc/bluemonday v1.0.2 h1:5lPfLTTAvAbtS0VqT+94yOtFnGfUWYyx0+iToC3Os3s= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= @@ -246,43 +339,80 @@ github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/mapstructure v1.0.0/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/monoculum/formam v0.0.0-20180901015400-4e68be1d79ba/go.mod h1:RKgILGEJq24YyJ2ban8EO0RUVSJlF1pGsEvoLEACr/Q= +github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= +github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/nicksnyder/go-i18n v1.10.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2xBGjv0j365Q= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/rogpeppe/go-internal v1.0.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.1.0 h1:g0fH8RicVgNl+zVZDCDfbdWxAWoAEJyI7I3TZYXFiig= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 h1:ofR1ZdrNSkiWcMsRrubK9tb2/SlZVWttAfqUjJi6QYc= github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs= +github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= +github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= +github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= +github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw= +github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI= github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= github.com/shurcooL/highlight_go v0.0.0-20170515013102-78fb10f4a5f8/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= +github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= +github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg= +github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw= +github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y= +github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= +github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ= +github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I= +github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0= github.com/shurcooL/octicon v0.0.0-20180602230221-c42b0e3b24d9/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= +github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= +github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk= github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= +github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.1.0/go.mod h1:zrgwTnHtNr00buQ1vSptGe8m1f/BbgsPukg8qsT7A+A= github.com/sirupsen/logrus v1.1.1/go.mod h1:zrgwTnHtNr00buQ1vSptGe8m1f/BbgsPukg8qsT7A+A= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME= github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d h1:yKm7XZV6j9Ev6lojP2XaIshpT4ymkqhMeSghO5Ps00E= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= +github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e h1:qpG93cPwA5f7s/ZPBJnGOYQNK/vKsaDaseuKT5Asee8= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.0/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.2.1/go.mod h1:P4AexN0a+C9tGAnUFNwDMYYZv3pjFuvmeiMyKRaNVlI= github.com/spf13/viper v1.3.1/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= @@ -291,10 +421,14 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/unrolled/secure v0.0.0-20180918153822-f340ee86eb8b/go.mod h1:mnPT77IAdsi/kV7+Es7y+pXALeV3h7G6dQF6mNYjcLA= github.com/unrolled/secure v0.0.0-20181005190816-ff9db2ff917f/go.mod h1:mnPT77IAdsi/kV7+Es7y+pXALeV3h7G6dQF6mNYjcLA= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= +go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= +golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -303,15 +437,21 @@ golang.org/x/crypto v0.0.0-20181015023909-0c41d7ab0a0e/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20181024171144-74cb1d3d52f4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181025113841-85e1b3f9139a/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181127143415-eb0de9b17e85/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190102171810-8d7daa0c54b3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc h1:F5tKCVGp+MUAHhKp5MZtGqAlGX3+oCsiL1Q629FL90M= golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67 h1:ng3VDlRp5/DHpSWl02R4rM9I+8M2rhmsuLwAMmkLQWE= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180816102801-aaf60122140d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180921000356-2f5d2388922f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -319,16 +459,24 @@ golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181017193950-04a2e542c03f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181102091132-c10e9556a7bc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181207154023-610586996380/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd h1:HuTn7WObtcDo9uEEU7rEqL0jYthdXAmZ6PP+meazmaU= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180906133057-8cf3aee42992/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -341,13 +489,20 @@ golang.org/x/sys v0.0.0-20181024145615-5cd93ef61a7c/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181025063200-d989b31c8746/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026064943-731415f00dce/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181106135930-3a76605856fd/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190102155601-82a175fd1598 h1:S8GOgffXV1X3fpVG442QRfWOt0iFl79eHJ7OPt725bo= golang.org/x/sys v0.0.0-20190102155601-82a175fd1598/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190116161447-11f53e031339 h1:g/Jesu8+QLnA0CPzF3E1pURg0Byr7i6jLoX5sqjcAh0= +golang.org/x/sys v0.0.0-20190116161447-11f53e031339/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181003024731-2f84ea8ef872/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181006002542-f60d9635b16a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -356,6 +511,7 @@ golang.org/x/tools v0.0.0-20181013182035-5e66757b835f/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20181017214349-06f26fdaaa28/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181024171208-a2dc47679d30/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181026183834-f60e5f99f081/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181105230042-78dc5bac0cac/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181107215632-34b416bd17b3/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181114190951-94339b83286c/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -369,18 +525,48 @@ golang.org/x/tools v0.0.0-20181207183836-8bc39b988060/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20181212172921-837e80568c09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190102213336-ca9055ed7d04/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190104182027-498d95493402/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190111214448-fc1d57b08d7b h1:Z5QW7z0ycYrOVRYv3z4FeSZbRNvVwUfXHKQSZKb5A6w= golang.org/x/tools v0.0.0-20190111214448-fc1d57b08d7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190118193359-16909d206f00/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190124004107-78ee07aa9465/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190131142011-8dbcc66f33bb/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206221403-44bcb96178d3/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190219185102-9394956cfdc5/go.mod h1:E6PF97AdD6v0s+fPshSmumCW1S1Ne85RbPQxELkKa44= +golang.org/x/tools v0.0.0-20190221204921-83362c3779f5 h1:ev5exjGDsOo0NPTB0qdCcE53BfWl1IICJlhgXgfT9fM= +golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= +google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922/go.mod h1:L3J43x8/uS+qIUoksaLKe6OS3nUKxOKuIFz1sl2/jx4= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/mail.v2 v2.0.0-20180731213649-a0242b2233b4/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= +sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/vendor/github.com/fatih/structs/.gitignore b/vendor/github.com/fatih/structs/.gitignore deleted file mode 100644 index 8365624..0000000 --- a/vendor/github.com/fatih/structs/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test diff --git a/vendor/github.com/fatih/structs/.travis.yml b/vendor/github.com/fatih/structs/.travis.yml deleted file mode 100644 index cbf2ccc..0000000 --- a/vendor/github.com/fatih/structs/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: go -go: - - 1.7.x - - tip -sudo: false -before_install: -- go get github.com/axw/gocov/gocov -- go get github.com/mattn/goveralls -- if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi -script: -- $HOME/gopath/bin/goveralls -service=travis-ci diff --git a/vendor/github.com/fatih/structs/LICENSE b/vendor/github.com/fatih/structs/LICENSE deleted file mode 100644 index 34504e4..0000000 --- a/vendor/github.com/fatih/structs/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Fatih Arslan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/fatih/structs/README.md b/vendor/github.com/fatih/structs/README.md deleted file mode 100644 index 44e0100..0000000 --- a/vendor/github.com/fatih/structs/README.md +++ /dev/null @@ -1,163 +0,0 @@ -# Structs [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/fatih/structs) [![Build Status](http://img.shields.io/travis/fatih/structs.svg?style=flat-square)](https://travis-ci.org/fatih/structs) [![Coverage Status](http://img.shields.io/coveralls/fatih/structs.svg?style=flat-square)](https://coveralls.io/r/fatih/structs) - -Structs contains various utilities to work with Go (Golang) structs. It was -initially used by me to convert a struct into a `map[string]interface{}`. With -time I've added other utilities for structs. It's basically a high level -package based on primitives from the reflect package. Feel free to add new -functions or improve the existing code. - -## Install - -```bash -go get github.com/fatih/structs -``` - -## Usage and Examples - -Just like the standard lib `strings`, `bytes` and co packages, `structs` has -many global functions to manipulate or organize your struct data. Lets define -and declare a struct: - -```go -type Server struct { - Name string `json:"name,omitempty"` - ID int - Enabled bool - users []string // not exported - http.Server // embedded -} - -server := &Server{ - Name: "gopher", - ID: 123456, - Enabled: true, -} -``` - -```go -// Convert a struct to a map[string]interface{} -// => {"Name":"gopher", "ID":123456, "Enabled":true} -m := structs.Map(server) - -// Convert the values of a struct to a []interface{} -// => ["gopher", 123456, true] -v := structs.Values(server) - -// Convert the names of a struct to a []string -// (see "Names methods" for more info about fields) -n := structs.Names(server) - -// Convert the values of a struct to a []*Field -// (see "Field methods" for more info about fields) -f := structs.Fields(server) - -// Return the struct name => "Server" -n := structs.Name(server) - -// Check if any field of a struct is initialized or not. -h := structs.HasZero(server) - -// Check if all fields of a struct is initialized or not. -z := structs.IsZero(server) - -// Check if server is a struct or a pointer to struct -i := structs.IsStruct(server) -``` - -### Struct methods - -The structs functions can be also used as independent methods by creating a new -`*structs.Struct`. This is handy if you want to have more control over the -structs (such as retrieving a single Field). - -```go -// Create a new struct type: -s := structs.New(server) - -m := s.Map() // Get a map[string]interface{} -v := s.Values() // Get a []interface{} -f := s.Fields() // Get a []*Field -n := s.Names() // Get a []string -f := s.Field(name) // Get a *Field based on the given field name -f, ok := s.FieldOk(name) // Get a *Field based on the given field name -n := s.Name() // Get the struct name -h := s.HasZero() // Check if any field is initialized -z := s.IsZero() // Check if all fields are initialized -``` - -### Field methods - -We can easily examine a single Field for more detail. Below you can see how we -get and interact with various field methods: - - -```go -s := structs.New(server) - -// Get the Field struct for the "Name" field -name := s.Field("Name") - -// Get the underlying value, value => "gopher" -value := name.Value().(string) - -// Set the field's value -name.Set("another gopher") - -// Get the field's kind, kind => "string" -name.Kind() - -// Check if the field is exported or not -if name.IsExported() { - fmt.Println("Name field is exported") -} - -// Check if the value is a zero value, such as "" for string, 0 for int -if !name.IsZero() { - fmt.Println("Name is initialized") -} - -// Check if the field is an anonymous (embedded) field -if !name.IsEmbedded() { - fmt.Println("Name is not an embedded field") -} - -// Get the Field's tag value for tag name "json", tag value => "name,omitempty" -tagValue := name.Tag("json") -``` - -Nested structs are supported too: - -```go -addrField := s.Field("Server").Field("Addr") - -// Get the value for addr -a := addrField.Value().(string) - -// Or get all fields -httpServer := s.Field("Server").Fields() -``` - -We can also get a slice of Fields from the Struct type to iterate over all -fields. This is handy if you wish to examine all fields: - -```go -s := structs.New(server) - -for _, f := range s.Fields() { - fmt.Printf("field name: %+v\n", f.Name()) - - if f.IsExported() { - fmt.Printf("value : %+v\n", f.Value()) - fmt.Printf("is zero : %+v\n", f.IsZero()) - } -} -``` - -## Credits - - * [Fatih Arslan](https://github.com/fatih) - * [Cihangir Savas](https://github.com/cihangir) - -## License - -The MIT License (MIT) - see LICENSE.md for more details diff --git a/vendor/github.com/fatih/structs/field.go b/vendor/github.com/fatih/structs/field.go deleted file mode 100644 index e697832..0000000 --- a/vendor/github.com/fatih/structs/field.go +++ /dev/null @@ -1,141 +0,0 @@ -package structs - -import ( - "errors" - "fmt" - "reflect" -) - -var ( - errNotExported = errors.New("field is not exported") - errNotSettable = errors.New("field is not settable") -) - -// Field represents a single struct field that encapsulates high level -// functions around the field. -type Field struct { - value reflect.Value - field reflect.StructField - defaultTag string -} - -// Tag returns the value associated with key in the tag string. If there is no -// such key in the tag, Tag returns the empty string. -func (f *Field) Tag(key string) string { - return f.field.Tag.Get(key) -} - -// Value returns the underlying value of the field. It panics if the field -// is not exported. -func (f *Field) Value() interface{} { - return f.value.Interface() -} - -// IsEmbedded returns true if the given field is an anonymous field (embedded) -func (f *Field) IsEmbedded() bool { - return f.field.Anonymous -} - -// IsExported returns true if the given field is exported. -func (f *Field) IsExported() bool { - return f.field.PkgPath == "" -} - -// IsZero returns true if the given field is not initialized (has a zero value). -// It panics if the field is not exported. -func (f *Field) IsZero() bool { - zero := reflect.Zero(f.value.Type()).Interface() - current := f.Value() - - return reflect.DeepEqual(current, zero) -} - -// Name returns the name of the given field -func (f *Field) Name() string { - return f.field.Name -} - -// Kind returns the fields kind, such as "string", "map", "bool", etc .. -func (f *Field) Kind() reflect.Kind { - return f.value.Kind() -} - -// Set sets the field to given value v. It returns an error if the field is not -// settable (not addressable or not exported) or if the given value's type -// doesn't match the fields type. -func (f *Field) Set(val interface{}) error { - // we can't set unexported fields, so be sure this field is exported - if !f.IsExported() { - return errNotExported - } - - // do we get here? not sure... - if !f.value.CanSet() { - return errNotSettable - } - - given := reflect.ValueOf(val) - - if f.value.Kind() != given.Kind() { - return fmt.Errorf("wrong kind. got: %s want: %s", given.Kind(), f.value.Kind()) - } - - f.value.Set(given) - return nil -} - -// Zero sets the field to its zero value. It returns an error if the field is not -// settable (not addressable or not exported). -func (f *Field) Zero() error { - zero := reflect.Zero(f.value.Type()).Interface() - return f.Set(zero) -} - -// Fields returns a slice of Fields. This is particular handy to get the fields -// of a nested struct . A struct tag with the content of "-" ignores the -// checking of that particular field. Example: -// -// // Field is ignored by this package. -// Field *http.Request `structs:"-"` -// -// It panics if field is not exported or if field's kind is not struct -func (f *Field) Fields() []*Field { - return getFields(f.value, f.defaultTag) -} - -// Field returns the field from a nested struct. It panics if the nested struct -// is not exported or if the field was not found. -func (f *Field) Field(name string) *Field { - field, ok := f.FieldOk(name) - if !ok { - panic("field not found") - } - - return field -} - -// FieldOk returns the field from a nested struct. The boolean returns whether -// the field was found (true) or not (false). -func (f *Field) FieldOk(name string) (*Field, bool) { - value := &f.value - // value must be settable so we need to make sure it holds the address of the - // variable and not a copy, so we can pass the pointer to strctVal instead of a - // copy (which is not assigned to any variable, hence not settable). - // see "https://blog.golang.org/laws-of-reflection#TOC_8." - if f.value.Kind() != reflect.Ptr { - a := f.value.Addr() - value = &a - } - v := strctVal(value.Interface()) - t := v.Type() - - field, ok := t.FieldByName(name) - if !ok { - return nil, false - } - - return &Field{ - field: field, - value: v.FieldByName(name), - }, true -} diff --git a/vendor/github.com/fatih/structs/structs.go b/vendor/github.com/fatih/structs/structs.go deleted file mode 100644 index be3816a..0000000 --- a/vendor/github.com/fatih/structs/structs.go +++ /dev/null @@ -1,586 +0,0 @@ -// Package structs contains various utilities functions to work with structs. -package structs - -import ( - "fmt" - - "reflect" -) - -var ( - // DefaultTagName is the default tag name for struct fields which provides - // a more granular to tweak certain structs. Lookup the necessary functions - // for more info. - DefaultTagName = "structs" // struct's field default tag name -) - -// Struct encapsulates a struct type to provide several high level functions -// around the struct. -type Struct struct { - raw interface{} - value reflect.Value - TagName string -} - -// New returns a new *Struct with the struct s. It panics if the s's kind is -// not struct. -func New(s interface{}) *Struct { - return &Struct{ - raw: s, - value: strctVal(s), - TagName: DefaultTagName, - } -} - -// Map converts the given struct to a map[string]interface{}, where the keys -// of the map are the field names and the values of the map the associated -// values of the fields. The default key string is the struct field name but -// can be changed in the struct field's tag value. The "structs" key in the -// struct's field tag value is the key name. Example: -// -// // Field appears in map as key "myName". -// Name string `structs:"myName"` -// -// A tag value with the content of "-" ignores that particular field. Example: -// -// // Field is ignored by this package. -// Field bool `structs:"-"` -// -// A tag value with the content of "string" uses the stringer to get the value. Example: -// -// // The value will be output of Animal's String() func. -// // Map will panic if Animal does not implement String(). -// Field *Animal `structs:"field,string"` -// -// A tag value with the option of "flatten" used in a struct field is to flatten its fields -// in the output map. Example: -// -// // The FieldStruct's fields will be flattened into the output map. -// FieldStruct time.Time `structs:",flatten"` -// -// A tag value with the option of "omitnested" stops iterating further if the type -// is a struct. Example: -// -// // Field is not processed further by this package. -// Field time.Time `structs:"myName,omitnested"` -// Field *http.Request `structs:",omitnested"` -// -// A tag value with the option of "omitempty" ignores that particular field if -// the field value is empty. Example: -// -// // Field appears in map as key "myName", but the field is -// // skipped if empty. -// Field string `structs:"myName,omitempty"` -// -// // Field appears in map as key "Field" (the default), but -// // the field is skipped if empty. -// Field string `structs:",omitempty"` -// -// Note that only exported fields of a struct can be accessed, non exported -// fields will be neglected. -func (s *Struct) Map() map[string]interface{} { - out := make(map[string]interface{}) - s.FillMap(out) - return out -} - -// FillMap is the same as Map. Instead of returning the output, it fills the -// given map. -func (s *Struct) FillMap(out map[string]interface{}) { - if out == nil { - return - } - - fields := s.structFields() - - for _, field := range fields { - name := field.Name - val := s.value.FieldByName(name) - isSubStruct := false - var finalVal interface{} - - tagName, tagOpts := parseTag(field.Tag.Get(s.TagName)) - if tagName != "" { - name = tagName - } - - // if the value is a zero value and the field is marked as omitempty do - // not include - if tagOpts.Has("omitempty") { - zero := reflect.Zero(val.Type()).Interface() - current := val.Interface() - - if reflect.DeepEqual(current, zero) { - continue - } - } - - if !tagOpts.Has("omitnested") { - finalVal = s.nested(val) - - v := reflect.ValueOf(val.Interface()) - if v.Kind() == reflect.Ptr { - v = v.Elem() - } - - switch v.Kind() { - case reflect.Map, reflect.Struct: - isSubStruct = true - } - } else { - finalVal = val.Interface() - } - - if tagOpts.Has("string") { - s, ok := val.Interface().(fmt.Stringer) - if ok { - out[name] = s.String() - } - continue - } - - if isSubStruct && (tagOpts.Has("flatten")) { - for k := range finalVal.(map[string]interface{}) { - out[k] = finalVal.(map[string]interface{})[k] - } - } else { - out[name] = finalVal - } - } -} - -// Values converts the given s struct's field values to a []interface{}. A -// struct tag with the content of "-" ignores the that particular field. -// Example: -// -// // Field is ignored by this package. -// Field int `structs:"-"` -// -// A value with the option of "omitnested" stops iterating further if the type -// is a struct. Example: -// -// // Fields is not processed further by this package. -// Field time.Time `structs:",omitnested"` -// Field *http.Request `structs:",omitnested"` -// -// A tag value with the option of "omitempty" ignores that particular field and -// is not added to the values if the field value is empty. Example: -// -// // Field is skipped if empty -// Field string `structs:",omitempty"` -// -// Note that only exported fields of a struct can be accessed, non exported -// fields will be neglected. -func (s *Struct) Values() []interface{} { - fields := s.structFields() - - var t []interface{} - - for _, field := range fields { - val := s.value.FieldByName(field.Name) - - _, tagOpts := parseTag(field.Tag.Get(s.TagName)) - - // if the value is a zero value and the field is marked as omitempty do - // not include - if tagOpts.Has("omitempty") { - zero := reflect.Zero(val.Type()).Interface() - current := val.Interface() - - if reflect.DeepEqual(current, zero) { - continue - } - } - - if tagOpts.Has("string") { - s, ok := val.Interface().(fmt.Stringer) - if ok { - t = append(t, s.String()) - } - continue - } - - if IsStruct(val.Interface()) && !tagOpts.Has("omitnested") { - // look out for embedded structs, and convert them to a - // []interface{} to be added to the final values slice - for _, embeddedVal := range Values(val.Interface()) { - t = append(t, embeddedVal) - } - } else { - t = append(t, val.Interface()) - } - } - - return t -} - -// Fields returns a slice of Fields. A struct tag with the content of "-" -// ignores the checking of that particular field. Example: -// -// // Field is ignored by this package. -// Field bool `structs:"-"` -// -// It panics if s's kind is not struct. -func (s *Struct) Fields() []*Field { - return getFields(s.value, s.TagName) -} - -// Names returns a slice of field names. A struct tag with the content of "-" -// ignores the checking of that particular field. Example: -// -// // Field is ignored by this package. -// Field bool `structs:"-"` -// -// It panics if s's kind is not struct. -func (s *Struct) Names() []string { - fields := getFields(s.value, s.TagName) - - names := make([]string, len(fields)) - - for i, field := range fields { - names[i] = field.Name() - } - - return names -} - -func getFields(v reflect.Value, tagName string) []*Field { - if v.Kind() == reflect.Ptr { - v = v.Elem() - } - - t := v.Type() - - var fields []*Field - - for i := 0; i < t.NumField(); i++ { - field := t.Field(i) - - if tag := field.Tag.Get(tagName); tag == "-" { - continue - } - - f := &Field{ - field: field, - value: v.FieldByName(field.Name), - } - - fields = append(fields, f) - - } - - return fields -} - -// Field returns a new Field struct that provides several high level functions -// around a single struct field entity. It panics if the field is not found. -func (s *Struct) Field(name string) *Field { - f, ok := s.FieldOk(name) - if !ok { - panic("field not found") - } - - return f -} - -// FieldOk returns a new Field struct that provides several high level functions -// around a single struct field entity. The boolean returns true if the field -// was found. -func (s *Struct) FieldOk(name string) (*Field, bool) { - t := s.value.Type() - - field, ok := t.FieldByName(name) - if !ok { - return nil, false - } - - return &Field{ - field: field, - value: s.value.FieldByName(name), - defaultTag: s.TagName, - }, true -} - -// IsZero returns true if all fields in a struct is a zero value (not -// initialized) A struct tag with the content of "-" ignores the checking of -// that particular field. Example: -// -// // Field is ignored by this package. -// Field bool `structs:"-"` -// -// A value with the option of "omitnested" stops iterating further if the type -// is a struct. Example: -// -// // Field is not processed further by this package. -// Field time.Time `structs:"myName,omitnested"` -// Field *http.Request `structs:",omitnested"` -// -// Note that only exported fields of a struct can be accessed, non exported -// fields will be neglected. It panics if s's kind is not struct. -func (s *Struct) IsZero() bool { - fields := s.structFields() - - for _, field := range fields { - val := s.value.FieldByName(field.Name) - - _, tagOpts := parseTag(field.Tag.Get(s.TagName)) - - if IsStruct(val.Interface()) && !tagOpts.Has("omitnested") { - ok := IsZero(val.Interface()) - if !ok { - return false - } - - continue - } - - // zero value of the given field, such as "" for string, 0 for int - zero := reflect.Zero(val.Type()).Interface() - - // current value of the given field - current := val.Interface() - - if !reflect.DeepEqual(current, zero) { - return false - } - } - - return true -} - -// HasZero returns true if a field in a struct is not initialized (zero value). -// A struct tag with the content of "-" ignores the checking of that particular -// field. Example: -// -// // Field is ignored by this package. -// Field bool `structs:"-"` -// -// A value with the option of "omitnested" stops iterating further if the type -// is a struct. Example: -// -// // Field is not processed further by this package. -// Field time.Time `structs:"myName,omitnested"` -// Field *http.Request `structs:",omitnested"` -// -// Note that only exported fields of a struct can be accessed, non exported -// fields will be neglected. It panics if s's kind is not struct. -func (s *Struct) HasZero() bool { - fields := s.structFields() - - for _, field := range fields { - val := s.value.FieldByName(field.Name) - - _, tagOpts := parseTag(field.Tag.Get(s.TagName)) - - if IsStruct(val.Interface()) && !tagOpts.Has("omitnested") { - ok := HasZero(val.Interface()) - if ok { - return true - } - - continue - } - - // zero value of the given field, such as "" for string, 0 for int - zero := reflect.Zero(val.Type()).Interface() - - // current value of the given field - current := val.Interface() - - if reflect.DeepEqual(current, zero) { - return true - } - } - - return false -} - -// Name returns the structs's type name within its package. For more info refer -// to Name() function. -func (s *Struct) Name() string { - return s.value.Type().Name() -} - -// structFields returns the exported struct fields for a given s struct. This -// is a convenient helper method to avoid duplicate code in some of the -// functions. -func (s *Struct) structFields() []reflect.StructField { - t := s.value.Type() - - var f []reflect.StructField - - for i := 0; i < t.NumField(); i++ { - field := t.Field(i) - // we can't access the value of unexported fields - if field.PkgPath != "" { - continue - } - - // don't check if it's omitted - if tag := field.Tag.Get(s.TagName); tag == "-" { - continue - } - - f = append(f, field) - } - - return f -} - -func strctVal(s interface{}) reflect.Value { - v := reflect.ValueOf(s) - - // if pointer get the underlying element≤ - for v.Kind() == reflect.Ptr { - v = v.Elem() - } - - if v.Kind() != reflect.Struct { - panic("not struct") - } - - return v -} - -// Map converts the given struct to a map[string]interface{}. For more info -// refer to Struct types Map() method. It panics if s's kind is not struct. -func Map(s interface{}) map[string]interface{} { - return New(s).Map() -} - -// FillMap is the same as Map. Instead of returning the output, it fills the -// given map. -func FillMap(s interface{}, out map[string]interface{}) { - New(s).FillMap(out) -} - -// Values converts the given struct to a []interface{}. For more info refer to -// Struct types Values() method. It panics if s's kind is not struct. -func Values(s interface{}) []interface{} { - return New(s).Values() -} - -// Fields returns a slice of *Field. For more info refer to Struct types -// Fields() method. It panics if s's kind is not struct. -func Fields(s interface{}) []*Field { - return New(s).Fields() -} - -// Names returns a slice of field names. For more info refer to Struct types -// Names() method. It panics if s's kind is not struct. -func Names(s interface{}) []string { - return New(s).Names() -} - -// IsZero returns true if all fields is equal to a zero value. For more info -// refer to Struct types IsZero() method. It panics if s's kind is not struct. -func IsZero(s interface{}) bool { - return New(s).IsZero() -} - -// HasZero returns true if any field is equal to a zero value. For more info -// refer to Struct types HasZero() method. It panics if s's kind is not struct. -func HasZero(s interface{}) bool { - return New(s).HasZero() -} - -// IsStruct returns true if the given variable is a struct or a pointer to -// struct. -func IsStruct(s interface{}) bool { - v := reflect.ValueOf(s) - if v.Kind() == reflect.Ptr { - v = v.Elem() - } - - // uninitialized zero value of a struct - if v.Kind() == reflect.Invalid { - return false - } - - return v.Kind() == reflect.Struct -} - -// Name returns the structs's type name within its package. It returns an -// empty string for unnamed types. It panics if s's kind is not struct. -func Name(s interface{}) string { - return New(s).Name() -} - -// nested retrieves recursively all types for the given value and returns the -// nested value. -func (s *Struct) nested(val reflect.Value) interface{} { - var finalVal interface{} - - v := reflect.ValueOf(val.Interface()) - if v.Kind() == reflect.Ptr { - v = v.Elem() - } - - switch v.Kind() { - case reflect.Struct: - n := New(val.Interface()) - n.TagName = s.TagName - m := n.Map() - - // do not add the converted value if there are no exported fields, ie: - // time.Time - if len(m) == 0 { - finalVal = val.Interface() - } else { - finalVal = m - } - case reflect.Map: - // get the element type of the map - mapElem := val.Type() - switch val.Type().Kind() { - case reflect.Ptr, reflect.Array, reflect.Map, - reflect.Slice, reflect.Chan: - mapElem = val.Type().Elem() - if mapElem.Kind() == reflect.Ptr { - mapElem = mapElem.Elem() - } - } - - // only iterate over struct types, ie: map[string]StructType, - // map[string][]StructType, - if mapElem.Kind() == reflect.Struct || - (mapElem.Kind() == reflect.Slice && - mapElem.Elem().Kind() == reflect.Struct) { - m := make(map[string]interface{}, val.Len()) - for _, k := range val.MapKeys() { - m[k.String()] = s.nested(val.MapIndex(k)) - } - finalVal = m - break - } - - // TODO(arslan): should this be optional? - finalVal = val.Interface() - case reflect.Slice, reflect.Array: - if val.Type().Kind() == reflect.Interface { - finalVal = val.Interface() - break - } - - // TODO(arslan): should this be optional? - // do not iterate of non struct types, just pass the value. Ie: []int, - // []string, co... We only iterate further if it's a struct. - // i.e []foo or []*foo - if val.Type().Elem().Kind() != reflect.Struct && - !(val.Type().Elem().Kind() == reflect.Ptr && - val.Type().Elem().Elem().Kind() == reflect.Struct) { - finalVal = val.Interface() - break - } - - slices := make([]interface{}, val.Len(), val.Len()) - for x := 0; x < val.Len(); x++ { - slices[x] = s.nested(val.Index(x)) - } - finalVal = slices - default: - finalVal = val.Interface() - } - - return finalVal -} diff --git a/vendor/github.com/fatih/structs/tags.go b/vendor/github.com/fatih/structs/tags.go deleted file mode 100644 index 8859341..0000000 --- a/vendor/github.com/fatih/structs/tags.go +++ /dev/null @@ -1,32 +0,0 @@ -package structs - -import "strings" - -// tagOptions contains a slice of tag options -type tagOptions []string - -// Has returns true if the given optiton is available in tagOptions -func (t tagOptions) Has(opt string) bool { - for _, tagOpt := range t { - if tagOpt == opt { - return true - } - } - - return false -} - -// parseTag splits a struct field's tag into its name and a list of options -// which comes after a name. A tag is in the form of: "name,option1,option2". -// The name can be neglectected. -func parseTag(tag string) (string, tagOptions) { - // tag is one of followings: - // "" - // "name" - // "name,opt" - // "name,opt,opt2" - // ",opt" - - res := strings.Split(tag, ",") - return res[0], res[1:] -} diff --git a/vendor/github.com/gobuffalo/buffalo-plugins/LICENSE b/vendor/github.com/gobuffalo/buffalo-plugins/LICENSE deleted file mode 100644 index aab0dd4..0000000 --- a/vendor/github.com/gobuffalo/buffalo-plugins/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright © 2018 Mark Bates - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/gobuffalo/buffalo-plugins/plugins/command.go b/vendor/github.com/gobuffalo/buffalo-plugins/plugins/command.go deleted file mode 100644 index 48c1f17..0000000 --- a/vendor/github.com/gobuffalo/buffalo-plugins/plugins/command.go +++ /dev/null @@ -1,18 +0,0 @@ -package plugins - -// Command that the plugin supplies -type Command struct { - // Name "foo" - Name string `json:"name"` - // UseCommand "bar" - UseCommand string `json:"use_command"` - // BuffaloCommand "generate" - BuffaloCommand string `json:"buffalo_command"` - // Description "generates a foo" - Description string `json:"description"` - Aliases []string `json:"aliases"` - Binary string `json:"-"` -} - -// Commands is a slice of Command -type Commands []Command diff --git a/vendor/github.com/gobuffalo/buffalo-plugins/plugins/plugins.go b/vendor/github.com/gobuffalo/buffalo-plugins/plugins/plugins.go deleted file mode 100644 index 3db8915..0000000 --- a/vendor/github.com/gobuffalo/buffalo-plugins/plugins/plugins.go +++ /dev/null @@ -1,148 +0,0 @@ -package plugins - -import ( - "bytes" - "context" - "encoding/json" - "os" - "os/exec" - "path/filepath" - "runtime" - "strings" - "time" - - "github.com/gobuffalo/envy" - "github.com/markbates/oncer" - "github.com/sirupsen/logrus" -) - -// List maps a Buffalo command to a slice of Command -type List map[string]Commands - -var _list List - -// Available plugins for the `buffalo` command. -// It will look in $GOPATH/bin and the `./plugins` directory. -// This can be changed by setting the $BUFFALO_PLUGIN_PATH -// environment variable. -// -// Requirements: -// * file/command must be executable -// * file/command must start with `buffalo-` -// * file/command must respond to `available` and return JSON of -// plugins.Commands{} -// -// Limit full path scan with direct plugin path -// -// If a file/command doesn't respond to being invoked with `available` -// within one second, buffalo will assume that it is unable to load. This -// can be changed by setting the $BUFFALO_PLUGIN_TIMEOUT environment -// variable. It must be set to a duration that `time.ParseDuration` can -// process. -func Available() (List, error) { - var err error - oncer.Do("plugins.Available", func() { - list := List{} - paths := []string{"plugins"} - - from, err := envy.MustGet("BUFFALO_PLUGIN_PATH") - if err != nil { - from, err = envy.MustGet("GOPATH") - if err != nil { - return - } - from = filepath.Join(from, "bin") - } - - const timeoutEnv = "BUFFALO_PLUGIN_TIMEOUT" - timeout := time.Second - rawTimeout, err := envy.MustGet(timeoutEnv) - if err == nil { - if parsed, err := time.ParseDuration(rawTimeout); err == nil { - timeout = parsed - } else { - logrus.Errorf("%q value is malformed assuming default %q: %v", timeoutEnv, timeout, err) - } - } else { - logrus.Debugf("%q not set, assuming default of %v", timeoutEnv, timeout) - } - - if runtime.GOOS == "windows" { - paths = append(paths, strings.Split(from, ";")...) - } else { - paths = append(paths, strings.Split(from, ":")...) - } - - for _, p := range paths { - if ignorePath(p) { - continue - } - if _, err := os.Stat(p); err != nil { - continue - } - err := filepath.Walk(p, func(path string, info os.FileInfo, err error) error { - if err != nil { - // May indicate a permissions problem with the path, skip it - return nil - } - if info.IsDir() { - return nil - } - base := filepath.Base(path) - if strings.HasPrefix(base, "buffalo-") { - ctx, cancel := context.WithTimeout(context.Background(), timeout) - commands := askBin(ctx, path) - cancel() - for _, c := range commands { - bc := c.BuffaloCommand - if _, ok := list[bc]; !ok { - list[bc] = Commands{} - } - c.Binary = path - list[bc] = append(list[bc], c) - } - } - return nil - }) - if err != nil { - return - } - } - _list = list - }) - return _list, err -} - -func askBin(ctx context.Context, path string) Commands { - commands := Commands{} - - cmd := exec.CommandContext(ctx, path, "available") - bb := &bytes.Buffer{} - cmd.Stdout = bb - cmd.Stderr = bb - err := cmd.Run() - if err != nil { - logrus.Errorf("[PLUGIN] error loading plugin %s: %s\n%s\n", path, err, bb.String()) - return commands - } - msg := bb.String() - for len(msg) > 0 { - err = json.NewDecoder(strings.NewReader(msg)).Decode(&commands) - if err == nil { - return commands - } - msg = msg[1:] - } - logrus.Errorf("[PLUGIN] error decoding plugin %s: %s\n%s\n", path, err, msg) - return commands -} - -func ignorePath(p string) bool { - p = strings.ToLower(p) - for _, x := range []string{`c:\windows`, `c:\program`} { - if strings.HasPrefix(p, x) { - return true - } - } - return false -} diff --git a/vendor/github.com/gobuffalo/buffalo-plugins/plugins/version.go b/vendor/github.com/gobuffalo/buffalo-plugins/plugins/version.go deleted file mode 100644 index f3be03a..0000000 --- a/vendor/github.com/gobuffalo/buffalo-plugins/plugins/version.go +++ /dev/null @@ -1,3 +0,0 @@ -package plugins - -const Version = "v0.0.1" diff --git a/vendor/github.com/gobuffalo/buffalo/LICENSE.txt b/vendor/github.com/gobuffalo/buffalo/LICENSE.txt deleted file mode 100644 index 3ccb336..0000000 --- a/vendor/github.com/gobuffalo/buffalo/LICENSE.txt +++ /dev/null @@ -1,8 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2016 Mark Bates - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/gobuffalo/buffalo/meta/app.go b/vendor/github.com/gobuffalo/buffalo/meta/app.go deleted file mode 100644 index 144be1e..0000000 --- a/vendor/github.com/gobuffalo/buffalo/meta/app.go +++ /dev/null @@ -1,154 +0,0 @@ -package meta - -import ( - "bytes" - "encoding/json" - "fmt" - "io/ioutil" - "os" - "path" - "path/filepath" - "runtime" - "strings" - - "github.com/gobuffalo/envy" - "github.com/markbates/inflect" -) - -var modsOn = (strings.TrimSpace(envy.Get("GO111MODULE", "off")) == "on") - -func init() { - if modsOn { - fmt.Println("experimental go modules support has been enabled [GO111MODULE=on]") - } -} - -// App represents meta data for a Buffalo application on disk -type App struct { - Pwd string `json:"pwd"` - Root string `json:"root"` - GoPath string `json:"go_path"` - Name inflect.Name `json:"name"` - Bin string `json:"bin"` - PackagePkg string `json:"package_path"` - ActionsPkg string `json:"actions_path"` - ModelsPkg string `json:"models_path"` - GriftsPkg string `json:"grifts_path"` - VCS string `json:"vcs"` - WithPop bool `json:"with_pop"` - WithSQLite bool `json:"with_sqlite"` - WithDep bool `json:"with_dep"` - WithWebpack bool `json:"with_webpack"` - WithYarn bool `json:"with_yarn"` - WithDocker bool `json:"with_docker"` - WithGrifts bool `json:"with_grifts"` - WithModules bool `json:"with_modules"` -} - -// New App based on the details found at the provided root path -func New(root string) App { - pwd, _ := os.Getwd() - if root == "." { - root = pwd - } - - // Handle symlinks - var oldPwd = pwd - pwd = ResolveSymlinks(pwd) - os.Chdir(pwd) - if runtime.GOOS != "windows" { - // On Non-Windows OS, os.Getwd() uses PWD env var as a preferred - // way to get the working dir. - os.Setenv("PWD", pwd) - } - defer func() { - // Restore PWD - os.Chdir(oldPwd) - if runtime.GOOS != "windows" { - os.Setenv("PWD", oldPwd) - } - }() - - // Gather meta data - name := inflect.Name(filepath.Base(root)) - - pp := envy.CurrentPackage() - if filepath.Base(pp) != string(name) { - pp = path.Join(pp, string(name)) - } - if modsOn { - if !strings.HasPrefix(pwd, filepath.Join(envy.GoPath(), "src")) { - pp = name.String() - } - } - - app := App{ - Pwd: pwd, - Root: root, - GoPath: envy.GoPath(), - Name: name, - PackagePkg: pp, - ActionsPkg: pp + "/actions", - ModelsPkg: pp + "/models", - GriftsPkg: pp + "/grifts", - WithModules: modsOn, - } - - app.Bin = filepath.Join("bin", filepath.Base(root)) - - if runtime.GOOS == "windows" { - app.Bin += ".exe" - } - db := filepath.Join(root, "database.yml") - if _, err := os.Stat(db); err == nil { - app.WithPop = true - if b, err := ioutil.ReadFile(db); err == nil { - app.WithSQLite = bytes.Contains(bytes.ToLower(b), []byte("sqlite")) - } - } - if _, err := os.Stat(filepath.Join(root, "Gopkg.toml")); err == nil { - app.WithDep = true - } - if _, err := os.Stat(filepath.Join(root, "webpack.config.js")); err == nil { - app.WithWebpack = true - } - if _, err := os.Stat(filepath.Join(root, "yarn.lock")); err == nil { - app.WithYarn = true - } - if _, err := os.Stat(filepath.Join(root, "Dockerfile")); err == nil { - app.WithDocker = true - } - if _, err := os.Stat(filepath.Join(root, "grifts")); err == nil { - app.WithGrifts = true - } - if _, err := os.Stat(filepath.Join(root, ".git")); err == nil { - app.VCS = "git" - } else if _, err := os.Stat(filepath.Join(root, ".bzr")); err == nil { - app.VCS = "bzr" - } - - return app -} - -// ResolveSymlinks takes a path and gets the pointed path -// if the original one is a symlink. -func ResolveSymlinks(p string) string { - cd, err := os.Lstat(p) - if err != nil { - return p - } - if cd.Mode()&os.ModeSymlink != 0 { - // This is a symlink - r, err := filepath.EvalSymlinks(p) - if err != nil { - return p - } - return r - } - return p -} - -func (a App) String() string { - b, _ := json.Marshal(a) - return string(b) -} diff --git a/vendor/github.com/gobuffalo/buffalo/meta/tags.go b/vendor/github.com/gobuffalo/buffalo/meta/tags.go deleted file mode 100644 index b7e2524..0000000 --- a/vendor/github.com/gobuffalo/buffalo/meta/tags.go +++ /dev/null @@ -1,30 +0,0 @@ -package meta - -import ( - "bytes" - "io/ioutil" - "strings" -) - -// BuildTags are tags used for building apps -type BuildTags []string - -// String returns the tags in the form of: -// "foo bar baz" (with the quotes!) -func (t BuildTags) String() string { - return strings.Join(t, " ") -} - -// BuildTags combines the passed in env, and any additional tags, -// with tags that Buffalo decides the build process requires. -// An example would be adding the "sqlite" build tag if using -// SQLite3. -func (a App) BuildTags(env string, tags ...string) BuildTags { - tags = append(tags, env) - if b, err := ioutil.ReadFile("database.yml"); err == nil { - if bytes.Contains(b, []byte("sqlite")) { - tags = append(tags, "sqlite") - } - } - return BuildTags(tags) -} diff --git a/vendor/github.com/gobuffalo/envy/.env b/vendor/github.com/gobuffalo/envy/.env deleted file mode 100644 index 33eeb3b..0000000 --- a/vendor/github.com/gobuffalo/envy/.env +++ /dev/null @@ -1,5 +0,0 @@ -# This is a comment -# We can use equal or colon notation -DIR: root -FLAVOUR: none -INSIDE_FOLDER=false \ No newline at end of file diff --git a/vendor/github.com/gobuffalo/envy/.gitignore b/vendor/github.com/gobuffalo/envy/.gitignore deleted file mode 100644 index 3689718..0000000 --- a/vendor/github.com/gobuffalo/envy/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -*.log -.DS_Store -doc -tmp -pkg -*.gem -*.pid -coverage -coverage.data -build/* -*.pbxuser -*.mode1v3 -.svn -profile -.console_history -.sass-cache/* -.rake_tasks~ -*.log.lck -solr/ -.jhw-cache/ -jhw.* -*.sublime* -node_modules/ -dist/ -generated/ -.vendor/ -bin/* -gin-bin -.idea/ diff --git a/vendor/github.com/gobuffalo/envy/.travis.yml b/vendor/github.com/gobuffalo/envy/.travis.yml deleted file mode 100644 index c8f27c8..0000000 --- a/vendor/github.com/gobuffalo/envy/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: go - -sudo: false - -go: - - 1.7 - - 1.8 - - 1.9 - - "1.10" - - tip - -matrix: - allow_failures: - - go: 'tip' diff --git a/vendor/github.com/gobuffalo/envy/LICENSE.txt b/vendor/github.com/gobuffalo/envy/LICENSE.txt deleted file mode 100644 index 123ddc0..0000000 --- a/vendor/github.com/gobuffalo/envy/LICENSE.txt +++ /dev/null @@ -1,8 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2018 Mark Bates - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/gobuffalo/envy/README.md b/vendor/github.com/gobuffalo/envy/README.md deleted file mode 100644 index f54462a..0000000 --- a/vendor/github.com/gobuffalo/envy/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# envy -[![Build Status](https://travis-ci.org/gobuffalo/envy.svg?branch=master)](https://travis-ci.org/gobuffalo/envy) - -Envy makes working with ENV variables in Go trivial. - -* Get ENV variables with default values. -* Set ENV variables safely without affecting the underlying system. -* Temporarily change ENV vars; useful for testing. -* Map all of the key/values in the ENV. -* Loads .env files (by using [godotenv](https://github.com/joho/godotenv/)) -* More! - -## Installation - -```text -$ go get -u github.com/gobuffalo/envy -``` - -## Usage - -```go -func Test_Get(t *testing.T) { - r := require.New(t) - r.NotZero(os.Getenv("GOPATH")) - r.Equal(os.Getenv("GOPATH"), envy.Get("GOPATH", "foo")) - r.Equal("bar", envy.Get("IDONTEXIST", "bar")) -} - -func Test_MustGet(t *testing.T) { - r := require.New(t) - r.NotZero(os.Getenv("GOPATH")) - v, err := envy.MustGet("GOPATH") - r.NoError(err) - r.Equal(os.Getenv("GOPATH"), v) - - _, err = envy.MustGet("IDONTEXIST") - r.Error(err) -} - -func Test_Set(t *testing.T) { - r := require.New(t) - _, err := envy.MustGet("FOO") - r.Error(err) - - envy.Set("FOO", "foo") - r.Equal("foo", envy.Get("FOO", "bar")) -} - -func Test_Temp(t *testing.T) { - r := require.New(t) - - _, err := envy.MustGet("BAR") - r.Error(err) - - envy.Temp(func() { - envy.Set("BAR", "foo") - r.Equal("foo", envy.Get("BAR", "bar")) - _, err = envy.MustGet("BAR") - r.NoError(err) - }) - - _, err = envy.MustGet("BAR") - r.Error(err) -} -``` -## .env files support - -Envy now supports loading `.env` files by using the [godotenv library](https://github.com/joho/godotenv/). -That means one can use and define multiple `.env` files which will be loaded on-demand. By default, no env files will be loaded. To load one or more, you need to call the `envy.Load` function in one of the following ways: - -```go -envy.Load() // 1 - -envy.Load("MY_ENV_FILE") // 2 - -envy.Load(".env", ".env.prod") // 3 - -envy.Load(".env", "NON_EXISTING_FILE") // 4 - -// 5 -envy.Load(".env") -envy.Load("NON_EXISTING_FILE") - -// 6 -envy.Load(".env", "NON_EXISTING_FILE", ".env.prod") -``` - -1. Will load the default `.env` file -2. Will load the file `MY_ENV_FILE`, **but not** `.env` -3. Will load the file `.env`, and after that will load the `.env.prod` file. If any variable is redefined in `. env.prod` it will be overwritten (will contain the `env.prod` value) -4. Will load the `.env` file and return an error as the second file does not exist. The values in `.env` will be loaded and available. -5. Same as 4 -6. Will load the `.env` file and return an error as the second file does not exist. The values in `.env` will be loaded and available, **but the ones in** `.env.prod` **won't**. diff --git a/vendor/github.com/gobuffalo/envy/envy.go b/vendor/github.com/gobuffalo/envy/envy.go deleted file mode 100644 index 7115311..0000000 --- a/vendor/github.com/gobuffalo/envy/envy.go +++ /dev/null @@ -1,223 +0,0 @@ -package envy - -import ( - "flag" - "fmt" - "os" - "os/exec" - "path/filepath" - "runtime" - "strconv" - "strings" - "sync" - - "github.com/joho/godotenv" -) - -var gil = &sync.RWMutex{} -var env = map[string]string{} - -func init() { - Load() - loadEnv() -} - -// Load the ENV variables to the env map -func loadEnv() { - gil.Lock() - defer gil.Unlock() - // Detect the Go version on the user system, not the one that was used to compile the binary - v := "" - out, err := exec.Command("go", "version").Output() - if err == nil { - // This will break when Go 2 lands - v = strings.Split(string(out), " ")[2][4:] - } else { - v = runtime.Version()[4:] - } - - goRuntimeVersion, _ := strconv.ParseFloat(runtime.Version()[4:], 64) - - goVersion, err := strconv.ParseFloat(v, 64) - if err != nil { - goVersion = goRuntimeVersion - } - - if os.Getenv("GO_ENV") == "" { - if v := flag.Lookup("test.v"); v != nil && v.Value.String() == "true" { - env["GO_ENV"] = "test" - } - } - - // set the GOPATH if using >= 1.8 and the GOPATH isn't set - if goVersion >= 8 && os.Getenv("GOPATH") == "" { - out, err := exec.Command("go", "env", "GOPATH").Output() - if err == nil { - gp := strings.TrimSpace(string(out)) - os.Setenv("GOPATH", gp) - } - } - - for _, e := range os.Environ() { - pair := strings.Split(e, "=") - env[pair[0]] = os.Getenv(pair[0]) - } -} - -// Reload the ENV variables. Useful if -// an external ENV manager has been used -func Reload() { - env = map[string]string{} - loadEnv() -} - -// Load .env files. Files will be loaded in the same order that are received. -// Redefined vars will override previously existing values. -// IE: envy.Load(".env", "test_env/.env") will result in DIR=test_env -// If no arg passed, it will try to load a .env file. -func Load(files ...string) error { - - // If no files received, load the default one - if len(files) == 0 { - err := godotenv.Overload() - if err == nil { - Reload() - } - return err - } - - // We received a list of files - for _, file := range files { - - // Check if it exists or we can access - if _, err := os.Stat(file); err != nil { - // It does not exist or we can not access. - // Return and stop loading - return err - } - - // It exists and we have permission. Load it - if err := godotenv.Overload(file); err != nil { - return err - } - - // Reload the env so all new changes are noticed - Reload() - - } - return nil -} - -// Get a value from the ENV. If it doesn't exist the -// default value will be returned. -func Get(key string, value string) string { - gil.RLock() - defer gil.RUnlock() - if v, ok := env[key]; ok { - return v - } - return value -} - -// Get a value from the ENV. If it doesn't exist -// an error will be returned -func MustGet(key string) (string, error) { - gil.RLock() - defer gil.RUnlock() - if v, ok := env[key]; ok { - return v, nil - } - return "", fmt.Errorf("could not find ENV var with %s", key) -} - -// Set a value into the ENV. This is NOT permanent. It will -// only affect values accessed through envy. -func Set(key string, value string) { - gil.Lock() - defer gil.Unlock() - env[key] = value -} - -// MustSet the value into the underlying ENV, as well as envy. -// This may return an error if there is a problem setting the -// underlying ENV value. -func MustSet(key string, value string) error { - gil.Lock() - defer gil.Unlock() - err := os.Setenv(key, value) - if err != nil { - return err - } - env[key] = value - return nil -} - -// Map all of the keys/values set in envy. -func Map() map[string]string { - gil.RLock() - defer gil.RUnlock() - cp := map[string]string{} - for k, v := range env { - cp[k] = v - } - return env -} - -// Temp makes a copy of the values and allows operation on -// those values temporarily during the run of the function. -// At the end of the function run the copy is discarded and -// the original values are replaced. This is useful for testing. -// Warning: This function is NOT safe to use from a goroutine or -// from code which may access any Get or Set function from a goroutine -func Temp(f func()) { - oenv := env - env = map[string]string{} - for k, v := range oenv { - env[k] = v - } - defer func() { env = oenv }() - f() -} - -func GoPath() string { - return Get("GOPATH", "") -} - -// GoPaths returns all possible GOPATHS that are set. -func GoPaths() []string { - gp := Get("GOPATH", "") - if runtime.GOOS == "windows" { - return strings.Split(gp, ";") // Windows uses a different separator - } - return strings.Split(gp, ":") -} - -func importPath(path string) string { - for _, gopath := range GoPaths() { - srcpath := filepath.Join(gopath, "src") - rel, err := filepath.Rel(srcpath, path) - if err == nil { - return filepath.ToSlash(rel) - } - } - - // fallback to trim - rel := strings.TrimPrefix(path, filepath.Join(GoPath(), "src")) - rel = strings.TrimPrefix(rel, string(filepath.Separator)) - return filepath.ToSlash(rel) -} - -func CurrentPackage() string { - pwd, _ := os.Getwd() - return importPath(pwd) -} - -func Environ() []string { - gil.RLock() - defer gil.RUnlock() - var e []string - for k, v := range env { - e = append(e, fmt.Sprintf("%s=%s", k, v)) - } - return e -} diff --git a/vendor/github.com/gobuffalo/envy/go.mod b/vendor/github.com/gobuffalo/envy/go.mod deleted file mode 100644 index 00cec12..0000000 --- a/vendor/github.com/gobuffalo/envy/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/gobuffalo/envy - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/joho/godotenv v1.2.0 - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/testify v1.2.2 -) diff --git a/vendor/github.com/gobuffalo/envy/go.sum b/vendor/github.com/gobuffalo/envy/go.sum deleted file mode 100644 index 887cc15..0000000 --- a/vendor/github.com/gobuffalo/envy/go.sum +++ /dev/null @@ -1,8 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/joho/godotenv v1.2.0 h1:vGTvz69FzUFp+X4/bAkb0j5BoLC+9bpqTWY8mjhA9pc= -github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= diff --git a/vendor/github.com/gobuffalo/flect/.gitignore b/vendor/github.com/gobuffalo/flect/.gitignore deleted file mode 100644 index ab4783b..0000000 --- a/vendor/github.com/gobuffalo/flect/.gitignore +++ /dev/null @@ -1,28 +0,0 @@ -*.log -.DS_Store -doc -tmp -pkg -*.gem -*.pid -coverage -coverage.data -build/* -*.pbxuser -*.mode1v3 -.svn -profile -.console_history -.sass-cache/* -.rake_tasks~ -*.log.lck -solr/ -.jhw-cache/ -jhw.* -*.sublime* -node_modules/ -dist/ -generated/ -.vendor/ -bin/* -gin-bin diff --git a/vendor/github.com/gobuffalo/flect/.travis.yml b/vendor/github.com/gobuffalo/flect/.travis.yml deleted file mode 100644 index b05f79d..0000000 --- a/vendor/github.com/gobuffalo/flect/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: go - -sudo: false - -go: - - 1.8 - - 1.9 - - "1.10" - - tip - -matrix: - allow_failures: - - go: 'tip' - -script: - - go test -race -v ./... diff --git a/vendor/github.com/gobuffalo/flect/LICENSE.txt b/vendor/github.com/gobuffalo/flect/LICENSE.txt deleted file mode 100644 index 123ddc0..0000000 --- a/vendor/github.com/gobuffalo/flect/LICENSE.txt +++ /dev/null @@ -1,8 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2018 Mark Bates - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/gobuffalo/flect/README.md b/vendor/github.com/gobuffalo/flect/README.md deleted file mode 100644 index af0afbd..0000000 --- a/vendor/github.com/gobuffalo/flect/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Flect - -

-GoDoc -Build Status -Go Report Card -

- -This is a new inflection engine to replace [https://github.com/markbates/inflect](https://github.com/markbates/inflect) designed to be more modular, more readable, and easier to fix issues on than the original. - -## Installation - -```bash -$ go get -u -v github.com/gobuffalo/flect -``` - -## `github.com/gobuffalo/flect` -GoDoc - -The `github.com/gobuffalo/flect` package contains "basic" inflection tools, like pluralization, singularization, etc... - -### The `Ident` Type - -In addition to helpful methods that take in a `string` and return a `string`, there is an `Ident` type that can be used to create new, custom, inflection rules. - -The `Ident` type contains two fields. - -* `Original` - This is the original `string` that was used to create the `Ident` -* `Parts` - This is a `[]string` that represents all of the "parts" of the string, that have been split apart, making the segments easier to work with - -Examples of creating new inflection rules using `Ident` can be found in the `github.com/gobuffalo/flect/name` package. - -## `github.com/gobuffalo/flect/name` -GoDoc - -The `github.com/gobuffalo/flect/name` package contains more "business" inflection rules like creating proper names, table names, etc... diff --git a/vendor/github.com/gobuffalo/flect/acronyms.go b/vendor/github.com/gobuffalo/flect/acronyms.go deleted file mode 100644 index 0208f59..0000000 --- a/vendor/github.com/gobuffalo/flect/acronyms.go +++ /dev/null @@ -1,148 +0,0 @@ -package flect - -var baseAcronyms = map[string]bool{ - "OK": true, - "UTF8": true, - "HTML": true, - "JSON": true, - "JWT": true, - "ID": true, - "UUID": true, - "SQL": true, - "ACK": true, - "ACL": true, - "ADSL": true, - "AES": true, - "ANSI": true, - "API": true, - "ARP": true, - "ATM": true, - "BGP": true, - "BSS": true, - "CCITT": true, - "CHAP": true, - "CIDR": true, - "CIR": true, - "CLI": true, - "CPE": true, - "CPU": true, - "CRC": true, - "CRT": true, - "CSMA": true, - "CMOS": true, - "DCE": true, - "DEC": true, - "DES": true, - "DHCP": true, - "DNS": true, - "DRAM": true, - "DSL": true, - "DSLAM": true, - "DTE": true, - "DMI": true, - "EHA": true, - "EIA": true, - "EIGRP": true, - "EOF": true, - "ESS": true, - "FCC": true, - "FCS": true, - "FDDI": true, - "FTP": true, - "GBIC": true, - "gbps": true, - "GEPOF": true, - "HDLC": true, - "HTTP": true, - "HTTPS": true, - "IANA": true, - "ICMP": true, - "IDF": true, - "IDS": true, - "IEEE": true, - "IETF": true, - "IMAP": true, - "IP": true, - "IPS": true, - "ISDN": true, - "ISP": true, - "kbps": true, - "LACP": true, - "LAN": true, - "LAPB": true, - "LAPF": true, - "LLC": true, - "MAC": true, - "Mbps": true, - "MC": true, - "MDF": true, - "MIB": true, - "MoCA": true, - "MPLS": true, - "MTU": true, - "NAC": true, - "NAT": true, - "NBMA": true, - "NIC": true, - "NRZ": true, - "NRZI": true, - "NVRAM": true, - "OSI": true, - "OSPF": true, - "OUI": true, - "PAP": true, - "PAT": true, - "PC": true, - "PIM": true, - "PCM": true, - "PDU": true, - "POP3": true, - "POTS": true, - "PPP": true, - "PPTP": true, - "PTT": true, - "PVST": true, - "RAM": true, - "RARP": true, - "RFC": true, - "RIP": true, - "RLL": true, - "ROM": true, - "RSTP": true, - "RTP": true, - "RCP": true, - "SDLC": true, - "SFD": true, - "SFP": true, - "SLARP": true, - "SLIP": true, - "SMTP": true, - "SNA": true, - "SNAP": true, - "SNMP": true, - "SOF": true, - "SRAM": true, - "SSH": true, - "SSID": true, - "STP": true, - "SYN": true, - "TDM": true, - "TFTP": true, - "TIA": true, - "TOFU": true, - "UDP": true, - "URL": true, - "URI": true, - "USB": true, - "UTP": true, - "VC": true, - "VLAN": true, - "VLSM": true, - "VPN": true, - "W3C": true, - "WAN": true, - "WEP": true, - "WiFi": true, - "WPA": true, - "WWW": true, -} diff --git a/vendor/github.com/gobuffalo/flect/camelize.go b/vendor/github.com/gobuffalo/flect/camelize.go deleted file mode 100644 index d8851c8..0000000 --- a/vendor/github.com/gobuffalo/flect/camelize.go +++ /dev/null @@ -1,44 +0,0 @@ -package flect - -import ( - "strings" - "unicode" -) - -// Camelize returns a camelize version of a string -// bob dylan = bobDylan -// widget_id = widgetID -// WidgetID = widgetID -func Camelize(s string) string { - return New(s).Camelize().String() -} - -// Camelize returns a camelize version of a string -// bob dylan = bobDylan -// widget_id = widgetID -// WidgetID = widgetID -func (i Ident) Camelize() Ident { - var out []string - for i, part := range i.Parts { - var x string - var capped bool - for _, c := range part { - if unicode.IsLetter(c) || unicode.IsDigit(c) { - if i == 0 { - x += string(unicode.ToLower(c)) - continue - } - if !capped { - capped = true - x += string(unicode.ToUpper(c)) - continue - } - x += string(c) - } - } - if x != "" { - out = append(out, x) - } - } - return New(strings.Join(out, "")) -} diff --git a/vendor/github.com/gobuffalo/flect/capitalize.go b/vendor/github.com/gobuffalo/flect/capitalize.go deleted file mode 100644 index 42ecc16..0000000 --- a/vendor/github.com/gobuffalo/flect/capitalize.go +++ /dev/null @@ -1,27 +0,0 @@ -package flect - -import "unicode" - -// Capitalize will cap the first letter of string -// user = User -// bob dylan = Bob dylan -// widget_id = Widget_id -func Capitalize(s string) string { - return New(s).Capitalize().String() -} - -// Capitalize will cap the first letter of string -// user = User -// bob dylan = Bob dylan -// widget_id = Widget_id -func (i Ident) Capitalize() Ident { - var x string - if len(i.Parts) == 0 { - return New("") - } - x = string(unicode.ToTitle(rune(i.Original[0]))) - if len(i.Original) > 1 { - x += i.Original[1:] - } - return New(x) -} diff --git a/vendor/github.com/gobuffalo/flect/dasherize.go b/vendor/github.com/gobuffalo/flect/dasherize.go deleted file mode 100644 index c7a8a33..0000000 --- a/vendor/github.com/gobuffalo/flect/dasherize.go +++ /dev/null @@ -1,34 +0,0 @@ -package flect - -import ( - "strings" - "unicode" -) - -// Dasherize returns an alphanumeric, lowercased, dashed string -// Donald E. Knuth = donald-e-knuth -// Test with + sign = test-with-sign -// admin/WidgetID = admin-widget-id -func Dasherize(s string) string { - return New(s).Dasherize().String() -} - -// Dasherize returns an alphanumeric, lowercased, dashed string -// Donald E. Knuth = donald-e-knuth -// Test with + sign = test-with-sign -// admin/WidgetID = admin-widget-id -func (i Ident) Dasherize() Ident { - var parts []string - - for _, part := range i.Parts { - var x string - for _, c := range part { - if unicode.IsLetter(c) || unicode.IsDigit(c) { - x += string(c) - } - } - parts = xappend(parts, x) - } - - return New(strings.ToLower(strings.Join(parts, "-"))) -} diff --git a/vendor/github.com/gobuffalo/flect/flect.go b/vendor/github.com/gobuffalo/flect/flect.go deleted file mode 100644 index 4af966b..0000000 --- a/vendor/github.com/gobuffalo/flect/flect.go +++ /dev/null @@ -1,84 +0,0 @@ -package flect - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "unicode" -) - -func init() { - pwd, _ := os.Getwd() - cfg := filepath.Join(pwd, "inflections.json") - if p := os.Getenv("INFLECT_PATH"); p != "" { - cfg = p - } - if _, err := os.Stat(cfg); err == nil { - b, err := ioutil.ReadFile(cfg) - if err != nil { - fmt.Printf("could not read inflection file %s (%s)\n", cfg, err) - return - } - if err = LoadReader(bytes.NewReader(b)); err != nil { - fmt.Println(err) - } - } -} - -//LoadReader loads rules from io.Reader param -func LoadReader(r io.Reader) error { - m := map[string]string{} - err := json.NewDecoder(r).Decode(&m) - if err != nil { - return fmt.Errorf("could not decode inflection JSON from reader: %s", err) - } - pluralMoot.Lock() - defer pluralMoot.Unlock() - singularMoot.Lock() - defer singularMoot.Unlock() - - for s, p := range m { - singleToPlural[s] = p - pluralToSingle[p] = s - } - return nil -} - -var spaces = []rune{'_', ' ', ':', '-', '/'} - -func isSpace(c rune) bool { - for _, r := range spaces { - if r == c { - return true - } - } - return unicode.IsSpace(c) -} - -func xappend(a []string, ss ...string) []string { - for _, s := range ss { - s = strings.TrimSpace(s) - for _, x := range spaces { - s = strings.Trim(s, string(x)) - } - if _, ok := baseAcronyms[strings.ToUpper(s)]; ok { - s = strings.ToUpper(s) - } - if s != "" { - a = append(a, s) - } - } - return a -} - -func abs(x int) int { - if x < 0 { - return -x - } - return x -} diff --git a/vendor/github.com/gobuffalo/flect/go.mod b/vendor/github.com/gobuffalo/flect/go.mod deleted file mode 100644 index affc9f6..0000000 --- a/vendor/github.com/gobuffalo/flect/go.mod +++ /dev/null @@ -1,7 +0,0 @@ -module github.com/gobuffalo/flect - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/testify v1.2.2 -) diff --git a/vendor/github.com/gobuffalo/flect/go.sum b/vendor/github.com/gobuffalo/flect/go.sum deleted file mode 100644 index e03ee77..0000000 --- a/vendor/github.com/gobuffalo/flect/go.sum +++ /dev/null @@ -1,6 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= diff --git a/vendor/github.com/gobuffalo/flect/ident.go b/vendor/github.com/gobuffalo/flect/ident.go deleted file mode 100644 index 171abbc..0000000 --- a/vendor/github.com/gobuffalo/flect/ident.go +++ /dev/null @@ -1,86 +0,0 @@ -package flect - -import ( - "regexp" - "strings" - "unicode" - "unicode/utf8" -) - -// Ident represents the string and it's parts -type Ident struct { - Original string - Parts []string -} - -// String implements fmt.Stringer and returns the original string -func (i Ident) String() string { - return i.Original -} - -// New creates a new Ident from the string -func New(s string) Ident { - i := Ident{ - Original: s, - Parts: toParts(s), - } - - return i -} - -var splitRx = regexp.MustCompile("[^\\p{L}]") - -func toParts(s string) []string { - parts := []string{} - s = strings.TrimSpace(s) - if len(s) == 0 { - return parts - } - if _, ok := baseAcronyms[strings.ToUpper(s)]; ok { - return []string{strings.ToUpper(s)} - } - var prev rune - var x string - for _, c := range s { - cs := string(c) - // fmt.Println("### cs ->", cs) - // fmt.Println("### unicode.IsControl(c) ->", unicode.IsControl(c)) - // fmt.Println("### unicode.IsDigit(c) ->", unicode.IsDigit(c)) - // fmt.Println("### unicode.IsGraphic(c) ->", unicode.IsGraphic(c)) - // fmt.Println("### unicode.IsLetter(c) ->", unicode.IsLetter(c)) - // fmt.Println("### unicode.IsLower(c) ->", unicode.IsLower(c)) - // fmt.Println("### unicode.IsMark(c) ->", unicode.IsMark(c)) - // fmt.Println("### unicode.IsPrint(c) ->", unicode.IsPrint(c)) - // fmt.Println("### unicode.IsPunct(c) ->", unicode.IsPunct(c)) - // fmt.Println("### unicode.IsSpace(c) ->", unicode.IsSpace(c)) - // fmt.Println("### unicode.IsTitle(c) ->", unicode.IsTitle(c)) - // fmt.Println("### unicode.IsUpper(c) ->", unicode.IsUpper(c)) - if !utf8.ValidRune(c) { - continue - } - - if isSpace(c) { - parts = xappend(parts, x) - x = cs - prev = c - continue - } - if unicode.IsUpper(c) && !unicode.IsUpper(prev) { - parts = xappend(parts, x) - x = cs - prev = c - continue - } - if unicode.IsLetter(c) || unicode.IsDigit(c) || unicode.IsPunct(c) || c == '`' { - prev = c - x += cs - continue - } - parts = xappend(parts, x) - x = "" - prev = c - } - parts = xappend(parts, x) - - return parts -} diff --git a/vendor/github.com/gobuffalo/flect/lower_upper.go b/vendor/github.com/gobuffalo/flect/lower_upper.go deleted file mode 100644 index 930da58..0000000 --- a/vendor/github.com/gobuffalo/flect/lower_upper.go +++ /dev/null @@ -1,13 +0,0 @@ -package flect - -import "strings" - -// ToUpper is a convience wrapper for strings.ToUpper -func (i Ident) ToUpper() Ident { - return New(strings.ToUpper(i.Original)) -} - -// ToLower is a convience wrapper for strings.ToLower -func (i Ident) ToLower() Ident { - return New(strings.ToLower(i.Original)) -} diff --git a/vendor/github.com/gobuffalo/flect/name/char.go b/vendor/github.com/gobuffalo/flect/name/char.go deleted file mode 100644 index 64b2cb8..0000000 --- a/vendor/github.com/gobuffalo/flect/name/char.go +++ /dev/null @@ -1,24 +0,0 @@ -package name - -import "unicode" - -// Char returns the first letter, lowered -// "" = "x" -// "foo" = "f" -// "123d456" = "d" -func Char(s string) string { - return New(s).Char().String() -} - -// Char returns the first letter, lowered -// "" = "x" -// "foo" = "f" -// "123d456" = "d" -func (i Ident) Char() Ident { - for _, c := range i.Original { - if unicode.IsLetter(c) { - return New(string(unicode.ToLower(c))) - } - } - return New("x") -} diff --git a/vendor/github.com/gobuffalo/flect/name/file.go b/vendor/github.com/gobuffalo/flect/name/file.go deleted file mode 100644 index ec5cdae..0000000 --- a/vendor/github.com/gobuffalo/flect/name/file.go +++ /dev/null @@ -1,28 +0,0 @@ -package name - -import ( - "strings" - - "github.com/gobuffalo/flect" -) - -// File creates a suitable file name -// admin/widget = admin/widget -// foo_bar = foo_bar -// U$ser = u_ser -func File(s string, exts ...string) string { - return New(s).File(exts...).String() -} - -// File creates a suitable file name -// admin/widget = admin/widget -// foo_bar = foo_bar -// U$ser = u_ser -func (i Ident) File(exts ...string) Ident { - var parts []string - - for _, part := range strings.Split(i.Original, "/") { - parts = append(parts, flect.Underscore(part)) - } - return New(strings.Join(parts, "/") + strings.Join(exts, "")) -} diff --git a/vendor/github.com/gobuffalo/flect/name/ident.go b/vendor/github.com/gobuffalo/flect/name/ident.go deleted file mode 100644 index 91f5d8b..0000000 --- a/vendor/github.com/gobuffalo/flect/name/ident.go +++ /dev/null @@ -1,13 +0,0 @@ -package name - -import "github.com/gobuffalo/flect" - -// Ident represents the string and it's parts -type Ident struct { - flect.Ident -} - -// New creates a new Ident from the string -func New(s string) Ident { - return Ident{flect.New(s)} -} diff --git a/vendor/github.com/gobuffalo/flect/name/join.go b/vendor/github.com/gobuffalo/flect/name/join.go deleted file mode 100644 index de84883..0000000 --- a/vendor/github.com/gobuffalo/flect/name/join.go +++ /dev/null @@ -1,20 +0,0 @@ -package name - -import "path/filepath" - -func FilePathJoin(names ...string) string { - var ni = make([]Ident, len(names)) - for i, n := range names { - ni[i] = New(n) - } - base := New("") - return base.FilePathJoin(ni...).String() -} - -func (i Ident) FilePathJoin(ni ...Ident) Ident { - var s = make([]string, len(ni)) - for i, n := range ni { - s[i] = n.OsPath().String() - } - return New(filepath.Join(s...)) -} diff --git a/vendor/github.com/gobuffalo/flect/name/key.go b/vendor/github.com/gobuffalo/flect/name/key.go deleted file mode 100644 index 5fbf9ad..0000000 --- a/vendor/github.com/gobuffalo/flect/name/key.go +++ /dev/null @@ -1,14 +0,0 @@ -package name - -import ( - "strings" -) - -func Key(s string) string { - return New(s).Key().String() -} - -func (i Ident) Key() Ident { - s := strings.Replace(i.String(), "\\", "/", -1) - return New(strings.ToLower(s)) -} diff --git a/vendor/github.com/gobuffalo/flect/name/name.go b/vendor/github.com/gobuffalo/flect/name/name.go deleted file mode 100644 index fd14e0c..0000000 --- a/vendor/github.com/gobuffalo/flect/name/name.go +++ /dev/null @@ -1,49 +0,0 @@ -package name - -import ( - "strings" - - "github.com/gobuffalo/flect" -) - -// Proper pascalizes and singularizes the string -// person = Person -// foo_bar = FooBar -// admin/widgets = AdminWidget -func Proper(s string) string { - return New(s).Proper().String() -} - -// Proper pascalizes and singularizes the string -// person = Person -// foo_bar = FooBar -// admin/widgets = AdminWidget -func (i Ident) Proper() Ident { - return Ident{i.Singularize().Pascalize()} -} - -// Group pascalizes and pluralizes the string -// person = People -// foo_bar = FooBars -// admin/widget = AdminWidgets -func Group(s string) string { - return New(s).Group().String() -} - -// Group pascalizes and pluralizes the string -// person = People -// foo_bar = FooBars -// admin/widget = AdminWidgets -func (i Ident) Group() Ident { - var parts []string - if len(i.Original) == 0 { - return i - } - last := i.Parts[len(i.Parts)-1] - for _, part := range i.Parts[:len(i.Parts)-1] { - parts = append(parts, flect.Pascalize(part)) - } - last = New(last).Pluralize().Pascalize().String() - parts = append(parts, last) - return New(strings.Join(parts, "")) -} diff --git a/vendor/github.com/gobuffalo/flect/name/os_path.go b/vendor/github.com/gobuffalo/flect/name/os_path.go deleted file mode 100644 index 2a85723..0000000 --- a/vendor/github.com/gobuffalo/flect/name/os_path.go +++ /dev/null @@ -1,21 +0,0 @@ -package name - -import ( - "path/filepath" - "runtime" - "strings" -) - -func OsPath(s string) string { - return New(s).OsPath().String() -} - -func (i Ident) OsPath() Ident { - s := i.String() - if runtime.GOOS == "windows" { - s = strings.Replace(s, "/", string(filepath.Separator), -1) - } else { - s = strings.Replace(s, "\\", string(filepath.Separator), -1) - } - return New(s) -} diff --git a/vendor/github.com/gobuffalo/flect/name/package.go b/vendor/github.com/gobuffalo/flect/name/package.go deleted file mode 100644 index 86f66f2..0000000 --- a/vendor/github.com/gobuffalo/flect/name/package.go +++ /dev/null @@ -1,42 +0,0 @@ -package name - -import ( - "os" - "os/exec" - "path/filepath" - "strings" -) - -// Package will attempt to return a package version of the name -// $GOPATH/src/foo/bar = foo/bar -// $GOPATH\src\foo\bar = foo/bar -// foo/bar = foo/bar -func Package(s string) string { - return New(s).Package().String() -} - -// Package will attempt to return a package version of the name -// $GOPATH/src/foo/bar = foo/bar -// $GOPATH\src\foo\bar = foo/bar -// foo/bar = foo/bar -func (i Ident) Package() Ident { - gp := goPath() - s := i.Original - slash := string(filepath.Separator) - trims := []string{gp, slash, "src", slash} - for _, pre := range trims { - s = strings.TrimPrefix(s, pre) - } - s = strings.Replace(s, "\\", "/", -1) - s = strings.Replace(s, "_", "", -1) - return Ident{New(s).ToLower()} -} - -func goPath() string { - cmd := exec.Command("go", "env", "GOPATH") - b, err := cmd.CombinedOutput() - if err != nil { - return filepath.Join(os.Getenv("HOME"), "go") - } - return strings.TrimSpace(string(b)) -} diff --git a/vendor/github.com/gobuffalo/flect/name/param_id.go b/vendor/github.com/gobuffalo/flect/name/param_id.go deleted file mode 100644 index 2a30021..0000000 --- a/vendor/github.com/gobuffalo/flect/name/param_id.go +++ /dev/null @@ -1,24 +0,0 @@ -package name - -import "strings" - -// ParamID returns the string as parameter with _id added -// user = user_id -// UserID = user_id -// admin/widgets = admin_widgets_id -func ParamID(s string) string { - return New(s).ParamID().String() -} - -// ParamID returns the string as parameter with _id added -// user = user_id -// UserID = user_id -// admin/widgets = admin_widgets_id -func (i Ident) ParamID() Ident { - s := i.Underscore().String() - s = strings.ToLower(s) - if strings.HasSuffix(s, "_id") { - return New(s) - } - return New(s + "_id") -} diff --git a/vendor/github.com/gobuffalo/flect/name/resource.go b/vendor/github.com/gobuffalo/flect/name/resource.go deleted file mode 100644 index c794809..0000000 --- a/vendor/github.com/gobuffalo/flect/name/resource.go +++ /dev/null @@ -1,24 +0,0 @@ -package name - -import ( - "strings" -) - -// Resource version of a name -func (n Ident) Resource() Ident { - name := n.Underscore().String() - x := strings.FieldsFunc(name, func(r rune) bool { - return r == '_' || r == '/' - }) - - for i, w := range x { - if i == len(x)-1 { - x[i] = New(w).Pluralize().Pascalize().String() - continue - } - - x[i] = New(w).Pascalize().String() - } - - return New(strings.Join(x, "")) -} diff --git a/vendor/github.com/gobuffalo/flect/name/tablize.go b/vendor/github.com/gobuffalo/flect/name/tablize.go deleted file mode 100644 index e03fe21..0000000 --- a/vendor/github.com/gobuffalo/flect/name/tablize.go +++ /dev/null @@ -1,17 +0,0 @@ -package name - -// Tableize returns an underscore, pluralized string -// User = users -// Person = persons -// Admin/Widget = admin_widgets -func Tableize(s string) string { - return New(s).Tableize().String() -} - -// Tableize returns an underscore, pluralized string -// User = users -// Person = persons -// Admin/Widget = admin_widgets -func (i Ident) Tableize() Ident { - return Ident{i.Pluralize().Underscore()} -} diff --git a/vendor/github.com/gobuffalo/flect/name/url.go b/vendor/github.com/gobuffalo/flect/name/url.go deleted file mode 100644 index f5f0641..0000000 --- a/vendor/github.com/gobuffalo/flect/name/url.go +++ /dev/null @@ -1,5 +0,0 @@ -package name - -func (n Ident) URL() Ident { - return Ident{n.Pluralize().Underscore()} -} diff --git a/vendor/github.com/gobuffalo/flect/name/var_case.go b/vendor/github.com/gobuffalo/flect/name/var_case.go deleted file mode 100644 index 804ce10..0000000 --- a/vendor/github.com/gobuffalo/flect/name/var_case.go +++ /dev/null @@ -1,33 +0,0 @@ -package name - -// VarCaseSingle version of a name. -// foo_bar = fooBar -// admin/widget = adminWidget -// User = users -func VarCaseSingle(s string) string { - return New(s).VarCaseSingle().String() -} - -// VarCaseSingle version of a name. -// foo_bar = fooBar -// admin/widget = adminWidget -// User = users -func (i Ident) VarCaseSingle() Ident { - return Ident{i.Group().Singularize().Camelize()} -} - -// VarCasePlural version of a name. -// foo_bar = fooBars -// admin/widget = adminWidgets -// User = users -func VarCasePlural(s string) string { - return New(s).VarCasePlural().String() -} - -// VarCasePlural version of a name. -// foo_bar = fooBars -// admin/widget = adminWidgets -// User = users -func (i Ident) VarCasePlural() Ident { - return Ident{i.Group().Pluralize().Camelize()} -} diff --git a/vendor/github.com/gobuffalo/flect/ordinalize.go b/vendor/github.com/gobuffalo/flect/ordinalize.go deleted file mode 100644 index 1ce27b3..0000000 --- a/vendor/github.com/gobuffalo/flect/ordinalize.go +++ /dev/null @@ -1,43 +0,0 @@ -package flect - -import ( - "fmt" - "strconv" -) - -// Ordinalize converts a number to an ordinal version -// 42 = 42nd -// 45 = 45th -// 1 = 1st -func Ordinalize(s string) string { - return New(s).Ordinalize().String() -} - -// Ordinalize converts a number to an ordinal version -// 42 = 42nd -// 45 = 45th -// 1 = 1st -func (i Ident) Ordinalize() Ident { - number, err := strconv.Atoi(i.Original) - if err != nil { - return i - } - var s string - switch abs(number) % 100 { - case 11, 12, 13: - s = fmt.Sprintf("%dth", number) - default: - switch abs(number) % 10 { - case 1: - s = fmt.Sprintf("%dst", number) - case 2: - s = fmt.Sprintf("%dnd", number) - case 3: - s = fmt.Sprintf("%drd", number) - } - } - if s != "" { - return New(s) - } - return New(fmt.Sprintf("%dth", number)) -} diff --git a/vendor/github.com/gobuffalo/flect/pascalize.go b/vendor/github.com/gobuffalo/flect/pascalize.go deleted file mode 100644 index 76f0c6a..0000000 --- a/vendor/github.com/gobuffalo/flect/pascalize.go +++ /dev/null @@ -1,25 +0,0 @@ -package flect - -import ( - "unicode" -) - -// Pascalize returns a string with each segment capitalized -// user = User -// bob dylan = BobDylan -// widget_id = WidgetID -func Pascalize(s string) string { - return New(s).Pascalize().String() -} - -// Pascalize returns a string with each segment capitalized -// user = User -// bob dylan = BobDylan -// widget_id = WidgetID -func (i Ident) Pascalize() Ident { - c := i.Camelize() - if len(c.String()) == 0 { - return c - } - return New(string(unicode.ToUpper(rune(c.Original[0]))) + c.Original[1:]) -} diff --git a/vendor/github.com/gobuffalo/flect/plural_rules.go b/vendor/github.com/gobuffalo/flect/plural_rules.go deleted file mode 100644 index 6abfd67..0000000 --- a/vendor/github.com/gobuffalo/flect/plural_rules.go +++ /dev/null @@ -1,238 +0,0 @@ -package flect - -var pluralRules = []rule{} - -// AddPlural adds a rule that will replace the given suffix with the replacement suffix. -func AddPlural(suffix string, repl string) { - pluralMoot.Lock() - defer pluralMoot.Unlock() - pluralRules = append(pluralRules, rule{ - suffix: suffix, - fn: func(s string) string { - s = s[:len(s)-len(suffix)] - return s + repl - }, - }) - - pluralRules = append(pluralRules, rule{ - suffix: repl, - fn: noop, - }) -} - -var singleToPlural = map[string]string{ - "matrix": "matrices", - "vertix": "vertices", - "index": "indices", - "mouse": "mice", - "louse": "lice", - "ress": "resses", - "ox": "oxen", - "quiz": "quizzes", - "series": "series", - "octopus": "octopi", - "equipment": "equipment", - "information": "information", - "rice": "rice", - "money": "money", - "species": "species", - "fish": "fish", - "sheep": "sheep", - "jeans": "jeans", - "police": "police", - "dear": "dear", - "goose": "geese", - "tooth": "teeth", - "foot": "feet", - "bus": "buses", - "fez": "fezzes", - "piano": "pianos", - "halo": "halos", - "photo": "photos", - "aircraft": "aircraft", - "alumna": "alumnae", - "alumnus": "alumni", - "analysis": "analyses", - "antenna": "antennas", - "antithesis": "antitheses", - "apex": "apexes", - "appendix": "appendices", - "axis": "axes", - "bacillus": "bacilli", - "bacterium": "bacteria", - "basis": "bases", - "beau": "beaus", - "bison": "bison", - "bureau": "bureaus", - "château": "châteaux", - "codex": "codices", - "concerto": "concertos", - "corpus": "corpora", - "crisis": "crises", - "curriculum": "curriculums", - "deer": "deer", - "diagnosis": "diagnoses", - "die": "dice", - "dwarf": "dwarves", - "ellipsis": "ellipses", - "erratum": "errata", - "faux pas": "faux pas", - "focus": "foci", - "formula": "formulas", - "fungus": "fungi", - "genus": "genera", - "graffito": "graffiti", - "grouse": "grouse", - "half": "halves", - "hoof": "hooves", - "hypothesis": "hypotheses", - "larva": "larvae", - "libretto": "librettos", - "loaf": "loaves", - "locus": "loci", - "minutia": "minutiae", - "moose": "moose", - "nebula": "nebulae", - "nucleus": "nuclei", - "oasis": "oases", - "offspring": "offspring", - "opus": "opera", - "parenthesis": "parentheses", - "phenomenon": "phenomena", - "phylum": "phyla", - "prognosis": "prognoses", - "radius": "radiuses", - "referendum": "referendums", - "salmon": "salmon", - "shrimp": "shrimp", - "stimulus": "stimuli", - "stratum": "strata", - "swine": "swine", - "syllabus": "syllabi", - "symposium": "symposiums", - "synopsis": "synopses", - "tableau": "tableaus", - "thesis": "theses", - "thief": "thieves", - "trout": "trout", - "tuna": "tuna", - "vertebra": "vertebrae", - "vita": "vitae", - "vortex": "vortices", - "wharf": "wharves", - "wife": "wives", - "wolf": "wolves", - "datum": "data", - "testis": "testes", - "alias": "aliases", - "house": "houses", - "shoe": "shoes", - "news": "news", - "ovum": "ova", - "foo": "foos", -} - -var pluralToSingle = map[string]string{} - -func init() { - for k, v := range singleToPlural { - pluralToSingle[v] = k - } -} -func init() { - AddPlural("man", "men") - AddPlural("tz", "tzes") - AddPlural("alias", "aliases") - AddPlural("oasis", "oasis") - AddPlural("wife", "wives") - AddPlural("basis", "basis") - AddPlural("atum", "ata") - AddPlural("adium", "adia") - AddPlural("actus", "acti") - AddPlural("irus", "iri") - AddPlural("iterion", "iteria") - AddPlural("dium", "diums") - AddPlural("ovum", "ova") - AddPlural("ize", "izes") - AddPlural("dge", "dges") - AddPlural("focus", "foci") - AddPlural("child", "children") - AddPlural("oaf", "oaves") - AddPlural("randum", "randa") - AddPlural("base", "bases") - AddPlural("atus", "atuses") - AddPlural("ode", "odes") - AddPlural("person", "people") - AddPlural("va", "vae") - AddPlural("leus", "li") - AddPlural("ld", "ldren") - AddPlural("oot", "eet") - AddPlural("oose", "eese") - AddPlural("box", "boxes") - AddPlural("ium", "ia") - AddPlural("sis", "ses") - AddPlural("nna", "nnas") - AddPlural("eses", "esis") - AddPlural("stis", "stes") - AddPlural("ex", "ices") - AddPlural("ula", "ulae") - AddPlural("isis", "ises") - AddPlural("ouses", "ouse") - AddPlural("olves", "olf") - AddPlural("lf", "lves") - AddPlural("rf", "rves") - AddPlural("afe", "aves") - AddPlural("bfe", "bves") - AddPlural("cfe", "cves") - AddPlural("dfe", "dves") - AddPlural("efe", "eves") - AddPlural("gfe", "gves") - AddPlural("hfe", "hves") - AddPlural("ife", "ives") - AddPlural("jfe", "jves") - AddPlural("kfe", "kves") - AddPlural("lfe", "lves") - AddPlural("mfe", "mves") - AddPlural("nfe", "nves") - AddPlural("ofe", "oves") - AddPlural("pfe", "pves") - AddPlural("qfe", "qves") - AddPlural("rfe", "rves") - AddPlural("sfe", "sves") - AddPlural("tfe", "tves") - AddPlural("ufe", "uves") - AddPlural("vfe", "vves") - AddPlural("wfe", "wves") - AddPlural("xfe", "xves") - AddPlural("yfe", "yves") - AddPlural("zfe", "zves") - AddPlural("hive", "hives") - AddPlural("quy", "quies") - AddPlural("by", "bies") - AddPlural("cy", "cies") - AddPlural("dy", "dies") - AddPlural("fy", "fies") - AddPlural("gy", "gies") - AddPlural("hy", "hies") - AddPlural("jy", "jies") - AddPlural("ky", "kies") - AddPlural("ly", "lies") - AddPlural("my", "mies") - AddPlural("ny", "nies") - AddPlural("py", "pies") - AddPlural("qy", "qies") - AddPlural("ry", "ries") - AddPlural("sy", "sies") - AddPlural("ty", "ties") - AddPlural("vy", "vies") - AddPlural("wy", "wies") - AddPlural("xy", "xies") - AddPlural("zy", "zies") - AddPlural("x", "xes") - AddPlural("ch", "ches") - AddPlural("ss", "sses") - AddPlural("sh", "shes") - AddPlural("oe", "oes") - AddPlural("io", "ios") - AddPlural("o", "oes") -} diff --git a/vendor/github.com/gobuffalo/flect/pluralize.go b/vendor/github.com/gobuffalo/flect/pluralize.go deleted file mode 100644 index 1b9d43e..0000000 --- a/vendor/github.com/gobuffalo/flect/pluralize.go +++ /dev/null @@ -1,49 +0,0 @@ -package flect - -import ( - "strings" - "sync" -) - -var pluralMoot = &sync.RWMutex{} - -// Pluralize returns a plural version of the string -// user = users -// person = people -// datum = data -func Pluralize(s string) string { - return New(s).Pluralize().String() -} - -// Pluralize returns a plural version of the string -// user = users -// person = people -// datum = data -func (i Ident) Pluralize() Ident { - s := i.Original - if len(s) == 0 { - return New("") - } - - pluralMoot.RLock() - defer pluralMoot.RUnlock() - - ls := strings.ToLower(s) - if _, ok := pluralToSingle[ls]; ok { - return i - } - if p, ok := singleToPlural[ls]; ok { - return New(p) - } - for _, r := range pluralRules { - if strings.HasSuffix(ls, r.suffix) { - return New(r.fn(s)) - } - } - - if strings.HasSuffix(ls, "s") { - return i - } - - return New(i.String() + "s") -} diff --git a/vendor/github.com/gobuffalo/flect/rule.go b/vendor/github.com/gobuffalo/flect/rule.go deleted file mode 100644 index dc616b3..0000000 --- a/vendor/github.com/gobuffalo/flect/rule.go +++ /dev/null @@ -1,10 +0,0 @@ -package flect - -type ruleFn func(string) string - -type rule struct { - suffix string - fn ruleFn -} - -func noop(s string) string { return s } diff --git a/vendor/github.com/gobuffalo/flect/singular_rules.go b/vendor/github.com/gobuffalo/flect/singular_rules.go deleted file mode 100644 index 14b471c..0000000 --- a/vendor/github.com/gobuffalo/flect/singular_rules.go +++ /dev/null @@ -1,122 +0,0 @@ -package flect - -var singularRules = []rule{} - -// AddSingular adds a rule that will replace the given suffix with the replacement suffix. -func AddSingular(ext string, repl string) { - singularMoot.Lock() - defer singularMoot.Unlock() - singularRules = append(singularRules, rule{ - suffix: ext, - fn: func(s string) string { - s = s[:len(s)-len(ext)] - return s + repl - }, - }) - - singularRules = append(singularRules, rule{ - suffix: repl, - fn: func(s string) string { - return s - }, - }) -} - -func init() { - AddSingular("ria", "rion") - AddSingular("news", "news") - AddSingular("halves", "half") - AddSingular("appendix", "appendix") - AddSingular("zzes", "zz") - AddSingular("ulas", "ula") - AddSingular("psis", "pse") - AddSingular("genus", "genera") - AddSingular("phyla", "phylum") - AddSingular("odice", "odex") - AddSingular("oxen", "ox") - AddSingular("ianos", "iano") - AddSingular("ulus", "uli") - AddSingular("mice", "mouse") - AddSingular("ouses", "ouse") - AddSingular("mni", "mnus") - AddSingular("ocus", "oci") - AddSingular("shoes", "shoe") - AddSingular("oasis", "oasis") - AddSingular("lice", "louse") - AddSingular("men", "man") - AddSingular("ta", "tum") - AddSingular("ia", "ium") - AddSingular("tives", "tive") - AddSingular("ldren", "ld") - AddSingular("people", "person") - AddSingular("aves", "afe") - AddSingular("uses", "us") - AddSingular("bves", "bfe") - AddSingular("cves", "cfe") - AddSingular("dves", "dfe") - AddSingular("eves", "efe") - AddSingular("gves", "gfe") - AddSingular("hves", "hfe") - AddSingular("chives", "chive") - AddSingular("ives", "ife") - AddSingular("movies", "movie") - AddSingular("jeans", "jeans") - AddSingular("cesses", "cess") - AddSingular("cess", "cess") - AddSingular("acti", "actus") - AddSingular("itzes", "itz") - AddSingular("usses", "uss") - AddSingular("uss", "uss") - AddSingular("jves", "jfe") - AddSingular("kves", "kfe") - AddSingular("mves", "mfe") - AddSingular("nves", "nfe") - AddSingular("moves", "move") - AddSingular("oves", "ofe") - AddSingular("pves", "pfe") - AddSingular("qves", "qfe") - AddSingular("sves", "sfe") - AddSingular("tves", "tfe") - AddSingular("uves", "ufe") - AddSingular("vves", "vfe") - AddSingular("wves", "wfe") - AddSingular("xves", "xfe") - AddSingular("yves", "yfe") - AddSingular("zves", "zfe") - AddSingular("hives", "hive") - AddSingular("lves", "lf") - AddSingular("rves", "rf") - AddSingular("quies", "quy") - AddSingular("bies", "by") - AddSingular("cies", "cy") - AddSingular("dies", "dy") - AddSingular("fies", "fy") - AddSingular("gies", "gy") - AddSingular("hies", "hy") - AddSingular("jies", "jy") - AddSingular("kies", "ky") - AddSingular("lies", "ly") - AddSingular("mies", "my") - AddSingular("nies", "ny") - AddSingular("pies", "py") - AddSingular("qies", "qy") - AddSingular("ries", "ry") - AddSingular("sies", "sy") - AddSingular("ties", "ty") - AddSingular("vies", "vy") - AddSingular("wies", "wy") - AddSingular("xies", "xy") - AddSingular("zies", "zy") - AddSingular("xes", "x") - AddSingular("ches", "ch") - AddSingular("sses", "ss") - AddSingular("shes", "sh") - AddSingular("oes", "o") - AddSingular("ress", "ress") - AddSingular("iri", "irus") - AddSingular("irus", "irus") - AddSingular("tuses", "tus") - AddSingular("tus", "tus") - AddSingular("s", "") - AddSingular("ss", "ss") -} diff --git a/vendor/github.com/gobuffalo/flect/singularize.go b/vendor/github.com/gobuffalo/flect/singularize.go deleted file mode 100644 index a08cbd5..0000000 --- a/vendor/github.com/gobuffalo/flect/singularize.go +++ /dev/null @@ -1,44 +0,0 @@ -package flect - -import ( - "strings" - "sync" -) - -var singularMoot = &sync.RWMutex{} - -// Singularize returns a singular version of the string -// users = user -// data = datum -// people = person -func Singularize(s string) string { - return New(s).Singularize().String() -} - -// Singularize returns a singular version of the string -// users = user -// data = datum -// people = person -func (i Ident) Singularize() Ident { - s := i.Original - if len(s) == 0 { - return i - } - - singularMoot.RLock() - defer singularMoot.RUnlock() - ls := strings.ToLower(s) - if p, ok := pluralToSingle[ls]; ok { - return New(p) - } - if _, ok := singleToPlural[ls]; ok { - return i - } - for _, r := range singularRules { - if strings.HasSuffix(ls, r.suffix) { - return New(r.fn(s)) - } - } - - return i -} diff --git a/vendor/github.com/gobuffalo/flect/titleize.go b/vendor/github.com/gobuffalo/flect/titleize.go deleted file mode 100644 index e7a20d3..0000000 --- a/vendor/github.com/gobuffalo/flect/titleize.go +++ /dev/null @@ -1,31 +0,0 @@ -package flect - -import ( - "strings" - "unicode" -) - -// Titleize will capitalize the start of each part -// "Nice to see you!" = "Nice To See You!" -// "i've read a book! have you?" = "I've Read A Book! Have You?" -// "This is `code` ok" = "This Is `code` OK" -func Titleize(s string) string { - return New(s).Titleize().String() -} - -// Titleize will capitalize the start of each part -// "Nice to see you!" = "Nice To See You!" -// "i've read a book! have you?" = "I've Read A Book! Have You?" -// "This is `code` ok" = "This Is `code` OK" -func (i Ident) Titleize() Ident { - var parts []string - for _, part := range i.Parts { - var x string - x = string(unicode.ToTitle(rune(part[0]))) - if len(part) > 1 { - x += part[1:] - } - parts = append(parts, x) - } - return New(strings.Join(parts, " ")) -} diff --git a/vendor/github.com/gobuffalo/flect/underscore.go b/vendor/github.com/gobuffalo/flect/underscore.go deleted file mode 100644 index b92488a..0000000 --- a/vendor/github.com/gobuffalo/flect/underscore.go +++ /dev/null @@ -1,34 +0,0 @@ -package flect - -import ( - "strings" - "unicode" -) - -// Underscore a string -// bob dylan = bob_dylan -// Nice to see you! = nice_to_see_you -// widgetID = widget_id -func Underscore(s string) string { - return New(s).Underscore().String() -} - -// Underscore a string -// bob dylan = bob_dylan -// Nice to see you! = nice_to_see_you -// widgetID = widget_id -func (i Ident) Underscore() Ident { - var out []string - for _, part := range i.Parts { - var x string - for _, c := range part { - if unicode.IsLetter(c) || unicode.IsDigit(c) { - x += string(c) - } - } - if x != "" { - out = append(out, x) - } - } - return New(strings.ToLower(strings.Join(out, "_"))) -} diff --git a/vendor/github.com/gobuffalo/genny/.codeclimate.yml b/vendor/github.com/gobuffalo/genny/.codeclimate.yml deleted file mode 100644 index 3d77930..0000000 --- a/vendor/github.com/gobuffalo/genny/.codeclimate.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -version: "2" -plugins: - golint: - enabled: true - checks: - GoLint/Naming/MixedCaps: - enabled: false - govet: - enabled: true - gofmt: - enabled: true - fixme: - enabled: true diff --git a/vendor/github.com/gobuffalo/genny/.gitignore b/vendor/github.com/gobuffalo/genny/.gitignore deleted file mode 100644 index 3689718..0000000 --- a/vendor/github.com/gobuffalo/genny/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -*.log -.DS_Store -doc -tmp -pkg -*.gem -*.pid -coverage -coverage.data -build/* -*.pbxuser -*.mode1v3 -.svn -profile -.console_history -.sass-cache/* -.rake_tasks~ -*.log.lck -solr/ -.jhw-cache/ -jhw.* -*.sublime* -node_modules/ -dist/ -generated/ -.vendor/ -bin/* -gin-bin -.idea/ diff --git a/vendor/github.com/gobuffalo/genny/.gometalinter.json b/vendor/github.com/gobuffalo/genny/.gometalinter.json deleted file mode 100644 index e4f65a3..0000000 --- a/vendor/github.com/gobuffalo/genny/.gometalinter.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Enable": ["vet", "golint", "goimports", "deadcode", "gotype", "ineffassign", "misspell", "nakedret", "unconvert", "megacheck", "varcheck"] -} diff --git a/vendor/github.com/gobuffalo/genny/.goreleaser.yml b/vendor/github.com/gobuffalo/genny/.goreleaser.yml deleted file mode 100644 index ba2dc82..0000000 --- a/vendor/github.com/gobuffalo/genny/.goreleaser.yml +++ /dev/null @@ -1,28 +0,0 @@ -builds: -- - goos: - - darwin - - linux - - windows - env: - - CGO_ENABLED=0 - # main: ./genny/main.go - # binary: {{.Binary}} - # hooks: - # pre: packr - # post: packr clean - -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ .Tag }}-next" -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:' -brew: - github: - owner: markbates - name: homebrew-tap diff --git a/vendor/github.com/gobuffalo/genny/.travis.yml b/vendor/github.com/gobuffalo/genny/.travis.yml deleted file mode 100644 index 405a8d8..0000000 --- a/vendor/github.com/gobuffalo/genny/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: go - -sudo: false - -go: - - 1.9.x - - 1.10.x - - 1.11.x - - tip - -install: make deps - -script: make ci-test - -matrix: - allow_failures: - - go: 'tip' - diff --git a/vendor/github.com/gobuffalo/genny/LICENSE.txt b/vendor/github.com/gobuffalo/genny/LICENSE.txt deleted file mode 100644 index 123ddc0..0000000 --- a/vendor/github.com/gobuffalo/genny/LICENSE.txt +++ /dev/null @@ -1,8 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2018 Mark Bates - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/gobuffalo/genny/Makefile b/vendor/github.com/gobuffalo/genny/Makefile deleted file mode 100644 index 4e586e5..0000000 --- a/vendor/github.com/gobuffalo/genny/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -TAGS ?= "sqlite" -GO_BIN ?= go - -install: - packr - $(GO_BIN) install -v ./genny - -deps: - $(GO_BIN) get github.com/gobuffalo/release - $(GO_BIN) get github.com/gobuffalo/packr/packr - $(GO_BIN) get -tags ${TAGS} -t ./... -ifeq ($(GO111MODULE),on) - $(GO_BIN) mod tidy -endif - -build: - packr - $(GO_BIN) build -v . - -test: - packr - $(GO_BIN) test -tags ${TAGS} ./... - -ci-test: - $(GO_BIN) test -tags ${TAGS} -race ./... - -lint: - gometalinter --vendor ./... --deadline=1m --skip=internal - -update: - $(GO_BIN) get -u -tags ${TAGS} -ifeq ($(GO111MODULE),on) - $(GO_BIN) mod tidy -endif - packr - make test - make install -ifeq ($(GO111MODULE),on) - $(GO_BIN) mod tidy -endif - -release-test: - $(GO_BIN) test -tags ${TAGS} -race ./... - -release: - release -y -f version.go diff --git a/vendor/github.com/gobuffalo/genny/README.md b/vendor/github.com/gobuffalo/genny/README.md deleted file mode 100644 index 6b6f1a0..0000000 --- a/vendor/github.com/gobuffalo/genny/README.md +++ /dev/null @@ -1,20 +0,0 @@ -

- -

-GoDoc -Build Status -Go Report Card -

- -# Genny [EXPERIMENTAL] - -**EXPERIMENTAL** - APIs can change without notice. You've been warned. - -## What Is Genny? - -Genny is a _framework_ for writing modular generators, it however, doesn't actually generate anything. It just makes it easier for you to. :) - -## Documentation - -For right now the [GoDoc](https://godoc.org/github.com/gobuffalo/genny) and the source/tests are best documentation as the APIs are currently in flux. - diff --git a/vendor/github.com/gobuffalo/genny/SHOULDERS.md b/vendor/github.com/gobuffalo/genny/SHOULDERS.md deleted file mode 100644 index 42b36ba..0000000 --- a/vendor/github.com/gobuffalo/genny/SHOULDERS.md +++ /dev/null @@ -1,108 +0,0 @@ -# `github.com/gobuffalo/genny` Stands on the Shoulders of Giants - -`github.com/gobuffalo/genny` does not try to reinvent the wheel! Instead, it uses the already great wheels developed by the Go community and puts them altogether in the best way possible. Without these giants this project would not be possible. Please make sure to check them out and thank them for all of their hard work. - -Thank you to the following **GIANTS**: - - -* [github.com/fatih/structs](https://godoc.org/github.com/fatih/structs) - -* [github.com/gobuffalo/envy](https://godoc.org/github.com/gobuffalo/envy) - -* [github.com/gobuffalo/flect](https://godoc.org/github.com/gobuffalo/flect) - -* [github.com/gobuffalo/flect/name](https://godoc.org/github.com/gobuffalo/flect/name) - -* [github.com/gobuffalo/github_flavored_markdown](https://godoc.org/github.com/gobuffalo/github_flavored_markdown) - -* [github.com/gobuffalo/packr](https://godoc.org/github.com/gobuffalo/packr) - -* [github.com/gobuffalo/plush](https://godoc.org/github.com/gobuffalo/plush) - -* [github.com/gobuffalo/plush/ast](https://godoc.org/github.com/gobuffalo/plush/ast) - -* [github.com/gobuffalo/plush/lexer](https://godoc.org/github.com/gobuffalo/plush/lexer) - -* [github.com/gobuffalo/plush/parser](https://godoc.org/github.com/gobuffalo/plush/parser) - -* [github.com/gobuffalo/plush/token](https://godoc.org/github.com/gobuffalo/plush/token) - -* [github.com/gobuffalo/tags](https://godoc.org/github.com/gobuffalo/tags) - -* [github.com/gobuffalo/tags/form](https://godoc.org/github.com/gobuffalo/tags/form) - -* [github.com/gobuffalo/tags/form/bootstrap](https://godoc.org/github.com/gobuffalo/tags/form/bootstrap) - -* [github.com/gobuffalo/uuid](https://godoc.org/github.com/gobuffalo/uuid) - -* [github.com/gobuffalo/validate](https://godoc.org/github.com/gobuffalo/validate) - -* [github.com/gobuffalo/validate/validators](https://godoc.org/github.com/gobuffalo/validate/validators) - -* [github.com/joho/godotenv](https://godoc.org/github.com/joho/godotenv) - -* [github.com/kr/pretty](https://godoc.org/github.com/kr/pretty) - -* [github.com/markbates/going/defaults](https://godoc.org/github.com/markbates/going/defaults) - -* [github.com/markbates/going/randx](https://godoc.org/github.com/markbates/going/randx) - -* [github.com/markbates/going/wait](https://godoc.org/github.com/markbates/going/wait) - -* [github.com/markbates/inflect](https://godoc.org/github.com/markbates/inflect) - -* [github.com/microcosm-cc/bluemonday](https://godoc.org/github.com/microcosm-cc/bluemonday) - -* [github.com/onsi/ginkgo](https://godoc.org/github.com/onsi/ginkgo) - -* [github.com/onsi/gomega](https://godoc.org/github.com/onsi/gomega) - -* [github.com/pkg/errors](https://godoc.org/github.com/pkg/errors) - -* [github.com/serenize/snaker](https://godoc.org/github.com/serenize/snaker) - -* [github.com/sergi/go-diff/diffmatchpatch](https://godoc.org/github.com/sergi/go-diff/diffmatchpatch) - -* [github.com/shurcooL/highlight_diff](https://godoc.org/github.com/shurcooL/highlight_diff) - -* [github.com/shurcooL/highlight_go](https://godoc.org/github.com/shurcooL/highlight_go) - -* [github.com/shurcooL/octicon](https://godoc.org/github.com/shurcooL/octicon) - -* [github.com/shurcooL/sanitized_anchor_name](https://godoc.org/github.com/shurcooL/sanitized_anchor_name) - -* [github.com/sirupsen/logrus](https://godoc.org/github.com/sirupsen/logrus) - -* [github.com/sourcegraph/annotate](https://godoc.org/github.com/sourcegraph/annotate) - -* [github.com/sourcegraph/syntaxhighlight](https://godoc.org/github.com/sourcegraph/syntaxhighlight) - -* [github.com/stretchr/testify/assert](https://godoc.org/github.com/stretchr/testify/assert) - -* [github.com/stretchr/testify/require](https://godoc.org/github.com/stretchr/testify/require) - -* [github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew](https://godoc.org/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew) - -* [github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib](https://godoc.org/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib) - -* [golang.org/x/crypto/ssh/terminal](https://godoc.org/golang.org/x/crypto/ssh/terminal) - -* [golang.org/x/net/context](https://godoc.org/golang.org/x/net/context) - -* [golang.org/x/net/html](https://godoc.org/golang.org/x/net/html) - -* [golang.org/x/net/html/atom](https://godoc.org/golang.org/x/net/html/atom) - -* [golang.org/x/sync/errgroup](https://godoc.org/golang.org/x/sync/errgroup) - -* [golang.org/x/sys/unix](https://godoc.org/golang.org/x/sys/unix) - -* [golang.org/x/tools/go/ast/astutil](https://godoc.org/golang.org/x/tools/go/ast/astutil) - -* [golang.org/x/tools/imports](https://godoc.org/golang.org/x/tools/imports) - -* [golang.org/x/tools/internal/fastwalk](https://godoc.org/golang.org/x/tools/internal/fastwalk) - -* [gopkg.in/check.v1](https://godoc.org/gopkg.in/check.v1) - -* [gopkg.in/russross/blackfriday.v1](https://godoc.org/gopkg.in/russross/blackfriday.v1) diff --git a/vendor/github.com/gobuffalo/genny/confirm.go b/vendor/github.com/gobuffalo/genny/confirm.go deleted file mode 100644 index 1316ccc..0000000 --- a/vendor/github.com/gobuffalo/genny/confirm.go +++ /dev/null @@ -1,15 +0,0 @@ -package genny - -import ( - "bufio" - "fmt" - "os" -) - -func Confirm(msg string) bool { - reader := bufio.NewReader(os.Stdin) - fmt.Print(msg) - text, _ := reader.ReadString('\n') - - return (text == "y\n" || text == "Y\n") -} diff --git a/vendor/github.com/gobuffalo/genny/disk.go b/vendor/github.com/gobuffalo/genny/disk.go deleted file mode 100644 index 23a0a95..0000000 --- a/vendor/github.com/gobuffalo/genny/disk.go +++ /dev/null @@ -1,97 +0,0 @@ -package genny - -import ( - "bytes" - "io" - "os" - "sort" - "strings" - "sync" - - "github.com/pkg/errors" -) - -// Disk is a virtual file system that works -// with both dry and wet runners. Perfect for seeding -// Files or non-destructively deleting files -type Disk struct { - Runner *Runner - files map[string]File - moot *sync.RWMutex -} - -// Files returns a sorted list of all the files in the disk -func (d *Disk) Files() []File { - var files []File - for _, f := range d.files { - if s, ok := f.(io.Seeker); ok { - s.Seek(0, 0) - } - files = append(files, f) - } - sort.Slice(files, func(i, j int) bool { - return files[i].Name() < files[j].Name() - }) - return files -} - -func newDisk(r *Runner) *Disk { - return &Disk{ - Runner: r, - files: map[string]File{}, - moot: &sync.RWMutex{}, - } -} - -// Remove a file(s) from the virtual disk. -func (d *Disk) Remove(name string) { - d.moot.Lock() - defer d.moot.Unlock() - for f, _ := range d.files { - if strings.HasPrefix(f, name) { - delete(d.files, f) - } - } -} - -// Delete calls the Runner#Delete function -func (d *Disk) Delete(name string) error { - return d.Runner.Delete(name) -} - -// Add file to the virtual disk -func (d *Disk) Add(f File) { - d.moot.Lock() - defer d.moot.Unlock() - d.files[f.Name()] = f -} - -// Find a file from the virtual disk. If the file doesn't -// exist it will try to read the file from the physical disk. -func (d *Disk) Find(name string) (File, error) { - d.moot.RLock() - if f, ok := d.files[name]; ok { - if seek, ok := f.(io.Seeker); ok { - seek.Seek(0, 0) - } - d.moot.RUnlock() - return f, nil - } - d.moot.RUnlock() - - gf := NewFile(name, bytes.NewReader([]byte(""))) - f, err := os.Open(name) - if err != nil { - return gf, errors.WithStack(err) - } - defer f.Close() - - bb := &bytes.Buffer{} - - if _, err := io.Copy(bb, f); err != nil { - return gf, errors.WithStack(err) - } - gf = NewFile(name, bb) - d.Add(gf) - return gf, nil -} diff --git a/vendor/github.com/gobuffalo/genny/dry_runner.go b/vendor/github.com/gobuffalo/genny/dry_runner.go deleted file mode 100644 index fd38005..0000000 --- a/vendor/github.com/gobuffalo/genny/dry_runner.go +++ /dev/null @@ -1,37 +0,0 @@ -package genny - -import ( - "bytes" - "context" - "io" - "os" - "sync" - - "github.com/pkg/errors" - "github.com/sirupsen/logrus" -) - -// DryRunner will NOT execute commands and write files -// it is NOT destructive -func DryRunner(ctx context.Context) *Runner { - pwd, _ := os.Getwd() - l := logrus.New() - l.Out = os.Stdout - l.SetLevel(logrus.DebugLevel) - r := &Runner{ - Logger: l, - Context: ctx, - Root: pwd, - moot: &sync.RWMutex{}, - FileFn: func(f File) (File, error) { - bb := &bytes.Buffer{} - mw := io.MultiWriter(bb, os.Stdout) - if _, err := io.Copy(mw, f); err != nil { - return f, errors.WithStack(err) - } - return NewFile(f.Name(), bb), nil - }, - } - r.Disk = newDisk(r) - return r -} diff --git a/vendor/github.com/gobuffalo/genny/file.go b/vendor/github.com/gobuffalo/genny/file.go deleted file mode 100644 index c91198a..0000000 --- a/vendor/github.com/gobuffalo/genny/file.go +++ /dev/null @@ -1,52 +0,0 @@ -package genny - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" -) - -// File interface for working with files -type File interface { - fmt.Stringer - io.Reader - Name() string -} - -type simpleFile struct { - io.Reader - name string -} - -func (s simpleFile) Name() string { - return s.name -} - -func (s *simpleFile) String() string { - src, _ := ioutil.ReadAll(s) - s.Reader = bytes.NewReader(src) - return string(src) -} - -func (s simpleFile) Seek(offset int64, whence int) (int64, error) { - if seek, ok := s.Reader.(io.Seeker); ok { - return seek.Seek(offset, whence) - } - return -1, nil -} - -// NewFile takes the name of the file you want to -// write to and a reader to reader from -func NewFile(name string, r io.Reader) File { - if r == nil { - r = &bytes.Buffer{} - } - if seek, ok := r.(io.Seeker); ok { - seek.Seek(0, 0) - } - return &simpleFile{ - Reader: r, - name: name, - } -} diff --git a/vendor/github.com/gobuffalo/genny/force.go b/vendor/github.com/gobuffalo/genny/force.go deleted file mode 100644 index 149ed0c..0000000 --- a/vendor/github.com/gobuffalo/genny/force.go +++ /dev/null @@ -1,73 +0,0 @@ -package genny - -import ( - "os" - "path/filepath" - - "github.com/gobuffalo/packr" - "github.com/pkg/errors" -) - -// ForceBox will mount each file in the box and wrap it with ForceFile -func ForceBox(g *Generator, box packr.Box, force bool) error { - return box.Walk(func(path string, bf packr.File) error { - f := NewFile(path, bf) - ff := ForceFile(f, force) - f, err := ff(f) - if err != nil { - return errors.WithStack(err) - } - g.File(f) - return nil - }) -} - -// ForceFile is a TransformerFn that will return an error if the path exists if `force` is false. If `force` is true it will delete the path. -func ForceFile(f File, force bool) TransformerFn { - return func(f File) (File, error) { - path := f.Name() - path, err := filepath.Abs(path) - if err != nil { - return f, errors.WithStack(err) - } - _, err = os.Stat(path) - if err != nil { - // path doesn't exist. move on. - return f, nil - } - if !force { - return f, errors.Errorf("path %s already exists", path) - } - if err := os.RemoveAll(path); err != nil { - return f, errors.WithStack(err) - } - return f, nil - } -} - -// Force is a RunFn that will return an error if the path exists if `force` is false. If `force` is true it will delete the path. -// Is is recommended to use ForceFile when you can. -func Force(path string, force bool) RunFn { - if path == "." || path == "" { - pwd, _ := os.Getwd() - path = pwd - } - return func(r *Runner) error { - path, err := filepath.Abs(path) - if err != nil { - return errors.WithStack(err) - } - _, err = os.Stat(path) - if err != nil { - // path doesn't exist. move on. - return nil - } - if !force { - return errors.Errorf("path %s already exists", path) - } - if err := os.RemoveAll(path); err != nil { - return errors.WithStack(err) - } - return nil - } -} diff --git a/vendor/github.com/gobuffalo/genny/generator.go b/vendor/github.com/gobuffalo/genny/generator.go deleted file mode 100644 index 1f80afb..0000000 --- a/vendor/github.com/gobuffalo/genny/generator.go +++ /dev/null @@ -1,78 +0,0 @@ -package genny - -import ( - "os/exec" - "sync" - - "github.com/gobuffalo/packr" - "github.com/pkg/errors" -) - -// Generator is the basic type for generators to use -type Generator struct { - Should func(*Runner) bool - runners []RunFn - transformers []Transformer - moot *sync.RWMutex -} - -// New, well-formed, generator -func New() *Generator { - g := &Generator{ - runners: []RunFn{}, - moot: &sync.RWMutex{}, - transformers: []Transformer{}, - } - return g -} - -// File adds a file to be run when the generator is run -func (g *Generator) File(f File) { - g.RunFn(func(r *Runner) error { - return r.File(f) - }) -} - -func (g *Generator) Transform(f File) (File, error) { - g.moot.RLock() - defer g.moot.RUnlock() - var err error - for _, t := range g.transformers { - f, err = t.Transform(f) - if err != nil { - return f, errors.WithStack(err) - } - } - - return f, nil -} - -// Transformer adds a file transform to the generator -func (g *Generator) Transformer(t Transformer) { - g.moot.Lock() - defer g.moot.Unlock() - g.transformers = append(g.transformers, t) -} - -// Command adds a command to be run when the generator is run -func (g *Generator) Command(cmd *exec.Cmd) { - g.RunFn(func(r *Runner) error { - return r.Exec(cmd) - }) -} - -// Box walks through a packr.Box and adds Files for each entry -// in the box. -func (g *Generator) Box(box packr.Box) error { - return box.Walk(func(path string, f packr.File) error { - g.File(NewFile(path, f)) - return nil - }) -} - -// RunFn adds a generic "runner" function to the generator. -func (g *Generator) RunFn(fn RunFn) { - g.moot.Lock() - defer g.moot.Unlock() - g.runners = append(g.runners, fn) -} diff --git a/vendor/github.com/gobuffalo/genny/go.mod b/vendor/github.com/gobuffalo/genny/go.mod deleted file mode 100644 index 1b14d6f..0000000 --- a/vendor/github.com/gobuffalo/genny/go.mod +++ /dev/null @@ -1,27 +0,0 @@ -module github.com/gobuffalo/genny - -require ( - github.com/fatih/structs v1.0.0 // indirect - github.com/gobuffalo/envy v1.6.4 - github.com/gobuffalo/flect v0.0.0-20180907193754-dc14d8acaf9f - github.com/gobuffalo/github_flavored_markdown v1.0.5 // indirect - github.com/gobuffalo/packr v1.13.7 - github.com/gobuffalo/plush v3.7.16+incompatible - github.com/gobuffalo/tags v2.0.11+incompatible // indirect - github.com/gobuffalo/uuid v2.0.3+incompatible // indirect - github.com/gobuffalo/validate v2.0.3+incompatible // indirect - github.com/joho/godotenv v1.3.0 // indirect - github.com/markbates/inflect v1.0.1 // indirect - github.com/markbates/oncer v0.0.0-20180924034138-723ad0170a46 - github.com/onsi/gomega v1.4.2 // indirect - github.com/pkg/errors v0.8.0 - github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 // indirect - github.com/sirupsen/logrus v1.1.0 - github.com/spf13/cobra v0.0.3 - github.com/stretchr/testify v1.2.2 - golang.org/x/crypto v0.0.0-20180927165925-5295e8364332 // indirect - golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3 // indirect - golang.org/x/sys v0.0.0-20180928133829-e4b3c5e90611 // indirect - golang.org/x/tools v0.0.0-20180928181343-b3c0be4c978b - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect -) diff --git a/vendor/github.com/gobuffalo/genny/go.sum b/vendor/github.com/gobuffalo/genny/go.sum deleted file mode 100644 index ea53896..0000000 --- a/vendor/github.com/gobuffalo/genny/go.sum +++ /dev/null @@ -1,109 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fatih/structs v1.0.0 h1:BrX964Rv5uQ3wwS+KRUAJCBBw5PQmgJfJ6v4yly5QwU= -github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gobuffalo/envy v1.6.4 h1:kxamN+VYjPMzEdjc2mn4CIKiuYXGxc8VIwXJNixFlNY= -github.com/gobuffalo/envy v1.6.4/go.mod h1:Abh+Jfw475/NWtYMEt+hnJWRiC8INKWibIMyNt1w2Mc= -github.com/gobuffalo/flect v0.0.0-20180907193754-dc14d8acaf9f h1:No1XsG+vtAsv5FARrCoAg5Xv4xTGGC1JNGtJK656kcQ= -github.com/gobuffalo/flect v0.0.0-20180907193754-dc14d8acaf9f/go.mod h1:rCiQgmAE4axgBNl3jZWzS5rETRYTGOsrixTRaCPzNdA= -github.com/gobuffalo/github_flavored_markdown v1.0.5 h1:YvGVf7yj1akgsb+qc64Q0WX8uhpuZSibChbqOMRSAqE= -github.com/gobuffalo/github_flavored_markdown v1.0.5/go.mod h1:U0643QShPF+OF2tJvYNiYDLDGDuQmJZXsf/bHOJPsMY= -github.com/gobuffalo/packr v1.13.7 h1:2uZgLd6b/W4yRBZV/ScaORxZLNGMHO0VCvqQNkKukNA= -github.com/gobuffalo/packr v1.13.7/go.mod h1:KkinLIn/n6+3tVXMwg6KkNvWwVsrRAz4ph+jgpk3Z24= -github.com/gobuffalo/plush v3.7.16+incompatible h1:nonpy24axg04np13bYi0zNu3gr812cXKJDNLSkKcEwk= -github.com/gobuffalo/plush v3.7.16+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= -github.com/gobuffalo/tags v2.0.11+incompatible h1:zLkaontB8lWefU+DX38mzPLRKFGTJL8FKb9JnKMt0Z0= -github.com/gobuffalo/tags v2.0.11+incompatible/go.mod h1:9XmhOkyaB7UzvuY4UoZO4s67q8/xRMVJEaakauVQYeY= -github.com/gobuffalo/uuid v2.0.3+incompatible h1:W83ymTRbzM+XNntIsjC8j63FyzGytcfKTudU1Cg6xyk= -github.com/gobuffalo/uuid v2.0.3+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= -github.com/gobuffalo/validate v2.0.3+incompatible h1:6f4JCEz11Zi6iIlexMv7Jz10RBPvgI795AOaubtCwTE= -github.com/gobuffalo/validate v2.0.3+incompatible/go.mod h1:N+EtDe0J8252BgfzQUChBgfd6L93m9weay53EWFVsMM= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/joho/godotenv v1.2.0 h1:vGTvz69FzUFp+X4/bAkb0j5BoLC+9bpqTWY8mjhA9pc= -github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe h1:CHRGQ8V7OlCYtwaKPJi3iA7J+YdNKdo8j7nG5IgDhjs= -github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/markbates/inflect v1.0.1 h1:t3WOiMLsNqn0Vvw87evC70WSawzHZcwMETn53rL1bBw= -github.com/markbates/inflect v1.0.1/go.mod h1:uv3UVNBe5qBIfCm8O8Q+DW+S1EopeyINj+Ikhc7rnCk= -github.com/markbates/oncer v0.0.0-20180924034138-723ad0170a46 h1:hE7AFWf+YsdjT67d8uMxhirH3FG5Up2ovbwFWjamdt4= -github.com/markbates/oncer v0.0.0-20180924034138-723ad0170a46/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/microcosm-cc/bluemonday v1.0.1 h1:SIYunPjnlXcW+gVfvm0IlSeR5U3WZUOLfVmqg85Go44= -github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= -github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.2 h1:3mYCb7aPxS/RU7TI1y4rkEn1oKmPRjNJLNEXgw7MH2I= -github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516 h1:ofR1ZdrNSkiWcMsRrubK9tb2/SlZVWttAfqUjJi6QYc= -github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e h1:MZM7FHLqUHYI0Y/mQAt3d2aYa0SiNms/hFqC9qJYolM= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041 h1:llrF3Fs4018ePo4+G/HV/uQUqEI1HMDjCeOf2V6puPc= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b h1:vYEG87HxbU6dXj5npkeulCS96Dtz5xg3jcfCgpcvbIw= -github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= -github.com/shurcooL/highlight_go v0.0.0-20170515013102-78fb10f4a5f8 h1:xLQlo0Ghg8zBaQi+tjpK+z/WLjbg/BhAWP9pYgqo/LQ= -github.com/shurcooL/highlight_go v0.0.0-20170515013102-78fb10f4a5f8/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= -github.com/shurcooL/octicon v0.0.0-20180602230221-c42b0e3b24d9 h1:j3cAp1j8k/tSLaCcDiXIpVJ8FzSJ9g1eeOAPRJYM75k= -github.com/shurcooL/octicon v0.0.0-20180602230221-c42b0e3b24d9/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= -github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95 h1:/vdW8Cb7EXrkqWGufVMES1OH2sU9gKVb2n9/1y5NMBY= -github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.1.0 h1:65VZabgUiV9ktjGM5nTq0+YurgTyX+YI2lSSfDjI+qU= -github.com/sirupsen/logrus v1.1.0/go.mod h1:zrgwTnHtNr00buQ1vSptGe8m1f/BbgsPukg8qsT7A+A= -github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d h1:yKm7XZV6j9Ev6lojP2XaIshpT4ymkqhMeSghO5Ps00E= -github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= -github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e h1:qpG93cPwA5f7s/ZPBJnGOYQNK/vKsaDaseuKT5Asee8= -github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= -github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.2 h1:Fy0orTDgHdbnzHcsOgfCN4LtHf0ec3wwtiwJqwvf3Gc= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180927165925-5295e8364332 h1:hvQVdF6P9DX4OiKA5tpehlG6JsgzmyQiThG7q5Bn3UQ= -golang.org/x/crypto v0.0.0-20180927165925-5295e8364332/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180921000356-2f5d2388922f h1:QM2QVxvDoW9PFSPp/zy9FgxJLfaWTZlS61KEPtBwacM= -golang.org/x/net v0.0.0-20180921000356-2f5d2388922f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3 h1:dgd4x4kJt7G4k4m93AYLzM8Ni6h2qLTfh9n9vXJT3/0= -golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180928133829-e4b3c5e90611 h1:O33LKL7WyJgjN9CvxfTIomjIClbd/Kq86/iipowHQU0= -golang.org/x/sys v0.0.0-20180928133829-e4b3c5e90611/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20180928181343-b3c0be4c978b h1:hjfKpJoTfQ2QXKPX9eCDFBZ0t9sDrZL/viAgrN962TQ= -golang.org/x/tools v0.0.0-20180928181343-b3c0be4c978b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/gobuffalo/genny/group.go b/vendor/github.com/gobuffalo/genny/group.go deleted file mode 100644 index e1be356..0000000 --- a/vendor/github.com/gobuffalo/genny/group.go +++ /dev/null @@ -1,30 +0,0 @@ -package genny - -import "sync" - -type Group struct { - Generators []*Generator - moot sync.RWMutex -} - -func (gg *Group) Add(g *Generator) { - m := &gg.moot - m.Lock() - defer m.Unlock() - gg.Generators = append(gg.Generators, g) -} - -func (gg *Group) Merge(g2 *Group) { - for _, g := range g2.Generators { - gg.Add(g) - } -} - -func (gg *Group) With(r *Runner) { - m := &gg.moot - m.RLock() - defer m.RUnlock() - for _, g := range gg.Generators { - r.With(g) - } -} diff --git a/vendor/github.com/gobuffalo/genny/helpers.go b/vendor/github.com/gobuffalo/genny/helpers.go deleted file mode 100644 index 9c246b7..0000000 --- a/vendor/github.com/gobuffalo/genny/helpers.go +++ /dev/null @@ -1,46 +0,0 @@ -package genny - -import ( - "path/filepath" - "strings" - - "github.com/gobuffalo/envy" -) - -func exts(f File) []string { - var exts []string - - name := f.Name() - ext := filepath.Ext(name) - - for ext != "" { - exts = append([]string{ext}, exts...) - name = strings.TrimSuffix(name, ext) - ext = filepath.Ext(name) - } - return exts -} - -// HasExt checks if a file has a particular extension -func HasExt(f File, ext string) bool { - if ext == "*" { - return true - } - for _, x := range exts(f) { - if x == ext { - return true - } - } - return false -} - -// StripExt from a File and return a new one -func StripExt(f File, ext string) File { - name := f.Name() - name = strings.Replace(name, ext, "", -1) - return NewFile(name, f) -} - -func GoBin() string { - return envy.Get("GO_BIN", "go") -} diff --git a/vendor/github.com/gobuffalo/genny/logger.go b/vendor/github.com/gobuffalo/genny/logger.go deleted file mode 100644 index 2095079..0000000 --- a/vendor/github.com/gobuffalo/genny/logger.go +++ /dev/null @@ -1,18 +0,0 @@ -package genny - -// Logger interface for a logger to be used -// with genny. Logrus is 100% compatible. -type Logger interface { - Debugf(string, ...interface{}) - Debug(...interface{}) - Infof(string, ...interface{}) - Info(...interface{}) - Printf(string, ...interface{}) - Print(...interface{}) - Warnf(string, ...interface{}) - Warn(...interface{}) - Errorf(string, ...interface{}) - Error(...interface{}) - Fatalf(string, ...interface{}) - Fatal(...interface{}) -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/attrs/attrs.go b/vendor/github.com/gobuffalo/genny/movinglater/attrs/attrs.go deleted file mode 100644 index 1c15e33..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/attrs/attrs.go +++ /dev/null @@ -1,54 +0,0 @@ -package attrs - -import "github.com/gobuffalo/flect/name" - -type Attr struct { - Original string - Name name.Ident - commonType string - goType string -} - -func (a Attr) String() string { - return a.Original -} - -func (a Attr) GoType() string { - if a.goType != "" { - return a.goType - } - - switch a.commonType { - case "text": - return "string" - case "timestamp", "datetime", "date", "time": - return "time.Time" - case "nulls.text": - return "nulls.String" - case "uuid": - return "uuid.UUID" - case "json", "jsonb": - return "slices.Map" - case "[]string": - return "slices.String" - case "[]int": - return "slices.Int" - case "slices.float", "[]float", "[]float32", "[]float64": - return "slices.Float" - case "decimal", "float": - return "float64" - case "[]byte", "blob": - return "[]byte" - } - - return a.commonType -} - -func (a Attr) CommonType() string { - if a.commonType != "" { - return a.commonType - } - return a.commonType -} - -type Attrs []Attr diff --git a/vendor/github.com/gobuffalo/genny/movinglater/attrs/named_attrs.go b/vendor/github.com/gobuffalo/genny/movinglater/attrs/named_attrs.go deleted file mode 100644 index 0416a2f..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/attrs/named_attrs.go +++ /dev/null @@ -1,45 +0,0 @@ -package attrs - -import ( - "strings" - - "github.com/gobuffalo/flect/name" - "github.com/pkg/errors" -) - -var ErrMissingName = errors.New("requires a name argument") - -type NamedAttrs struct { - Name name.Ident - Attrs Attrs -} - -func (n NamedAttrs) Validate() error { - if len(n.Name.String()) == 0 { - return ErrMissingName - } - return nil -} - -func (n NamedAttrs) String() string { - x := []string{n.Name.Original} - for _, a := range n.Attrs { - x = append(x, a.String()) - } - return strings.Join(x, " ") -} - -func ParseNamedArgs(args ...string) (NamedAttrs, error) { - var na NamedAttrs - if len(args) < 1 { - return na, ErrMissingName - } - na.Name = name.New(args[0]) - if len(args) > 1 { - var err error - if na.Attrs, err = ParseArgs(args[1:]...); err != nil { - return na, err - } - } - return na, nil -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/attrs/parse.go b/vendor/github.com/gobuffalo/genny/movinglater/attrs/parse.go deleted file mode 100644 index 2bb1abd..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/attrs/parse.go +++ /dev/null @@ -1,57 +0,0 @@ -package attrs - -import ( - "strings" - - "github.com/gobuffalo/flect/name" - "github.com/pkg/errors" -) - -//ErrRepeatedAttr is returned when parsing an array with repeated names -var ErrRepeatedAttr = errors.New("duplicate attr name") - -func Parse(arg string) (Attr, error) { - arg = strings.TrimSpace(arg) - attr := Attr{ - Original: arg, - commonType: "string", - } - if len(arg) == 0 { - return attr, errors.New("argument can not be blank") - } - - parts := strings.Split(arg, ":") - attr.Name = name.New(parts[0]) - if len(parts) > 1 { - attr.commonType = parts[1] - } - - if len(parts) > 2 { - attr.goType = parts[2] - } - - return attr, nil -} - -//ParseArgs parses passed string args into Attrs -func ParseArgs(args ...string) (Attrs, error) { - var attrs Attrs - parsed := map[string]string{} - - for _, arg := range args { - a, err := Parse(arg) - if err != nil { - return attrs, errors.WithStack(err) - } - - key := a.Name.Underscore().String() - if parsed[key] != "" { - return attrs, ErrRepeatedAttr - } - - parsed[key] = arg - attrs = append(attrs, a) - } - - return attrs, nil -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/add_import.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/add_import.go deleted file mode 100644 index 8714c62..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/add_import.go +++ /dev/null @@ -1,52 +0,0 @@ -package gotools - -import ( - "fmt" - "go/ast" - "go/token" - "strings" - - "github.com/gobuffalo/genny" - "github.com/pkg/errors" -) - -// AddImport adds n number of import statements into the path provided -func AddImport(gf genny.File, imports ...string) (genny.File, error) { - pf, err := ParseFile(gf) - if err != nil { - return gf, errors.WithStack(err) - } - gf = pf.File - - end := findLastImport(pf.Ast, pf.FileSet, pf.Lines) - - x := make([]string, len(imports), len(imports)+2) - for _, i := range imports { - x = append(x, fmt.Sprintf("\t\"%s\"", i)) - - } - if end < 0 { - x = append([]string{"import ("}, x...) - x = append(x, ")") - } - - pf.Lines = append(pf.Lines[:end], append(x, pf.Lines[end:]...)...) - - fileContent := strings.Join(pf.Lines, "\n") - return genny.NewFile(gf.Name(), strings.NewReader(fileContent)), nil -} - -func findLastImport(f *ast.File, fset *token.FileSet, fileLines []string) int { - var end = -1 - - ast.Inspect(f, func(n ast.Node) bool { - switch x := n.(type) { - case *ast.ImportSpec: - end = fset.Position(x.End()).Line - return true - } - return true - }) - - return end -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/add_inside_block.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/add_inside_block.go deleted file mode 100644 index 84db655..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/add_inside_block.go +++ /dev/null @@ -1,79 +0,0 @@ -package gotools - -import ( - "fmt" - "go/ast" - "strings" - - "github.com/gobuffalo/genny" - "github.com/pkg/errors" -) - -// AddInsideBlock will add anything inside of the app declaration block inside of file -func AddInsideBlock(gf genny.File, search string, expressions ...string) (genny.File, error) { - pf, err := ParseFile(gf) - if err != nil { - return gf, errors.WithStack(err) - } - gf = pf.File - - _, end := findBlockCoordinates(search, pf) - if end < 0 { - return gf, errors.Errorf("could not find desired block in %s", gf.Name()) - } - - end = end - 1 - - el := pf.Lines[end:] - sl := []string{} - sf := []string{} - for _, l := range pf.Lines[:end] { - // if there's a app.ServeFiles("/", foo) line it needs to be the last added to the router - if strings.Contains(l, "ServeFiles(\"/\"") { - sf = append(sf, l) - continue - } - sl = append(sl, l) - } - - for i := 0; i < len(expressions); i++ { - expressions[i] = fmt.Sprintf("\t\t%s", expressions[i]) - } - - el = append(sf, el...) - pf.Lines = append(sl, append(expressions, el...)...) - - fileContent := strings.Join(pf.Lines, "\n") - return genny.NewFile(gf.Name(), strings.NewReader(fileContent)), nil -} - -func findBlockCoordinates(search string, pf ParsedFile) (int, int) { - var end = -1 - var start = -1 - - ast.Inspect(pf.Ast, func(n ast.Node) bool { - switch x := n.(type) { - case *ast.StructType: - line := pf.FileSet.Position(x.Pos()).Line - structDeclaration := fmt.Sprintf("%s\n", pf.Lines[line-1]) - - if strings.Contains(structDeclaration, search) { - start = line - end = pf.FileSet.Position(x.End()).Line - return false - } - - case *ast.BlockStmt: - start = pf.FileSet.Position(x.Lbrace).Line - blockDeclaration := fmt.Sprintf("%s\n", pf.Lines[start-1]) - - if strings.Contains(blockDeclaration, search) { - end = pf.FileSet.Position(x.Rbrace).Line - 1 - } - - } - return true - }) - - return start, end -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/append.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/append.go deleted file mode 100644 index 438f324..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/append.go +++ /dev/null @@ -1,22 +0,0 @@ -package gotools - -import ( - "strings" - - "github.com/gobuffalo/genny" - "github.com/pkg/errors" -) - -//Append allows to append source into a go file -func Append(gf genny.File, expressions ...string) (genny.File, error) { - pf, err := ParseFile(gf) - if err != nil { - return gf, errors.WithStack(err) - } - - gf = pf.File - pf.Lines = append(pf.Lines, expressions...) - - fileContent := strings.Join(pf.Lines, "\n") - return genny.NewFile(gf.Name(), strings.NewReader(fileContent)), nil -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/change_import.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/change_import.go deleted file mode 100644 index 1927a9b..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/change_import.go +++ /dev/null @@ -1,34 +0,0 @@ -package gotools - -import ( - "bytes" - "go/ast" - "go/parser" - "go/printer" - - "github.com/gobuffalo/genny" - "github.com/pkg/errors" - "golang.org/x/tools/go/ast/astutil" -) - -func RewriteImports(gf genny.File, swaps map[string]string) (genny.File, error) { - pf, err := ParseFileMode(gf, parser.ParseComments) - if err != nil { - return gf, errors.WithStack(err) - } - for key, value := range swaps { - if !astutil.DeleteImport(pf.FileSet, pf.Ast, key) { - continue - } - - astutil.AddImport(pf.FileSet, pf.Ast, value) - } - ast.SortImports(pf.FileSet, pf.Ast) - - w := &bytes.Buffer{} - if err = (&printer.Config{Mode: printer.TabIndent | printer.UseSpaces, Tabwidth: 8}).Fprint(w, pf.FileSet, pf.Ast); err != nil { - return gf, errors.WithStack(err) - } - - return genny.NewFile(gf.Name(), w), nil -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/files.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/files.go deleted file mode 100644 index 466cda7..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/files.go +++ /dev/null @@ -1,36 +0,0 @@ -package gotools - -import ( - "os" - "path/filepath" - "strings" - - "github.com/pkg/errors" -) - -func GoFiles(dir string) ([]string, error) { - var files []string - - pwd, err := os.Getwd() - if err != nil { - return files, errors.WithStack(err) - } - if dir == "" { - dir = pwd - } - - err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { - path = strings.TrimPrefix(path, pwd+"/") - if strings.Contains(path, ".git") || strings.Contains(path, "node_modules") || strings.Contains(path, "vendor"+string(os.PathSeparator)) { - if info.IsDir() { - return filepath.SkipDir - } - return nil - } - if filepath.Ext(path) == ".go" { - files = append(files, path) - } - return nil - }) - return files, nil -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/fmt.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/fmt.go deleted file mode 100644 index f266988..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/fmt.go +++ /dev/null @@ -1,40 +0,0 @@ -package gotools - -import ( - "bytes" - - "github.com/gobuffalo/genny" - "github.com/gobuffalo/genny/movinglater/gotools/goimports" - "github.com/pkg/errors" -) - -func GoFmt(root string) (*genny.Generator, error) { - g := genny.New() - g.RunFn(func(r *genny.Runner) error { - i, err := goimports.New(root) - if err != nil { - return errors.WithStack(err) - } - return i.Run() - }) - - return g, nil -} - -func FmtTransformer() genny.Transformer { - t := genny.NewTransformer(".go", func(f genny.File) (genny.File, error) { - bb := &bytes.Buffer{} - gi := goimports.NewFromFiles(goimports.File{ - Name: f.Name(), - In: f, - Out: bb, - }) - if err := gi.Run(); err != nil { - return f, errors.WithStack(err) - } - f = genny.NewFile(f.Name(), bb) - return f, nil - }) - t.StripExt = false - return t -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/get.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/get.go deleted file mode 100644 index a497df6..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/get.go +++ /dev/null @@ -1,25 +0,0 @@ -package gotools - -import ( - "os/exec" - - "github.com/gobuffalo/genny" - "github.com/gobuffalo/genny/movinglater/gotools/gomods" -) - -func Get(pkg string, args ...string) genny.RunFn { - return func(r *genny.Runner) error { - args = append([]string{"get"}, args...) - args = append(args, pkg) - cmd := exec.Command(genny.GoBin(), args...) - return r.Exec(cmd) - } -} - -func Install(pkg string, args ...string) genny.RunFn { - return func(r *genny.Runner) error { - return gomods.Disable(func() error { - return Get(pkg, args...)(r) - }) - } -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/goimports/LICENSE b/vendor/github.com/gobuffalo/genny/movinglater/gotools/goimports/LICENSE deleted file mode 100644 index 6a66aea..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/goimports/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/goimports/README.md b/vendor/github.com/gobuffalo/genny/movinglater/gotools/goimports/README.md deleted file mode 100644 index 2fc7513..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/goimports/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# goimports - -This package is a modified version of [https://github.com/golang/tools/tree/master/cmd/goimports](https://github.com/golang/tools/tree/master/cmd/goimports) to be called programmatically, instead of via the binary. - -Please see the `LICENSE` file details on the original license. diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/goimports/goimports.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/goimports/goimports.go deleted file mode 100644 index 093cc3a..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/goimports/goimports.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package goimports - -import ( - "bytes" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - - "github.com/pkg/errors" - "golang.org/x/tools/imports" -) - -type File struct { - Name string - In io.Reader - Out io.Writer -} - -type Runner struct { - files []File -} - -func New(path ...string) (Runner, error) { - r := Runner{} - files, err := buildFiles(path...) - if err != nil { - return r, errors.WithStack(err) - } - r.files = files - return r, nil -} - -func NewFromFiles(files ...File) Runner { - return Runner{ - files: files, - } -} - -func (r Runner) Run() error { - for _, file := range r.files { - if err := r.processFile(file); err != nil { - return errors.WithStack(err) - } - } - return nil -} - -func (r Runner) processFile(file File) error { - var src []byte - var err error - if file.In == nil { - src, err = ioutil.ReadFile(file.Name) - if err != nil { - return errors.WithStack(err) - } - } else { - src, err = ioutil.ReadAll(file.In) - } - res, err := imports.Process(file.Name, src, nil) - if err != nil { - return errors.WithStack(err) - } - if bytes.Equal(src, res) { - return nil - } - if file.Out == nil { - if err = ioutil.WriteFile(file.Name, res, 0); err != nil { - return errors.WithStack(err) - } - return nil - } - _, err = file.Out.Write(res) - return err -} - -func isGoFile(f os.FileInfo) bool { - // ignore non-Go files - name := f.Name() - return !f.IsDir() && !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".go") -} - -func buildFiles(paths ...string) ([]File, error) { - var files []File - for _, root := range paths { - err := filepath.Walk(root, func(path string, info os.FileInfo, _ error) error { - if info == nil { - return nil - } - if info.IsDir() { - return nil - } - if !isGoFile(info) { - return nil - } - f, err := os.Open(path) - if err != nil { - return errors.WithStack(err) - } - files = append(files, File{ - Name: path, - In: f, - }) - return nil - }) - if err != nil { - return files, errors.WithStack(err) - } - } - return files, nil -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/gomods/gomods.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/gomods/gomods.go deleted file mode 100644 index 19f2dba..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/gomods/gomods.go +++ /dev/null @@ -1,32 +0,0 @@ -package gomods - -import ( - "strings" - - "github.com/gobuffalo/envy" - "github.com/pkg/errors" -) - -const ENV = "GO111MODULE" - -var ErrModsOff = errors.New("go mods are turned off") -var modsOn = (strings.TrimSpace(envy.Get(ENV, "off")) == "on") - -func On() bool { - return modsOn -} - -func Disable(fn func() error) error { - gm := envy.Get("GO111MODULE", "off") - defer envy.MustSet("GO111MODULE", gm) - if err := envy.MustSet("GO111MODULE", "off"); err != nil { - return errors.WithStack(err) - } - - // this ensures the defer gets called after fn() - // doing return fn() would have it called before - if err := fn(); err != nil { - return errors.WithStack(err) - } - return nil -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/gomods/init.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/gomods/init.go deleted file mode 100644 index 07b5f27..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/gomods/init.go +++ /dev/null @@ -1,39 +0,0 @@ -package gomods - -import ( - "os/exec" - - "github.com/gobuffalo/genny" - "github.com/pkg/errors" -) - -func New(name string, path string) (*genny.Group, error) { - g := &genny.Group{} - - init, err := Init(name, path) - if err != nil { - return g, errors.WithStack(err) - } - g.Add(init) - - tidy, err := Tidy(path, false) - if err != nil { - return g, errors.WithStack(err) - } - g.Add(tidy) - return g, nil -} - -func Init(name string, path string) (*genny.Generator, error) { - g := genny.New() - g.RunFn(func(r *genny.Runner) error { - if !modsOn { - return nil - } - return r.Chdir(path, func() error { - cmd := exec.Command(genny.GoBin(), "mod", "init", name) - return r.Exec(cmd) - }) - }) - return g, nil -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/gomods/tidy.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/gomods/tidy.go deleted file mode 100644 index c2b402a..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/gomods/tidy.go +++ /dev/null @@ -1,24 +0,0 @@ -package gomods - -import ( - "os/exec" - - "github.com/gobuffalo/genny" -) - -func Tidy(path string, verbose bool) (*genny.Generator, error) { - g := genny.New() - g.RunFn(func(r *genny.Runner) error { - if !modsOn { - return nil - } - return r.Chdir(path, func() error { - cmd := exec.Command(genny.GoBin(), "mod", "tidy") - if verbose { - cmd.Args = append(cmd.Args, "-v") - } - return r.Exec(cmd) - }) - }) - return g, nil -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/gotools.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/gotools.go deleted file mode 100644 index 7174107..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/gotools.go +++ /dev/null @@ -1 +0,0 @@ -package gotools diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/package.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/package.go deleted file mode 100644 index 26dd7e0..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/package.go +++ /dev/null @@ -1,20 +0,0 @@ -package gotools - -import ( - "path/filepath" - - "github.com/gobuffalo/genny" - "github.com/pkg/errors" -) - -func PackageName(f genny.File) (string, error) { - pkg := filepath.Base(filepath.Dir(f.Name())) - pf, err := ParseFile(f) - if err == nil { - pkg = pf.Ast.Name.String() - } - if len(pkg) == 0 || pkg == "." { - return "", errors.New("could not determine package") - } - return pkg, nil -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/parsed_file.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/parsed_file.go deleted file mode 100644 index b282823..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/parsed_file.go +++ /dev/null @@ -1,76 +0,0 @@ -package gotools - -import ( - "bytes" - "fmt" - "go/ast" - "go/parser" - "go/token" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" - - "github.com/gobuffalo/genny" - "github.com/pkg/errors" -) - -type ParsedFile struct { - File genny.File - FileSet *token.FileSet - Ast *ast.File - Lines []string -} - -func ParseFileMode(gf genny.File, mode parser.Mode) (ParsedFile, error) { - name := gf.Name() - pf := ParsedFile{ - FileSet: token.NewFileSet(), - } - - gf, err := beforeParse(gf) - if err != nil { - return pf, errors.WithStack(err) - } - - src := gf.String() - f, err := parser.ParseFile(pf.FileSet, gf.Name(), src, mode) - if err != nil { - return pf, errors.WithStack(err) - } - pf.Ast = f - - pf.Lines = strings.Split(src, "\n") - pf.File = genny.NewFile(name, gf) - return pf, nil -} - -func ParseFile(gf genny.File) (ParsedFile, error) { - return ParseFileMode(gf, 0) -} - -func beforeParse(gf genny.File) (genny.File, error) { - src, err := ioutil.ReadAll(gf) - if err != nil { - return gf, errors.WithStack(err) - } - - dir := os.TempDir() - path := filepath.Join(dir, fmt.Sprintf("%d.go", time.Now().UnixNano())) - if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil { - return gf, errors.WithStack(err) - } - - tf, err := os.Create(path) - if err != nil { - return gf, errors.WithStack(err) - } - if _, err := tf.Write(src); err != nil { - return gf, errors.WithStack(err) - } - if err := tf.Close(); err != nil { - return gf, errors.WithStack(err) - } - return genny.NewFile(path, bytes.NewReader(src)), nil -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/replace_block_body.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/replace_block_body.go deleted file mode 100644 index 22c21f6..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/replace_block_body.go +++ /dev/null @@ -1,27 +0,0 @@ -package gotools - -import ( - "strings" - - "github.com/gobuffalo/genny" - "github.com/pkg/errors" -) - -// ReplaceBlockBody will replace found block with expressions passed -func ReplaceBlockBody(gf genny.File, search string, expressions ...string) (genny.File, error) { - pf, err := ParseFile(gf) - if err != nil { - return gf, errors.WithStack(err) - } - gf = pf.File - - start, end := findBlockCoordinates(search, pf) - if end < 0 { - return gf, errors.Errorf("could not find desired block in %s", gf.Name()) - } - - pf.Lines = append(pf.Lines[:start], append(expressions, pf.Lines[end:]...)...) - - fileContent := strings.Join(pf.Lines, "\n") - return genny.NewFile(gf.Name(), strings.NewReader(fileContent)), nil -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/gotools/templates.go b/vendor/github.com/gobuffalo/genny/movinglater/gotools/templates.go deleted file mode 100644 index 017f283..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/gotools/templates.go +++ /dev/null @@ -1,52 +0,0 @@ -package gotools - -import ( - "bytes" - "io/ioutil" - - "text/template" - - "github.com/gobuffalo/genny" - "github.com/pkg/errors" -) - -var TemplateHelpers = map[string]interface{}{} - -// TemplateTransformer will run any file that has a ".tmpl" extension through text/template -func TemplateTransformer(data interface{}, helpers map[string]interface{}) genny.Transformer { - if helpers == nil { - helpers = TemplateHelpers - } - t := genny.NewTransformer(".tmpl", func(f genny.File) (genny.File, error) { - return renderWithTemplate(f, data, helpers) - }) - t.StripExt = true - return t -} - -func renderWithTemplate(f genny.File, data interface{}, helpers template.FuncMap) (genny.File, error) { - if f == nil { - return f, errors.New("file was nil") - } - path := f.Name() - t := template.New(path) - if helpers != nil { - t = t.Funcs(helpers) - } - - b, err := ioutil.ReadAll(f) - if err != nil { - return f, errors.WithStack(err) - } - t, err = t.Parse(string(b)) - if err != nil { - return f, errors.WithStack(err) - } - - var bb bytes.Buffer - if err = t.Execute(&bb, data); err != nil { - err = errors.WithStack(err) - return f, errors.WithStack(err) - } - return genny.StripExt(genny.NewFile(path, &bb), ".tmpl"), nil -} diff --git a/vendor/github.com/gobuffalo/genny/movinglater/plushgen/plush.go b/vendor/github.com/gobuffalo/genny/movinglater/plushgen/plush.go deleted file mode 100644 index c58e887..0000000 --- a/vendor/github.com/gobuffalo/genny/movinglater/plushgen/plush.go +++ /dev/null @@ -1,27 +0,0 @@ -package plushgen - -import ( - "io/ioutil" - "strings" - - "github.com/gobuffalo/genny" - "github.com/gobuffalo/plush" - "github.com/pkg/errors" -) - -// Transformer will plushify any file that has a ".plush" extension -func Transformer(ctx *plush.Context) genny.Transformer { - t := genny.NewTransformer(".plush", func(f genny.File) (genny.File, error) { - b, err := ioutil.ReadAll(f) - if err != nil { - return f, errors.WithStack(err) - } - s, err := plush.Render(string(b), ctx) - if err != nil { - return f, errors.WithStack(err) - } - return genny.NewFile(f.Name(), strings.NewReader(s)), nil - }) - t.StripExt = true - return t -} diff --git a/vendor/github.com/gobuffalo/genny/replacer.go b/vendor/github.com/gobuffalo/genny/replacer.go deleted file mode 100644 index 3866071..0000000 --- a/vendor/github.com/gobuffalo/genny/replacer.go +++ /dev/null @@ -1,20 +0,0 @@ -package genny - -import ( - "strings" -) - -// Replace search/replace in a file name -func Replace(search string, replace string) Transformer { - return NewTransformer("*", func(f File) (File, error) { - name := f.Name() - name = strings.Replace(name, search, replace, -1) - return NewFile(name, f), nil - }) -} - -// Dot will convert -dot- in a file name to just a . -// example -dot-travis.yml becomes .travis.yml -func Dot() Transformer { - return Replace("-dot-", ".") -} diff --git a/vendor/github.com/gobuffalo/genny/results.go b/vendor/github.com/gobuffalo/genny/results.go deleted file mode 100644 index 8a7b1e0..0000000 --- a/vendor/github.com/gobuffalo/genny/results.go +++ /dev/null @@ -1,19 +0,0 @@ -package genny - -import ( - "net/http" - "os/exec" -) - -type Results struct { - Files []File - Commands []*exec.Cmd - Requests []RequestResult -} - -type RequestResult struct { - Request *http.Request - Response *http.Response - Client *http.Client - Error error -} diff --git a/vendor/github.com/gobuffalo/genny/runner.go b/vendor/github.com/gobuffalo/genny/runner.go deleted file mode 100644 index fa7c02e..0000000 --- a/vendor/github.com/gobuffalo/genny/runner.go +++ /dev/null @@ -1,218 +0,0 @@ -package genny - -import ( - "context" - "fmt" - "io" - "net/http" - "os" - "os/exec" - "path/filepath" - "strings" - "sync" - - "github.com/markbates/oncer" - "github.com/pkg/errors" -) - -type RunFn func(r *Runner) error - -// Runner will run the generators -type Runner struct { - Logger Logger // Logger to use for the run - Context context.Context // context to use for the run - ExecFn func(*exec.Cmd) error // function to use when executing files - FileFn func(File) (File, error) // function to use when writing files - ChdirFn func(string, func() error) error // function to use when changing directories - DeleteFn func(string) error // function used to delete files/folders - RequestFn func(*http.Request, *http.Client) (*http.Response, error) // function used to make http requests - Root string // the root of the write path - Disk *Disk - generators []*Generator - moot *sync.RWMutex - results Results - curGen *Generator -} - -func (r *Runner) Results() Results { - r.moot.Lock() - defer r.moot.Unlock() - r.results.Files = r.Disk.Files() - return r.results -} - -func (r *Runner) WithRun(fn RunFn) { - g := New() - g.RunFn(fn) - r.With(g) -} - -// With adds a Generator to the Runner -func (r *Runner) With(g *Generator) { - r.moot.Lock() - defer r.moot.Unlock() - r.generators = append(r.generators, g) -} - -func (r *Runner) WithGroup(gg *Group) { - for _, g := range gg.Generators { - r.With(g) - } -} - -// WithNew takes a Generator and an error. -// Perfect for new-ing up generators -/* - // foo.New(Options) (*genny.Generator, error) - if err := run.WithNew(foo.New(opts)); err != nil { - return err - } -*/ -func (r *Runner) WithNew(g *Generator, err error) error { - if err != nil { - return errors.WithStack(err) - } - r.With(g) - return nil -} - -// WithFn will evaluate the function and if successful it will add -// the Generator to the Runner, otherwise it will return the error -// Deprecated -func (r *Runner) WithFn(fn func() (*Generator, error)) error { - oncer.Deprecate(5, "genny.Runner#WithFn", "") - g, err := fn() - if err != nil { - return errors.WithStack(err) - } - r.With(g) - return nil -} - -// Run all of the generators! -func (r *Runner) Run() error { - r.moot.Lock() - defer r.moot.Unlock() - for _, g := range r.generators { - r.curGen = g - if g.Should != nil { - if !g.Should(r) { - continue - } - } - for _, fn := range g.runners { - if err := fn(r); err != nil { - return errors.WithStack(err) - } - } - } - return nil -} - -// Exec can be used inside of Generators to run commands -func (r *Runner) Exec(cmd *exec.Cmd) error { - r.results.Commands = append(r.results.Commands, cmd) - r.Logger.Infof(strings.Join(cmd.Args, " ")) - if r.ExecFn == nil { - return nil - } - return r.ExecFn(cmd) -} - -// File can be used inside of Generators to write files -func (r *Runner) File(f File) error { - if r.curGen != nil { - var err error - f, err = r.curGen.Transform(f) - if err != nil { - return errors.WithStack(err) - } - } - name := f.Name() - if !filepath.IsAbs(name) { - name = filepath.Join(r.Root, name) - } - r.Logger.Infof(name) - if r.FileFn != nil { - var err error - if f, err = r.FileFn(f); err != nil { - return errors.WithStack(err) - } - if s, ok := f.(io.Seeker); ok { - s.Seek(0, 0) - } - } - f = NewFile(f.Name(), f) - if s, ok := f.(io.Seeker); ok { - s.Seek(0, 0) - } - r.Disk.Add(f) - return nil -} - -func (r *Runner) FindFile(name string) (File, error) { - return r.Disk.Find(name) -} - -// Chdir will change to the specified directory -// and revert back to the current directory when -// the runner function has returned. -// If the directory does not exist, it will be -// created for you. -func (r *Runner) Chdir(path string, fn func() error) error { - if len(path) == 0 { - return fn() - } - r.Logger.Infof("cd: %s", path) - - if r.ChdirFn != nil { - return r.ChdirFn(path, fn) - } - - pwd, _ := os.Getwd() - defer os.Chdir(pwd) - os.MkdirAll(path, 0755) - if err := os.Chdir(path); err != nil { - return errors.WithStack(err) - } - if err := fn(); err != nil { - return errors.WithStack(err) - } - return nil -} - -func (r *Runner) Delete(path string) error { - r.Logger.Infof("rm: %s", path) - - defer r.Disk.Remove(path) - if r.DeleteFn != nil { - return r.DeleteFn(path) - } - return nil -} - -func (r *Runner) Request(req *http.Request) (*http.Response, error) { - return r.RequestWithClient(req, http.DefaultClient) -} - -func (r *Runner) RequestWithClient(req *http.Request, c *http.Client) (*http.Response, error) { - key := fmt.Sprintf("[%s] %s\n", strings.ToUpper(req.Method), req.URL) - r.Logger.Infof(key) - store := func(res *http.Response, err error) { - r.moot.Lock() - r.results.Requests = append(r.results.Requests, RequestResult{ - Request: req, - Response: res, - Client: c, - Error: err, - }) - r.moot.Unlock() - } - if r.RequestFn == nil { - store(nil, nil) - return nil, nil - } - res, err := r.RequestFn(req, c) - store(res, err) - return res, err -} diff --git a/vendor/github.com/gobuffalo/genny/transformer.go b/vendor/github.com/gobuffalo/genny/transformer.go deleted file mode 100644 index 7b7eaff..0000000 --- a/vendor/github.com/gobuffalo/genny/transformer.go +++ /dev/null @@ -1,37 +0,0 @@ -package genny - -import ( - "github.com/pkg/errors" -) - -type TransformerFn func(File) (File, error) - -type Transformer struct { - Ext string - StripExt bool - fn TransformerFn -} - -func (t Transformer) Transform(f File) (File, error) { - if !HasExt(f, t.Ext) { - return f, nil - } - if t.fn == nil { - return f, nil - } - f, err := t.fn(f) - if err != nil { - return f, errors.WithStack(err) - } - if t.StripExt { - return StripExt(f, t.Ext), nil - } - return f, nil -} - -func NewTransformer(ext string, fn TransformerFn) Transformer { - return Transformer{ - Ext: ext, - fn: fn, - } -} diff --git a/vendor/github.com/gobuffalo/genny/version.go b/vendor/github.com/gobuffalo/genny/version.go deleted file mode 100644 index 103c8c9..0000000 --- a/vendor/github.com/gobuffalo/genny/version.go +++ /dev/null @@ -1,3 +0,0 @@ -package genny - -const Version = "v0.0.1" diff --git a/vendor/github.com/gobuffalo/genny/wet_runner.go b/vendor/github.com/gobuffalo/genny/wet_runner.go deleted file mode 100644 index 5dddc79..0000000 --- a/vendor/github.com/gobuffalo/genny/wet_runner.go +++ /dev/null @@ -1,86 +0,0 @@ -package genny - -import ( - "bytes" - "context" - "io" - "net/http" - "os" - "os/exec" - "path/filepath" - "time" - - "github.com/pkg/errors" - "github.com/sirupsen/logrus" -) - -// WetRunner will execute commands and write files -// it is DESTRUCTIVE -func WetRunner(ctx context.Context) *Runner { - r := DryRunner(ctx) - l := logrus.New() - l.Out = os.Stdout - r.Logger = l - - r.ExecFn = wetExecFn - r.FileFn = func(f File) (File, error) { - return wetFileFn(r, f) - } - r.DeleteFn = os.RemoveAll - r.RequestFn = wetRequestFn - return r -} - -func wetRequestFn(req *http.Request, c *http.Client) (*http.Response, error) { - if c == nil { - c = &http.Client{} - } - ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second) - defer cancel() - req = req.WithContext(ctx) - - res, err := c.Do(req) - if err != nil { - return res, errors.WithStack(err) - } - - if res.StatusCode >= 400 { - return res, errors.WithStack(errors.Errorf("response returned non-success code: %d", res.StatusCode)) - } - return res, nil -} - -func wetExecFn(cmd *exec.Cmd) error { - if cmd.Stdin == nil { - cmd.Stdin = os.Stdin - } - if cmd.Stdout == nil { - cmd.Stdout = os.Stdout - } - if cmd.Stderr == nil { - cmd.Stderr = os.Stderr - } - return cmd.Run() -} - -func wetFileFn(r *Runner, f File) (File, error) { - name := f.Name() - if !filepath.IsAbs(name) { - name = filepath.Join(r.Root, name) - } - dir := filepath.Dir(name) - if err := os.MkdirAll(dir, 0755); err != nil { - return f, errors.WithStack(err) - } - ff, err := os.Create(name) - if err != nil { - return f, errors.WithStack(err) - } - defer ff.Close() - bb := &bytes.Buffer{} - mw := io.MultiWriter(bb, ff) - if _, err := io.Copy(mw, f); err != nil { - return f, errors.WithStack(err) - } - return NewFile(f.Name(), bb), nil -} diff --git a/vendor/github.com/gobuffalo/github_flavored_markdown/.gometalinter.json b/vendor/github.com/gobuffalo/github_flavored_markdown/.gometalinter.json deleted file mode 100644 index e4f65a3..0000000 --- a/vendor/github.com/gobuffalo/github_flavored_markdown/.gometalinter.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Enable": ["vet", "golint", "goimports", "deadcode", "gotype", "ineffassign", "misspell", "nakedret", "unconvert", "megacheck", "varcheck"] -} diff --git a/vendor/github.com/gobuffalo/github_flavored_markdown/.travis.yml b/vendor/github.com/gobuffalo/github_flavored_markdown/.travis.yml deleted file mode 100644 index 93b1fcd..0000000 --- a/vendor/github.com/gobuffalo/github_flavored_markdown/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -sudo: false -language: go -go: - - 1.x - - master -matrix: - allow_failures: - - go: master - fast_finish: true -install: - - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). -script: - - go get -t -v ./... - - diff -u <(echo -n) <(gofmt -d -s .) - - go tool vet . - - go test -v -race ./... diff --git a/vendor/github.com/gobuffalo/github_flavored_markdown/Makefile b/vendor/github.com/gobuffalo/github_flavored_markdown/Makefile deleted file mode 100644 index 187cb8a..0000000 --- a/vendor/github.com/gobuffalo/github_flavored_markdown/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -TAGS ?= "sqlite" -GO_BIN ?= go - -install: - packr - $(GO_BIN) install -v . - -deps: - $(GO_BIN) get github.com/gobuffalo/release - $(GO_BIN) get github.com/gobuffalo/packr/packr - $(GO_BIN) get -tags ${TAGS} -t ./... - $(GO_BIN) mod tidy - -build: - packr - $(GO_BIN) build -v . - -test: - packr - $(GO_BIN) test -tags ${TAGS} ./... - -ci-test: deps - $(GO_BIN) test -tags ${TAGS} -race ./... - -lint: - gometalinter --vendor ./... --deadline=1m --skip=internal - -update: - $(GO_BIN) get -u -tags ${TAGS} - $(GO_BIN) mod tidy - packr - make test - make install - $(GO_BIN) mod tidy - -release-test: - $(GO_BIN) test -tags ${TAGS} -race ./... - -release: - release -y -f version.go diff --git a/vendor/github.com/gobuffalo/github_flavored_markdown/README.md b/vendor/github.com/gobuffalo/github_flavored_markdown/README.md deleted file mode 100644 index 1207a70..0000000 --- a/vendor/github.com/gobuffalo/github_flavored_markdown/README.md +++ /dev/null @@ -1,32 +0,0 @@ -github_flavored_markdown -======================== - -[![Build Status](https://travis-ci.org/gobuffalo/github_flavored_markdown.svg?branch=master)](https://travis-ci.org/gobuffalo/github_flavored_markdown) [![GoDoc](https://godoc.org/github.com/gobuffalo/github_flavored_markdown?status.svg)](https://godoc.org/github.com/gobuffalo/github_flavored_markdown) - -Package github_flavored_markdown provides a GitHub Flavored Markdown renderer -with fenced code block highlighting, clickable heading anchor links. - -The functionality should be equivalent to the GitHub Markdown API endpoint specified at -https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode, except -the rendering is performed locally. - -See examples for how to generate a complete HTML page, including CSS styles. - -Installation ------------- - -```bash -go get -u github.com/gobuffalo/github_flavored_markdown -``` - -Directories ------------ - -| Path | Synopsis | -|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------| -| [gfmstyle](https://godoc.org/github.com/gobuffalo/github_flavored_markdown/gfmstyle) | Package gfmstyle contains CSS styles for rendering GitHub Flavored Markdown. | - -License -------- - -- [MIT License](https://opensource.org/licenses/mit-license.php) diff --git a/vendor/github.com/gobuffalo/github_flavored_markdown/go.mod b/vendor/github.com/gobuffalo/github_flavored_markdown/go.mod deleted file mode 100644 index 2fe4d61..0000000 --- a/vendor/github.com/gobuffalo/github_flavored_markdown/go.mod +++ /dev/null @@ -1,19 +0,0 @@ -module github.com/gobuffalo/github_flavored_markdown - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/kr/pretty v0.1.0 // indirect - github.com/microcosm-cc/bluemonday v1.0.1 - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/sergi/go-diff v1.0.0 // indirect - github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e // indirect - github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041 // indirect - github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b - github.com/shurcooL/highlight_go v0.0.0-20170515013102-78fb10f4a5f8 - github.com/shurcooL/octicon v0.0.0-20180602230221-c42b0e3b24d9 - github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95 - github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d - github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e - github.com/stretchr/testify v1.2.2 // indirect - golang.org/x/net v0.0.0-20180921000356-2f5d2388922f -) diff --git a/vendor/github.com/gobuffalo/github_flavored_markdown/go.sum b/vendor/github.com/gobuffalo/github_flavored_markdown/go.sum deleted file mode 100644 index 168c8d9..0000000 --- a/vendor/github.com/gobuffalo/github_flavored_markdown/go.sum +++ /dev/null @@ -1,33 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/microcosm-cc/bluemonday v1.0.1 h1:SIYunPjnlXcW+gVfvm0IlSeR5U3WZUOLfVmqg85Go44= -github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e h1:MZM7FHLqUHYI0Y/mQAt3d2aYa0SiNms/hFqC9qJYolM= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041 h1:llrF3Fs4018ePo4+G/HV/uQUqEI1HMDjCeOf2V6puPc= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b h1:vYEG87HxbU6dXj5npkeulCS96Dtz5xg3jcfCgpcvbIw= -github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= -github.com/shurcooL/highlight_go v0.0.0-20170515013102-78fb10f4a5f8 h1:xLQlo0Ghg8zBaQi+tjpK+z/WLjbg/BhAWP9pYgqo/LQ= -github.com/shurcooL/highlight_go v0.0.0-20170515013102-78fb10f4a5f8/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= -github.com/shurcooL/octicon v0.0.0-20180602230221-c42b0e3b24d9 h1:j3cAp1j8k/tSLaCcDiXIpVJ8FzSJ9g1eeOAPRJYM75k= -github.com/shurcooL/octicon v0.0.0-20180602230221-c42b0e3b24d9/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= -github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95 h1:/vdW8Cb7EXrkqWGufVMES1OH2sU9gKVb2n9/1y5NMBY= -github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d h1:yKm7XZV6j9Ev6lojP2XaIshpT4ymkqhMeSghO5Ps00E= -github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= -github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e h1:qpG93cPwA5f7s/ZPBJnGOYQNK/vKsaDaseuKT5Asee8= -github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/net v0.0.0-20180921000356-2f5d2388922f h1:QM2QVxvDoW9PFSPp/zy9FgxJLfaWTZlS61KEPtBwacM= -golang.org/x/net v0.0.0-20180921000356-2f5d2388922f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/.gitignore b/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/.gitignore deleted file mode 100644 index 75623dc..0000000 --- a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -*.out -*.swp -*.8 -*.6 -_obj -_test* -markdown -tags diff --git a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/.travis.yml b/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/.travis.yml deleted file mode 100644 index a1687f1..0000000 --- a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -sudo: false -language: go -go: - - 1.5.4 - - 1.6.2 - - tip -matrix: - include: - - go: 1.2.2 - script: - - go get -t -v ./... - - go test -v -race ./... - - go: 1.3.3 - script: - - go get -t -v ./... - - go test -v -race ./... - - go: 1.4.3 - script: - - go get -t -v ./... - - go test -v -race ./... - allow_failures: - - go: tip - fast_finish: true -install: - - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). -script: - - go get -t -v ./... - - diff -u <(echo -n) <(gofmt -d -s .) - - go tool vet . - - go test -v -race ./... diff --git a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/LICENSE.txt b/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/LICENSE.txt deleted file mode 100644 index 2885af3..0000000 --- a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/LICENSE.txt +++ /dev/null @@ -1,29 +0,0 @@ -Blackfriday is distributed under the Simplified BSD License: - -> Copyright © 2011 Russ Ross -> All rights reserved. -> -> Redistribution and use in source and binary forms, with or without -> modification, are permitted provided that the following conditions -> are met: -> -> 1. Redistributions of source code must retain the above copyright -> notice, this list of conditions and the following disclaimer. -> -> 2. Redistributions in binary form must reproduce the above -> copyright notice, this list of conditions and the following -> disclaimer in the documentation and/or other materials provided with -> the distribution. -> -> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -> "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -> LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -> FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -> COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -> INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -> BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -> LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -> LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -> ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -> POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/README.md b/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/README.md deleted file mode 100644 index a6c94b7..0000000 --- a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/README.md +++ /dev/null @@ -1,363 +0,0 @@ -Blackfriday -[![Build Status][BuildSVG]][BuildURL] -[![Godoc][GodocV2SVG]][GodocV2URL] -=========== - -Blackfriday is a [Markdown][1] processor implemented in [Go][2]. It -is paranoid about its input (so you can safely feed it user-supplied -data), it is fast, it supports common extensions (tables, smart -punctuation substitutions, etc.), and it is safe for all utf-8 -(unicode) input. - -HTML output is currently supported, along with Smartypants -extensions. - -It started as a translation from C of [Sundown][3]. - - -Installation ------------- - -Blackfriday is compatible with any modern Go release. With Go and git installed: - - go get -u gopkg.in/russross/blackfriday.v2 - -will download, compile, and install the package into your `$GOPATH` directory -hierarchy. - - -Versions --------- - -Currently maintained and recommended version of Blackfriday is `v2`. It's being -developed on its own branch: https://github.com/russross/blackfriday/tree/v2 and the -documentation is available at -https://godoc.org/gopkg.in/russross/blackfriday.v2. - -It is `go get`-able via via [gopkg.in][6] at `gopkg.in/russross/blackfriday.v2`, -but we highly recommend using package management tool like [dep][7] or -[Glide][8] and make use of semantic versioning. With package management you -should import `github.com/russross/blackfriday` and specify that you're using -version 2.0.0. - -Version 2 offers a number of improvements over v1: - -* Cleaned up API -* A separate call to [`Parse`][4], which produces an abstract syntax tree for - the document -* Latest bug fixes -* Flexibility to easily add your own rendering extensions - -Potential drawbacks: - -* Our benchmarks show v2 to be slightly slower than v1. Currently in the - ballpark of around 15%. -* API breakage. If you can't afford modifying your code to adhere to the new API - and don't care too much about the new features, v2 is probably not for you. -* Several bug fixes are trailing behind and still need to be forward-ported to - v2. See issue [#348](https://github.com/russross/blackfriday/issues/348) for - tracking. - -If you are still interested in the legacy `v1`, you can import it from -`github.com/russross/blackfriday`. Documentation for the legacy v1 can be found -here: https://godoc.org/github.com/russross/blackfriday - -### Known issue with `dep` - -There is a known problem with using Blackfriday v1 _transitively_ and `dep`. -Currently `dep` prioritizes semver versions over anything else, and picks the -latest one, plus it does not apply a `[[constraint]]` specifier to transitively -pulled in packages. So if you're using something that uses Blackfriday v1, but -that something does not use `dep` yet, you will get Blackfriday v2 pulled in and -your first dependency will fail to build. - -There are couple of fixes for it, documented here: -https://github.com/golang/dep/blob/master/docs/FAQ.md#how-do-i-constrain-a-transitive-dependencys-version - -Meanwhile, `dep` team is working on a more general solution to the constraints -on transitive dependencies problem: https://github.com/golang/dep/issues/1124. - - -Usage ------ - -### v1 - -For basic usage, it is as simple as getting your input into a byte -slice and calling: - - output := blackfriday.MarkdownBasic(input) - -This renders it with no extensions enabled. To get a more useful -feature set, use this instead: - - output := blackfriday.MarkdownCommon(input) - -### v2 - -For the most sensible markdown processing, it is as simple as getting your input -into a byte slice and calling: - -```go -output := blackfriday.Run(input) -``` - -Your input will be parsed and the output rendered with a set of most popular -extensions enabled. If you want the most basic feature set, corresponding with -the bare Markdown specification, use: - -```go -output := blackfriday.Run(input, blackfriday.WithNoExtensions()) -``` - -### Sanitize untrusted content - -Blackfriday itself does nothing to protect against malicious content. If you are -dealing with user-supplied markdown, we recommend running Blackfriday's output -through HTML sanitizer such as [Bluemonday][5]. - -Here's an example of simple usage of Blackfriday together with Bluemonday: - -```go -import ( - "github.com/microcosm-cc/bluemonday" - "gopkg.in/russross/blackfriday.v2" -) - -// ... -unsafe := blackfriday.Run(input) -html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) -``` - -### Custom options, v1 - -If you want to customize the set of options, first get a renderer -(currently only the HTML output engine), then use it to -call the more general `Markdown` function. For examples, see the -implementations of `MarkdownBasic` and `MarkdownCommon` in -`markdown.go`. - -### Custom options, v2 - -If you want to customize the set of options, use `blackfriday.WithExtensions`, -`blackfriday.WithRenderer` and `blackfriday.WithRefOverride`. - -### `blackfriday-tool` - -You can also check out `blackfriday-tool` for a more complete example -of how to use it. Download and install it using: - - go get github.com/russross/blackfriday-tool - -This is a simple command-line tool that allows you to process a -markdown file using a standalone program. You can also browse the -source directly on github if you are just looking for some example -code: - -* - -Note that if you have not already done so, installing -`blackfriday-tool` will be sufficient to download and install -blackfriday in addition to the tool itself. The tool binary will be -installed in `$GOPATH/bin`. This is a statically-linked binary that -can be copied to wherever you need it without worrying about -dependencies and library versions. - -### Sanitized anchor names - -Blackfriday includes an algorithm for creating sanitized anchor names -corresponding to a given input text. This algorithm is used to create -anchors for headings when `EXTENSION_AUTO_HEADER_IDS` is enabled. The -algorithm has a specification, so that other packages can create -compatible anchor names and links to those anchors. - -The specification is located at https://godoc.org/github.com/russross/blackfriday#hdr-Sanitized_Anchor_Names. - -[`SanitizedAnchorName`](https://godoc.org/github.com/russross/blackfriday#SanitizedAnchorName) exposes this functionality, and can be used to -create compatible links to the anchor names generated by blackfriday. -This algorithm is also implemented in a small standalone package at -[`github.com/shurcooL/sanitized_anchor_name`](https://godoc.org/github.com/shurcooL/sanitized_anchor_name). It can be useful for clients -that want a small package and don't need full functionality of blackfriday. - - -Features --------- - -All features of Sundown are supported, including: - -* **Compatibility**. The Markdown v1.0.3 test suite passes with - the `--tidy` option. Without `--tidy`, the differences are - mostly in whitespace and entity escaping, where blackfriday is - more consistent and cleaner. - -* **Common extensions**, including table support, fenced code - blocks, autolinks, strikethroughs, non-strict emphasis, etc. - -* **Safety**. Blackfriday is paranoid when parsing, making it safe - to feed untrusted user input without fear of bad things - happening. The test suite stress tests this and there are no - known inputs that make it crash. If you find one, please let me - know and send me the input that does it. - - NOTE: "safety" in this context means *runtime safety only*. In order to - protect yourself against JavaScript injection in untrusted content, see - [this example](https://github.com/russross/blackfriday#sanitize-untrusted-content). - -* **Fast processing**. It is fast enough to render on-demand in - most web applications without having to cache the output. - -* **Thread safety**. You can run multiple parsers in different - goroutines without ill effect. There is no dependence on global - shared state. - -* **Minimal dependencies**. Blackfriday only depends on standard - library packages in Go. The source code is pretty - self-contained, so it is easy to add to any project, including - Google App Engine projects. - -* **Standards compliant**. Output successfully validates using the - W3C validation tool for HTML 4.01 and XHTML 1.0 Transitional. - - -Extensions ----------- - -In addition to the standard markdown syntax, this package -implements the following extensions: - -* **Intra-word emphasis supression**. The `_` character is - commonly used inside words when discussing code, so having - markdown interpret it as an emphasis command is usually the - wrong thing. Blackfriday lets you treat all emphasis markers as - normal characters when they occur inside a word. - -* **Tables**. Tables can be created by drawing them in the input - using a simple syntax: - - ``` - Name | Age - --------|------ - Bob | 27 - Alice | 23 - ``` - -* **Fenced code blocks**. In addition to the normal 4-space - indentation to mark code blocks, you can explicitly mark them - and supply a language (to make syntax highlighting simple). Just - mark it like this: - - ``` go - func getTrue() bool { - return true - } - ``` - - You can use 3 or more backticks to mark the beginning of the - block, and the same number to mark the end of the block. - - To preserve classes of fenced code blocks while using the bluemonday - HTML sanitizer, use the following policy: - - ``` go - p := bluemonday.UGCPolicy() - p.AllowAttrs("class").Matching(regexp.MustCompile("^language-[a-zA-Z0-9]+$")).OnElements("code") - html := p.SanitizeBytes(unsafe) - ``` - -* **Definition lists**. A simple definition list is made of a single-line - term followed by a colon and the definition for that term. - - Cat - : Fluffy animal everyone likes - - Internet - : Vector of transmission for pictures of cats - - Terms must be separated from the previous definition by a blank line. - -* **Footnotes**. A marker in the text that will become a superscript number; - a footnote definition that will be placed in a list of footnotes at the - end of the document. A footnote looks like this: - - This is a footnote.[^1] - - [^1]: the footnote text. - -* **Autolinking**. Blackfriday can find URLs that have not been - explicitly marked as links and turn them into links. - -* **Strikethrough**. Use two tildes (`~~`) to mark text that - should be crossed out. - -* **Hard line breaks**. With this extension enabled (it is off by - default in the `MarkdownBasic` and `MarkdownCommon` convenience - functions), newlines in the input translate into line breaks in - the output. - -* **Smart quotes**. Smartypants-style punctuation substitution is - supported, turning normal double- and single-quote marks into - curly quotes, etc. - -* **LaTeX-style dash parsing** is an additional option, where `--` - is translated into `–`, and `---` is translated into - `—`. This differs from most smartypants processors, which - turn a single hyphen into an ndash and a double hyphen into an - mdash. - -* **Smart fractions**, where anything that looks like a fraction - is translated into suitable HTML (instead of just a few special - cases like most smartypant processors). For example, `4/5` - becomes `45`, which renders as - 45. - - -Other renderers ---------------- - -Blackfriday is structured to allow alternative rendering engines. Here -are a few of note: - -* [github_flavored_markdown](https://godoc.org/github.com/shurcooL/github_flavored_markdown): - provides a GitHub Flavored Markdown renderer with fenced code block - highlighting, clickable heading anchor links. - - It's not customizable, and its goal is to produce HTML output - equivalent to the [GitHub Markdown API endpoint](https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode), - except the rendering is performed locally. - -* [markdownfmt](https://github.com/shurcooL/markdownfmt): like gofmt, - but for markdown. - -* [LaTeX output](https://bitbucket.org/ambrevar/blackfriday-latex): - renders output as LaTeX. - - -TODO ----- - -* More unit testing -* Improve Unicode support. It does not understand all Unicode - rules (about what constitutes a letter, a punctuation symbol, - etc.), so it may fail to detect word boundaries correctly in - some instances. It is safe on all UTF-8 input. - - -License -------- - -[Blackfriday is distributed under the Simplified BSD License](LICENSE.txt) - - - [1]: https://daringfireball.net/projects/markdown/ "Markdown" - [2]: https://golang.org/ "Go Language" - [3]: https://github.com/vmg/sundown "Sundown" - [4]: https://godoc.org/gopkg.in/russross/blackfriday.v2#Parse "Parse func" - [5]: https://github.com/microcosm-cc/bluemonday "Bluemonday" - [6]: https://labix.org/gopkg.in "gopkg.in" - [7]: https://github.com/golang/dep/ "dep" - [8]: https://github.com/Masterminds/glide "Glide" - - [BuildSVG]: https://travis-ci.org/russross/blackfriday.svg?branch=master - [BuildURL]: https://travis-ci.org/russross/blackfriday - [GodocV2SVG]: https://godoc.org/gopkg.in/russross/blackfriday.v2?status.svg - [GodocV2URL]: https://godoc.org/gopkg.in/russross/blackfriday.v2 diff --git a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/block.go b/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/block.go deleted file mode 100644 index 7fc731d..0000000 --- a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/block.go +++ /dev/null @@ -1,1450 +0,0 @@ -// -// Blackfriday Markdown Processor -// Available at http://github.com/russross/blackfriday -// -// Copyright © 2011 Russ Ross . -// Distributed under the Simplified BSD License. -// See README.md for details. -// - -// -// Functions to parse block-level elements. -// - -package blackfriday - -import ( - "bytes" - "unicode" -) - -// Parse block-level data. -// Note: this function and many that it calls assume that -// the input buffer ends with a newline. -func (p *parser) block(out *bytes.Buffer, data []byte) { - if len(data) == 0 || data[len(data)-1] != '\n' { - panic("block input is missing terminating newline") - } - - // this is called recursively: enforce a maximum depth - if p.nesting >= p.maxNesting { - return - } - p.nesting++ - - // parse out one block-level construct at a time - for len(data) > 0 { - // prefixed header: - // - // # Header 1 - // ## Header 2 - // ... - // ###### Header 6 - if p.isPrefixHeader(data) { - data = data[p.prefixHeader(out, data):] - continue - } - - // block of preformatted HTML: - // - //
- // ... - //
- if data[0] == '<' { - if i := p.html(out, data, true); i > 0 { - data = data[i:] - continue - } - } - - // title block - // - // % stuff - // % more stuff - // % even more stuff - if p.flags&EXTENSION_TITLEBLOCK != 0 { - if data[0] == '%' { - if i := p.titleBlock(out, data, true); i > 0 { - data = data[i:] - continue - } - } - } - - // blank lines. note: returns the # of bytes to skip - if i := p.isEmpty(data); i > 0 { - data = data[i:] - continue - } - - // indented code block: - // - // func max(a, b int) int { - // if a > b { - // return a - // } - // return b - // } - if p.codePrefix(data) > 0 { - data = data[p.code(out, data):] - continue - } - - // fenced code block: - // - // ``` go - // func fact(n int) int { - // if n <= 1 { - // return n - // } - // return n * fact(n-1) - // } - // ``` - if p.flags&EXTENSION_FENCED_CODE != 0 { - if i := p.fencedCodeBlock(out, data, true); i > 0 { - data = data[i:] - continue - } - } - - // horizontal rule: - // - // ------ - // or - // ****** - // or - // ______ - if p.isHRule(data) { - p.r.HRule(out) - var i int - for i = 0; data[i] != '\n'; i++ { - } - data = data[i:] - continue - } - - // block quote: - // - // > A big quote I found somewhere - // > on the web - if p.quotePrefix(data) > 0 { - data = data[p.quote(out, data):] - continue - } - - // table: - // - // Name | Age | Phone - // ------|-----|--------- - // Bob | 31 | 555-1234 - // Alice | 27 | 555-4321 - if p.flags&EXTENSION_TABLES != 0 { - if i := p.table(out, data); i > 0 { - data = data[i:] - continue - } - } - - // an itemized/unordered list: - // - // * Item 1 - // * Item 2 - // - // also works with + or - - if p.uliPrefix(data) > 0 { - data = data[p.list(out, data, 0):] - continue - } - - // a numbered/ordered list: - // - // 1. Item 1 - // 2. Item 2 - if p.oliPrefix(data) > 0 { - data = data[p.list(out, data, LIST_TYPE_ORDERED):] - continue - } - - // definition lists: - // - // Term 1 - // : Definition a - // : Definition b - // - // Term 2 - // : Definition c - if p.flags&EXTENSION_DEFINITION_LISTS != 0 { - if p.dliPrefix(data) > 0 { - data = data[p.list(out, data, LIST_TYPE_DEFINITION):] - continue - } - } - - // anything else must look like a normal paragraph - // note: this finds underlined headers, too - data = data[p.paragraph(out, data):] - } - - p.nesting-- -} - -func (p *parser) isPrefixHeader(data []byte) bool { - if data[0] != '#' { - return false - } - - if p.flags&EXTENSION_SPACE_HEADERS != 0 { - level := 0 - for level < 6 && data[level] == '#' { - level++ - } - if data[level] != ' ' { - return false - } - } - return true -} - -func (p *parser) prefixHeader(out *bytes.Buffer, data []byte) int { - level := 0 - for level < 6 && data[level] == '#' { - level++ - } - i := skipChar(data, level, ' ') - end := skipUntilChar(data, i, '\n') - skip := end - id := "" - if p.flags&EXTENSION_HEADER_IDS != 0 { - j, k := 0, 0 - // find start/end of header id - for j = i; j < end-1 && (data[j] != '{' || data[j+1] != '#'); j++ { - } - for k = j + 1; k < end && data[k] != '}'; k++ { - } - // extract header id iff found - if j < end && k < end { - id = string(data[j+2 : k]) - end = j - skip = k + 1 - for end > 0 && data[end-1] == ' ' { - end-- - } - } - } - for end > 0 && data[end-1] == '#' { - if isBackslashEscaped(data, end-1) { - break - } - end-- - } - for end > 0 && data[end-1] == ' ' { - end-- - } - if end > i { - if id == "" && p.flags&EXTENSION_AUTO_HEADER_IDS != 0 { - id = SanitizedAnchorName(string(data[i:end])) - } - work := func() bool { - p.inline(out, data[i:end]) - return true - } - p.r.Header(out, work, level, id) - } - return skip -} - -func (p *parser) isUnderlinedHeader(data []byte) int { - // test of level 1 header - if data[0] == '=' { - i := skipChar(data, 1, '=') - i = skipChar(data, i, ' ') - if data[i] == '\n' { - return 1 - } else { - return 0 - } - } - - // test of level 2 header - if data[0] == '-' { - i := skipChar(data, 1, '-') - i = skipChar(data, i, ' ') - if data[i] == '\n' { - return 2 - } else { - return 0 - } - } - - return 0 -} - -func (p *parser) titleBlock(out *bytes.Buffer, data []byte, doRender bool) int { - if data[0] != '%' { - return 0 - } - splitData := bytes.Split(data, []byte("\n")) - var i int - for idx, b := range splitData { - if !bytes.HasPrefix(b, []byte("%")) { - i = idx // - 1 - break - } - } - - data = bytes.Join(splitData[0:i], []byte("\n")) - p.r.TitleBlock(out, data) - - return len(data) -} - -func (p *parser) html(out *bytes.Buffer, data []byte, doRender bool) int { - var i, j int - - // identify the opening tag - if data[0] != '<' { - return 0 - } - curtag, tagfound := p.htmlFindTag(data[1:]) - - // handle special cases - if !tagfound { - // check for an HTML comment - if size := p.htmlComment(out, data, doRender); size > 0 { - return size - } - - // check for an
tag - if size := p.htmlHr(out, data, doRender); size > 0 { - return size - } - - // check for HTML CDATA - if size := p.htmlCDATA(out, data, doRender); size > 0 { - return size - } - - // no special case recognized - return 0 - } - - // look for an unindented matching closing tag - // followed by a blank line - found := false - /* - closetag := []byte("\n") - j = len(curtag) + 1 - for !found { - // scan for a closing tag at the beginning of a line - if skip := bytes.Index(data[j:], closetag); skip >= 0 { - j += skip + len(closetag) - } else { - break - } - - // see if it is the only thing on the line - if skip := p.isEmpty(data[j:]); skip > 0 { - // see if it is followed by a blank line/eof - j += skip - if j >= len(data) { - found = true - i = j - } else { - if skip := p.isEmpty(data[j:]); skip > 0 { - j += skip - found = true - i = j - } - } - } - } - */ - - // if not found, try a second pass looking for indented match - // but not if tag is "ins" or "del" (following original Markdown.pl) - if !found && curtag != "ins" && curtag != "del" { - i = 1 - for i < len(data) { - i++ - for i < len(data) && !(data[i-1] == '<' && data[i] == '/') { - i++ - } - - if i+2+len(curtag) >= len(data) { - break - } - - j = p.htmlFindEnd(curtag, data[i-1:]) - - if j > 0 { - i += j - 1 - found = true - break - } - } - } - - if !found { - return 0 - } - - // the end of the block has been found - if doRender { - // trim newlines - end := i - for end > 0 && data[end-1] == '\n' { - end-- - } - p.r.BlockHtml(out, data[:end]) - } - - return i -} - -func (p *parser) renderHTMLBlock(out *bytes.Buffer, data []byte, start int, doRender bool) int { - // html block needs to end with a blank line - if i := p.isEmpty(data[start:]); i > 0 { - size := start + i - if doRender { - // trim trailing newlines - end := size - for end > 0 && data[end-1] == '\n' { - end-- - } - p.r.BlockHtml(out, data[:end]) - } - return size - } - return 0 -} - -// HTML comment, lax form -func (p *parser) htmlComment(out *bytes.Buffer, data []byte, doRender bool) int { - i := p.inlineHTMLComment(out, data) - return p.renderHTMLBlock(out, data, i, doRender) -} - -// HTML CDATA section -func (p *parser) htmlCDATA(out *bytes.Buffer, data []byte, doRender bool) int { - const cdataTag = "') { - i++ - } - i++ - // no end-of-comment marker - if i >= len(data) { - return 0 - } - return p.renderHTMLBlock(out, data, i, doRender) -} - -// HR, which is the only self-closing block tag considered -func (p *parser) htmlHr(out *bytes.Buffer, data []byte, doRender bool) int { - if data[0] != '<' || (data[1] != 'h' && data[1] != 'H') || (data[2] != 'r' && data[2] != 'R') { - return 0 - } - if data[3] != ' ' && data[3] != '/' && data[3] != '>' { - // not an
tag after all; at least not a valid one - return 0 - } - - i := 3 - for data[i] != '>' && data[i] != '\n' { - i++ - } - - if data[i] == '>' { - return p.renderHTMLBlock(out, data, i+1, doRender) - } - - return 0 -} - -func (p *parser) htmlFindTag(data []byte) (string, bool) { - i := 0 - for isalnum(data[i]) { - i++ - } - key := string(data[:i]) - if _, ok := blockTags[key]; ok { - return key, true - } - return "", false -} - -func (p *parser) htmlFindEnd(tag string, data []byte) int { - // assume data[0] == '<' && data[1] == '/' already tested - - // check if tag is a match - closetag := []byte("") - if !bytes.HasPrefix(data, closetag) { - return 0 - } - i := len(closetag) - - // check that the rest of the line is blank - skip := 0 - if skip = p.isEmpty(data[i:]); skip == 0 { - return 0 - } - i += skip - skip = 0 - - if i >= len(data) { - return i - } - - if p.flags&EXTENSION_LAX_HTML_BLOCKS != 0 { - return i - } - if skip = p.isEmpty(data[i:]); skip == 0 { - // following line must be blank - return 0 - } - - return i + skip -} - -func (*parser) isEmpty(data []byte) int { - // it is okay to call isEmpty on an empty buffer - if len(data) == 0 { - return 0 - } - - var i int - for i = 0; i < len(data) && data[i] != '\n'; i++ { - if data[i] != ' ' && data[i] != '\t' { - return 0 - } - } - return i + 1 -} - -func (*parser) isHRule(data []byte) bool { - i := 0 - - // skip up to three spaces - for i < 3 && data[i] == ' ' { - i++ - } - - // look at the hrule char - if data[i] != '*' && data[i] != '-' && data[i] != '_' { - return false - } - c := data[i] - - // the whole line must be the char or whitespace - n := 0 - for data[i] != '\n' { - switch { - case data[i] == c: - n++ - case data[i] != ' ': - return false - } - i++ - } - - return n >= 3 -} - -// isFenceLine checks if there's a fence line (e.g., ``` or ``` go) at the beginning of data, -// and returns the end index if so, or 0 otherwise. It also returns the marker found. -// If syntax is not nil, it gets set to the syntax specified in the fence line. -// A final newline is mandatory to recognize the fence line, unless newlineOptional is true. -func isFenceLine(data []byte, syntax *string, oldmarker string, newlineOptional bool) (end int, marker string) { - i, size := 0, 0 - - // skip up to three spaces - for i < len(data) && i < 3 && data[i] == ' ' { - i++ - } - - // check for the marker characters: ~ or ` - if i >= len(data) { - return 0, "" - } - if data[i] != '~' && data[i] != '`' { - return 0, "" - } - - c := data[i] - - // the whole line must be the same char or whitespace - for i < len(data) && data[i] == c { - size++ - i++ - } - - // the marker char must occur at least 3 times - if size < 3 { - return 0, "" - } - marker = string(data[i-size : i]) - - // if this is the end marker, it must match the beginning marker - if oldmarker != "" && marker != oldmarker { - return 0, "" - } - - // TODO(shurcooL): It's probably a good idea to simplify the 2 code paths here - // into one, always get the syntax, and discard it if the caller doesn't care. - if syntax != nil { - syn := 0 - i = skipChar(data, i, ' ') - - if i >= len(data) { - if newlineOptional && i == len(data) { - return i, marker - } - return 0, "" - } - - syntaxStart := i - - if data[i] == '{' { - i++ - syntaxStart++ - - for i < len(data) && data[i] != '}' && data[i] != '\n' { - syn++ - i++ - } - - if i >= len(data) || data[i] != '}' { - return 0, "" - } - - // strip all whitespace at the beginning and the end - // of the {} block - for syn > 0 && isspace(data[syntaxStart]) { - syntaxStart++ - syn-- - } - - for syn > 0 && isspace(data[syntaxStart+syn-1]) { - syn-- - } - - i++ - } else { - for i < len(data) && !isspace(data[i]) { - syn++ - i++ - } - } - - *syntax = string(data[syntaxStart : syntaxStart+syn]) - } - - i = skipChar(data, i, ' ') - if i >= len(data) || data[i] != '\n' { - if newlineOptional && i == len(data) { - return i, marker - } - return 0, "" - } - - return i + 1, marker // Take newline into account. -} - -// fencedCodeBlock returns the end index if data contains a fenced code block at the beginning, -// or 0 otherwise. It writes to out if doRender is true, otherwise it has no side effects. -// If doRender is true, a final newline is mandatory to recognize the fenced code block. -func (p *parser) fencedCodeBlock(out *bytes.Buffer, data []byte, doRender bool) int { - var syntax string - beg, marker := isFenceLine(data, &syntax, "", false) - if beg == 0 || beg >= len(data) { - return 0 - } - - var work bytes.Buffer - - for { - // safe to assume beg < len(data) - - // check for the end of the code block - newlineOptional := !doRender - fenceEnd, _ := isFenceLine(data[beg:], nil, marker, newlineOptional) - if fenceEnd != 0 { - beg += fenceEnd - break - } - - // copy the current line - end := skipUntilChar(data, beg, '\n') + 1 - - // did we reach the end of the buffer without a closing marker? - if end >= len(data) { - return 0 - } - - // verbatim copy to the working buffer - if doRender { - work.Write(data[beg:end]) - } - beg = end - } - - if doRender { - p.r.BlockCode(out, work.Bytes(), syntax) - } - - return beg -} - -func (p *parser) table(out *bytes.Buffer, data []byte) int { - var header bytes.Buffer - i, columns := p.tableHeader(&header, data) - if i == 0 { - return 0 - } - - var body bytes.Buffer - - for i < len(data) { - pipes, rowStart := 0, i - for ; data[i] != '\n'; i++ { - if data[i] == '|' { - pipes++ - } - } - - if pipes == 0 { - i = rowStart - break - } - - // include the newline in data sent to tableRow - i++ - p.tableRow(&body, data[rowStart:i], columns, false) - } - - p.r.Table(out, header.Bytes(), body.Bytes(), columns) - - return i -} - -// check if the specified position is preceded by an odd number of backslashes -func isBackslashEscaped(data []byte, i int) bool { - backslashes := 0 - for i-backslashes-1 >= 0 && data[i-backslashes-1] == '\\' { - backslashes++ - } - return backslashes&1 == 1 -} - -func (p *parser) tableHeader(out *bytes.Buffer, data []byte) (size int, columns []int) { - i := 0 - colCount := 1 - for i = 0; data[i] != '\n'; i++ { - if data[i] == '|' && !isBackslashEscaped(data, i) { - colCount++ - } - } - - // doesn't look like a table header - if colCount == 1 { - return - } - - // include the newline in the data sent to tableRow - header := data[:i+1] - - // column count ignores pipes at beginning or end of line - if data[0] == '|' { - colCount-- - } - if i > 2 && data[i-1] == '|' && !isBackslashEscaped(data, i-1) { - colCount-- - } - - columns = make([]int, colCount) - - // move on to the header underline - i++ - if i >= len(data) { - return - } - - if data[i] == '|' && !isBackslashEscaped(data, i) { - i++ - } - i = skipChar(data, i, ' ') - - // each column header is of form: / *:?-+:? *|/ with # dashes + # colons >= 3 - // and trailing | optional on last column - col := 0 - for data[i] != '\n' { - dashes := 0 - - if data[i] == ':' { - i++ - columns[col] |= TABLE_ALIGNMENT_LEFT - dashes++ - } - for data[i] == '-' { - i++ - dashes++ - } - if data[i] == ':' { - i++ - columns[col] |= TABLE_ALIGNMENT_RIGHT - dashes++ - } - for data[i] == ' ' { - i++ - } - - // end of column test is messy - switch { - case dashes < 3: - // not a valid column - return - - case data[i] == '|' && !isBackslashEscaped(data, i): - // marker found, now skip past trailing whitespace - col++ - i++ - for data[i] == ' ' { - i++ - } - - // trailing junk found after last column - if col >= colCount && data[i] != '\n' { - return - } - - case (data[i] != '|' || isBackslashEscaped(data, i)) && col+1 < colCount: - // something else found where marker was required - return - - case data[i] == '\n': - // marker is optional for the last column - col++ - - default: - // trailing junk found after last column - return - } - } - if col != colCount { - return - } - - p.tableRow(out, header, columns, true) - size = i + 1 - return -} - -func (p *parser) tableRow(out *bytes.Buffer, data []byte, columns []int, header bool) { - i, col := 0, 0 - var rowWork bytes.Buffer - - if data[i] == '|' && !isBackslashEscaped(data, i) { - i++ - } - - for col = 0; col < len(columns) && i < len(data); col++ { - for data[i] == ' ' { - i++ - } - - cellStart := i - - for (data[i] != '|' || isBackslashEscaped(data, i)) && data[i] != '\n' { - i++ - } - - cellEnd := i - - // skip the end-of-cell marker, possibly taking us past end of buffer - i++ - - for cellEnd > cellStart && data[cellEnd-1] == ' ' { - cellEnd-- - } - - var cellWork bytes.Buffer - p.inline(&cellWork, data[cellStart:cellEnd]) - - if header { - p.r.TableHeaderCell(&rowWork, cellWork.Bytes(), columns[col]) - } else { - p.r.TableCell(&rowWork, cellWork.Bytes(), columns[col]) - } - } - - // pad it out with empty columns to get the right number - for ; col < len(columns); col++ { - if header { - p.r.TableHeaderCell(&rowWork, nil, columns[col]) - } else { - p.r.TableCell(&rowWork, nil, columns[col]) - } - } - - // silently ignore rows with too many cells - - p.r.TableRow(out, rowWork.Bytes()) -} - -// returns blockquote prefix length -func (p *parser) quotePrefix(data []byte) int { - i := 0 - for i < 3 && data[i] == ' ' { - i++ - } - if data[i] == '>' { - if data[i+1] == ' ' { - return i + 2 - } - return i + 1 - } - return 0 -} - -// blockquote ends with at least one blank line -// followed by something without a blockquote prefix -func (p *parser) terminateBlockquote(data []byte, beg, end int) bool { - if p.isEmpty(data[beg:]) <= 0 { - return false - } - if end >= len(data) { - return true - } - return p.quotePrefix(data[end:]) == 0 && p.isEmpty(data[end:]) == 0 -} - -// parse a blockquote fragment -func (p *parser) quote(out *bytes.Buffer, data []byte) int { - var raw bytes.Buffer - beg, end := 0, 0 - for beg < len(data) { - end = beg - // Step over whole lines, collecting them. While doing that, check for - // fenced code and if one's found, incorporate it altogether, - // irregardless of any contents inside it - for data[end] != '\n' { - if p.flags&EXTENSION_FENCED_CODE != 0 { - if i := p.fencedCodeBlock(out, data[end:], false); i > 0 { - // -1 to compensate for the extra end++ after the loop: - end += i - 1 - break - } - } - end++ - } - end++ - - if pre := p.quotePrefix(data[beg:]); pre > 0 { - // skip the prefix - beg += pre - } else if p.terminateBlockquote(data, beg, end) { - break - } - - // this line is part of the blockquote - raw.Write(data[beg:end]) - beg = end - } - - var cooked bytes.Buffer - p.block(&cooked, raw.Bytes()) - p.r.BlockQuote(out, cooked.Bytes()) - return end -} - -// returns prefix length for block code -func (p *parser) codePrefix(data []byte) int { - if data[0] == ' ' && data[1] == ' ' && data[2] == ' ' && data[3] == ' ' { - return 4 - } - return 0 -} - -func (p *parser) code(out *bytes.Buffer, data []byte) int { - var work bytes.Buffer - - i := 0 - for i < len(data) { - beg := i - for data[i] != '\n' { - i++ - } - i++ - - blankline := p.isEmpty(data[beg:i]) > 0 - if pre := p.codePrefix(data[beg:i]); pre > 0 { - beg += pre - } else if !blankline { - // non-empty, non-prefixed line breaks the pre - i = beg - break - } - - // verbatim copy to the working buffeu - if blankline { - work.WriteByte('\n') - } else { - work.Write(data[beg:i]) - } - } - - // trim all the \n off the end of work - workbytes := work.Bytes() - eol := len(workbytes) - for eol > 0 && workbytes[eol-1] == '\n' { - eol-- - } - if eol != len(workbytes) { - work.Truncate(eol) - } - - work.WriteByte('\n') - - p.r.BlockCode(out, work.Bytes(), "") - - return i -} - -// returns unordered list item prefix -func (p *parser) uliPrefix(data []byte) int { - i := 0 - - // start with up to 3 spaces - for i < 3 && data[i] == ' ' { - i++ - } - - // need a *, +, or - followed by a space - if (data[i] != '*' && data[i] != '+' && data[i] != '-') || - data[i+1] != ' ' { - return 0 - } - return i + 2 -} - -// returns ordered list item prefix -func (p *parser) oliPrefix(data []byte) int { - i := 0 - - // start with up to 3 spaces - for i < 3 && data[i] == ' ' { - i++ - } - - // count the digits - start := i - for data[i] >= '0' && data[i] <= '9' { - i++ - } - - // we need >= 1 digits followed by a dot and a space - if start == i || data[i] != '.' || data[i+1] != ' ' { - return 0 - } - return i + 2 -} - -// returns definition list item prefix -func (p *parser) dliPrefix(data []byte) int { - i := 0 - - // need a : followed by a spaces - if data[i] != ':' || data[i+1] != ' ' { - return 0 - } - for data[i] == ' ' { - i++ - } - return i + 2 -} - -// parse ordered or unordered list block -func (p *parser) list(out *bytes.Buffer, data []byte, flags int) int { - i := 0 - flags |= LIST_ITEM_BEGINNING_OF_LIST - work := func() bool { - for i < len(data) { - skip := p.listItem(out, data[i:], &flags) - i += skip - - if skip == 0 || flags&LIST_ITEM_END_OF_LIST != 0 { - break - } - flags &= ^LIST_ITEM_BEGINNING_OF_LIST - } - return true - } - - p.r.List(out, work, flags) - return i -} - -// Parse a single list item. -// Assumes initial prefix is already removed if this is a sublist. -func (p *parser) listItem(out *bytes.Buffer, data []byte, flags *int) int { - // keep track of the indentation of the first line - itemIndent := 0 - for itemIndent < 3 && data[itemIndent] == ' ' { - itemIndent++ - } - - i := p.uliPrefix(data) - if i == 0 { - i = p.oliPrefix(data) - } - if i == 0 { - i = p.dliPrefix(data) - // reset definition term flag - if i > 0 { - *flags &= ^LIST_TYPE_TERM - } - } - if i == 0 { - // if in defnition list, set term flag and continue - if *flags&LIST_TYPE_DEFINITION != 0 { - *flags |= LIST_TYPE_TERM - } else { - return 0 - } - } - - // skip leading whitespace on first line - for data[i] == ' ' { - i++ - } - - // find the end of the line - line := i - for i > 0 && data[i-1] != '\n' { - i++ - } - - // get working buffer - var raw bytes.Buffer - - // put the first line into the working buffer - raw.Write(data[line:i]) - line = i - - // process the following lines - containsBlankLine := false - sublist := 0 - -gatherlines: - for line < len(data) { - i++ - - // find the end of this line - for data[i-1] != '\n' { - i++ - } - - // if it is an empty line, guess that it is part of this item - // and move on to the next line - if p.isEmpty(data[line:i]) > 0 { - containsBlankLine = true - raw.Write(data[line:i]) - line = i - continue - } - - // calculate the indentation - indent := 0 - for indent < 4 && line+indent < i && data[line+indent] == ' ' { - indent++ - } - - chunk := data[line+indent : i] - - // evaluate how this line fits in - switch { - // is this a nested list item? - case (p.uliPrefix(chunk) > 0 && !p.isHRule(chunk)) || - p.oliPrefix(chunk) > 0 || - p.dliPrefix(chunk) > 0: - - if containsBlankLine { - // end the list if the type changed after a blank line - if indent <= itemIndent && - ((*flags&LIST_TYPE_ORDERED != 0 && p.uliPrefix(chunk) > 0) || - (*flags&LIST_TYPE_ORDERED == 0 && p.oliPrefix(chunk) > 0)) { - - *flags |= LIST_ITEM_END_OF_LIST - break gatherlines - } - *flags |= LIST_ITEM_CONTAINS_BLOCK - } - - // to be a nested list, it must be indented more - // if not, it is the next item in the same list - if indent <= itemIndent { - break gatherlines - } - - // is this the first item in the nested list? - if sublist == 0 { - sublist = raw.Len() - } - - // is this a nested prefix header? - case p.isPrefixHeader(chunk): - // if the header is not indented, it is not nested in the list - // and thus ends the list - if containsBlankLine && indent < 4 { - *flags |= LIST_ITEM_END_OF_LIST - break gatherlines - } - *flags |= LIST_ITEM_CONTAINS_BLOCK - - // anything following an empty line is only part - // of this item if it is indented 4 spaces - // (regardless of the indentation of the beginning of the item) - case containsBlankLine && indent < 4: - if *flags&LIST_TYPE_DEFINITION != 0 && i < len(data)-1 { - // is the next item still a part of this list? - next := i - for data[next] != '\n' { - next++ - } - for next < len(data)-1 && data[next] == '\n' { - next++ - } - if i < len(data)-1 && data[i] != ':' && data[next] != ':' { - *flags |= LIST_ITEM_END_OF_LIST - } - } else { - *flags |= LIST_ITEM_END_OF_LIST - } - break gatherlines - - // a blank line means this should be parsed as a block - case containsBlankLine: - *flags |= LIST_ITEM_CONTAINS_BLOCK - } - - containsBlankLine = false - - // add the line into the working buffer without prefix - raw.Write(data[line+indent : i]) - - line = i - } - - // If reached end of data, the Renderer.ListItem call we're going to make below - // is definitely the last in the list. - if line >= len(data) { - *flags |= LIST_ITEM_END_OF_LIST - } - - rawBytes := raw.Bytes() - - // render the contents of the list item - var cooked bytes.Buffer - if *flags&LIST_ITEM_CONTAINS_BLOCK != 0 && *flags&LIST_TYPE_TERM == 0 { - // intermediate render of block item, except for definition term - if sublist > 0 { - p.block(&cooked, rawBytes[:sublist]) - p.block(&cooked, rawBytes[sublist:]) - } else { - p.block(&cooked, rawBytes) - } - } else { - // intermediate render of inline item - if sublist > 0 { - p.inline(&cooked, rawBytes[:sublist]) - p.block(&cooked, rawBytes[sublist:]) - } else { - p.inline(&cooked, rawBytes) - } - } - - // render the actual list item - cookedBytes := cooked.Bytes() - parsedEnd := len(cookedBytes) - - // strip trailing newlines - for parsedEnd > 0 && cookedBytes[parsedEnd-1] == '\n' { - parsedEnd-- - } - p.r.ListItem(out, cookedBytes[:parsedEnd], *flags) - - return line -} - -// render a single paragraph that has already been parsed out -func (p *parser) renderParagraph(out *bytes.Buffer, data []byte) { - if len(data) == 0 { - return - } - - // trim leading spaces - beg := 0 - for data[beg] == ' ' { - beg++ - } - - // trim trailing newline - end := len(data) - 1 - - // trim trailing spaces - for end > beg && data[end-1] == ' ' { - end-- - } - - work := func() bool { - p.inline(out, data[beg:end]) - return true - } - p.r.Paragraph(out, work) -} - -func (p *parser) paragraph(out *bytes.Buffer, data []byte) int { - // prev: index of 1st char of previous line - // line: index of 1st char of current line - // i: index of cursor/end of current line - var prev, line, i int - - // keep going until we find something to mark the end of the paragraph - for i < len(data) { - // mark the beginning of the current line - prev = line - current := data[i:] - line = i - - // did we find a blank line marking the end of the paragraph? - if n := p.isEmpty(current); n > 0 { - // did this blank line followed by a definition list item? - if p.flags&EXTENSION_DEFINITION_LISTS != 0 { - if i < len(data)-1 && data[i+1] == ':' { - return p.list(out, data[prev:], LIST_TYPE_DEFINITION) - } - } - - p.renderParagraph(out, data[:i]) - return i + n - } - - // an underline under some text marks a header, so our paragraph ended on prev line - if i > 0 { - if level := p.isUnderlinedHeader(current); level > 0 { - // render the paragraph - p.renderParagraph(out, data[:prev]) - - // ignore leading and trailing whitespace - eol := i - 1 - for prev < eol && data[prev] == ' ' { - prev++ - } - for eol > prev && data[eol-1] == ' ' { - eol-- - } - - // render the header - // this ugly double closure avoids forcing variables onto the heap - work := func(o *bytes.Buffer, pp *parser, d []byte) func() bool { - return func() bool { - pp.inline(o, d) - return true - } - }(out, p, data[prev:eol]) - - id := "" - if p.flags&EXTENSION_AUTO_HEADER_IDS != 0 { - id = SanitizedAnchorName(string(data[prev:eol])) - } - - p.r.Header(out, work, level, id) - - // find the end of the underline - for data[i] != '\n' { - i++ - } - return i - } - } - - // if the next line starts a block of HTML, then the paragraph ends here - if p.flags&EXTENSION_LAX_HTML_BLOCKS != 0 { - if data[i] == '<' && p.html(out, current, false) > 0 { - // rewind to before the HTML block - p.renderParagraph(out, data[:i]) - return i - } - } - - // if there's a prefixed header or a horizontal rule after this, paragraph is over - if p.isPrefixHeader(current) || p.isHRule(current) { - p.renderParagraph(out, data[:i]) - return i - } - - // if there's a fenced code block, paragraph is over - if p.flags&EXTENSION_FENCED_CODE != 0 { - if p.fencedCodeBlock(out, current, false) > 0 { - p.renderParagraph(out, data[:i]) - return i - } - } - - // if there's a definition list item, prev line is a definition term - if p.flags&EXTENSION_DEFINITION_LISTS != 0 { - if p.dliPrefix(current) != 0 { - return p.list(out, data[prev:], LIST_TYPE_DEFINITION) - } - } - - // if there's a list after this, paragraph is over - if p.flags&EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK != 0 { - if p.uliPrefix(current) != 0 || - p.oliPrefix(current) != 0 || - p.quotePrefix(current) != 0 || - p.codePrefix(current) != 0 { - p.renderParagraph(out, data[:i]) - return i - } - } - - // otherwise, scan to the beginning of the next line - for data[i] != '\n' { - i++ - } - i++ - } - - p.renderParagraph(out, data[:i]) - return i -} - -// SanitizedAnchorName returns a sanitized anchor name for the given text. -// -// It implements the algorithm specified in the package comment. -func SanitizedAnchorName(text string) string { - var anchorName []rune - futureDash := false - for _, r := range text { - switch { - case unicode.IsLetter(r) || unicode.IsNumber(r): - if futureDash && len(anchorName) > 0 { - anchorName = append(anchorName, '-') - } - futureDash = false - anchorName = append(anchorName, unicode.ToLower(r)) - default: - futureDash = true - } - } - return string(anchorName) -} diff --git a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/doc.go b/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/doc.go deleted file mode 100644 index 9656c42..0000000 --- a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Package blackfriday is a Markdown processor. -// -// It translates plain text with simple formatting rules into HTML or LaTeX. -// -// Sanitized Anchor Names -// -// Blackfriday includes an algorithm for creating sanitized anchor names -// corresponding to a given input text. This algorithm is used to create -// anchors for headings when EXTENSION_AUTO_HEADER_IDS is enabled. The -// algorithm is specified below, so that other packages can create -// compatible anchor names and links to those anchors. -// -// The algorithm iterates over the input text, interpreted as UTF-8, -// one Unicode code point (rune) at a time. All runes that are letters (category L) -// or numbers (category N) are considered valid characters. They are mapped to -// lower case, and included in the output. All other runes are considered -// invalid characters. Invalid characters that preceed the first valid character, -// as well as invalid character that follow the last valid character -// are dropped completely. All other sequences of invalid characters -// between two valid characters are replaced with a single dash character '-'. -// -// SanitizedAnchorName exposes this functionality, and can be used to -// create compatible links to the anchor names generated by blackfriday. -// This algorithm is also implemented in a small standalone package at -// github.com/shurcooL/sanitized_anchor_name. It can be useful for clients -// that want a small package and don't need full functionality of blackfriday. -package blackfriday - -// NOTE: Keep Sanitized Anchor Name algorithm in sync with package -// github.com/shurcooL/sanitized_anchor_name. -// Otherwise, users of sanitized_anchor_name will get anchor names -// that are incompatible with those generated by blackfriday. diff --git a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/html.go b/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/html.go deleted file mode 100644 index c917c7d..0000000 --- a/vendor/github.com/gobuffalo/github_flavored_markdown/internal/russross/blackfriday/html.go +++ /dev/null @@ -1,950 +0,0 @@ -// -// Blackfriday Markdown Processor -// Available at http://github.com/russross/blackfriday -// -// Copyright © 2011 Russ Ross . -// Distributed under the Simplified BSD License. -// See README.md for details. -// - -// -// -// HTML rendering backend -// -// - -package blackfriday - -import ( - "bytes" - "fmt" - "regexp" - "strconv" - "strings" -) - -// Html renderer configuration options. -const ( - HTML_SKIP_HTML = 1 << iota // skip preformatted HTML blocks - HTML_SKIP_STYLE // skip embedded World -``` - -Into a harmless: -```html -Hello World -``` - -And it turns this: -```html -XSS -``` - -Into this: -```html -XSS -``` - -Whilst still allowing this: -```html - - - -``` - -To pass through mostly unaltered (it gained a rel="nofollow" which is a good thing for user generated content): -```html - - - -``` - -It protects sites from [XSS](http://en.wikipedia.org/wiki/Cross-site_scripting) attacks. There are many [vectors for an XSS attack](https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet) and the best way to mitigate the risk is to sanitize user input against a known safe list of HTML elements and attributes. - -You should **always** run bluemonday **after** any other processing. - -If you use [blackfriday](https://github.com/russross/blackfriday) or [Pandoc](http://johnmacfarlane.net/pandoc/) then bluemonday should be run after these steps. This ensures that no insecure HTML is introduced later in your process. - -bluemonday is heavily inspired by both the [OWASP Java HTML Sanitizer](https://code.google.com/p/owasp-java-html-sanitizer/) and the [HTML Purifier](http://htmlpurifier.org/). - -## Technical Summary - -Whitelist based, you need to either build a policy describing the HTML elements and attributes to permit (and the `regexp` patterns of attributes), or use one of the supplied policies representing good defaults. - -The policy containing the whitelist is applied using a fast non-validating, forward only, token-based parser implemented in the [Go net/html library](https://godoc.org/golang.org/x/net/html) by the core Go team. - -We expect to be supplied with well-formatted HTML (closing elements for every applicable open element, nested correctly) and so we do not focus on repairing badly nested or incomplete HTML. We focus on simply ensuring that whatever elements do exist are described in the policy whitelist and that attributes and links are safe for use on your web page. [GIGO](http://en.wikipedia.org/wiki/Garbage_in,_garbage_out) does apply and if you feed it bad HTML bluemonday is not tasked with figuring out how to make it good again. - -### Supported Go Versions - -bluemonday is tested against Go 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, and tip. - -We do not support Go 1.0 as we depend on `golang.org/x/net/html` which includes a reference to `io.ErrNoProgress` which did not exist in Go 1.0. - -## Is it production ready? - -*Yes* - -We are using bluemonday in production having migrated from the widely used and heavily field tested OWASP Java HTML Sanitizer. - -We are passing our extensive test suite (including AntiSamy tests as well as tests for any issues raised). Check for any [unresolved issues](https://github.com/microcosm-cc/bluemonday/issues?page=1&state=open) to see whether anything may be a blocker for you. - -We invite pull requests and issues to help us ensure we are offering comprehensive protection against various attacks via user generated content. - -## Usage - -Install in your `${GOPATH}` using `go get -u github.com/microcosm-cc/bluemonday` - -Then call it: -```go -package main - -import ( - "fmt" - - "github.com/microcosm-cc/bluemonday" -) - -func main() { - // Do this once for each unique policy, and use the policy for the life of the program - // Policy creation/editing is not safe to use in multiple goroutines - p := bluemonday.UGCPolicy() - - // The policy can then be used to sanitize lots of input and it is safe to use the policy in multiple goroutines - html := p.Sanitize( - `Google`, - ) - - // Output: - // Google - fmt.Println(html) -} -``` - -We offer three ways to call Sanitize: -```go -p.Sanitize(string) string -p.SanitizeBytes([]byte) []byte -p.SanitizeReader(io.Reader) bytes.Buffer -``` - -If you are obsessed about performance, `p.SanitizeReader(r).Bytes()` will return a `[]byte` without performing any unnecessary casting of the inputs or outputs. Though the difference is so negligible you should never need to care. - -You can build your own policies: -```go -package main - -import ( - "fmt" - - "github.com/microcosm-cc/bluemonday" -) - -func main() { - p := bluemonday.NewPolicy() - - // Require URLs to be parseable by net/url.Parse and either: - // mailto: http:// or https:// - p.AllowStandardURLs() - - // We only allow

and - p.AllowAttrs("href").OnElements("a") - p.AllowElements("p") - - html := p.Sanitize( - `Google`, - ) - - // Output: - // Google - fmt.Println(html) -} -``` - -We ship two default policies: - -1. `bluemonday.StrictPolicy()` which can be thought of as equivalent to stripping all HTML elements and their attributes as it has nothing on its whitelist. An example usage scenario would be blog post titles where HTML tags are not expected at all and if they are then the elements *and* the content of the elements should be stripped. This is a *very* strict policy. -2. `bluemonday.UGCPolicy()` which allows a broad selection of HTML elements and attributes that are safe for user generated content. Note that this policy does *not* whitelist iframes, object, embed, styles, script, etc. An example usage scenario would be blog post bodies where a variety of formatting is expected along with the potential for TABLEs and IMGs. - -## Policy Building - -The essence of building a policy is to determine which HTML elements and attributes are considered safe for your scenario. OWASP provide an [XSS prevention cheat sheet](https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet) to help explain the risks, but essentially: - -1. Avoid anything other than the standard HTML elements -1. Avoid `script`, `style`, `iframe`, `object`, `embed`, `base` elements that allow code to be executed by the client or third party content to be included that can execute code -1. Avoid anything other than plain HTML attributes with values matched to a regexp - -Basically, you should be able to describe what HTML is fine for your scenario. If you do not have confidence that you can describe your policy please consider using one of the shipped policies such as `bluemonday.UGCPolicy()`. - -To create a new policy: -```go -p := bluemonday.NewPolicy() -``` - -To add elements to a policy either add just the elements: -```go -p.AllowElements("b", "strong") -``` - -Or add elements as a virtue of adding an attribute: -```go -// Not the recommended pattern, see the recommendation on using .Matching() below -p.AllowAttrs("nowrap").OnElements("td", "th") -``` - -Attributes can either be added to all elements: -```go -p.AllowAttrs("dir").Matching(regexp.MustCompile("(?i)rtl|ltr")).Globally() -``` - -Or attributes can be added to specific elements: -```go -// Not the recommended pattern, see the recommendation on using .Matching() below -p.AllowAttrs("value").OnElements("li") -``` - -It is **always** recommended that an attribute be made to match a pattern. XSS in HTML attributes is very easy otherwise: -```go -// \p{L} matches unicode letters, \p{N} matches unicode numbers -p.AllowAttrs("title").Matching(regexp.MustCompile(`[\p{L}\p{N}\s\-_',:\[\]!\./\\\(\)&]*`)).Globally() -``` - -You can stop at any time and call .Sanitize(): -```go -// string htmlIn passed in from a HTTP POST -htmlOut := p.Sanitize(htmlIn) -``` - -And you can take any existing policy and extend it: -```go -p := bluemonday.UGCPolicy() -p.AllowElements("fieldset", "select", "option") -``` - -### Links - -Links are difficult beasts to sanitise safely and also one of the biggest attack vectors for malicious content. - -It is possible to do this: -```go -p.AllowAttrs("href").Matching(regexp.MustCompile(`(?i)mailto|https?`)).OnElements("a") -``` - -But that will not protect you as the regular expression is insufficient in this case to have prevented a malformed value doing something unexpected. - -We provide some additional global options for safely working with links. - -`RequireParseableURLs` will ensure that URLs are parseable by Go's `net/url` package: -```go -p.RequireParseableURLs(true) -``` - -If you have enabled parseable URLs then the following option will `AllowRelativeURLs`. By default this is disabled (bluemonday is a whitelist tool... you need to explicitly tell us to permit things) and when disabled it will prevent all local and scheme relative URLs (i.e. `href="localpage.html"`, `href="../home.html"` and even `href="//www.google.com"` are relative): -```go -p.AllowRelativeURLs(true) -``` - -If you have enabled parseable URLs then you can whitelist the schemes (commonly called protocol when thinking of `http` and `https`) that are permitted. Bear in mind that allowing relative URLs in the above option will allow for a blank scheme: -```go -p.AllowURLSchemes("mailto", "http", "https") -``` - -Regardless of whether you have enabled parseable URLs, you can force all URLs to have a rel="nofollow" attribute. This will be added if it does not exist, but only when the `href` is valid: -```go -// This applies to "a" "area" "link" elements that have a "href" attribute -p.RequireNoFollowOnLinks(true) -``` - -We provide a convenience method that applies all of the above, but you will still need to whitelist the linkable elements for the URL rules to be applied to: -```go -p.AllowStandardURLs() -p.AllowAttrs("cite").OnElements("blockquote", "q") -p.AllowAttrs("href").OnElements("a", "area") -p.AllowAttrs("src").OnElements("img") -``` - -An additional complexity regarding links is the data URI as defined in [RFC2397](http://tools.ietf.org/html/rfc2397). The data URI allows for images to be served inline using this format: - -```html - -``` - -We have provided a helper to verify the mimetype followed by base64 content of data URIs links: - -```go -p.AllowDataURIImages() -``` - -That helper will enable GIF, JPEG, PNG and WEBP images. - -It should be noted that there is a potential [security](http://palizine.plynt.com/issues/2010Oct/bypass-xss-filters/) [risk](https://capec.mitre.org/data/definitions/244.html) with the use of data URI links. You should only enable data URI links if you already trust the content. - -We also have some features to help deal with user generated content: -```go -p.AddTargetBlankToFullyQualifiedLinks(true) -``` - -This will ensure that anchor `` links that are fully qualified (the href destination includes a host name) will get `target="_blank"` added to them. - -Additionally any link that has `target="_blank"` after the policy has been applied will also have the `rel` attribute adjusted to add `noopener`. This means a link may start like `` and will end up as ``. It is important to note that the addition of `noopener` is a security feature and not an issue. There is an unfortunate feature to browsers that a browser window opened as a result of `target="_blank"` can still control the opener (your web page) and this protects against that. The background to this can be found here: [https://dev.to/ben/the-targetblank-vulnerability-by-example](https://dev.to/ben/the-targetblank-vulnerability-by-example) - -### Policy Building Helpers - -We also bundle some helpers to simplify policy building: -```go - -// Permits the "dir", "id", "lang", "title" attributes globally -p.AllowStandardAttributes() - -// Permits the "img" element and its standard attributes -p.AllowImages() - -// Permits ordered and unordered lists, and also definition lists -p.AllowLists() - -// Permits HTML tables and all applicable elements and non-styling attributes -p.AllowTables() -``` - -### Invalid Instructions - -The following are invalid: -```go -// This does not say where the attributes are allowed, you need to add -// .Globally() or .OnElements(...) -// This will be ignored without error. -p.AllowAttrs("value") - -// This does not say where the attributes are allowed, you need to add -// .Globally() or .OnElements(...) -// This will be ignored without error. -p.AllowAttrs( - "type", -).Matching( - regexp.MustCompile("(?i)^(circle|disc|square|a|A|i|I|1)$"), -) -``` - -Both examples exhibit the same issue, they declare attributes but do not then specify whether they are whitelisted globally or only on specific elements (and which elements). Attributes belong to one or more elements, and the policy needs to declare this. - -## Limitations - -We are not yet including any tools to help whitelist and sanitize CSS. Which means that unless you wish to do the heavy lifting in a single regular expression (inadvisable), **you should not allow the "style" attribute anywhere**. - -It is not the job of bluemonday to fix your bad HTML, it is merely the job of bluemonday to prevent malicious HTML getting through. If you have mismatched HTML elements, or non-conforming nesting of elements, those will remain. But if you have well-structured HTML bluemonday will not break it. - -## TODO - -* Add support for CSS sanitisation to allow some CSS properties based on a whitelist, possibly using the [Gorilla CSS3 scanner](http://www.gorillatoolkit.org/pkg/css/scanner) - PRs welcome so long as testing covers XSS and demonstrates safety first -* Investigate whether devs want to blacklist elements and attributes. This would allow devs to take an existing policy (such as the `bluemonday.UGCPolicy()` ) that encapsulates 90% of what they're looking for but does more than they need, and to remove the extra things they do not want to make it 100% what they want -* Investigate whether devs want a validating HTML mode, in which the HTML elements are not just transformed into a balanced tree (every start tag has a closing tag at the correct depth) but also that elements and character data appear only in their allowed context (i.e. that a `table` element isn't a descendent of a `caption`, that `colgroup`, `thead`, `tbody`, `tfoot` and `tr` are permitted, and that character data is not permitted) - -## Development - -If you have cloned this repo you will probably need the dependency: - -`go get golang.org/x/net/html` - -Gophers can use their familiar tools: - -`go build` - -`go test` - -I personally use a Makefile as it spares typing the same args over and over whilst providing consistency for those of us who jump from language to language and enjoy just typing `make` in a project directory and watch magic happen. - -`make` will build, vet, test and install the library. - -`make clean` will remove the library from a *single* `${GOPATH}/pkg` directory tree - -`make test` will run the tests - -`make cover` will run the tests and *open a browser window* with the coverage report - -`make lint` will run golint (install via `go get github.com/golang/lint/golint`) - -## Long term goals - -1. Open the code to adversarial peer review similar to the [Attack Review Ground Rules](https://code.google.com/p/owasp-java-html-sanitizer/wiki/AttackReviewGroundRules) -1. Raise funds and pay for an external security review diff --git a/vendor/github.com/microcosm-cc/bluemonday/doc.go b/vendor/github.com/microcosm-cc/bluemonday/doc.go deleted file mode 100644 index 71dab60..0000000 --- a/vendor/github.com/microcosm-cc/bluemonday/doc.go +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) 2014, David Kitchen -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the organisation (Microcosm) nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* -Package bluemonday provides a way of describing a whitelist of HTML elements -and attributes as a policy, and for that policy to be applied to untrusted -strings from users that may contain markup. All elements and attributes not on -the whitelist will be stripped. - -The default bluemonday.UGCPolicy().Sanitize() turns this: - - Hello World - -Into the more harmless: - - Hello World - -And it turns this: - - XSS - -Into this: - - XSS - -Whilst still allowing this: - - - - - -To pass through mostly unaltered (it gained a rel="nofollow"): - - - - - -The primary purpose of bluemonday is to take potentially unsafe user generated -content (from things like Markdown, HTML WYSIWYG tools, etc) and make it safe -for you to put on your website. - -It protects sites against XSS (http://en.wikipedia.org/wiki/Cross-site_scripting) -and other malicious content that a user interface may deliver. There are many -vectors for an XSS attack (https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet) -and the safest thing to do is to sanitize user input against a known safe list -of HTML elements and attributes. - -Note: You should always run bluemonday after any other processing. - -If you use blackfriday (https://github.com/russross/blackfriday) or -Pandoc (http://johnmacfarlane.net/pandoc/) then bluemonday should be run after -these steps. This ensures that no insecure HTML is introduced later in your -process. - -bluemonday is heavily inspired by both the OWASP Java HTML Sanitizer -(https://code.google.com/p/owasp-java-html-sanitizer/) and the HTML Purifier -(http://htmlpurifier.org/). - -We ship two default policies, one is bluemonday.StrictPolicy() and can be -thought of as equivalent to stripping all HTML elements and their attributes as -it has nothing on its whitelist. - -The other is bluemonday.UGCPolicy() and allows a broad selection of HTML -elements and attributes that are safe for user generated content. Note that -this policy does not whitelist iframes, object, embed, styles, script, etc. - -The essence of building a policy is to determine which HTML elements and -attributes are considered safe for your scenario. OWASP provide an XSS -prevention cheat sheet ( https://www.google.com/search?q=xss+prevention+cheat+sheet ) -to help explain the risks, but essentially: - - 1. Avoid whitelisting anything other than plain HTML elements - 2. Avoid whitelisting `script`, `style`, `iframe`, `object`, `embed`, `base` - elements - 3. Avoid whitelisting anything other than plain HTML elements with simple - values that you can match to a regexp -*/ -package bluemonday diff --git a/vendor/github.com/microcosm-cc/bluemonday/helpers.go b/vendor/github.com/microcosm-cc/bluemonday/helpers.go deleted file mode 100644 index dfa5868..0000000 --- a/vendor/github.com/microcosm-cc/bluemonday/helpers.go +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright (c) 2014, David Kitchen -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the organisation (Microcosm) nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package bluemonday - -import ( - "encoding/base64" - "net/url" - "regexp" -) - -// A selection of regular expressions that can be used as .Matching() rules on -// HTML attributes. -var ( - // CellAlign handles the `align` attribute - // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-align - CellAlign = regexp.MustCompile(`(?i)^(center|justify|left|right|char)$`) - - // CellVerticalAlign handles the `valign` attribute - // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-valign - CellVerticalAlign = regexp.MustCompile(`(?i)^(baseline|bottom|middle|top)$`) - - // Direction handles the `dir` attribute - // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdo#attr-dir - Direction = regexp.MustCompile(`(?i)^(rtl|ltr)$`) - - // ImageAlign handles the `align` attribute on the `image` tag - // http://www.w3.org/MarkUp/Test/Img/imgtest.html - ImageAlign = regexp.MustCompile( - `(?i)^(left|right|top|texttop|middle|absmiddle|baseline|bottom|absbottom)$`, - ) - - // Integer describes whole positive integers (including 0) used in places - // like td.colspan - // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-colspan - Integer = regexp.MustCompile(`^[0-9]+$`) - - // ISO8601 according to the W3 group is only a subset of the ISO8601 - // standard: http://www.w3.org/TR/NOTE-datetime - // - // Used in places like time.datetime - // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time#attr-datetime - // - // Matches patterns: - // Year: - // YYYY (eg 1997) - // Year and month: - // YYYY-MM (eg 1997-07) - // Complete date: - // YYYY-MM-DD (eg 1997-07-16) - // Complete date plus hours and minutes: - // YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00) - // Complete date plus hours, minutes and seconds: - // YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00) - // Complete date plus hours, minutes, seconds and a decimal fraction of a - // second - // YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00) - ISO8601 = regexp.MustCompile( - `^[0-9]{4}(-[0-9]{2}(-[0-9]{2}([ T][0-9]{2}(:[0-9]{2}){1,2}(.[0-9]{1,6})` + - `?Z?([\+-][0-9]{2}:[0-9]{2})?)?)?)?$`, - ) - - // ListType encapsulates the common value as well as the latest spec - // values for lists - // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol#attr-type - ListType = regexp.MustCompile(`(?i)^(circle|disc|square|a|A|i|I|1)$`) - - // SpaceSeparatedTokens is used in places like `a.rel` and the common attribute - // `class` which both contain space delimited lists of data tokens - // http://www.w3.org/TR/html-markup/datatypes.html#common.data.tokens-def - // Regexp: \p{L} matches unicode letters, \p{N} matches unicode numbers - SpaceSeparatedTokens = regexp.MustCompile(`^([\s\p{L}\p{N}_-]+)$`) - - // Number is a double value used on HTML5 meter and progress elements - // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-meter-element - Number = regexp.MustCompile(`^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$`) - - // NumberOrPercent is used predominantly as units of measurement in width - // and height attributes - // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-height - NumberOrPercent = regexp.MustCompile(`^[0-9]+[%]?$`) - - // Paragraph of text in an attribute such as *.'title', img.alt, etc - // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#attr-title - // Note that we are not allowing chars that could close tags like '>' - Paragraph = regexp.MustCompile(`^[\p{L}\p{N}\s\-_',\[\]!\./\\\(\)]*$`) - - // dataURIImagePrefix is used by AllowDataURIImages to define the acceptable - // prefix of data URIs that contain common web image formats. - // - // This is not exported as it's not useful by itself, and only has value - // within the AllowDataURIImages func - dataURIImagePrefix = regexp.MustCompile( - `^image/(gif|jpeg|png|webp);base64,`, - ) -) - -// AllowStandardURLs is a convenience function that will enable rel="nofollow" -// on "a", "area" and "link" (if you have allowed those elements) and will -// ensure that the URL values are parseable and either relative or belong to the -// "mailto", "http", or "https" schemes -func (p *Policy) AllowStandardURLs() { - // URLs must be parseable by net/url.Parse() - p.RequireParseableURLs(true) - - // !url.IsAbs() is permitted - p.AllowRelativeURLs(true) - - // Most common URL schemes only - p.AllowURLSchemes("mailto", "http", "https") - - // For all anchors we will add rel="nofollow" if it does not already exist - // This applies to "a" "area" "link" - p.RequireNoFollowOnLinks(true) -} - -// AllowStandardAttributes will enable "id", "title" and the language specific -// attributes "dir" and "lang" on all elements that are whitelisted -func (p *Policy) AllowStandardAttributes() { - // "dir" "lang" are permitted as both language attributes affect charsets - // and direction of text. - p.AllowAttrs("dir").Matching(Direction).Globally() - p.AllowAttrs( - "lang", - ).Matching(regexp.MustCompile(`[a-zA-Z]{2,20}`)).Globally() - - // "id" is permitted. This is pretty much as some HTML elements require this - // to work well ("dfn" is an example of a "id" being value) - // This does create a risk that JavaScript and CSS within your web page - // might identify the wrong elements. Ensure that you select things - // accurately - p.AllowAttrs("id").Matching( - regexp.MustCompile(`[a-zA-Z0-9\:\-_\.]+`), - ).Globally() - - // "title" is permitted as it improves accessibility. - p.AllowAttrs("title").Matching(Paragraph).Globally() -} - -// AllowStyling presently enables the class attribute globally. -// -// Note: When bluemonday ships a CSS parser and we can safely sanitise that, -// this will also allow sanitized styling of elements via the style attribute. -func (p *Policy) AllowStyling() { - - // "class" is permitted globally - p.AllowAttrs("class").Matching(SpaceSeparatedTokens).Globally() -} - -// AllowImages enables the img element and some popular attributes. It will also -// ensure that URL values are parseable. This helper does not enable data URI -// images, for that you should also use the AllowDataURIImages() helper. -func (p *Policy) AllowImages() { - - // "img" is permitted - p.AllowAttrs("align").Matching(ImageAlign).OnElements("img") - p.AllowAttrs("alt").Matching(Paragraph).OnElements("img") - p.AllowAttrs("height", "width").Matching(NumberOrPercent).OnElements("img") - - // Standard URLs enabled - p.AllowStandardURLs() - p.AllowAttrs("src").OnElements("img") -} - -// AllowDataURIImages permits the use of inline images defined in RFC2397 -// http://tools.ietf.org/html/rfc2397 -// http://en.wikipedia.org/wiki/Data_URI_scheme -// -// Images must have a mimetype matching: -// image/gif -// image/jpeg -// image/png -// image/webp -// -// NOTE: There is a potential security risk to allowing data URIs and you should -// only permit them on content you already trust. -// http://palizine.plynt.com/issues/2010Oct/bypass-xss-filters/ -// https://capec.mitre.org/data/definitions/244.html -func (p *Policy) AllowDataURIImages() { - - // URLs must be parseable by net/url.Parse() - p.RequireParseableURLs(true) - - // Supply a function to validate images contained within data URI - p.AllowURLSchemeWithCustomPolicy( - "data", - func(url *url.URL) (allowUrl bool) { - if url.RawQuery != "" || url.Fragment != "" { - return false - } - - matched := dataURIImagePrefix.FindString(url.Opaque) - if matched == "" { - return false - } - - _, err := base64.StdEncoding.DecodeString(url.Opaque[len(matched):]) - if err != nil { - return false - } - - return true - }, - ) -} - -// AllowLists will enabled ordered and unordered lists, as well as definition -// lists -func (p *Policy) AllowLists() { - // "ol" "ul" are permitted - p.AllowAttrs("type").Matching(ListType).OnElements("ol", "ul") - - // "li" is permitted - p.AllowAttrs("type").Matching(ListType).OnElements("li") - p.AllowAttrs("value").Matching(Integer).OnElements("li") - - // "dl" "dt" "dd" are permitted - p.AllowElements("dl", "dt", "dd") -} - -// AllowTables will enable a rich set of elements and attributes to describe -// HTML tables -func (p *Policy) AllowTables() { - - // "table" is permitted - p.AllowAttrs("height", "width").Matching(NumberOrPercent).OnElements("table") - p.AllowAttrs("summary").Matching(Paragraph).OnElements("table") - - // "caption" is permitted - p.AllowElements("caption") - - // "col" "colgroup" are permitted - p.AllowAttrs("align").Matching(CellAlign).OnElements("col", "colgroup") - p.AllowAttrs("height", "width").Matching( - NumberOrPercent, - ).OnElements("col", "colgroup") - p.AllowAttrs("span").Matching(Integer).OnElements("colgroup", "col") - p.AllowAttrs("valign").Matching( - CellVerticalAlign, - ).OnElements("col", "colgroup") - - // "thead" "tr" are permitted - p.AllowAttrs("align").Matching(CellAlign).OnElements("thead", "tr") - p.AllowAttrs("valign").Matching(CellVerticalAlign).OnElements("thead", "tr") - - // "td" "th" are permitted - p.AllowAttrs("abbr").Matching(Paragraph).OnElements("td", "th") - p.AllowAttrs("align").Matching(CellAlign).OnElements("td", "th") - p.AllowAttrs("colspan", "rowspan").Matching(Integer).OnElements("td", "th") - p.AllowAttrs("headers").Matching( - SpaceSeparatedTokens, - ).OnElements("td", "th") - p.AllowAttrs("height", "width").Matching( - NumberOrPercent, - ).OnElements("td", "th") - p.AllowAttrs( - "scope", - ).Matching( - regexp.MustCompile(`(?i)(?:row|col)(?:group)?`), - ).OnElements("td", "th") - p.AllowAttrs("valign").Matching(CellVerticalAlign).OnElements("td", "th") - p.AllowAttrs("nowrap").Matching( - regexp.MustCompile(`(?i)|nowrap`), - ).OnElements("td", "th") - - // "tbody" "tfoot" - p.AllowAttrs("align").Matching(CellAlign).OnElements("tbody", "tfoot") - p.AllowAttrs("valign").Matching( - CellVerticalAlign, - ).OnElements("tbody", "tfoot") -} diff --git a/vendor/github.com/microcosm-cc/bluemonday/policies.go b/vendor/github.com/microcosm-cc/bluemonday/policies.go deleted file mode 100644 index 570bba8..0000000 --- a/vendor/github.com/microcosm-cc/bluemonday/policies.go +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (c) 2014, David Kitchen -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the organisation (Microcosm) nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package bluemonday - -import ( - "regexp" -) - -// StrictPolicy returns an empty policy, which will effectively strip all HTML -// elements and their attributes from a document. -func StrictPolicy() *Policy { - return NewPolicy() -} - -// StripTagsPolicy is DEPRECATED. Use StrictPolicy instead. -func StripTagsPolicy() *Policy { - return StrictPolicy() -} - -// UGCPolicy returns a policy aimed at user generated content that is a result -// of HTML WYSIWYG tools and Markdown conversions. -// -// This is expected to be a fairly rich document where as much markup as -// possible should be retained. Markdown permits raw HTML so we are basically -// providing a policy to sanitise HTML5 documents safely but with the -// least intrusion on the formatting expectations of the user. -func UGCPolicy() *Policy { - - p := NewPolicy() - - /////////////////////// - // Global attributes // - /////////////////////// - - // "class" is not permitted as we are not allowing users to style their own - // content - - p.AllowStandardAttributes() - - ////////////////////////////// - // Global URL format policy // - ////////////////////////////// - - p.AllowStandardURLs() - - //////////////////////////////// - // Declarations and structure // - //////////////////////////////// - - // "xml" "xslt" "DOCTYPE" "html" "head" are not permitted as we are - // expecting user generated content to be a fragment of HTML and not a full - // document. - - ////////////////////////// - // Sectioning root tags // - ////////////////////////// - - // "article" and "aside" are permitted and takes no attributes - p.AllowElements("article", "aside") - - // "body" is not permitted as we are expecting user generated content to be a fragment - // of HTML and not a full document. - - // "details" is permitted, including the "open" attribute which can either - // be blank or the value "open". - p.AllowAttrs( - "open", - ).Matching(regexp.MustCompile(`(?i)^(|open)$`)).OnElements("details") - - // "fieldset" is not permitted as we are not allowing forms to be created. - - // "figure" is permitted and takes no attributes - p.AllowElements("figure") - - // "nav" is not permitted as it is assumed that the site (and not the user) - // has defined navigation elements - - // "section" is permitted and takes no attributes - p.AllowElements("section") - - // "summary" is permitted and takes no attributes - p.AllowElements("summary") - - ////////////////////////// - // Headings and footers // - ////////////////////////// - - // "footer" is not permitted as we expect user content to be a fragment and - // not structural to this extent - - // "h1" through "h6" are permitted and take no attributes - p.AllowElements("h1", "h2", "h3", "h4", "h5", "h6") - - // "header" is not permitted as we expect user content to be a fragment and - // not structural to this extent - - // "hgroup" is permitted and takes no attributes - p.AllowElements("hgroup") - - ///////////////////////////////////// - // Content grouping and separating // - ///////////////////////////////////// - - // "blockquote" is permitted, including the "cite" attribute which must be - // a standard URL. - p.AllowAttrs("cite").OnElements("blockquote") - - // "br" "div" "hr" "p" "span" "wbr" are permitted and take no attributes - p.AllowElements("br", "div", "hr", "p", "span", "wbr") - - /////////// - // Links // - /////////// - - // "a" is permitted - p.AllowAttrs("href").OnElements("a") - - // "area" is permitted along with the attributes that map image maps work - p.AllowAttrs("name").Matching( - regexp.MustCompile(`^([\p{L}\p{N}_-]+)$`), - ).OnElements("map") - p.AllowAttrs("alt").Matching(Paragraph).OnElements("area") - p.AllowAttrs("coords").Matching( - regexp.MustCompile(`^([0-9]+,)+[0-9]+$`), - ).OnElements("area") - p.AllowAttrs("href").OnElements("area") - p.AllowAttrs("rel").Matching(SpaceSeparatedTokens).OnElements("area") - p.AllowAttrs("shape").Matching( - regexp.MustCompile(`(?i)^(default|circle|rect|poly)$`), - ).OnElements("area") - p.AllowAttrs("usemap").Matching( - regexp.MustCompile(`(?i)^#[\p{L}\p{N}_-]+$`), - ).OnElements("img") - - // "link" is not permitted - - ///////////////////// - // Phrase elements // - ///////////////////// - - // The following are all inline phrasing elements - p.AllowElements("abbr", "acronym", "cite", "code", "dfn", "em", - "figcaption", "mark", "s", "samp", "strong", "sub", "sup", "var") - - // "q" is permitted and "cite" is a URL and handled by URL policies - p.AllowAttrs("cite").OnElements("q") - - // "time" is permitted - p.AllowAttrs("datetime").Matching(ISO8601).OnElements("time") - - //////////////////// - // Style elements // - //////////////////// - - // block and inline elements that impart no semantic meaning but style the - // document - p.AllowElements("b", "i", "pre", "small", "strike", "tt", "u") - - // "style" is not permitted as we are not yet sanitising CSS and it is an - // XSS attack vector - - ////////////////////// - // HTML5 Formatting // - ////////////////////// - - // "bdi" "bdo" are permitted - p.AllowAttrs("dir").Matching(Direction).OnElements("bdi", "bdo") - - // "rp" "rt" "ruby" are permitted - p.AllowElements("rp", "rt", "ruby") - - /////////////////////////// - // HTML5 Change tracking // - /////////////////////////// - - // "del" "ins" are permitted - p.AllowAttrs("cite").Matching(Paragraph).OnElements("del", "ins") - p.AllowAttrs("datetime").Matching(ISO8601).OnElements("del", "ins") - - /////////// - // Lists // - /////////// - - p.AllowLists() - - //////////// - // Tables // - //////////// - - p.AllowTables() - - /////////// - // Forms // - /////////// - - // By and large, forms are not permitted. However there are some form - // elements that can be used to present data, and we do permit those - // - // "button" "fieldset" "input" "keygen" "label" "output" "select" "datalist" - // "textarea" "optgroup" "option" are all not permitted - - // "meter" is permitted - p.AllowAttrs( - "value", - "min", - "max", - "low", - "high", - "optimum", - ).Matching(Number).OnElements("meter") - - // "progress" is permitted - p.AllowAttrs("value", "max").Matching(Number).OnElements("progress") - - ////////////////////// - // Embedded content // - ////////////////////// - - // Vast majority not permitted - // "audio" "canvas" "embed" "iframe" "object" "param" "source" "svg" "track" - // "video" are all not permitted - - p.AllowImages() - - return p -} diff --git a/vendor/github.com/microcosm-cc/bluemonday/policy.go b/vendor/github.com/microcosm-cc/bluemonday/policy.go deleted file mode 100644 index f61d98f..0000000 --- a/vendor/github.com/microcosm-cc/bluemonday/policy.go +++ /dev/null @@ -1,552 +0,0 @@ -// Copyright (c) 2014, David Kitchen -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the organisation (Microcosm) nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package bluemonday - -import ( - "net/url" - "regexp" - "strings" -) - -// Policy encapsulates the whitelist of HTML elements and attributes that will -// be applied to the sanitised HTML. -// -// You should use bluemonday.NewPolicy() to create a blank policy as the -// unexported fields contain maps that need to be initialized. -type Policy struct { - - // Declares whether the maps have been initialized, used as a cheap check to - // ensure that those using Policy{} directly won't cause nil pointer - // exceptions - initialized bool - - // If true then we add spaces when stripping tags, specifically the closing - // tag is replaced by a space character. - addSpaces bool - - // When true, add rel="nofollow" to HTML anchors - requireNoFollow bool - - // When true, add rel="nofollow" to HTML anchors - // Will add for href="http://foo" - // Will skip for href="/foo" or href="foo" - requireNoFollowFullyQualifiedLinks bool - - // When true add target="_blank" to fully qualified links - // Will add for href="http://foo" - // Will skip for href="/foo" or href="foo" - addTargetBlankToFullyQualifiedLinks bool - - // When true, URLs must be parseable by "net/url" url.Parse() - requireParseableURLs bool - - // When true, u, _ := url.Parse("url"); !u.IsAbs() is permitted - allowRelativeURLs bool - - // When true, allow data attributes. - allowDataAttributes bool - - // map[htmlElementName]map[htmlAttributeName]attrPolicy - elsAndAttrs map[string]map[string]attrPolicy - - // map[htmlAttributeName]attrPolicy - globalAttrs map[string]attrPolicy - - // If urlPolicy is nil, all URLs with matching schema are allowed. - // Otherwise, only the URLs with matching schema and urlPolicy(url) - // returning true are allowed. - allowURLSchemes map[string]urlPolicy - - // If an element has had all attributes removed as a result of a policy - // being applied, then the element would be removed from the output. - // - // However some elements are valid and have strong layout meaning without - // any attributes, i.e. . To prevent those being removed we maintain - // a list of elements that are allowed to have no attributes and that will - // be maintained in the output HTML. - setOfElementsAllowedWithoutAttrs map[string]struct{} - - setOfElementsToSkipContent map[string]struct{} -} - -type attrPolicy struct { - - // optional pattern to match, when not nil the regexp needs to match - // otherwise the attribute is removed - regexp *regexp.Regexp -} - -type attrPolicyBuilder struct { - p *Policy - - attrNames []string - regexp *regexp.Regexp - allowEmpty bool -} - -type urlPolicy func(url *url.URL) (allowUrl bool) - -// init initializes the maps if this has not been done already -func (p *Policy) init() { - if !p.initialized { - p.elsAndAttrs = make(map[string]map[string]attrPolicy) - p.globalAttrs = make(map[string]attrPolicy) - p.allowURLSchemes = make(map[string]urlPolicy) - p.setOfElementsAllowedWithoutAttrs = make(map[string]struct{}) - p.setOfElementsToSkipContent = make(map[string]struct{}) - p.initialized = true - } -} - -// NewPolicy returns a blank policy with nothing whitelisted or permitted. This -// is the recommended way to start building a policy and you should now use -// AllowAttrs() and/or AllowElements() to construct the whitelist of HTML -// elements and attributes. -func NewPolicy() *Policy { - - p := Policy{} - - p.addDefaultElementsWithoutAttrs() - p.addDefaultSkipElementContent() - - return &p -} - -// AllowAttrs takes a range of HTML attribute names and returns an -// attribute policy builder that allows you to specify the pattern and scope of -// the whitelisted attribute. -// -// The attribute policy is only added to the core policy when either Globally() -// or OnElements(...) are called. -func (p *Policy) AllowAttrs(attrNames ...string) *attrPolicyBuilder { - - p.init() - - abp := attrPolicyBuilder{ - p: p, - allowEmpty: false, - } - - for _, attrName := range attrNames { - abp.attrNames = append(abp.attrNames, strings.ToLower(attrName)) - } - - return &abp -} - -// AllowDataAttributes whitelists all data attributes. We can't specify the name -// of each attribute exactly as they are customized. -// -// NOTE: These values are not sanitized and applications that evaluate or process -// them without checking and verification of the input may be at risk if this option -// is enabled. This is a 'caveat emptor' option and the person enabling this option -// needs to fully understand the potential impact with regards to whatever application -// will be consuming the sanitized HTML afterwards, i.e. if you know you put a link in a -// data attribute and use that to automatically load some new window then you're giving -// the author of a HTML fragment the means to open a malicious destination automatically. -// Use with care! -func (p *Policy) AllowDataAttributes() { - p.allowDataAttributes = true -} - -// AllowNoAttrs says that attributes on element are optional. -// -// The attribute policy is only added to the core policy when OnElements(...) -// are called. -func (p *Policy) AllowNoAttrs() *attrPolicyBuilder { - - p.init() - - abp := attrPolicyBuilder{ - p: p, - allowEmpty: true, - } - return &abp -} - -// AllowNoAttrs says that attributes on element are optional. -// -// The attribute policy is only added to the core policy when OnElements(...) -// are called. -func (abp *attrPolicyBuilder) AllowNoAttrs() *attrPolicyBuilder { - - abp.allowEmpty = true - - return abp -} - -// Matching allows a regular expression to be applied to a nascent attribute -// policy, and returns the attribute policy. Calling this more than once will -// replace the existing regexp. -func (abp *attrPolicyBuilder) Matching(regex *regexp.Regexp) *attrPolicyBuilder { - - abp.regexp = regex - - return abp -} - -// OnElements will bind an attribute policy to a given range of HTML elements -// and return the updated policy -func (abp *attrPolicyBuilder) OnElements(elements ...string) *Policy { - - for _, element := range elements { - element = strings.ToLower(element) - - for _, attr := range abp.attrNames { - - if _, ok := abp.p.elsAndAttrs[element]; !ok { - abp.p.elsAndAttrs[element] = make(map[string]attrPolicy) - } - - ap := attrPolicy{} - if abp.regexp != nil { - ap.regexp = abp.regexp - } - - abp.p.elsAndAttrs[element][attr] = ap - } - - if abp.allowEmpty { - abp.p.setOfElementsAllowedWithoutAttrs[element] = struct{}{} - - if _, ok := abp.p.elsAndAttrs[element]; !ok { - abp.p.elsAndAttrs[element] = make(map[string]attrPolicy) - } - } - } - - return abp.p -} - -// Globally will bind an attribute policy to all HTML elements and return the -// updated policy -func (abp *attrPolicyBuilder) Globally() *Policy { - - for _, attr := range abp.attrNames { - if _, ok := abp.p.globalAttrs[attr]; !ok { - abp.p.globalAttrs[attr] = attrPolicy{} - } - - ap := attrPolicy{} - if abp.regexp != nil { - ap.regexp = abp.regexp - } - - abp.p.globalAttrs[attr] = ap - } - - return abp.p -} - -// AllowElements will append HTML elements to the whitelist without applying an -// attribute policy to those elements (the elements are permitted -// sans-attributes) -func (p *Policy) AllowElements(names ...string) *Policy { - p.init() - - for _, element := range names { - element = strings.ToLower(element) - - if _, ok := p.elsAndAttrs[element]; !ok { - p.elsAndAttrs[element] = make(map[string]attrPolicy) - } - } - - return p -} - -// RequireNoFollowOnLinks will result in all tags having a rel="nofollow" -// added to them if one does not already exist -// -// Note: This requires p.RequireParseableURLs(true) and will enable it. -func (p *Policy) RequireNoFollowOnLinks(require bool) *Policy { - - p.requireNoFollow = require - p.requireParseableURLs = true - - return p -} - -// RequireNoFollowOnFullyQualifiedLinks will result in all tags that point -// to a non-local destination (i.e. starts with a protocol and has a host) -// having a rel="nofollow" added to them if one does not already exist -// -// Note: This requires p.RequireParseableURLs(true) and will enable it. -func (p *Policy) RequireNoFollowOnFullyQualifiedLinks(require bool) *Policy { - - p.requireNoFollowFullyQualifiedLinks = require - p.requireParseableURLs = true - - return p -} - -// AddTargetBlankToFullyQualifiedLinks will result in all tags that point -// to a non-local destination (i.e. starts with a protocol and has a host) -// having a target="_blank" added to them if one does not already exist -// -// Note: This requires p.RequireParseableURLs(true) and will enable it. -func (p *Policy) AddTargetBlankToFullyQualifiedLinks(require bool) *Policy { - - p.addTargetBlankToFullyQualifiedLinks = require - p.requireParseableURLs = true - - return p -} - -// RequireParseableURLs will result in all URLs requiring that they be parseable -// by "net/url" url.Parse() -// This applies to: -// - a.href -// - area.href -// - blockquote.cite -// - img.src -// - link.href -// - script.src -func (p *Policy) RequireParseableURLs(require bool) *Policy { - - p.requireParseableURLs = require - - return p -} - -// AllowRelativeURLs enables RequireParseableURLs and then permits URLs that -// are parseable, have no schema information and url.IsAbs() returns false -// This permits local URLs -func (p *Policy) AllowRelativeURLs(require bool) *Policy { - - p.RequireParseableURLs(true) - p.allowRelativeURLs = require - - return p -} - -// AllowURLSchemes will append URL schemes to the whitelist -// Example: p.AllowURLSchemes("mailto", "http", "https") -func (p *Policy) AllowURLSchemes(schemes ...string) *Policy { - p.init() - - p.RequireParseableURLs(true) - - for _, scheme := range schemes { - scheme = strings.ToLower(scheme) - - // Allow all URLs with matching scheme. - p.allowURLSchemes[scheme] = nil - } - - return p -} - -// AllowURLSchemeWithCustomPolicy will append URL schemes with -// a custom URL policy to the whitelist. -// Only the URLs with matching schema and urlPolicy(url) -// returning true will be allowed. -func (p *Policy) AllowURLSchemeWithCustomPolicy( - scheme string, - urlPolicy func(url *url.URL) (allowUrl bool), -) *Policy { - - p.init() - - p.RequireParseableURLs(true) - - scheme = strings.ToLower(scheme) - - p.allowURLSchemes[scheme] = urlPolicy - - return p -} - -// AddSpaceWhenStrippingTag states whether to add a single space " " when -// removing tags that are not whitelisted by the policy. -// -// This is useful if you expect to strip tags in dense markup and may lose the -// value of whitespace. -// -// For example: "

Hello

World

"" would be sanitized to "HelloWorld" -// with the default value of false, but you may wish to sanitize this to -// " Hello World " by setting AddSpaceWhenStrippingTag to true as this would -// retain the intent of the text. -func (p *Policy) AddSpaceWhenStrippingTag(allow bool) *Policy { - - p.addSpaces = allow - - return p -} - -// SkipElementsContent adds the HTML elements whose tags is needed to be removed -// with its content. -func (p *Policy) SkipElementsContent(names ...string) *Policy { - - p.init() - - for _, element := range names { - element = strings.ToLower(element) - - if _, ok := p.setOfElementsToSkipContent[element]; !ok { - p.setOfElementsToSkipContent[element] = struct{}{} - } - } - - return p -} - -// AllowElementsContent marks the HTML elements whose content should be -// retained after removing the tag. -func (p *Policy) AllowElementsContent(names ...string) *Policy { - - p.init() - - for _, element := range names { - delete(p.setOfElementsToSkipContent, strings.ToLower(element)) - } - - return p -} - -// addDefaultElementsWithoutAttrs adds the HTML elements that we know are valid -// without any attributes to an internal map. -// i.e. we know that
is valid, but isn't valid as the "dir" attr -// is mandatory -func (p *Policy) addDefaultElementsWithoutAttrs() { - p.init() - - p.setOfElementsAllowedWithoutAttrs["abbr"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["acronym"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["address"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["article"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["aside"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["audio"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["b"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["bdi"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["blockquote"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["body"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["br"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["button"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["canvas"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["caption"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["center"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["cite"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["code"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["col"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["colgroup"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["datalist"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["dd"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["del"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["details"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["dfn"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["div"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["dl"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["dt"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["em"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["fieldset"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["figcaption"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["figure"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["footer"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["h1"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["h2"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["h3"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["h4"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["h5"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["h6"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["head"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["header"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["hgroup"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["hr"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["html"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["i"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["ins"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["kbd"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["li"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["mark"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["marquee"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["nav"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["ol"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["optgroup"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["option"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["p"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["pre"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["q"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["rp"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["rt"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["ruby"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["s"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["samp"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["script"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["section"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["select"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["small"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["span"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["strike"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["strong"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["style"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["sub"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["summary"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["sup"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["svg"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["table"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["tbody"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["td"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["textarea"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["tfoot"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["th"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["thead"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["title"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["time"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["tr"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["tt"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["u"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["ul"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["var"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["video"] = struct{}{} - p.setOfElementsAllowedWithoutAttrs["wbr"] = struct{}{} - -} - -// addDefaultSkipElementContent adds the HTML elements that we should skip -// rendering the character content of, if the element itself is not allowed. -// This is all character data that the end user would not normally see. -// i.e. if we exclude a tag. -func (p *Policy) addDefaultSkipElementContent() { - p.init() - - p.setOfElementsToSkipContent["frame"] = struct{}{} - p.setOfElementsToSkipContent["frameset"] = struct{}{} - p.setOfElementsToSkipContent["iframe"] = struct{}{} - p.setOfElementsToSkipContent["noembed"] = struct{}{} - p.setOfElementsToSkipContent["noframes"] = struct{}{} - p.setOfElementsToSkipContent["noscript"] = struct{}{} - p.setOfElementsToSkipContent["nostyle"] = struct{}{} - p.setOfElementsToSkipContent["object"] = struct{}{} - p.setOfElementsToSkipContent["script"] = struct{}{} - p.setOfElementsToSkipContent["style"] = struct{}{} - p.setOfElementsToSkipContent["title"] = struct{}{} -} diff --git a/vendor/github.com/microcosm-cc/bluemonday/sanitize.go b/vendor/github.com/microcosm-cc/bluemonday/sanitize.go deleted file mode 100644 index 65ed89b..0000000 --- a/vendor/github.com/microcosm-cc/bluemonday/sanitize.go +++ /dev/null @@ -1,581 +0,0 @@ -// Copyright (c) 2014, David Kitchen -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of the organisation (Microcosm) nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package bluemonday - -import ( - "bytes" - "io" - "net/url" - "regexp" - "strings" - - "golang.org/x/net/html" -) - -var ( - dataAttribute = regexp.MustCompile("^data-.+") - dataAttributeXMLPrefix = regexp.MustCompile("^xml.+") - dataAttributeInvalidChars = regexp.MustCompile("[A-Z;]+") -) - -// Sanitize takes a string that contains a HTML fragment or document and applies -// the given policy whitelist. -// -// It returns a HTML string that has been sanitized by the policy or an empty -// string if an error has occurred (most likely as a consequence of extremely -// malformed input) -func (p *Policy) Sanitize(s string) string { - if strings.TrimSpace(s) == "" { - return s - } - - return p.sanitize(strings.NewReader(s)).String() -} - -// SanitizeBytes takes a []byte that contains a HTML fragment or document and applies -// the given policy whitelist. -// -// It returns a []byte containing the HTML that has been sanitized by the policy -// or an empty []byte if an error has occurred (most likely as a consequence of -// extremely malformed input) -func (p *Policy) SanitizeBytes(b []byte) []byte { - if len(bytes.TrimSpace(b)) == 0 { - return b - } - - return p.sanitize(bytes.NewReader(b)).Bytes() -} - -// SanitizeReader takes an io.Reader that contains a HTML fragment or document -// and applies the given policy whitelist. -// -// It returns a bytes.Buffer containing the HTML that has been sanitized by the -// policy. Errors during sanitization will merely return an empty result. -func (p *Policy) SanitizeReader(r io.Reader) *bytes.Buffer { - return p.sanitize(r) -} - -// Performs the actual sanitization process. -func (p *Policy) sanitize(r io.Reader) *bytes.Buffer { - - // It is possible that the developer has created the policy via: - // p := bluemonday.Policy{} - // rather than: - // p := bluemonday.NewPolicy() - // If this is the case, and if they haven't yet triggered an action that - // would initiliaze the maps, then we need to do that. - p.init() - - var ( - buff bytes.Buffer - skipElementContent bool - skippingElementsCount int64 - skipClosingTag bool - closingTagToSkipStack []string - mostRecentlyStartedToken string - ) - - tokenizer := html.NewTokenizer(r) - for { - if tokenizer.Next() == html.ErrorToken { - err := tokenizer.Err() - if err == io.EOF { - // End of input means end of processing - return &buff - } - - // Raw tokenizer error - return &bytes.Buffer{} - } - - token := tokenizer.Token() - switch token.Type { - case html.DoctypeToken: - - // DocType is not handled as there is no safe parsing mechanism - // provided by golang.org/x/net/html for the content, and this can - // be misused to insert HTML tags that are not then sanitized - // - // One might wish to recursively sanitize here using the same policy - // but I will need to do some further testing before considering - // this. - - case html.CommentToken: - - // Comments are ignored by default - - case html.StartTagToken: - - mostRecentlyStartedToken = token.Data - - aps, ok := p.elsAndAttrs[token.Data] - if !ok { - if _, ok := p.setOfElementsToSkipContent[token.Data]; ok { - skipElementContent = true - skippingElementsCount++ - } - if p.addSpaces { - buff.WriteString(" ") - } - break - } - - if len(token.Attr) != 0 { - token.Attr = p.sanitizeAttrs(token.Data, token.Attr, aps) - } - - if len(token.Attr) == 0 { - if !p.allowNoAttrs(token.Data) { - skipClosingTag = true - closingTagToSkipStack = append(closingTagToSkipStack, token.Data) - if p.addSpaces { - buff.WriteString(" ") - } - break - } - } - - if !skipElementContent { - buff.WriteString(token.String()) - } - - case html.EndTagToken: - - if mostRecentlyStartedToken == token.Data { - mostRecentlyStartedToken = "" - } - - if skipClosingTag && closingTagToSkipStack[len(closingTagToSkipStack)-1] == token.Data { - closingTagToSkipStack = closingTagToSkipStack[:len(closingTagToSkipStack)-1] - if len(closingTagToSkipStack) == 0 { - skipClosingTag = false - } - if p.addSpaces { - buff.WriteString(" ") - } - break - } - - if _, ok := p.elsAndAttrs[token.Data]; !ok { - if _, ok := p.setOfElementsToSkipContent[token.Data]; ok { - skippingElementsCount-- - if skippingElementsCount == 0 { - skipElementContent = false - } - } - if p.addSpaces { - buff.WriteString(" ") - } - break - } - - if !skipElementContent { - buff.WriteString(token.String()) - } - - case html.SelfClosingTagToken: - - aps, ok := p.elsAndAttrs[token.Data] - if !ok { - if p.addSpaces { - buff.WriteString(" ") - } - break - } - - if len(token.Attr) != 0 { - token.Attr = p.sanitizeAttrs(token.Data, token.Attr, aps) - } - - if len(token.Attr) == 0 && !p.allowNoAttrs(token.Data) { - if p.addSpaces { - buff.WriteString(" ") - } - break - } - - if !skipElementContent { - buff.WriteString(token.String()) - } - - case html.TextToken: - - if !skipElementContent { - switch mostRecentlyStartedToken { - case "script": - // not encouraged, but if a policy allows JavaScript we - // should not HTML escape it as that would break the output - buff.WriteString(token.Data) - case "style": - // not encouraged, but if a policy allows CSS styles we - // should not HTML escape it as that would break the output - buff.WriteString(token.Data) - default: - // HTML escape the text - buff.WriteString(token.String()) - } - } - default: - // A token that didn't exist in the html package when we wrote this - return &bytes.Buffer{} - } - } -} - -// sanitizeAttrs takes a set of element attribute policies and the global -// attribute policies and applies them to the []html.Attribute returning a set -// of html.Attributes that match the policies -func (p *Policy) sanitizeAttrs( - elementName string, - attrs []html.Attribute, - aps map[string]attrPolicy, -) []html.Attribute { - - if len(attrs) == 0 { - return attrs - } - - // Builds a new attribute slice based on the whether the attribute has been - // whitelisted explicitly or globally. - cleanAttrs := []html.Attribute{} - for _, htmlAttr := range attrs { - if p.allowDataAttributes { - // If we see a data attribute, let it through. - if isDataAttribute(htmlAttr.Key) { - cleanAttrs = append(cleanAttrs, htmlAttr) - continue - } - } - // Is there an element specific attribute policy that applies? - if ap, ok := aps[htmlAttr.Key]; ok { - if ap.regexp != nil { - if ap.regexp.MatchString(htmlAttr.Val) { - cleanAttrs = append(cleanAttrs, htmlAttr) - continue - } - } else { - cleanAttrs = append(cleanAttrs, htmlAttr) - continue - } - } - - // Is there a global attribute policy that applies? - if ap, ok := p.globalAttrs[htmlAttr.Key]; ok { - - if ap.regexp != nil { - if ap.regexp.MatchString(htmlAttr.Val) { - cleanAttrs = append(cleanAttrs, htmlAttr) - } - } else { - cleanAttrs = append(cleanAttrs, htmlAttr) - } - } - } - - if len(cleanAttrs) == 0 { - // If nothing was allowed, let's get out of here - return cleanAttrs - } - // cleanAttrs now contains the attributes that are permitted - - if linkable(elementName) { - if p.requireParseableURLs { - // Ensure URLs are parseable: - // - a.href - // - area.href - // - link.href - // - blockquote.cite - // - q.cite - // - img.src - // - script.src - tmpAttrs := []html.Attribute{} - for _, htmlAttr := range cleanAttrs { - switch elementName { - case "a", "area", "link": - if htmlAttr.Key == "href" { - if u, ok := p.validURL(htmlAttr.Val); ok { - htmlAttr.Val = u - tmpAttrs = append(tmpAttrs, htmlAttr) - } - break - } - tmpAttrs = append(tmpAttrs, htmlAttr) - case "blockquote", "q": - if htmlAttr.Key == "cite" { - if u, ok := p.validURL(htmlAttr.Val); ok { - htmlAttr.Val = u - tmpAttrs = append(tmpAttrs, htmlAttr) - } - break - } - tmpAttrs = append(tmpAttrs, htmlAttr) - case "img", "script": - if htmlAttr.Key == "src" { - if u, ok := p.validURL(htmlAttr.Val); ok { - htmlAttr.Val = u - tmpAttrs = append(tmpAttrs, htmlAttr) - } - break - } - tmpAttrs = append(tmpAttrs, htmlAttr) - default: - tmpAttrs = append(tmpAttrs, htmlAttr) - } - } - cleanAttrs = tmpAttrs - } - - if (p.requireNoFollow || - p.requireNoFollowFullyQualifiedLinks || - p.addTargetBlankToFullyQualifiedLinks) && - len(cleanAttrs) > 0 { - - // Add rel="nofollow" if a "href" exists - switch elementName { - case "a", "area", "link": - var hrefFound bool - var externalLink bool - for _, htmlAttr := range cleanAttrs { - if htmlAttr.Key == "href" { - hrefFound = true - - u, err := url.Parse(htmlAttr.Val) - if err != nil { - continue - } - if u.Host != "" { - externalLink = true - } - - continue - } - } - - if hrefFound { - var ( - noFollowFound bool - targetBlankFound bool - ) - - addNoFollow := (p.requireNoFollow || - externalLink && p.requireNoFollowFullyQualifiedLinks) - - addTargetBlank := (externalLink && - p.addTargetBlankToFullyQualifiedLinks) - - tmpAttrs := []html.Attribute{} - for _, htmlAttr := range cleanAttrs { - - var appended bool - if htmlAttr.Key == "rel" && addNoFollow { - - if strings.Contains(htmlAttr.Val, "nofollow") { - noFollowFound = true - tmpAttrs = append(tmpAttrs, htmlAttr) - appended = true - } else { - htmlAttr.Val += " nofollow" - noFollowFound = true - tmpAttrs = append(tmpAttrs, htmlAttr) - appended = true - } - } - - if elementName == "a" && htmlAttr.Key == "target" { - if htmlAttr.Val == "_blank" { - targetBlankFound = true - } - if addTargetBlank && !targetBlankFound { - htmlAttr.Val = "_blank" - targetBlankFound = true - tmpAttrs = append(tmpAttrs, htmlAttr) - appended = true - } - } - - if !appended { - tmpAttrs = append(tmpAttrs, htmlAttr) - } - } - if noFollowFound || targetBlankFound { - cleanAttrs = tmpAttrs - } - - if addNoFollow && !noFollowFound { - rel := html.Attribute{} - rel.Key = "rel" - rel.Val = "nofollow" - cleanAttrs = append(cleanAttrs, rel) - } - - if elementName == "a" && addTargetBlank && !targetBlankFound { - rel := html.Attribute{} - rel.Key = "target" - rel.Val = "_blank" - targetBlankFound = true - cleanAttrs = append(cleanAttrs, rel) - } - - if targetBlankFound { - // target="_blank" has a security risk that allows the - // opened window/tab to issue JavaScript calls against - // window.opener, which in effect allow the destination - // of the link to control the source: - // https://dev.to/ben/the-targetblank-vulnerability-by-example - // - // To mitigate this risk, we need to add a specific rel - // attribute if it is not already present. - // rel="noopener" - // - // Unfortunately this is processing the rel twice (we - // already looked at it earlier ^^) as we cannot be sure - // of the ordering of the href and rel, and whether we - // have fully satisfied that we need to do this. This - // double processing only happens *if* target="_blank" - // is true. - var noOpenerAdded bool - tmpAttrs := []html.Attribute{} - for _, htmlAttr := range cleanAttrs { - var appended bool - if htmlAttr.Key == "rel" { - if strings.Contains(htmlAttr.Val, "noopener") { - noOpenerAdded = true - tmpAttrs = append(tmpAttrs, htmlAttr) - } else { - htmlAttr.Val += " noopener" - noOpenerAdded = true - tmpAttrs = append(tmpAttrs, htmlAttr) - } - - appended = true - } - if !appended { - tmpAttrs = append(tmpAttrs, htmlAttr) - } - } - if noOpenerAdded { - cleanAttrs = tmpAttrs - } else { - // rel attr was not found, or else noopener would - // have been added already - rel := html.Attribute{} - rel.Key = "rel" - rel.Val = "noopener" - cleanAttrs = append(cleanAttrs, rel) - } - - } - } - default: - } - } - } - - return cleanAttrs -} - -func (p *Policy) allowNoAttrs(elementName string) bool { - _, ok := p.setOfElementsAllowedWithoutAttrs[elementName] - return ok -} - -func (p *Policy) validURL(rawurl string) (string, bool) { - if p.requireParseableURLs { - // URLs are valid if when space is trimmed the URL is valid - rawurl = strings.TrimSpace(rawurl) - - // URLs cannot contain whitespace, unless it is a data-uri - if (strings.Contains(rawurl, " ") || - strings.Contains(rawurl, "\t") || - strings.Contains(rawurl, "\n")) && - !strings.HasPrefix(rawurl, `data:`) { - return "", false - } - - // URLs are valid if they parse - u, err := url.Parse(rawurl) - if err != nil { - return "", false - } - - if u.Scheme != "" { - - urlPolicy, ok := p.allowURLSchemes[u.Scheme] - if !ok { - return "", false - - } - - if urlPolicy == nil || urlPolicy(u) == true { - return u.String(), true - } - - return "", false - } - - if p.allowRelativeURLs { - if u.String() != "" { - return u.String(), true - } - } - - return "", false - } - - return rawurl, true -} - -func linkable(elementName string) bool { - switch elementName { - case "a", "area", "blockquote", "img", "link", "script": - return true - default: - return false - } -} - -func isDataAttribute(val string) bool { - if !dataAttribute.MatchString(val) { - return false - } - rest := strings.Split(val, "data-") - if len(rest) == 1 { - return false - } - // data-xml* is invalid. - if dataAttributeXMLPrefix.MatchString(rest[1]) { - return false - } - // no uppercase or semi-colons allowed. - if dataAttributeInvalidChars.MatchString(rest[1]) { - return false - } - return true -} diff --git a/vendor/github.com/serenize/snaker/.travis.yml b/vendor/github.com/serenize/snaker/.travis.yml deleted file mode 100644 index 91e4b9a..0000000 --- a/vendor/github.com/serenize/snaker/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: go - -go: - - 1.8 - - 1.9 - - tip - -install: go get -t -d -v ./... && go build -v ./... diff --git a/vendor/github.com/serenize/snaker/LICENSE.txt b/vendor/github.com/serenize/snaker/LICENSE.txt deleted file mode 100644 index d8f52e4..0000000 --- a/vendor/github.com/serenize/snaker/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015 Serenize UG (haftungsbeschränkt) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/serenize/snaker/README.md b/vendor/github.com/serenize/snaker/README.md deleted file mode 100644 index cec4048..0000000 --- a/vendor/github.com/serenize/snaker/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# snaker - -[![Build Status](https://travis-ci.org/serenize/snaker.svg?branch=master)](https://travis-ci.org/serenize/snaker) -[![GoDoc](https://godoc.org/github.com/serenize/snaker?status.svg)](https://godoc.org/github.com/serenize/snaker) - -This is a small utility to convert camel cased strings to snake case and back, except some defined words. - -## QBS Usage - -To replace the original toSnake and back algorithms for [https://github.com/coocood/qbs](https://github.com/coocood/qbs) -you can easily use snaker: - -Import snaker -```go -import ( - github.com/coocood/qbs - github.com/serenize/snaker -) -``` - -Register the snaker methods to qbs -```go -qbs.ColumnNameToFieldName = snaker.SnakeToCamel -qbs.FieldNameToColumnName = snaker.CamelToSnake -``` diff --git a/vendor/github.com/serenize/snaker/snaker.go b/vendor/github.com/serenize/snaker/snaker.go deleted file mode 100644 index 408be6a..0000000 --- a/vendor/github.com/serenize/snaker/snaker.go +++ /dev/null @@ -1,150 +0,0 @@ -// Package snaker provides methods to convert CamelCase names to snake_case and back. -// It considers the list of allowed initialsms used by github.com/golang/lint/golint (e.g. ID or HTTP) -package snaker - -import ( - "strings" - "unicode" -) - -// CamelToSnake converts a given string to snake case -func CamelToSnake(s string) string { - var result string - var words []string - var lastPos int - rs := []rune(s) - - for i := 0; i < len(rs); i++ { - if i > 0 && unicode.IsUpper(rs[i]) { - if initialism := startsWithInitialism(s[lastPos:]); initialism != "" { - words = append(words, initialism) - - i += len(initialism) - 1 - lastPos = i - continue - } - - words = append(words, s[lastPos:i]) - lastPos = i - } - } - - // append the last word - if s[lastPos:] != "" { - words = append(words, s[lastPos:]) - } - - for k, word := range words { - if k > 0 { - result += "_" - } - - result += strings.ToLower(word) - } - - return result -} - -func snakeToCamel(s string, upperCase bool) string { - var result string - - words := strings.Split(s, "_") - - for i, word := range words { - if exception := snakeToCamelExceptions[word]; len(exception) > 0 { - result += exception - continue - } - - if upperCase || i > 0 { - if upper := strings.ToUpper(word); commonInitialisms[upper] { - result += upper - continue - } - } - - if (upperCase || i > 0) && len(word) > 0 { - w := []rune(word) - w[0] = unicode.ToUpper(w[0]) - result += string(w) - } else { - result += word - } - } - - return result -} - -// SnakeToCamel returns a string converted from snake case to uppercase -func SnakeToCamel(s string) string { - return snakeToCamel(s, true) -} - -// SnakeToCamelLower returns a string converted from snake case to lowercase -func SnakeToCamelLower(s string) string { - return snakeToCamel(s, false) -} - -// startsWithInitialism returns the initialism if the given string begins with it -func startsWithInitialism(s string) string { - var initialism string - // the longest initialism is 5 char, the shortest 2 - for i := 1; i <= 5; i++ { - if len(s) > i-1 && commonInitialisms[s[:i]] { - initialism = s[:i] - } - } - return initialism -} - -// commonInitialisms, taken from -// https://github.com/golang/lint/blob/206c0f020eba0f7fbcfbc467a5eb808037df2ed6/lint.go#L731 -var commonInitialisms = map[string]bool{ - "ACL": true, - "API": true, - "ASCII": true, - "CPU": true, - "CSS": true, - "DNS": true, - "EOF": true, - "ETA": true, - "GPU": true, - "GUID": true, - "HTML": true, - "HTTP": true, - "HTTPS": true, - "ID": true, - "IP": true, - "JSON": true, - "LHS": true, - "OS": true, - "QPS": true, - "RAM": true, - "RHS": true, - "RPC": true, - "SLA": true, - "SMTP": true, - "SQL": true, - "SSH": true, - "TCP": true, - "TLS": true, - "TTL": true, - "UDP": true, - "UI": true, - "UID": true, - "UUID": true, - "URI": true, - "URL": true, - "UTF8": true, - "VM": true, - "XML": true, - "XMPP": true, - "XSRF": true, - "XSS": true, - "OAuth": true, -} - -// add exceptions here for things that are not automatically convertable -var snakeToCamelExceptions = map[string]string{ - "oauth": "OAuth", -} diff --git a/vendor/github.com/sergi/go-diff/AUTHORS b/vendor/github.com/sergi/go-diff/AUTHORS deleted file mode 100644 index 2d7bb2b..0000000 --- a/vendor/github.com/sergi/go-diff/AUTHORS +++ /dev/null @@ -1,25 +0,0 @@ -# This is the official list of go-diff authors for copyright purposes. -# This file is distinct from the CONTRIBUTORS files. -# See the latter for an explanation. - -# Names should be added to this file as -# Name or Organization -# The email address is not required for organizations. - -# Please keep the list sorted. - -Danny Yoo -James Kolb -Jonathan Amsterdam -Markus Zimmermann -Matt Kovars -Örjan Persson -Osman Masood -Robert Carlsen -Rory Flynn -Sergi Mansilla -Shatrugna Sadhu -Shawn Smith -Stas Maksimov -Tor Arvid Lund -Zac Bergquist diff --git a/vendor/github.com/sergi/go-diff/CONTRIBUTORS b/vendor/github.com/sergi/go-diff/CONTRIBUTORS deleted file mode 100644 index 369e3d5..0000000 --- a/vendor/github.com/sergi/go-diff/CONTRIBUTORS +++ /dev/null @@ -1,32 +0,0 @@ -# This is the official list of people who can contribute -# (and typically have contributed) code to the go-diff -# repository. -# -# The AUTHORS file lists the copyright holders; this file -# lists people. For example, ACME Inc. employees would be listed here -# but not in AUTHORS, because ACME Inc. would hold the copyright. -# -# When adding J Random Contributor's name to this file, -# either J's name or J's organization's name should be -# added to the AUTHORS file. -# -# Names should be added to this file like so: -# Name -# -# Please keep the list sorted. - -Danny Yoo -James Kolb -Jonathan Amsterdam -Markus Zimmermann -Matt Kovars -Örjan Persson -Osman Masood -Robert Carlsen -Rory Flynn -Sergi Mansilla -Shatrugna Sadhu -Shawn Smith -Stas Maksimov -Tor Arvid Lund -Zac Bergquist diff --git a/vendor/github.com/sergi/go-diff/LICENSE b/vendor/github.com/sergi/go-diff/LICENSE deleted file mode 100644 index 937942c..0000000 --- a/vendor/github.com/sergi/go-diff/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2012-2016 The go-diff Authors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - diff --git a/vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go b/vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go deleted file mode 100644 index 82ad7bc..0000000 --- a/vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go +++ /dev/null @@ -1,1344 +0,0 @@ -// Copyright (c) 2012-2016 The go-diff authors. All rights reserved. -// https://github.com/sergi/go-diff -// See the included LICENSE file for license details. -// -// go-diff is a Go implementation of Google's Diff, Match, and Patch library -// Original library is Copyright (c) 2006 Google Inc. -// http://code.google.com/p/google-diff-match-patch/ - -package diffmatchpatch - -import ( - "bytes" - "errors" - "fmt" - "html" - "math" - "net/url" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" -) - -// Operation defines the operation of a diff item. -type Operation int8 - -const ( - // DiffDelete item represents a delete diff. - DiffDelete Operation = -1 - // DiffInsert item represents an insert diff. - DiffInsert Operation = 1 - // DiffEqual item represents an equal diff. - DiffEqual Operation = 0 -) - -// Diff represents one diff operation -type Diff struct { - Type Operation - Text string -} - -func splice(slice []Diff, index int, amount int, elements ...Diff) []Diff { - return append(slice[:index], append(elements, slice[index+amount:]...)...) -} - -// DiffMain finds the differences between two texts. -// If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character. -func (dmp *DiffMatchPatch) DiffMain(text1, text2 string, checklines bool) []Diff { - return dmp.DiffMainRunes([]rune(text1), []rune(text2), checklines) -} - -// DiffMainRunes finds the differences between two rune sequences. -// If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character. -func (dmp *DiffMatchPatch) DiffMainRunes(text1, text2 []rune, checklines bool) []Diff { - var deadline time.Time - if dmp.DiffTimeout > 0 { - deadline = time.Now().Add(dmp.DiffTimeout) - } - return dmp.diffMainRunes(text1, text2, checklines, deadline) -} - -func (dmp *DiffMatchPatch) diffMainRunes(text1, text2 []rune, checklines bool, deadline time.Time) []Diff { - if runesEqual(text1, text2) { - var diffs []Diff - if len(text1) > 0 { - diffs = append(diffs, Diff{DiffEqual, string(text1)}) - } - return diffs - } - // Trim off common prefix (speedup). - commonlength := commonPrefixLength(text1, text2) - commonprefix := text1[:commonlength] - text1 = text1[commonlength:] - text2 = text2[commonlength:] - - // Trim off common suffix (speedup). - commonlength = commonSuffixLength(text1, text2) - commonsuffix := text1[len(text1)-commonlength:] - text1 = text1[:len(text1)-commonlength] - text2 = text2[:len(text2)-commonlength] - - // Compute the diff on the middle block. - diffs := dmp.diffCompute(text1, text2, checklines, deadline) - - // Restore the prefix and suffix. - if len(commonprefix) != 0 { - diffs = append([]Diff{Diff{DiffEqual, string(commonprefix)}}, diffs...) - } - if len(commonsuffix) != 0 { - diffs = append(diffs, Diff{DiffEqual, string(commonsuffix)}) - } - - return dmp.DiffCleanupMerge(diffs) -} - -// diffCompute finds the differences between two rune slices. Assumes that the texts do not have any common prefix or suffix. -func (dmp *DiffMatchPatch) diffCompute(text1, text2 []rune, checklines bool, deadline time.Time) []Diff { - diffs := []Diff{} - if len(text1) == 0 { - // Just add some text (speedup). - return append(diffs, Diff{DiffInsert, string(text2)}) - } else if len(text2) == 0 { - // Just delete some text (speedup). - return append(diffs, Diff{DiffDelete, string(text1)}) - } - - var longtext, shorttext []rune - if len(text1) > len(text2) { - longtext = text1 - shorttext = text2 - } else { - longtext = text2 - shorttext = text1 - } - - if i := runesIndex(longtext, shorttext); i != -1 { - op := DiffInsert - // Swap insertions for deletions if diff is reversed. - if len(text1) > len(text2) { - op = DiffDelete - } - // Shorter text is inside the longer text (speedup). - return []Diff{ - Diff{op, string(longtext[:i])}, - Diff{DiffEqual, string(shorttext)}, - Diff{op, string(longtext[i+len(shorttext):])}, - } - } else if len(shorttext) == 1 { - // Single character string. - // After the previous speedup, the character can't be an equality. - return []Diff{ - Diff{DiffDelete, string(text1)}, - Diff{DiffInsert, string(text2)}, - } - // Check to see if the problem can be split in two. - } else if hm := dmp.diffHalfMatch(text1, text2); hm != nil { - // A half-match was found, sort out the return data. - text1A := hm[0] - text1B := hm[1] - text2A := hm[2] - text2B := hm[3] - midCommon := hm[4] - // Send both pairs off for separate processing. - diffsA := dmp.diffMainRunes(text1A, text2A, checklines, deadline) - diffsB := dmp.diffMainRunes(text1B, text2B, checklines, deadline) - // Merge the results. - return append(diffsA, append([]Diff{Diff{DiffEqual, string(midCommon)}}, diffsB...)...) - } else if checklines && len(text1) > 100 && len(text2) > 100 { - return dmp.diffLineMode(text1, text2, deadline) - } - return dmp.diffBisect(text1, text2, deadline) -} - -// diffLineMode does a quick line-level diff on both []runes, then rediff the parts for greater accuracy. This speedup can produce non-minimal diffs. -func (dmp *DiffMatchPatch) diffLineMode(text1, text2 []rune, deadline time.Time) []Diff { - // Scan the text on a line-by-line basis first. - text1, text2, linearray := dmp.diffLinesToRunes(text1, text2) - - diffs := dmp.diffMainRunes(text1, text2, false, deadline) - - // Convert the diff back to original text. - diffs = dmp.DiffCharsToLines(diffs, linearray) - // Eliminate freak matches (e.g. blank lines) - diffs = dmp.DiffCleanupSemantic(diffs) - - // Rediff any replacement blocks, this time character-by-character. - // Add a dummy entry at the end. - diffs = append(diffs, Diff{DiffEqual, ""}) - - pointer := 0 - countDelete := 0 - countInsert := 0 - - // NOTE: Rune slices are slower than using strings in this case. - textDelete := "" - textInsert := "" - - for pointer < len(diffs) { - switch diffs[pointer].Type { - case DiffInsert: - countInsert++ - textInsert += diffs[pointer].Text - case DiffDelete: - countDelete++ - textDelete += diffs[pointer].Text - case DiffEqual: - // Upon reaching an equality, check for prior redundancies. - if countDelete >= 1 && countInsert >= 1 { - // Delete the offending records and add the merged ones. - diffs = splice(diffs, pointer-countDelete-countInsert, - countDelete+countInsert) - - pointer = pointer - countDelete - countInsert - a := dmp.diffMainRunes([]rune(textDelete), []rune(textInsert), false, deadline) - for j := len(a) - 1; j >= 0; j-- { - diffs = splice(diffs, pointer, 0, a[j]) - } - pointer = pointer + len(a) - } - - countInsert = 0 - countDelete = 0 - textDelete = "" - textInsert = "" - } - pointer++ - } - - return diffs[:len(diffs)-1] // Remove the dummy entry at the end. -} - -// DiffBisect finds the 'middle snake' of a diff, split the problem in two and return the recursively constructed diff. -// If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character. -// See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. -func (dmp *DiffMatchPatch) DiffBisect(text1, text2 string, deadline time.Time) []Diff { - // Unused in this code, but retained for interface compatibility. - return dmp.diffBisect([]rune(text1), []rune(text2), deadline) -} - -// diffBisect finds the 'middle snake' of a diff, splits the problem in two and returns the recursively constructed diff. -// See Myers's 1986 paper: An O(ND) Difference Algorithm and Its Variations. -func (dmp *DiffMatchPatch) diffBisect(runes1, runes2 []rune, deadline time.Time) []Diff { - // Cache the text lengths to prevent multiple calls. - runes1Len, runes2Len := len(runes1), len(runes2) - - maxD := (runes1Len + runes2Len + 1) / 2 - vOffset := maxD - vLength := 2 * maxD - - v1 := make([]int, vLength) - v2 := make([]int, vLength) - for i := range v1 { - v1[i] = -1 - v2[i] = -1 - } - v1[vOffset+1] = 0 - v2[vOffset+1] = 0 - - delta := runes1Len - runes2Len - // If the total number of characters is odd, then the front path will collide with the reverse path. - front := (delta%2 != 0) - // Offsets for start and end of k loop. Prevents mapping of space beyond the grid. - k1start := 0 - k1end := 0 - k2start := 0 - k2end := 0 - for d := 0; d < maxD; d++ { - // Bail out if deadline is reached. - if !deadline.IsZero() && time.Now().After(deadline) { - break - } - - // Walk the front path one step. - for k1 := -d + k1start; k1 <= d-k1end; k1 += 2 { - k1Offset := vOffset + k1 - var x1 int - - if k1 == -d || (k1 != d && v1[k1Offset-1] < v1[k1Offset+1]) { - x1 = v1[k1Offset+1] - } else { - x1 = v1[k1Offset-1] + 1 - } - - y1 := x1 - k1 - for x1 < runes1Len && y1 < runes2Len { - if runes1[x1] != runes2[y1] { - break - } - x1++ - y1++ - } - v1[k1Offset] = x1 - if x1 > runes1Len { - // Ran off the right of the graph. - k1end += 2 - } else if y1 > runes2Len { - // Ran off the bottom of the graph. - k1start += 2 - } else if front { - k2Offset := vOffset + delta - k1 - if k2Offset >= 0 && k2Offset < vLength && v2[k2Offset] != -1 { - // Mirror x2 onto top-left coordinate system. - x2 := runes1Len - v2[k2Offset] - if x1 >= x2 { - // Overlap detected. - return dmp.diffBisectSplit(runes1, runes2, x1, y1, deadline) - } - } - } - } - // Walk the reverse path one step. - for k2 := -d + k2start; k2 <= d-k2end; k2 += 2 { - k2Offset := vOffset + k2 - var x2 int - if k2 == -d || (k2 != d && v2[k2Offset-1] < v2[k2Offset+1]) { - x2 = v2[k2Offset+1] - } else { - x2 = v2[k2Offset-1] + 1 - } - var y2 = x2 - k2 - for x2 < runes1Len && y2 < runes2Len { - if runes1[runes1Len-x2-1] != runes2[runes2Len-y2-1] { - break - } - x2++ - y2++ - } - v2[k2Offset] = x2 - if x2 > runes1Len { - // Ran off the left of the graph. - k2end += 2 - } else if y2 > runes2Len { - // Ran off the top of the graph. - k2start += 2 - } else if !front { - k1Offset := vOffset + delta - k2 - if k1Offset >= 0 && k1Offset < vLength && v1[k1Offset] != -1 { - x1 := v1[k1Offset] - y1 := vOffset + x1 - k1Offset - // Mirror x2 onto top-left coordinate system. - x2 = runes1Len - x2 - if x1 >= x2 { - // Overlap detected. - return dmp.diffBisectSplit(runes1, runes2, x1, y1, deadline) - } - } - } - } - } - // Diff took too long and hit the deadline or number of diffs equals number of characters, no commonality at all. - return []Diff{ - Diff{DiffDelete, string(runes1)}, - Diff{DiffInsert, string(runes2)}, - } -} - -func (dmp *DiffMatchPatch) diffBisectSplit(runes1, runes2 []rune, x, y int, - deadline time.Time) []Diff { - runes1a := runes1[:x] - runes2a := runes2[:y] - runes1b := runes1[x:] - runes2b := runes2[y:] - - // Compute both diffs serially. - diffs := dmp.diffMainRunes(runes1a, runes2a, false, deadline) - diffsb := dmp.diffMainRunes(runes1b, runes2b, false, deadline) - - return append(diffs, diffsb...) -} - -// DiffLinesToChars splits two texts into a list of strings, and educes the texts to a string of hashes where each Unicode character represents one line. -// It's slightly faster to call DiffLinesToRunes first, followed by DiffMainRunes. -func (dmp *DiffMatchPatch) DiffLinesToChars(text1, text2 string) (string, string, []string) { - chars1, chars2, lineArray := dmp.DiffLinesToRunes(text1, text2) - return string(chars1), string(chars2), lineArray -} - -// DiffLinesToRunes splits two texts into a list of runes. Each rune represents one line. -func (dmp *DiffMatchPatch) DiffLinesToRunes(text1, text2 string) ([]rune, []rune, []string) { - // '\x00' is a valid character, but various debuggers don't like it. So we'll insert a junk entry to avoid generating a null character. - lineArray := []string{""} // e.g. lineArray[4] == 'Hello\n' - lineHash := map[string]int{} // e.g. lineHash['Hello\n'] == 4 - - chars1 := dmp.diffLinesToRunesMunge(text1, &lineArray, lineHash) - chars2 := dmp.diffLinesToRunesMunge(text2, &lineArray, lineHash) - - return chars1, chars2, lineArray -} - -func (dmp *DiffMatchPatch) diffLinesToRunes(text1, text2 []rune) ([]rune, []rune, []string) { - return dmp.DiffLinesToRunes(string(text1), string(text2)) -} - -// diffLinesToRunesMunge splits a text into an array of strings, and reduces the texts to a []rune where each Unicode character represents one line. -// We use strings instead of []runes as input mainly because you can't use []rune as a map key. -func (dmp *DiffMatchPatch) diffLinesToRunesMunge(text string, lineArray *[]string, lineHash map[string]int) []rune { - // Walk the text, pulling out a substring for each line. text.split('\n') would would temporarily double our memory footprint. Modifying text would create many large strings to garbage collect. - lineStart := 0 - lineEnd := -1 - runes := []rune{} - - for lineEnd < len(text)-1 { - lineEnd = indexOf(text, "\n", lineStart) - - if lineEnd == -1 { - lineEnd = len(text) - 1 - } - - line := text[lineStart : lineEnd+1] - lineStart = lineEnd + 1 - lineValue, ok := lineHash[line] - - if ok { - runes = append(runes, rune(lineValue)) - } else { - *lineArray = append(*lineArray, line) - lineHash[line] = len(*lineArray) - 1 - runes = append(runes, rune(len(*lineArray)-1)) - } - } - - return runes -} - -// DiffCharsToLines rehydrates the text in a diff from a string of line hashes to real lines of text. -func (dmp *DiffMatchPatch) DiffCharsToLines(diffs []Diff, lineArray []string) []Diff { - hydrated := make([]Diff, 0, len(diffs)) - for _, aDiff := range diffs { - chars := aDiff.Text - text := make([]string, len(chars)) - - for i, r := range chars { - text[i] = lineArray[r] - } - - aDiff.Text = strings.Join(text, "") - hydrated = append(hydrated, aDiff) - } - return hydrated -} - -// DiffCommonPrefix determines the common prefix length of two strings. -func (dmp *DiffMatchPatch) DiffCommonPrefix(text1, text2 string) int { - // Unused in this code, but retained for interface compatibility. - return commonPrefixLength([]rune(text1), []rune(text2)) -} - -// DiffCommonSuffix determines the common suffix length of two strings. -func (dmp *DiffMatchPatch) DiffCommonSuffix(text1, text2 string) int { - // Unused in this code, but retained for interface compatibility. - return commonSuffixLength([]rune(text1), []rune(text2)) -} - -// commonPrefixLength returns the length of the common prefix of two rune slices. -func commonPrefixLength(text1, text2 []rune) int { - short, long := text1, text2 - if len(short) > len(long) { - short, long = long, short - } - for i, r := range short { - if r != long[i] { - return i - } - } - return len(short) -} - -// commonSuffixLength returns the length of the common suffix of two rune slices. -func commonSuffixLength(text1, text2 []rune) int { - n := min(len(text1), len(text2)) - for i := 0; i < n; i++ { - if text1[len(text1)-i-1] != text2[len(text2)-i-1] { - return i - } - } - return n - - // TODO research and benchmark this, why is it not activated? https://github.com/sergi/go-diff/issues/54 - // Binary search. - // Performance analysis: http://neil.fraser.name/news/2007/10/09/ - /* - pointermin := 0 - pointermax := math.Min(len(text1), len(text2)) - pointermid := pointermax - pointerend := 0 - for pointermin < pointermid { - if text1[len(text1)-pointermid:len(text1)-pointerend] == - text2[len(text2)-pointermid:len(text2)-pointerend] { - pointermin = pointermid - pointerend = pointermin - } else { - pointermax = pointermid - } - pointermid = math.Floor((pointermax-pointermin)/2 + pointermin) - } - return pointermid - */ -} - -// DiffCommonOverlap determines if the suffix of one string is the prefix of another. -func (dmp *DiffMatchPatch) DiffCommonOverlap(text1 string, text2 string) int { - // Cache the text lengths to prevent multiple calls. - text1Length := len(text1) - text2Length := len(text2) - // Eliminate the null case. - if text1Length == 0 || text2Length == 0 { - return 0 - } - // Truncate the longer string. - if text1Length > text2Length { - text1 = text1[text1Length-text2Length:] - } else if text1Length < text2Length { - text2 = text2[0:text1Length] - } - textLength := int(math.Min(float64(text1Length), float64(text2Length))) - // Quick check for the worst case. - if text1 == text2 { - return textLength - } - - // Start by looking for a single character match and increase length until no match is found. Performance analysis: http://neil.fraser.name/news/2010/11/04/ - best := 0 - length := 1 - for { - pattern := text1[textLength-length:] - found := strings.Index(text2, pattern) - if found == -1 { - break - } - length += found - if found == 0 || text1[textLength-length:] == text2[0:length] { - best = length - length++ - } - } - - return best -} - -// DiffHalfMatch checks whether the two texts share a substring which is at least half the length of the longer text. This speedup can produce non-minimal diffs. -func (dmp *DiffMatchPatch) DiffHalfMatch(text1, text2 string) []string { - // Unused in this code, but retained for interface compatibility. - runeSlices := dmp.diffHalfMatch([]rune(text1), []rune(text2)) - if runeSlices == nil { - return nil - } - - result := make([]string, len(runeSlices)) - for i, r := range runeSlices { - result[i] = string(r) - } - return result -} - -func (dmp *DiffMatchPatch) diffHalfMatch(text1, text2 []rune) [][]rune { - if dmp.DiffTimeout <= 0 { - // Don't risk returning a non-optimal diff if we have unlimited time. - return nil - } - - var longtext, shorttext []rune - if len(text1) > len(text2) { - longtext = text1 - shorttext = text2 - } else { - longtext = text2 - shorttext = text1 - } - - if len(longtext) < 4 || len(shorttext)*2 < len(longtext) { - return nil // Pointless. - } - - // First check if the second quarter is the seed for a half-match. - hm1 := dmp.diffHalfMatchI(longtext, shorttext, int(float64(len(longtext)+3)/4)) - - // Check again based on the third quarter. - hm2 := dmp.diffHalfMatchI(longtext, shorttext, int(float64(len(longtext)+1)/2)) - - hm := [][]rune{} - if hm1 == nil && hm2 == nil { - return nil - } else if hm2 == nil { - hm = hm1 - } else if hm1 == nil { - hm = hm2 - } else { - // Both matched. Select the longest. - if len(hm1[4]) > len(hm2[4]) { - hm = hm1 - } else { - hm = hm2 - } - } - - // A half-match was found, sort out the return data. - if len(text1) > len(text2) { - return hm - } - - return [][]rune{hm[2], hm[3], hm[0], hm[1], hm[4]} -} - -// diffHalfMatchI checks if a substring of shorttext exist within longtext such that the substring is at least half the length of longtext? -// Returns a slice containing the prefix of longtext, the suffix of longtext, the prefix of shorttext, the suffix of shorttext and the common middle, or null if there was no match. -func (dmp *DiffMatchPatch) diffHalfMatchI(l, s []rune, i int) [][]rune { - var bestCommonA []rune - var bestCommonB []rune - var bestCommonLen int - var bestLongtextA []rune - var bestLongtextB []rune - var bestShorttextA []rune - var bestShorttextB []rune - - // Start with a 1/4 length substring at position i as a seed. - seed := l[i : i+len(l)/4] - - for j := runesIndexOf(s, seed, 0); j != -1; j = runesIndexOf(s, seed, j+1) { - prefixLength := commonPrefixLength(l[i:], s[j:]) - suffixLength := commonSuffixLength(l[:i], s[:j]) - - if bestCommonLen < suffixLength+prefixLength { - bestCommonA = s[j-suffixLength : j] - bestCommonB = s[j : j+prefixLength] - bestCommonLen = len(bestCommonA) + len(bestCommonB) - bestLongtextA = l[:i-suffixLength] - bestLongtextB = l[i+prefixLength:] - bestShorttextA = s[:j-suffixLength] - bestShorttextB = s[j+prefixLength:] - } - } - - if bestCommonLen*2 < len(l) { - return nil - } - - return [][]rune{ - bestLongtextA, - bestLongtextB, - bestShorttextA, - bestShorttextB, - append(bestCommonA, bestCommonB...), - } -} - -// DiffCleanupSemantic reduces the number of edits by eliminating semantically trivial equalities. -func (dmp *DiffMatchPatch) DiffCleanupSemantic(diffs []Diff) []Diff { - changes := false - // Stack of indices where equalities are found. - type equality struct { - data int - next *equality - } - var equalities *equality - - var lastequality string - // Always equal to diffs[equalities[equalitiesLength - 1]][1] - var pointer int // Index of current position. - // Number of characters that changed prior to the equality. - var lengthInsertions1, lengthDeletions1 int - // Number of characters that changed after the equality. - var lengthInsertions2, lengthDeletions2 int - - for pointer < len(diffs) { - if diffs[pointer].Type == DiffEqual { - // Equality found. - - equalities = &equality{ - data: pointer, - next: equalities, - } - lengthInsertions1 = lengthInsertions2 - lengthDeletions1 = lengthDeletions2 - lengthInsertions2 = 0 - lengthDeletions2 = 0 - lastequality = diffs[pointer].Text - } else { - // An insertion or deletion. - - if diffs[pointer].Type == DiffInsert { - lengthInsertions2 += len(diffs[pointer].Text) - } else { - lengthDeletions2 += len(diffs[pointer].Text) - } - // Eliminate an equality that is smaller or equal to the edits on both sides of it. - difference1 := int(math.Max(float64(lengthInsertions1), float64(lengthDeletions1))) - difference2 := int(math.Max(float64(lengthInsertions2), float64(lengthDeletions2))) - if len(lastequality) > 0 && - (len(lastequality) <= difference1) && - (len(lastequality) <= difference2) { - // Duplicate record. - insPoint := equalities.data - diffs = append( - diffs[:insPoint], - append([]Diff{Diff{DiffDelete, lastequality}}, diffs[insPoint:]...)...) - - // Change second copy to insert. - diffs[insPoint+1].Type = DiffInsert - // Throw away the equality we just deleted. - equalities = equalities.next - - if equalities != nil { - equalities = equalities.next - } - if equalities != nil { - pointer = equalities.data - } else { - pointer = -1 - } - - lengthInsertions1 = 0 // Reset the counters. - lengthDeletions1 = 0 - lengthInsertions2 = 0 - lengthDeletions2 = 0 - lastequality = "" - changes = true - } - } - pointer++ - } - - // Normalize the diff. - if changes { - diffs = dmp.DiffCleanupMerge(diffs) - } - diffs = dmp.DiffCleanupSemanticLossless(diffs) - // Find any overlaps between deletions and insertions. - // e.g: abcxxxxxxdef - // -> abcxxxdef - // e.g: xxxabcdefxxx - // -> defxxxabc - // Only extract an overlap if it is as big as the edit ahead or behind it. - pointer = 1 - for pointer < len(diffs) { - if diffs[pointer-1].Type == DiffDelete && - diffs[pointer].Type == DiffInsert { - deletion := diffs[pointer-1].Text - insertion := diffs[pointer].Text - overlapLength1 := dmp.DiffCommonOverlap(deletion, insertion) - overlapLength2 := dmp.DiffCommonOverlap(insertion, deletion) - if overlapLength1 >= overlapLength2 { - if float64(overlapLength1) >= float64(len(deletion))/2 || - float64(overlapLength1) >= float64(len(insertion))/2 { - - // Overlap found. Insert an equality and trim the surrounding edits. - diffs = append( - diffs[:pointer], - append([]Diff{Diff{DiffEqual, insertion[:overlapLength1]}}, diffs[pointer:]...)...) - - diffs[pointer-1].Text = - deletion[0 : len(deletion)-overlapLength1] - diffs[pointer+1].Text = insertion[overlapLength1:] - pointer++ - } - } else { - if float64(overlapLength2) >= float64(len(deletion))/2 || - float64(overlapLength2) >= float64(len(insertion))/2 { - // Reverse overlap found. Insert an equality and swap and trim the surrounding edits. - overlap := Diff{DiffEqual, deletion[:overlapLength2]} - diffs = append( - diffs[:pointer], - append([]Diff{overlap}, diffs[pointer:]...)...) - - diffs[pointer-1].Type = DiffInsert - diffs[pointer-1].Text = insertion[0 : len(insertion)-overlapLength2] - diffs[pointer+1].Type = DiffDelete - diffs[pointer+1].Text = deletion[overlapLength2:] - pointer++ - } - } - pointer++ - } - pointer++ - } - - return diffs -} - -// Define some regex patterns for matching boundaries. -var ( - nonAlphaNumericRegex = regexp.MustCompile(`[^a-zA-Z0-9]`) - whitespaceRegex = regexp.MustCompile(`\s`) - linebreakRegex = regexp.MustCompile(`[\r\n]`) - blanklineEndRegex = regexp.MustCompile(`\n\r?\n$`) - blanklineStartRegex = regexp.MustCompile(`^\r?\n\r?\n`) -) - -// diffCleanupSemanticScore computes a score representing whether the internal boundary falls on logical boundaries. -// Scores range from 6 (best) to 0 (worst). Closure, but does not reference any external variables. -func diffCleanupSemanticScore(one, two string) int { - if len(one) == 0 || len(two) == 0 { - // Edges are the best. - return 6 - } - - // Each port of this function behaves slightly differently due to subtle differences in each language's definition of things like 'whitespace'. Since this function's purpose is largely cosmetic, the choice has been made to use each language's native features rather than force total conformity. - rune1, _ := utf8.DecodeLastRuneInString(one) - rune2, _ := utf8.DecodeRuneInString(two) - char1 := string(rune1) - char2 := string(rune2) - - nonAlphaNumeric1 := nonAlphaNumericRegex.MatchString(char1) - nonAlphaNumeric2 := nonAlphaNumericRegex.MatchString(char2) - whitespace1 := nonAlphaNumeric1 && whitespaceRegex.MatchString(char1) - whitespace2 := nonAlphaNumeric2 && whitespaceRegex.MatchString(char2) - lineBreak1 := whitespace1 && linebreakRegex.MatchString(char1) - lineBreak2 := whitespace2 && linebreakRegex.MatchString(char2) - blankLine1 := lineBreak1 && blanklineEndRegex.MatchString(one) - blankLine2 := lineBreak2 && blanklineEndRegex.MatchString(two) - - if blankLine1 || blankLine2 { - // Five points for blank lines. - return 5 - } else if lineBreak1 || lineBreak2 { - // Four points for line breaks. - return 4 - } else if nonAlphaNumeric1 && !whitespace1 && whitespace2 { - // Three points for end of sentences. - return 3 - } else if whitespace1 || whitespace2 { - // Two points for whitespace. - return 2 - } else if nonAlphaNumeric1 || nonAlphaNumeric2 { - // One point for non-alphanumeric. - return 1 - } - return 0 -} - -// DiffCleanupSemanticLossless looks for single edits surrounded on both sides by equalities which can be shifted sideways to align the edit to a word boundary. -// E.g: The cat came. -> The cat came. -func (dmp *DiffMatchPatch) DiffCleanupSemanticLossless(diffs []Diff) []Diff { - pointer := 1 - - // Intentionally ignore the first and last element (don't need checking). - for pointer < len(diffs)-1 { - if diffs[pointer-1].Type == DiffEqual && - diffs[pointer+1].Type == DiffEqual { - - // This is a single edit surrounded by equalities. - equality1 := diffs[pointer-1].Text - edit := diffs[pointer].Text - equality2 := diffs[pointer+1].Text - - // First, shift the edit as far left as possible. - commonOffset := dmp.DiffCommonSuffix(equality1, edit) - if commonOffset > 0 { - commonString := edit[len(edit)-commonOffset:] - equality1 = equality1[0 : len(equality1)-commonOffset] - edit = commonString + edit[:len(edit)-commonOffset] - equality2 = commonString + equality2 - } - - // Second, step character by character right, looking for the best fit. - bestEquality1 := equality1 - bestEdit := edit - bestEquality2 := equality2 - bestScore := diffCleanupSemanticScore(equality1, edit) + - diffCleanupSemanticScore(edit, equality2) - - for len(edit) != 0 && len(equality2) != 0 { - _, sz := utf8.DecodeRuneInString(edit) - if len(equality2) < sz || edit[:sz] != equality2[:sz] { - break - } - equality1 += edit[:sz] - edit = edit[sz:] + equality2[:sz] - equality2 = equality2[sz:] - score := diffCleanupSemanticScore(equality1, edit) + - diffCleanupSemanticScore(edit, equality2) - // The >= encourages trailing rather than leading whitespace on edits. - if score >= bestScore { - bestScore = score - bestEquality1 = equality1 - bestEdit = edit - bestEquality2 = equality2 - } - } - - if diffs[pointer-1].Text != bestEquality1 { - // We have an improvement, save it back to the diff. - if len(bestEquality1) != 0 { - diffs[pointer-1].Text = bestEquality1 - } else { - diffs = splice(diffs, pointer-1, 1) - pointer-- - } - - diffs[pointer].Text = bestEdit - if len(bestEquality2) != 0 { - diffs[pointer+1].Text = bestEquality2 - } else { - diffs = append(diffs[:pointer+1], diffs[pointer+2:]...) - pointer-- - } - } - } - pointer++ - } - - return diffs -} - -// DiffCleanupEfficiency reduces the number of edits by eliminating operationally trivial equalities. -func (dmp *DiffMatchPatch) DiffCleanupEfficiency(diffs []Diff) []Diff { - changes := false - // Stack of indices where equalities are found. - type equality struct { - data int - next *equality - } - var equalities *equality - // Always equal to equalities[equalitiesLength-1][1] - lastequality := "" - pointer := 0 // Index of current position. - // Is there an insertion operation before the last equality. - preIns := false - // Is there a deletion operation before the last equality. - preDel := false - // Is there an insertion operation after the last equality. - postIns := false - // Is there a deletion operation after the last equality. - postDel := false - for pointer < len(diffs) { - if diffs[pointer].Type == DiffEqual { // Equality found. - if len(diffs[pointer].Text) < dmp.DiffEditCost && - (postIns || postDel) { - // Candidate found. - equalities = &equality{ - data: pointer, - next: equalities, - } - preIns = postIns - preDel = postDel - lastequality = diffs[pointer].Text - } else { - // Not a candidate, and can never become one. - equalities = nil - lastequality = "" - } - postIns = false - postDel = false - } else { // An insertion or deletion. - if diffs[pointer].Type == DiffDelete { - postDel = true - } else { - postIns = true - } - - // Five types to be split: - // ABXYCD - // AXCD - // ABXC - // AXCD - // ABXC - var sumPres int - if preIns { - sumPres++ - } - if preDel { - sumPres++ - } - if postIns { - sumPres++ - } - if postDel { - sumPres++ - } - if len(lastequality) > 0 && - ((preIns && preDel && postIns && postDel) || - ((len(lastequality) < dmp.DiffEditCost/2) && sumPres == 3)) { - - insPoint := equalities.data - - // Duplicate record. - diffs = append(diffs[:insPoint], - append([]Diff{Diff{DiffDelete, lastequality}}, diffs[insPoint:]...)...) - - // Change second copy to insert. - diffs[insPoint+1].Type = DiffInsert - // Throw away the equality we just deleted. - equalities = equalities.next - lastequality = "" - - if preIns && preDel { - // No changes made which could affect previous entry, keep going. - postIns = true - postDel = true - equalities = nil - } else { - if equalities != nil { - equalities = equalities.next - } - if equalities != nil { - pointer = equalities.data - } else { - pointer = -1 - } - postIns = false - postDel = false - } - changes = true - } - } - pointer++ - } - - if changes { - diffs = dmp.DiffCleanupMerge(diffs) - } - - return diffs -} - -// DiffCleanupMerge reorders and merges like edit sections. Merge equalities. -// Any edit section can move as long as it doesn't cross an equality. -func (dmp *DiffMatchPatch) DiffCleanupMerge(diffs []Diff) []Diff { - // Add a dummy entry at the end. - diffs = append(diffs, Diff{DiffEqual, ""}) - pointer := 0 - countDelete := 0 - countInsert := 0 - commonlength := 0 - textDelete := []rune(nil) - textInsert := []rune(nil) - - for pointer < len(diffs) { - switch diffs[pointer].Type { - case DiffInsert: - countInsert++ - textInsert = append(textInsert, []rune(diffs[pointer].Text)...) - pointer++ - break - case DiffDelete: - countDelete++ - textDelete = append(textDelete, []rune(diffs[pointer].Text)...) - pointer++ - break - case DiffEqual: - // Upon reaching an equality, check for prior redundancies. - if countDelete+countInsert > 1 { - if countDelete != 0 && countInsert != 0 { - // Factor out any common prefixies. - commonlength = commonPrefixLength(textInsert, textDelete) - if commonlength != 0 { - x := pointer - countDelete - countInsert - if x > 0 && diffs[x-1].Type == DiffEqual { - diffs[x-1].Text += string(textInsert[:commonlength]) - } else { - diffs = append([]Diff{Diff{DiffEqual, string(textInsert[:commonlength])}}, diffs...) - pointer++ - } - textInsert = textInsert[commonlength:] - textDelete = textDelete[commonlength:] - } - // Factor out any common suffixies. - commonlength = commonSuffixLength(textInsert, textDelete) - if commonlength != 0 { - insertIndex := len(textInsert) - commonlength - deleteIndex := len(textDelete) - commonlength - diffs[pointer].Text = string(textInsert[insertIndex:]) + diffs[pointer].Text - textInsert = textInsert[:insertIndex] - textDelete = textDelete[:deleteIndex] - } - } - // Delete the offending records and add the merged ones. - if countDelete == 0 { - diffs = splice(diffs, pointer-countInsert, - countDelete+countInsert, - Diff{DiffInsert, string(textInsert)}) - } else if countInsert == 0 { - diffs = splice(diffs, pointer-countDelete, - countDelete+countInsert, - Diff{DiffDelete, string(textDelete)}) - } else { - diffs = splice(diffs, pointer-countDelete-countInsert, - countDelete+countInsert, - Diff{DiffDelete, string(textDelete)}, - Diff{DiffInsert, string(textInsert)}) - } - - pointer = pointer - countDelete - countInsert + 1 - if countDelete != 0 { - pointer++ - } - if countInsert != 0 { - pointer++ - } - } else if pointer != 0 && diffs[pointer-1].Type == DiffEqual { - // Merge this equality with the previous one. - diffs[pointer-1].Text += diffs[pointer].Text - diffs = append(diffs[:pointer], diffs[pointer+1:]...) - } else { - pointer++ - } - countInsert = 0 - countDelete = 0 - textDelete = nil - textInsert = nil - break - } - } - - if len(diffs[len(diffs)-1].Text) == 0 { - diffs = diffs[0 : len(diffs)-1] // Remove the dummy entry at the end. - } - - // Second pass: look for single edits surrounded on both sides by equalities which can be shifted sideways to eliminate an equality. E.g: ABAC -> ABAC - changes := false - pointer = 1 - // Intentionally ignore the first and last element (don't need checking). - for pointer < (len(diffs) - 1) { - if diffs[pointer-1].Type == DiffEqual && - diffs[pointer+1].Type == DiffEqual { - // This is a single edit surrounded by equalities. - if strings.HasSuffix(diffs[pointer].Text, diffs[pointer-1].Text) { - // Shift the edit over the previous equality. - diffs[pointer].Text = diffs[pointer-1].Text + - diffs[pointer].Text[:len(diffs[pointer].Text)-len(diffs[pointer-1].Text)] - diffs[pointer+1].Text = diffs[pointer-1].Text + diffs[pointer+1].Text - diffs = splice(diffs, pointer-1, 1) - changes = true - } else if strings.HasPrefix(diffs[pointer].Text, diffs[pointer+1].Text) { - // Shift the edit over the next equality. - diffs[pointer-1].Text += diffs[pointer+1].Text - diffs[pointer].Text = - diffs[pointer].Text[len(diffs[pointer+1].Text):] + diffs[pointer+1].Text - diffs = splice(diffs, pointer+1, 1) - changes = true - } - } - pointer++ - } - - // If shifts were made, the diff needs reordering and another shift sweep. - if changes { - diffs = dmp.DiffCleanupMerge(diffs) - } - - return diffs -} - -// DiffXIndex returns the equivalent location in s2. -func (dmp *DiffMatchPatch) DiffXIndex(diffs []Diff, loc int) int { - chars1 := 0 - chars2 := 0 - lastChars1 := 0 - lastChars2 := 0 - lastDiff := Diff{} - for i := 0; i < len(diffs); i++ { - aDiff := diffs[i] - if aDiff.Type != DiffInsert { - // Equality or deletion. - chars1 += len(aDiff.Text) - } - if aDiff.Type != DiffDelete { - // Equality or insertion. - chars2 += len(aDiff.Text) - } - if chars1 > loc { - // Overshot the location. - lastDiff = aDiff - break - } - lastChars1 = chars1 - lastChars2 = chars2 - } - if lastDiff.Type == DiffDelete { - // The location was deleted. - return lastChars2 - } - // Add the remaining character length. - return lastChars2 + (loc - lastChars1) -} - -// DiffPrettyHtml converts a []Diff into a pretty HTML report. -// It is intended as an example from which to write one's own display functions. -func (dmp *DiffMatchPatch) DiffPrettyHtml(diffs []Diff) string { - var buff bytes.Buffer - for _, diff := range diffs { - text := strings.Replace(html.EscapeString(diff.Text), "\n", "¶
", -1) - switch diff.Type { - case DiffInsert: - _, _ = buff.WriteString("") - _, _ = buff.WriteString(text) - _, _ = buff.WriteString("") - case DiffDelete: - _, _ = buff.WriteString("") - _, _ = buff.WriteString(text) - _, _ = buff.WriteString("") - case DiffEqual: - _, _ = buff.WriteString("") - _, _ = buff.WriteString(text) - _, _ = buff.WriteString("") - } - } - return buff.String() -} - -// DiffPrettyText converts a []Diff into a colored text report. -func (dmp *DiffMatchPatch) DiffPrettyText(diffs []Diff) string { - var buff bytes.Buffer - for _, diff := range diffs { - text := diff.Text - - switch diff.Type { - case DiffInsert: - _, _ = buff.WriteString("\x1b[32m") - _, _ = buff.WriteString(text) - _, _ = buff.WriteString("\x1b[0m") - case DiffDelete: - _, _ = buff.WriteString("\x1b[31m") - _, _ = buff.WriteString(text) - _, _ = buff.WriteString("\x1b[0m") - case DiffEqual: - _, _ = buff.WriteString(text) - } - } - - return buff.String() -} - -// DiffText1 computes and returns the source text (all equalities and deletions). -func (dmp *DiffMatchPatch) DiffText1(diffs []Diff) string { - //StringBuilder text = new StringBuilder() - var text bytes.Buffer - - for _, aDiff := range diffs { - if aDiff.Type != DiffInsert { - _, _ = text.WriteString(aDiff.Text) - } - } - return text.String() -} - -// DiffText2 computes and returns the destination text (all equalities and insertions). -func (dmp *DiffMatchPatch) DiffText2(diffs []Diff) string { - var text bytes.Buffer - - for _, aDiff := range diffs { - if aDiff.Type != DiffDelete { - _, _ = text.WriteString(aDiff.Text) - } - } - return text.String() -} - -// DiffLevenshtein computes the Levenshtein distance that is the number of inserted, deleted or substituted characters. -func (dmp *DiffMatchPatch) DiffLevenshtein(diffs []Diff) int { - levenshtein := 0 - insertions := 0 - deletions := 0 - - for _, aDiff := range diffs { - switch aDiff.Type { - case DiffInsert: - insertions += len(aDiff.Text) - case DiffDelete: - deletions += len(aDiff.Text) - case DiffEqual: - // A deletion and an insertion is one substitution. - levenshtein += max(insertions, deletions) - insertions = 0 - deletions = 0 - } - } - - levenshtein += max(insertions, deletions) - return levenshtein -} - -// DiffToDelta crushes the diff into an encoded string which describes the operations required to transform text1 into text2. -// E.g. =3\t-2\t+ing -> Keep 3 chars, delete 2 chars, insert 'ing'. Operations are tab-separated. Inserted text is escaped using %xx notation. -func (dmp *DiffMatchPatch) DiffToDelta(diffs []Diff) string { - var text bytes.Buffer - for _, aDiff := range diffs { - switch aDiff.Type { - case DiffInsert: - _, _ = text.WriteString("+") - _, _ = text.WriteString(strings.Replace(url.QueryEscape(aDiff.Text), "+", " ", -1)) - _, _ = text.WriteString("\t") - break - case DiffDelete: - _, _ = text.WriteString("-") - _, _ = text.WriteString(strconv.Itoa(utf8.RuneCountInString(aDiff.Text))) - _, _ = text.WriteString("\t") - break - case DiffEqual: - _, _ = text.WriteString("=") - _, _ = text.WriteString(strconv.Itoa(utf8.RuneCountInString(aDiff.Text))) - _, _ = text.WriteString("\t") - break - } - } - delta := text.String() - if len(delta) != 0 { - // Strip off trailing tab character. - delta = delta[0 : utf8.RuneCountInString(delta)-1] - delta = unescaper.Replace(delta) - } - return delta -} - -// DiffFromDelta given the original text1, and an encoded string which describes the operations required to transform text1 into text2, comAdde the full diff. -func (dmp *DiffMatchPatch) DiffFromDelta(text1 string, delta string) (diffs []Diff, err error) { - i := 0 - runes := []rune(text1) - - for _, token := range strings.Split(delta, "\t") { - if len(token) == 0 { - // Blank tokens are ok (from a trailing \t). - continue - } - - // Each token begins with a one character parameter which specifies the operation of this token (delete, insert, equality). - param := token[1:] - - switch op := token[0]; op { - case '+': - // Decode would Diff all "+" to " " - param = strings.Replace(param, "+", "%2b", -1) - param, err = url.QueryUnescape(param) - if err != nil { - return nil, err - } - if !utf8.ValidString(param) { - return nil, fmt.Errorf("invalid UTF-8 token: %q", param) - } - - diffs = append(diffs, Diff{DiffInsert, param}) - case '=', '-': - n, err := strconv.ParseInt(param, 10, 0) - if err != nil { - return nil, err - } else if n < 0 { - return nil, errors.New("Negative number in DiffFromDelta: " + param) - } - - i += int(n) - // Break out if we are out of bounds, go1.6 can't handle this very well - if i > len(runes) { - break - } - // Remember that string slicing is by byte - we want by rune here. - text := string(runes[i-int(n) : i]) - - if op == '=' { - diffs = append(diffs, Diff{DiffEqual, text}) - } else { - diffs = append(diffs, Diff{DiffDelete, text}) - } - default: - // Anything else is an error. - return nil, errors.New("Invalid diff operation in DiffFromDelta: " + string(token[0])) - } - } - - if i != len(runes) { - return nil, fmt.Errorf("Delta length (%v) is different from source text length (%v)", i, len(text1)) - } - - return diffs, nil -} diff --git a/vendor/github.com/sergi/go-diff/diffmatchpatch/diffmatchpatch.go b/vendor/github.com/sergi/go-diff/diffmatchpatch/diffmatchpatch.go deleted file mode 100644 index d3acc32..0000000 --- a/vendor/github.com/sergi/go-diff/diffmatchpatch/diffmatchpatch.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2012-2016 The go-diff authors. All rights reserved. -// https://github.com/sergi/go-diff -// See the included LICENSE file for license details. -// -// go-diff is a Go implementation of Google's Diff, Match, and Patch library -// Original library is Copyright (c) 2006 Google Inc. -// http://code.google.com/p/google-diff-match-patch/ - -// Package diffmatchpatch offers robust algorithms to perform the operations required for synchronizing plain text. -package diffmatchpatch - -import ( - "time" -) - -// DiffMatchPatch holds the configuration for diff-match-patch operations. -type DiffMatchPatch struct { - // Number of seconds to map a diff before giving up (0 for infinity). - DiffTimeout time.Duration - // Cost of an empty edit operation in terms of edit characters. - DiffEditCost int - // How far to search for a match (0 = exact location, 1000+ = broad match). A match this many characters away from the expected location will add 1.0 to the score (0.0 is a perfect match). - MatchDistance int - // When deleting a large block of text (over ~64 characters), how close do the contents have to be to match the expected contents. (0.0 = perfection, 1.0 = very loose). Note that MatchThreshold controls how closely the end points of a delete need to match. - PatchDeleteThreshold float64 - // Chunk size for context length. - PatchMargin int - // The number of bits in an int. - MatchMaxBits int - // At what point is no match declared (0.0 = perfection, 1.0 = very loose). - MatchThreshold float64 -} - -// New creates a new DiffMatchPatch object with default parameters. -func New() *DiffMatchPatch { - // Defaults. - return &DiffMatchPatch{ - DiffTimeout: time.Second, - DiffEditCost: 4, - MatchThreshold: 0.5, - MatchDistance: 1000, - PatchDeleteThreshold: 0.5, - PatchMargin: 4, - MatchMaxBits: 32, - } -} diff --git a/vendor/github.com/sergi/go-diff/diffmatchpatch/match.go b/vendor/github.com/sergi/go-diff/diffmatchpatch/match.go deleted file mode 100644 index 17374e1..0000000 --- a/vendor/github.com/sergi/go-diff/diffmatchpatch/match.go +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) 2012-2016 The go-diff authors. All rights reserved. -// https://github.com/sergi/go-diff -// See the included LICENSE file for license details. -// -// go-diff is a Go implementation of Google's Diff, Match, and Patch library -// Original library is Copyright (c) 2006 Google Inc. -// http://code.google.com/p/google-diff-match-patch/ - -package diffmatchpatch - -import ( - "math" -) - -// MatchMain locates the best instance of 'pattern' in 'text' near 'loc'. -// Returns -1 if no match found. -func (dmp *DiffMatchPatch) MatchMain(text, pattern string, loc int) int { - // Check for null inputs not needed since null can't be passed in C#. - - loc = int(math.Max(0, math.Min(float64(loc), float64(len(text))))) - if text == pattern { - // Shortcut (potentially not guaranteed by the algorithm) - return 0 - } else if len(text) == 0 { - // Nothing to match. - return -1 - } else if loc+len(pattern) <= len(text) && text[loc:loc+len(pattern)] == pattern { - // Perfect match at the perfect spot! (Includes case of null pattern) - return loc - } - // Do a fuzzy compare. - return dmp.MatchBitap(text, pattern, loc) -} - -// MatchBitap locates the best instance of 'pattern' in 'text' near 'loc' using the Bitap algorithm. -// Returns -1 if no match was found. -func (dmp *DiffMatchPatch) MatchBitap(text, pattern string, loc int) int { - // Initialise the alphabet. - s := dmp.MatchAlphabet(pattern) - - // Highest score beyond which we give up. - scoreThreshold := dmp.MatchThreshold - // Is there a nearby exact match? (speedup) - bestLoc := indexOf(text, pattern, loc) - if bestLoc != -1 { - scoreThreshold = math.Min(dmp.matchBitapScore(0, bestLoc, loc, - pattern), scoreThreshold) - // What about in the other direction? (speedup) - bestLoc = lastIndexOf(text, pattern, loc+len(pattern)) - if bestLoc != -1 { - scoreThreshold = math.Min(dmp.matchBitapScore(0, bestLoc, loc, - pattern), scoreThreshold) - } - } - - // Initialise the bit arrays. - matchmask := 1 << uint((len(pattern) - 1)) - bestLoc = -1 - - var binMin, binMid int - binMax := len(pattern) + len(text) - lastRd := []int{} - for d := 0; d < len(pattern); d++ { - // Scan for the best match; each iteration allows for one more error. Run a binary search to determine how far from 'loc' we can stray at this error level. - binMin = 0 - binMid = binMax - for binMin < binMid { - if dmp.matchBitapScore(d, loc+binMid, loc, pattern) <= scoreThreshold { - binMin = binMid - } else { - binMax = binMid - } - binMid = (binMax-binMin)/2 + binMin - } - // Use the result from this iteration as the maximum for the next. - binMax = binMid - start := int(math.Max(1, float64(loc-binMid+1))) - finish := int(math.Min(float64(loc+binMid), float64(len(text))) + float64(len(pattern))) - - rd := make([]int, finish+2) - rd[finish+1] = (1 << uint(d)) - 1 - - for j := finish; j >= start; j-- { - var charMatch int - if len(text) <= j-1 { - // Out of range. - charMatch = 0 - } else if _, ok := s[text[j-1]]; !ok { - charMatch = 0 - } else { - charMatch = s[text[j-1]] - } - - if d == 0 { - // First pass: exact match. - rd[j] = ((rd[j+1] << 1) | 1) & charMatch - } else { - // Subsequent passes: fuzzy match. - rd[j] = ((rd[j+1]<<1)|1)&charMatch | (((lastRd[j+1] | lastRd[j]) << 1) | 1) | lastRd[j+1] - } - if (rd[j] & matchmask) != 0 { - score := dmp.matchBitapScore(d, j-1, loc, pattern) - // This match will almost certainly be better than any existing match. But check anyway. - if score <= scoreThreshold { - // Told you so. - scoreThreshold = score - bestLoc = j - 1 - if bestLoc > loc { - // When passing loc, don't exceed our current distance from loc. - start = int(math.Max(1, float64(2*loc-bestLoc))) - } else { - // Already passed loc, downhill from here on in. - break - } - } - } - } - if dmp.matchBitapScore(d+1, loc, loc, pattern) > scoreThreshold { - // No hope for a (better) match at greater error levels. - break - } - lastRd = rd - } - return bestLoc -} - -// matchBitapScore computes and returns the score for a match with e errors and x location. -func (dmp *DiffMatchPatch) matchBitapScore(e, x, loc int, pattern string) float64 { - accuracy := float64(e) / float64(len(pattern)) - proximity := math.Abs(float64(loc - x)) - if dmp.MatchDistance == 0 { - // Dodge divide by zero error. - if proximity == 0 { - return accuracy - } - - return 1.0 - } - return accuracy + (proximity / float64(dmp.MatchDistance)) -} - -// MatchAlphabet initialises the alphabet for the Bitap algorithm. -func (dmp *DiffMatchPatch) MatchAlphabet(pattern string) map[byte]int { - s := map[byte]int{} - charPattern := []byte(pattern) - for _, c := range charPattern { - _, ok := s[c] - if !ok { - s[c] = 0 - } - } - i := 0 - - for _, c := range charPattern { - value := s[c] | int(uint(1)< y { - return x - } - return y -} diff --git a/vendor/github.com/sergi/go-diff/diffmatchpatch/patch.go b/vendor/github.com/sergi/go-diff/diffmatchpatch/patch.go deleted file mode 100644 index 223c43c..0000000 --- a/vendor/github.com/sergi/go-diff/diffmatchpatch/patch.go +++ /dev/null @@ -1,556 +0,0 @@ -// Copyright (c) 2012-2016 The go-diff authors. All rights reserved. -// https://github.com/sergi/go-diff -// See the included LICENSE file for license details. -// -// go-diff is a Go implementation of Google's Diff, Match, and Patch library -// Original library is Copyright (c) 2006 Google Inc. -// http://code.google.com/p/google-diff-match-patch/ - -package diffmatchpatch - -import ( - "bytes" - "errors" - "math" - "net/url" - "regexp" - "strconv" - "strings" -) - -// Patch represents one patch operation. -type Patch struct { - diffs []Diff - Start1 int - Start2 int - Length1 int - Length2 int -} - -// String emulates GNU diff's format. -// Header: @@ -382,8 +481,9 @@ -// Indices are printed as 1-based, not 0-based. -func (p *Patch) String() string { - var coords1, coords2 string - - if p.Length1 == 0 { - coords1 = strconv.Itoa(p.Start1) + ",0" - } else if p.Length1 == 1 { - coords1 = strconv.Itoa(p.Start1 + 1) - } else { - coords1 = strconv.Itoa(p.Start1+1) + "," + strconv.Itoa(p.Length1) - } - - if p.Length2 == 0 { - coords2 = strconv.Itoa(p.Start2) + ",0" - } else if p.Length2 == 1 { - coords2 = strconv.Itoa(p.Start2 + 1) - } else { - coords2 = strconv.Itoa(p.Start2+1) + "," + strconv.Itoa(p.Length2) - } - - var text bytes.Buffer - _, _ = text.WriteString("@@ -" + coords1 + " +" + coords2 + " @@\n") - - // Escape the body of the patch with %xx notation. - for _, aDiff := range p.diffs { - switch aDiff.Type { - case DiffInsert: - _, _ = text.WriteString("+") - case DiffDelete: - _, _ = text.WriteString("-") - case DiffEqual: - _, _ = text.WriteString(" ") - } - - _, _ = text.WriteString(strings.Replace(url.QueryEscape(aDiff.Text), "+", " ", -1)) - _, _ = text.WriteString("\n") - } - - return unescaper.Replace(text.String()) -} - -// PatchAddContext increases the context until it is unique, but doesn't let the pattern expand beyond MatchMaxBits. -func (dmp *DiffMatchPatch) PatchAddContext(patch Patch, text string) Patch { - if len(text) == 0 { - return patch - } - - pattern := text[patch.Start2 : patch.Start2+patch.Length1] - padding := 0 - - // Look for the first and last matches of pattern in text. If two different matches are found, increase the pattern length. - for strings.Index(text, pattern) != strings.LastIndex(text, pattern) && - len(pattern) < dmp.MatchMaxBits-2*dmp.PatchMargin { - padding += dmp.PatchMargin - maxStart := max(0, patch.Start2-padding) - minEnd := min(len(text), patch.Start2+patch.Length1+padding) - pattern = text[maxStart:minEnd] - } - // Add one chunk for good luck. - padding += dmp.PatchMargin - - // Add the prefix. - prefix := text[max(0, patch.Start2-padding):patch.Start2] - if len(prefix) != 0 { - patch.diffs = append([]Diff{Diff{DiffEqual, prefix}}, patch.diffs...) - } - // Add the suffix. - suffix := text[patch.Start2+patch.Length1 : min(len(text), patch.Start2+patch.Length1+padding)] - if len(suffix) != 0 { - patch.diffs = append(patch.diffs, Diff{DiffEqual, suffix}) - } - - // Roll back the start points. - patch.Start1 -= len(prefix) - patch.Start2 -= len(prefix) - // Extend the lengths. - patch.Length1 += len(prefix) + len(suffix) - patch.Length2 += len(prefix) + len(suffix) - - return patch -} - -// PatchMake computes a list of patches. -func (dmp *DiffMatchPatch) PatchMake(opt ...interface{}) []Patch { - if len(opt) == 1 { - diffs, _ := opt[0].([]Diff) - text1 := dmp.DiffText1(diffs) - return dmp.PatchMake(text1, diffs) - } else if len(opt) == 2 { - text1 := opt[0].(string) - switch t := opt[1].(type) { - case string: - diffs := dmp.DiffMain(text1, t, true) - if len(diffs) > 2 { - diffs = dmp.DiffCleanupSemantic(diffs) - diffs = dmp.DiffCleanupEfficiency(diffs) - } - return dmp.PatchMake(text1, diffs) - case []Diff: - return dmp.patchMake2(text1, t) - } - } else if len(opt) == 3 { - return dmp.PatchMake(opt[0], opt[2]) - } - return []Patch{} -} - -// patchMake2 computes a list of patches to turn text1 into text2. -// text2 is not provided, diffs are the delta between text1 and text2. -func (dmp *DiffMatchPatch) patchMake2(text1 string, diffs []Diff) []Patch { - // Check for null inputs not needed since null can't be passed in C#. - patches := []Patch{} - if len(diffs) == 0 { - return patches // Get rid of the null case. - } - - patch := Patch{} - charCount1 := 0 // Number of characters into the text1 string. - charCount2 := 0 // Number of characters into the text2 string. - // Start with text1 (prepatchText) and apply the diffs until we arrive at text2 (postpatchText). We recreate the patches one by one to determine context info. - prepatchText := text1 - postpatchText := text1 - - for i, aDiff := range diffs { - if len(patch.diffs) == 0 && aDiff.Type != DiffEqual { - // A new patch starts here. - patch.Start1 = charCount1 - patch.Start2 = charCount2 - } - - switch aDiff.Type { - case DiffInsert: - patch.diffs = append(patch.diffs, aDiff) - patch.Length2 += len(aDiff.Text) - postpatchText = postpatchText[:charCount2] + - aDiff.Text + postpatchText[charCount2:] - case DiffDelete: - patch.Length1 += len(aDiff.Text) - patch.diffs = append(patch.diffs, aDiff) - postpatchText = postpatchText[:charCount2] + postpatchText[charCount2+len(aDiff.Text):] - case DiffEqual: - if len(aDiff.Text) <= 2*dmp.PatchMargin && - len(patch.diffs) != 0 && i != len(diffs)-1 { - // Small equality inside a patch. - patch.diffs = append(patch.diffs, aDiff) - patch.Length1 += len(aDiff.Text) - patch.Length2 += len(aDiff.Text) - } - if len(aDiff.Text) >= 2*dmp.PatchMargin { - // Time for a new patch. - if len(patch.diffs) != 0 { - patch = dmp.PatchAddContext(patch, prepatchText) - patches = append(patches, patch) - patch = Patch{} - // Unlike Unidiff, our patch lists have a rolling context. http://code.google.com/p/google-diff-match-patch/wiki/Unidiff Update prepatch text & pos to reflect the application of the just completed patch. - prepatchText = postpatchText - charCount1 = charCount2 - } - } - } - - // Update the current character count. - if aDiff.Type != DiffInsert { - charCount1 += len(aDiff.Text) - } - if aDiff.Type != DiffDelete { - charCount2 += len(aDiff.Text) - } - } - - // Pick up the leftover patch if not empty. - if len(patch.diffs) != 0 { - patch = dmp.PatchAddContext(patch, prepatchText) - patches = append(patches, patch) - } - - return patches -} - -// PatchDeepCopy returns an array that is identical to a given an array of patches. -func (dmp *DiffMatchPatch) PatchDeepCopy(patches []Patch) []Patch { - patchesCopy := []Patch{} - for _, aPatch := range patches { - patchCopy := Patch{} - for _, aDiff := range aPatch.diffs { - patchCopy.diffs = append(patchCopy.diffs, Diff{ - aDiff.Type, - aDiff.Text, - }) - } - patchCopy.Start1 = aPatch.Start1 - patchCopy.Start2 = aPatch.Start2 - patchCopy.Length1 = aPatch.Length1 - patchCopy.Length2 = aPatch.Length2 - patchesCopy = append(patchesCopy, patchCopy) - } - return patchesCopy -} - -// PatchApply merges a set of patches onto the text. Returns a patched text, as well as an array of true/false values indicating which patches were applied. -func (dmp *DiffMatchPatch) PatchApply(patches []Patch, text string) (string, []bool) { - if len(patches) == 0 { - return text, []bool{} - } - - // Deep copy the patches so that no changes are made to originals. - patches = dmp.PatchDeepCopy(patches) - - nullPadding := dmp.PatchAddPadding(patches) - text = nullPadding + text + nullPadding - patches = dmp.PatchSplitMax(patches) - - x := 0 - // delta keeps track of the offset between the expected and actual location of the previous patch. If there are patches expected at positions 10 and 20, but the first patch was found at 12, delta is 2 and the second patch has an effective expected position of 22. - delta := 0 - results := make([]bool, len(patches)) - for _, aPatch := range patches { - expectedLoc := aPatch.Start2 + delta - text1 := dmp.DiffText1(aPatch.diffs) - var startLoc int - endLoc := -1 - if len(text1) > dmp.MatchMaxBits { - // PatchSplitMax will only provide an oversized pattern in the case of a monster delete. - startLoc = dmp.MatchMain(text, text1[:dmp.MatchMaxBits], expectedLoc) - if startLoc != -1 { - endLoc = dmp.MatchMain(text, - text1[len(text1)-dmp.MatchMaxBits:], expectedLoc+len(text1)-dmp.MatchMaxBits) - if endLoc == -1 || startLoc >= endLoc { - // Can't find valid trailing context. Drop this patch. - startLoc = -1 - } - } - } else { - startLoc = dmp.MatchMain(text, text1, expectedLoc) - } - if startLoc == -1 { - // No match found. :( - results[x] = false - // Subtract the delta for this failed patch from subsequent patches. - delta -= aPatch.Length2 - aPatch.Length1 - } else { - // Found a match. :) - results[x] = true - delta = startLoc - expectedLoc - var text2 string - if endLoc == -1 { - text2 = text[startLoc:int(math.Min(float64(startLoc+len(text1)), float64(len(text))))] - } else { - text2 = text[startLoc:int(math.Min(float64(endLoc+dmp.MatchMaxBits), float64(len(text))))] - } - if text1 == text2 { - // Perfect match, just shove the Replacement text in. - text = text[:startLoc] + dmp.DiffText2(aPatch.diffs) + text[startLoc+len(text1):] - } else { - // Imperfect match. Run a diff to get a framework of equivalent indices. - diffs := dmp.DiffMain(text1, text2, false) - if len(text1) > dmp.MatchMaxBits && float64(dmp.DiffLevenshtein(diffs))/float64(len(text1)) > dmp.PatchDeleteThreshold { - // The end points match, but the content is unacceptably bad. - results[x] = false - } else { - diffs = dmp.DiffCleanupSemanticLossless(diffs) - index1 := 0 - for _, aDiff := range aPatch.diffs { - if aDiff.Type != DiffEqual { - index2 := dmp.DiffXIndex(diffs, index1) - if aDiff.Type == DiffInsert { - // Insertion - text = text[:startLoc+index2] + aDiff.Text + text[startLoc+index2:] - } else if aDiff.Type == DiffDelete { - // Deletion - startIndex := startLoc + index2 - text = text[:startIndex] + - text[startIndex+dmp.DiffXIndex(diffs, index1+len(aDiff.Text))-index2:] - } - } - if aDiff.Type != DiffDelete { - index1 += len(aDiff.Text) - } - } - } - } - } - x++ - } - // Strip the padding off. - text = text[len(nullPadding) : len(nullPadding)+(len(text)-2*len(nullPadding))] - return text, results -} - -// PatchAddPadding adds some padding on text start and end so that edges can match something. -// Intended to be called only from within patchApply. -func (dmp *DiffMatchPatch) PatchAddPadding(patches []Patch) string { - paddingLength := dmp.PatchMargin - nullPadding := "" - for x := 1; x <= paddingLength; x++ { - nullPadding += string(x) - } - - // Bump all the patches forward. - for i := range patches { - patches[i].Start1 += paddingLength - patches[i].Start2 += paddingLength - } - - // Add some padding on start of first diff. - if len(patches[0].diffs) == 0 || patches[0].diffs[0].Type != DiffEqual { - // Add nullPadding equality. - patches[0].diffs = append([]Diff{Diff{DiffEqual, nullPadding}}, patches[0].diffs...) - patches[0].Start1 -= paddingLength // Should be 0. - patches[0].Start2 -= paddingLength // Should be 0. - patches[0].Length1 += paddingLength - patches[0].Length2 += paddingLength - } else if paddingLength > len(patches[0].diffs[0].Text) { - // Grow first equality. - extraLength := paddingLength - len(patches[0].diffs[0].Text) - patches[0].diffs[0].Text = nullPadding[len(patches[0].diffs[0].Text):] + patches[0].diffs[0].Text - patches[0].Start1 -= extraLength - patches[0].Start2 -= extraLength - patches[0].Length1 += extraLength - patches[0].Length2 += extraLength - } - - // Add some padding on end of last diff. - last := len(patches) - 1 - if len(patches[last].diffs) == 0 || patches[last].diffs[len(patches[last].diffs)-1].Type != DiffEqual { - // Add nullPadding equality. - patches[last].diffs = append(patches[last].diffs, Diff{DiffEqual, nullPadding}) - patches[last].Length1 += paddingLength - patches[last].Length2 += paddingLength - } else if paddingLength > len(patches[last].diffs[len(patches[last].diffs)-1].Text) { - // Grow last equality. - lastDiff := patches[last].diffs[len(patches[last].diffs)-1] - extraLength := paddingLength - len(lastDiff.Text) - patches[last].diffs[len(patches[last].diffs)-1].Text += nullPadding[:extraLength] - patches[last].Length1 += extraLength - patches[last].Length2 += extraLength - } - - return nullPadding -} - -// PatchSplitMax looks through the patches and breaks up any which are longer than the maximum limit of the match algorithm. -// Intended to be called only from within patchApply. -func (dmp *DiffMatchPatch) PatchSplitMax(patches []Patch) []Patch { - patchSize := dmp.MatchMaxBits - for x := 0; x < len(patches); x++ { - if patches[x].Length1 <= patchSize { - continue - } - bigpatch := patches[x] - // Remove the big old patch. - patches = append(patches[:x], patches[x+1:]...) - x-- - - Start1 := bigpatch.Start1 - Start2 := bigpatch.Start2 - precontext := "" - for len(bigpatch.diffs) != 0 { - // Create one of several smaller patches. - patch := Patch{} - empty := true - patch.Start1 = Start1 - len(precontext) - patch.Start2 = Start2 - len(precontext) - if len(precontext) != 0 { - patch.Length1 = len(precontext) - patch.Length2 = len(precontext) - patch.diffs = append(patch.diffs, Diff{DiffEqual, precontext}) - } - for len(bigpatch.diffs) != 0 && patch.Length1 < patchSize-dmp.PatchMargin { - diffType := bigpatch.diffs[0].Type - diffText := bigpatch.diffs[0].Text - if diffType == DiffInsert { - // Insertions are harmless. - patch.Length2 += len(diffText) - Start2 += len(diffText) - patch.diffs = append(patch.diffs, bigpatch.diffs[0]) - bigpatch.diffs = bigpatch.diffs[1:] - empty = false - } else if diffType == DiffDelete && len(patch.diffs) == 1 && patch.diffs[0].Type == DiffEqual && len(diffText) > 2*patchSize { - // This is a large deletion. Let it pass in one chunk. - patch.Length1 += len(diffText) - Start1 += len(diffText) - empty = false - patch.diffs = append(patch.diffs, Diff{diffType, diffText}) - bigpatch.diffs = bigpatch.diffs[1:] - } else { - // Deletion or equality. Only take as much as we can stomach. - diffText = diffText[:min(len(diffText), patchSize-patch.Length1-dmp.PatchMargin)] - - patch.Length1 += len(diffText) - Start1 += len(diffText) - if diffType == DiffEqual { - patch.Length2 += len(diffText) - Start2 += len(diffText) - } else { - empty = false - } - patch.diffs = append(patch.diffs, Diff{diffType, diffText}) - if diffText == bigpatch.diffs[0].Text { - bigpatch.diffs = bigpatch.diffs[1:] - } else { - bigpatch.diffs[0].Text = - bigpatch.diffs[0].Text[len(diffText):] - } - } - } - // Compute the head context for the next patch. - precontext = dmp.DiffText2(patch.diffs) - precontext = precontext[max(0, len(precontext)-dmp.PatchMargin):] - - postcontext := "" - // Append the end context for this patch. - if len(dmp.DiffText1(bigpatch.diffs)) > dmp.PatchMargin { - postcontext = dmp.DiffText1(bigpatch.diffs)[:dmp.PatchMargin] - } else { - postcontext = dmp.DiffText1(bigpatch.diffs) - } - - if len(postcontext) != 0 { - patch.Length1 += len(postcontext) - patch.Length2 += len(postcontext) - if len(patch.diffs) != 0 && patch.diffs[len(patch.diffs)-1].Type == DiffEqual { - patch.diffs[len(patch.diffs)-1].Text += postcontext - } else { - patch.diffs = append(patch.diffs, Diff{DiffEqual, postcontext}) - } - } - if !empty { - x++ - patches = append(patches[:x], append([]Patch{patch}, patches[x:]...)...) - } - } - } - return patches -} - -// PatchToText takes a list of patches and returns a textual representation. -func (dmp *DiffMatchPatch) PatchToText(patches []Patch) string { - var text bytes.Buffer - for _, aPatch := range patches { - _, _ = text.WriteString(aPatch.String()) - } - return text.String() -} - -// PatchFromText parses a textual representation of patches and returns a List of Patch objects. -func (dmp *DiffMatchPatch) PatchFromText(textline string) ([]Patch, error) { - patches := []Patch{} - if len(textline) == 0 { - return patches, nil - } - text := strings.Split(textline, "\n") - textPointer := 0 - patchHeader := regexp.MustCompile("^@@ -(\\d+),?(\\d*) \\+(\\d+),?(\\d*) @@$") - - var patch Patch - var sign uint8 - var line string - for textPointer < len(text) { - - if !patchHeader.MatchString(text[textPointer]) { - return patches, errors.New("Invalid patch string: " + text[textPointer]) - } - - patch = Patch{} - m := patchHeader.FindStringSubmatch(text[textPointer]) - - patch.Start1, _ = strconv.Atoi(m[1]) - if len(m[2]) == 0 { - patch.Start1-- - patch.Length1 = 1 - } else if m[2] == "0" { - patch.Length1 = 0 - } else { - patch.Start1-- - patch.Length1, _ = strconv.Atoi(m[2]) - } - - patch.Start2, _ = strconv.Atoi(m[3]) - - if len(m[4]) == 0 { - patch.Start2-- - patch.Length2 = 1 - } else if m[4] == "0" { - patch.Length2 = 0 - } else { - patch.Start2-- - patch.Length2, _ = strconv.Atoi(m[4]) - } - textPointer++ - - for textPointer < len(text) { - if len(text[textPointer]) > 0 { - sign = text[textPointer][0] - } else { - textPointer++ - continue - } - - line = text[textPointer][1:] - line = strings.Replace(line, "+", "%2b", -1) - line, _ = url.QueryUnescape(line) - if sign == '-' { - // Deletion. - patch.diffs = append(patch.diffs, Diff{DiffDelete, line}) - } else if sign == '+' { - // Insertion. - patch.diffs = append(patch.diffs, Diff{DiffInsert, line}) - } else if sign == ' ' { - // Minor equality. - patch.diffs = append(patch.diffs, Diff{DiffEqual, line}) - } else if sign == '@' { - // Start of next patch. - break - } else { - // WTF? - return patches, errors.New("Invalid patch mode '" + string(sign) + "' in: " + string(line)) - } - textPointer++ - } - - patches = append(patches, patch) - } - return patches, nil -} diff --git a/vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go b/vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go deleted file mode 100644 index 265f29c..0000000 --- a/vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2012-2016 The go-diff authors. All rights reserved. -// https://github.com/sergi/go-diff -// See the included LICENSE file for license details. -// -// go-diff is a Go implementation of Google's Diff, Match, and Patch library -// Original library is Copyright (c) 2006 Google Inc. -// http://code.google.com/p/google-diff-match-patch/ - -package diffmatchpatch - -import ( - "strings" - "unicode/utf8" -) - -// unescaper unescapes selected chars for compatibility with JavaScript's encodeURI. -// In speed critical applications this could be dropped since the receiving application will certainly decode these fine. Note that this function is case-sensitive. Thus "%3F" would not be unescaped. But this is ok because it is only called with the output of HttpUtility.UrlEncode which returns lowercase hex. Example: "%3f" -> "?", "%24" -> "$", etc. -var unescaper = strings.NewReplacer( - "%21", "!", "%7E", "~", "%27", "'", - "%28", "(", "%29", ")", "%3B", ";", - "%2F", "/", "%3F", "?", "%3A", ":", - "%40", "@", "%26", "&", "%3D", "=", - "%2B", "+", "%24", "$", "%2C", ",", "%23", "#", "%2A", "*") - -// indexOf returns the first index of pattern in str, starting at str[i]. -func indexOf(str string, pattern string, i int) int { - if i > len(str)-1 { - return -1 - } - if i <= 0 { - return strings.Index(str, pattern) - } - ind := strings.Index(str[i:], pattern) - if ind == -1 { - return -1 - } - return ind + i -} - -// lastIndexOf returns the last index of pattern in str, starting at str[i]. -func lastIndexOf(str string, pattern string, i int) int { - if i < 0 { - return -1 - } - if i >= len(str) { - return strings.LastIndex(str, pattern) - } - _, size := utf8.DecodeRuneInString(str[i:]) - return strings.LastIndex(str[:i+size], pattern) -} - -// runesIndexOf returns the index of pattern in target, starting at target[i]. -func runesIndexOf(target, pattern []rune, i int) int { - if i > len(target)-1 { - return -1 - } - if i <= 0 { - return runesIndex(target, pattern) - } - ind := runesIndex(target[i:], pattern) - if ind == -1 { - return -1 - } - return ind + i -} - -func runesEqual(r1, r2 []rune) bool { - if len(r1) != len(r2) { - return false - } - for i, c := range r1 { - if c != r2[i] { - return false - } - } - return true -} - -// runesIndex is the equivalent of strings.Index for rune slices. -func runesIndex(r1, r2 []rune) int { - last := len(r1) - len(r2) - for i := 0; i <= last; i++ { - if runesEqual(r1[i:i+len(r2)], r2) { - return i - } - } - return -1 -} diff --git a/vendor/github.com/shurcooL/highlight_diff/.travis.yml b/vendor/github.com/shurcooL/highlight_diff/.travis.yml deleted file mode 100644 index 93b1fcd..0000000 --- a/vendor/github.com/shurcooL/highlight_diff/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -sudo: false -language: go -go: - - 1.x - - master -matrix: - allow_failures: - - go: master - fast_finish: true -install: - - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). -script: - - go get -t -v ./... - - diff -u <(echo -n) <(gofmt -d -s .) - - go tool vet . - - go test -v -race ./... diff --git a/vendor/github.com/shurcooL/highlight_diff/README.md b/vendor/github.com/shurcooL/highlight_diff/README.md deleted file mode 100644 index 3671860..0000000 --- a/vendor/github.com/shurcooL/highlight_diff/README.md +++ /dev/null @@ -1,22 +0,0 @@ -highlight_diff -============== - -[![Build Status](https://travis-ci.org/shurcooL/highlight_diff.svg?branch=master)](https://travis-ci.org/shurcooL/highlight_diff) [![GoDoc](https://godoc.org/github.com/shurcooL/highlight_diff?status.svg)](https://godoc.org/github.com/shurcooL/highlight_diff) - -Package highlight_diff provides syntaxhighlight.Printer and syntaxhighlight.Annotator implementations -for diff format. It implements intra-block character-level inner diff highlighting. - -It uses GitHub Flavored Markdown .css class names "gi", "gd", "gu", "gh" for outer blocks, -"x" for inner emphasis blocks. - -Installation ------------- - -```bash -go get -u github.com/shurcooL/highlight_diff -``` - -License -------- - -- [MIT License](https://opensource.org/licenses/mit-license.php) diff --git a/vendor/github.com/shurcooL/highlight_diff/main.go b/vendor/github.com/shurcooL/highlight_diff/main.go deleted file mode 100644 index 16732d5..0000000 --- a/vendor/github.com/shurcooL/highlight_diff/main.go +++ /dev/null @@ -1,179 +0,0 @@ -// Package highlight_diff provides syntaxhighlight.Printer and syntaxhighlight.Annotator implementations -// for diff format. It implements intra-block character-level inner diff highlighting. -// -// It uses GitHub Flavored Markdown .css class names "gi", "gd", "gu", "gh" for outer blocks, -// "x" for inner emphasis blocks. -package highlight_diff - -import ( - "bufio" - "bytes" - "io" - "text/template" - - "github.com/sergi/go-diff/diffmatchpatch" - "github.com/sourcegraph/annotate" - "github.com/sourcegraph/syntaxhighlight" -) - -var gfmDiff = HTMLConfig{ - "", - "gi", - "gd", - "gu", - "gh", -} - -func Print(s *Scanner, w io.Writer) error { - var p syntaxhighlight.Printer = HTMLPrinter(gfmDiff) - - for s.Scan() { - tok, kind := s.Token() - err := p.Print(w, kind, string(tok)) - if err != nil { - return err - } - } - - return s.Err() -} - -type HTMLConfig []string - -type HTMLPrinter HTMLConfig - -func (p HTMLPrinter) Print(w io.Writer, kind syntaxhighlight.Kind, tokText string) error { - class := HTMLConfig(p)[kind] - if class != "" { - _, err := w.Write([]byte(``)) - if err != nil { - return err - } - } - template.HTMLEscape(w, []byte(tokText)) - if class != "" { - _, err := w.Write([]byte(``)) - if err != nil { - return err - } - } - return nil -} - -type Scanner struct { - br *bufio.Reader - line []byte -} - -func NewScanner(src []byte) *Scanner { - r := bytes.NewReader(src) - return &Scanner{br: bufio.NewReader(r)} -} - -func (s *Scanner) Scan() bool { - var err error - s.line, err = s.br.ReadBytes('\n') - return err == nil -} - -func (s *Scanner) Token() ([]byte, syntaxhighlight.Kind) { - var kind syntaxhighlight.Kind - switch { - // The backslash is to detect "\ No newline at end of file" lines. - case len(s.line) == 0 || s.line[0] == ' ' || s.line[0] == '\\': - kind = 0 - case s.line[0] == '+': - //kind = 1 - kind = 0 - case s.line[0] == '-': - //kind = 2 - kind = 0 - case s.line[0] == '@': - kind = 3 - default: - kind = 4 - } - return s.line, kind -} - -func (s *Scanner) Err() error { - return nil -} - -// --- - -type HTMLAnnotator HTMLConfig - -func (a HTMLAnnotator) Annotate(start int, kind syntaxhighlight.Kind, tokText string) (*annotate.Annotation, error) { - class := HTMLConfig(a)[kind] - if class != "" { - left := []byte(``)...) - return &annotate.Annotation{ - Start: start, End: start + len(tokText), - Left: left, Right: []byte(""), - }, nil - } - return nil, nil -} - -func Annotate(src []byte) (annotate.Annotations, error) { - var a syntaxhighlight.Annotator = HTMLAnnotator(gfmDiff) - s := NewScanner(src) - - var anns annotate.Annotations - read := 0 - for s.Scan() { - tok, kind := s.Token() - ann, err := a.Annotate(read, kind, string(tok)) - if err != nil { - return nil, err - } - read += len(tok) - if ann != nil { - anns = append(anns, ann) - } - } - - if err := s.Err(); err != nil { - return nil, err - } - - return anns, nil -} - -// --- - -func HighlightedDiffFunc(leftContent, rightContent string, segments *[2][]*annotate.Annotation, offsets [2]int) { - dmp := diffmatchpatch.New() - diffs := dmp.DiffMain(leftContent, rightContent, true) - - for side := range *segments { - offset := offsets[side] - - for _, diff := range diffs { - if side == 0 && diff.Type == -1 { - (*segments)[side] = append((*segments)[side], &annotate.Annotation{Start: offset, End: offset + len(diff.Text), Left: []byte(``), Right: []byte(``), WantInner: 1}) - offset += len(diff.Text) - } - if side == 1 && diff.Type == +1 { - (*segments)[side] = append((*segments)[side], &annotate.Annotation{Start: offset, End: offset + len(diff.Text), Left: []byte(``), Right: []byte(``), WantInner: 1}) - offset += len(diff.Text) - } - if diff.Type == 0 { - offset += len(diff.Text) - } - } - } -} diff --git a/vendor/github.com/shurcooL/highlight_go/.travis.yml b/vendor/github.com/shurcooL/highlight_go/.travis.yml deleted file mode 100644 index 93b1fcd..0000000 --- a/vendor/github.com/shurcooL/highlight_go/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -sudo: false -language: go -go: - - 1.x - - master -matrix: - allow_failures: - - go: master - fast_finish: true -install: - - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). -script: - - go get -t -v ./... - - diff -u <(echo -n) <(gofmt -d -s .) - - go tool vet . - - go test -v -race ./... diff --git a/vendor/github.com/shurcooL/highlight_go/README.md b/vendor/github.com/shurcooL/highlight_go/README.md deleted file mode 100644 index 5467995..0000000 --- a/vendor/github.com/shurcooL/highlight_go/README.md +++ /dev/null @@ -1,18 +0,0 @@ -highlight_go -============ - -[![Build Status](https://travis-ci.org/shurcooL/highlight_go.svg?branch=master)](https://travis-ci.org/shurcooL/highlight_go) [![GoDoc](https://godoc.org/github.com/shurcooL/highlight_go?status.svg)](https://godoc.org/github.com/shurcooL/highlight_go) - -Package highlight_go provides a syntax highlighter for Go, using go/scanner. - -Installation ------------- - -```bash -go get -u github.com/shurcooL/highlight_go -``` - -License -------- - -- [MIT License](https://opensource.org/licenses/mit-license.php) diff --git a/vendor/github.com/shurcooL/highlight_go/main.go b/vendor/github.com/shurcooL/highlight_go/main.go deleted file mode 100644 index 5befd49..0000000 --- a/vendor/github.com/shurcooL/highlight_go/main.go +++ /dev/null @@ -1,127 +0,0 @@ -// Package highlight_go provides a syntax highlighter for Go, using go/scanner. -package highlight_go - -import ( - "go/scanner" - "go/token" - "io" - - "github.com/sourcegraph/annotate" - "github.com/sourcegraph/syntaxhighlight" -) - -// TokenKind returns a syntaxhighlight token kind value for the given tok and lit. -func TokenKind(tok token.Token, lit string) syntaxhighlight.Kind { - switch { - case tok.IsKeyword() || (tok.IsOperator() && tok <= token.ELLIPSIS): - return syntaxhighlight.Keyword - - // Literals. - case tok == token.INT || tok == token.FLOAT || tok == token.IMAG || tok == token.CHAR: - return syntaxhighlight.Decimal - case tok == token.STRING: - return syntaxhighlight.String - case lit == "true" || lit == "false" || lit == "iota" || lit == "nil": - return syntaxhighlight.Literal - - case tok == token.COMMENT: - return syntaxhighlight.Comment - default: - return syntaxhighlight.Plaintext - } -} - -func Print(src []byte, w io.Writer, p syntaxhighlight.Printer) error { - var s scanner.Scanner - fset := token.NewFileSet() - file := fset.AddFile("", fset.Base(), len(src)) - s.Init(file, src, nil, scanner.ScanComments) - - var lastOffset int - - for { - pos, tok, lit := s.Scan() - if tok == token.EOF { - break - } - - var tokString string - if lit != "" { - tokString = lit - } else { - tokString = tok.String() - } - - // TODO: Clean this up. - //if tok == token.SEMICOLON { - if tok == token.SEMICOLON && lit == "\n" { - continue - } - - // Whitespace between previous and current tokens. - offset := fset.Position(pos).Offset - if whitespace := string(src[lastOffset:offset]); whitespace != "" { - err := p.Print(w, syntaxhighlight.Whitespace, whitespace) - if err != nil { - return err - } - } - lastOffset = offset + len(tokString) - - err := p.Print(w, TokenKind(tok, lit), tokString) - if err != nil { - return err - } - } - - // Print final whitespace after the last token. - if whitespace := string(src[lastOffset:]); whitespace != "" { - err := p.Print(w, syntaxhighlight.Whitespace, whitespace) - if err != nil { - return err - } - } - - return nil -} - -func Annotate(src []byte, a syntaxhighlight.Annotator) (annotate.Annotations, error) { - var s scanner.Scanner - fset := token.NewFileSet() - file := fset.AddFile("", fset.Base(), len(src)) - s.Init(file, src, nil, scanner.ScanComments) - - var anns annotate.Annotations - - for { - pos, tok, lit := s.Scan() - if tok == token.EOF { - break - } - - offset := fset.Position(pos).Offset - - var tokString string - if lit != "" { - tokString = lit - } else { - tokString = tok.String() - } - - // TODO: Clean this up. - //if tok == token.SEMICOLON { - if tok == token.SEMICOLON && lit == "\n" { - continue - } - - ann, err := a.Annotate(offset, TokenKind(tok, lit), tokString) - if err != nil { - return nil, err - } - if ann != nil { - anns = append(anns, ann) - } - } - - return anns, nil -} diff --git a/vendor/github.com/shurcooL/octicon/.travis.yml b/vendor/github.com/shurcooL/octicon/.travis.yml deleted file mode 100644 index 93b1fcd..0000000 --- a/vendor/github.com/shurcooL/octicon/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -sudo: false -language: go -go: - - 1.x - - master -matrix: - allow_failures: - - go: master - fast_finish: true -install: - - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). -script: - - go get -t -v ./... - - diff -u <(echo -n) <(gofmt -d -s .) - - go tool vet . - - go test -v -race ./... diff --git a/vendor/github.com/shurcooL/octicon/README.md b/vendor/github.com/shurcooL/octicon/README.md deleted file mode 100644 index 8648142..0000000 --- a/vendor/github.com/shurcooL/octicon/README.md +++ /dev/null @@ -1,18 +0,0 @@ -octicon -======= - -[![Build Status](https://travis-ci.org/shurcooL/octicon.svg?branch=master)](https://travis-ci.org/shurcooL/octicon) [![GoDoc](https://godoc.org/github.com/shurcooL/octicon?status.svg)](https://godoc.org/github.com/shurcooL/octicon) - -Package octicon provides GitHub Octicons. - -Installation ------------- - -```bash -go get -u github.com/shurcooL/octicon -``` - -License -------- - -- [MIT License](https://opensource.org/licenses/mit-license.php) diff --git a/vendor/github.com/shurcooL/octicon/doc.go b/vendor/github.com/shurcooL/octicon/doc.go deleted file mode 100644 index 675817e..0000000 --- a/vendor/github.com/shurcooL/octicon/doc.go +++ /dev/null @@ -1,11 +0,0 @@ -// Package octicon provides GitHub Octicons. -package octicon - -//go:generate curl -L -o octicons.tgz https://registry.npmjs.org/octicons/-/octicons-7.3.0.tgz -//go:generate tar -xf octicons.tgz package/build/data.json -//go:generate rm octicons.tgz -//go:generate mv package/build/data.json _data/data.json -//go:generate rmdir -p package/build -//go:generate go run generate.go -o octicon.go -//go:generate unconvert -apply -//go:generate gofmt -w -s octicon.go diff --git a/vendor/github.com/shurcooL/octicon/generate.go b/vendor/github.com/shurcooL/octicon/generate.go deleted file mode 100644 index 60271b3..0000000 --- a/vendor/github.com/shurcooL/octicon/generate.go +++ /dev/null @@ -1,165 +0,0 @@ -// +build ignore - -package main - -import ( - "bytes" - "encoding/json" - "flag" - "fmt" - "io" - "log" - "os" - "path/filepath" - "sort" - "strings" - - "dmitri.shuralyov.com/text/kebabcase" - "github.com/shurcooL/go-goon" - "golang.org/x/net/html" - "golang.org/x/net/html/atom" -) - -var oFlag = flag.String("o", "", "write output to `file` (default standard output)") - -func main() { - flag.Parse() - - err := run() - if err != nil { - log.Fatalln(err) - } -} - -func run() error { - f, err := os.Open(filepath.Join("_data", "data.json")) - if err != nil { - return err - } - defer f.Close() - - var octicons map[string]octicon - err = json.NewDecoder(f).Decode(&octicons) - if err != nil { - return err - } - - var names []string - for name := range octicons { - names = append(names, name) - } - sort.Strings(names) - - var buf bytes.Buffer - fmt.Fprint(&buf, `package octicon - -import ( - "strconv" - - "golang.org/x/net/html" - "golang.org/x/net/html/atom" -) - -// Icon returns the named Octicon SVG node. -// It returns nil if name is not a valid Octicon symbol name. -func Icon(name string) *html.Node { - switch name { -`) - for _, name := range names { - fmt.Fprintf(&buf, " case %q:\n return %v()\n", name, kebabcase.Parse(name).ToMixedCaps()) - } - fmt.Fprint(&buf, ` default: - return nil - } -} - -// SetSize sets size of icon, and returns a reference to it. -func SetSize(icon *html.Node, size int) *html.Node { - icon.Attr[`, widthAttrIndex, `].Val = strconv.Itoa(size) - icon.Attr[`, heightAttrIndex, `].Val = strconv.Itoa(size) - return icon -} -`) - - // Write all individual Octicon functions. - for _, name := range names { - generateAndWriteOcticon(&buf, octicons, name) - } - - var w io.Writer - switch *oFlag { - case "": - w = os.Stdout - default: - f, err := os.Create(*oFlag) - if err != nil { - return err - } - defer f.Close() - w = f - } - - _, err = w.Write(buf.Bytes()) - return err -} - -type octicon struct { - Path string - Width int - Height int -} - -func generateAndWriteOcticon(w io.Writer, octicons map[string]octicon, name string) { - svgXML := generateOcticon(octicons[name]) - - svg := parseOcticon(svgXML) - // Clear these fields to remove cycles in the data structure, since go-goon - // cannot print those in a way that's valid Go code. The generated data structure - // is not a proper *html.Node with all fields set, but it's enough for rendering - // to be successful. - svg.LastChild = nil - svg.FirstChild.Parent = nil - - fmt.Fprintln(w) - fmt.Fprintf(w, "// %s returns an %q Octicon SVG node.\n", kebabcase.Parse(name).ToMixedCaps(), name) - fmt.Fprintf(w, "func %s() *html.Node {\n", kebabcase.Parse(name).ToMixedCaps()) - fmt.Fprint(w, " return ") - goon.Fdump(w, svg) - fmt.Fprintln(w, "}") -} - -// These constants are used during generation of SetSize function. -// Keep them in sync with generateOcticon below. -const ( - widthAttrIndex = 1 - heightAttrIndex = 2 -) - -func generateOcticon(o octicon) (svgXML string) { - path := o.Path - if strings.HasPrefix(path, `%s`, - o.Width, o.Height, o.Width, o.Height, path) -} - -func parseOcticon(svgXML string) *html.Node { - e, err := html.ParseFragment(strings.NewReader(svgXML), nil) - if err != nil { - panic(fmt.Errorf("internal error: html.ParseFragment failed: %v", err)) - } - svg := e[0].LastChild.FirstChild // TODO: Is there a better way to just get the ... element directly, skipping ...? - svg.Parent.RemoveChild(svg) - for i, attr := range svg.Attr { - if attr.Namespace == "" && attr.Key == "width" { - svg.Attr[i].Val = "16" - break - } - } - svg.Attr = append(svg.Attr, html.Attribute{Key: atom.Style.String(), Val: `fill: currentColor; vertical-align: top;`}) - return svg -} diff --git a/vendor/github.com/shurcooL/octicon/octicon.go b/vendor/github.com/shurcooL/octicon/octicon.go deleted file mode 100644 index 9815022..0000000 --- a/vendor/github.com/shurcooL/octicon/octicon.go +++ /dev/null @@ -1,10821 +0,0 @@ -package octicon - -import ( - "strconv" - - "golang.org/x/net/html" - "golang.org/x/net/html/atom" -) - -// Icon returns the named Octicon SVG node. -// It returns nil if name is not a valid Octicon symbol name. -func Icon(name string) *html.Node { - switch name { - case "alert": - return Alert() - case "archive": - return Archive() - case "arrow-down": - return ArrowDown() - case "arrow-left": - return ArrowLeft() - case "arrow-right": - return ArrowRight() - case "arrow-small-down": - return ArrowSmallDown() - case "arrow-small-left": - return ArrowSmallLeft() - case "arrow-small-right": - return ArrowSmallRight() - case "arrow-small-up": - return ArrowSmallUp() - case "arrow-up": - return ArrowUp() - case "beaker": - return Beaker() - case "bell": - return Bell() - case "bold": - return Bold() - case "book": - return Book() - case "bookmark": - return Bookmark() - case "briefcase": - return Briefcase() - case "broadcast": - return Broadcast() - case "browser": - return Browser() - case "bug": - return Bug() - case "calendar": - return Calendar() - case "check": - return Check() - case "checklist": - return Checklist() - case "chevron-down": - return ChevronDown() - case "chevron-left": - return ChevronLeft() - case "chevron-right": - return ChevronRight() - case "chevron-up": - return ChevronUp() - case "circle-slash": - return CircleSlash() - case "circuit-board": - return CircuitBoard() - case "clippy": - return Clippy() - case "clock": - return Clock() - case "cloud-download": - return CloudDownload() - case "cloud-upload": - return CloudUpload() - case "code": - return Code() - case "comment": - return Comment() - case "comment-discussion": - return CommentDiscussion() - case "credit-card": - return CreditCard() - case "dash": - return Dash() - case "dashboard": - return Dashboard() - case "database": - return Database() - case "desktop-download": - return DesktopDownload() - case "device-camera": - return DeviceCamera() - case "device-camera-video": - return DeviceCameraVideo() - case "device-desktop": - return DeviceDesktop() - case "device-mobile": - return DeviceMobile() - case "diff": - return Diff() - case "diff-added": - return DiffAdded() - case "diff-ignored": - return DiffIgnored() - case "diff-modified": - return DiffModified() - case "diff-removed": - return DiffRemoved() - case "diff-renamed": - return DiffRenamed() - case "ellipsis": - return Ellipsis() - case "eye": - return Eye() - case "file": - return File() - case "file-binary": - return FileBinary() - case "file-code": - return FileCode() - case "file-directory": - return FileDirectory() - case "file-media": - return FileMedia() - case "file-pdf": - return FilePdf() - case "file-submodule": - return FileSubmodule() - case "file-symlink-directory": - return FileSymlinkDirectory() - case "file-symlink-file": - return FileSymlinkFile() - case "file-zip": - return FileZip() - case "flame": - return Flame() - case "fold": - return Fold() - case "gear": - return Gear() - case "gift": - return Gift() - case "gist": - return Gist() - case "gist-secret": - return GistSecret() - case "git-branch": - return GitBranch() - case "git-commit": - return GitCommit() - case "git-compare": - return GitCompare() - case "git-merge": - return GitMerge() - case "git-pull-request": - return GitPullRequest() - case "globe": - return Globe() - case "grabber": - return Grabber() - case "graph": - return Graph() - case "heart": - return Heart() - case "history": - return History() - case "home": - return Home() - case "horizontal-rule": - return HorizontalRule() - case "hubot": - return Hubot() - case "inbox": - return Inbox() - case "info": - return Info() - case "issue-closed": - return IssueClosed() - case "issue-opened": - return IssueOpened() - case "issue-reopened": - return IssueReopened() - case "italic": - return Italic() - case "jersey": - return Jersey() - case "kebab-horizontal": - return KebabHorizontal() - case "kebab-vertical": - return KebabVertical() - case "key": - return Key() - case "keyboard": - return Keyboard() - case "law": - return Law() - case "light-bulb": - return LightBulb() - case "link": - return Link() - case "link-external": - return LinkExternal() - case "list-ordered": - return ListOrdered() - case "list-unordered": - return ListUnordered() - case "location": - return Location() - case "lock": - return Lock() - case "logo-gist": - return LogoGist() - case "logo-github": - return LogoGitHub() - case "mail": - return Mail() - case "mail-read": - return MailRead() - case "mark-github": - return MarkGitHub() - case "markdown": - return Markdown() - case "megaphone": - return Megaphone() - case "mention": - return Mention() - case "milestone": - return Milestone() - case "mirror": - return Mirror() - case "mortar-board": - return MortarBoard() - case "mute": - return Mute() - case "no-newline": - return NoNewline() - case "note": - return Note() - case "octoface": - return Octoface() - case "organization": - return Organization() - case "package": - return Package() - case "paintcan": - return Paintcan() - case "pencil": - return Pencil() - case "person": - return Person() - case "pin": - return Pin() - case "plug": - return Plug() - case "plus": - return Plus() - case "plus-small": - return PlusSmall() - case "primitive-dot": - return PrimitiveDot() - case "primitive-square": - return PrimitiveSquare() - case "project": - return Project() - case "pulse": - return Pulse() - case "question": - return Question() - case "quote": - return Quote() - case "radio-tower": - return RadioTower() - case "reply": - return Reply() - case "repo": - return Repo() - case "repo-clone": - return RepoClone() - case "repo-force-push": - return RepoForcePush() - case "repo-forked": - return RepoForked() - case "repo-pull": - return RepoPull() - case "repo-push": - return RepoPush() - case "report": - return Report() - case "rocket": - return Rocket() - case "rss": - return RSS() - case "ruby": - return Ruby() - case "screen-full": - return ScreenFull() - case "screen-normal": - return ScreenNormal() - case "search": - return Search() - case "server": - return Server() - case "settings": - return Settings() - case "shield": - return Shield() - case "sign-in": - return SignIn() - case "sign-out": - return SignOut() - case "smiley": - return Smiley() - case "squirrel": - return Squirrel() - case "star": - return Star() - case "stop": - return Stop() - case "sync": - return Sync() - case "tag": - return Tag() - case "tasklist": - return Tasklist() - case "telescope": - return Telescope() - case "terminal": - return Terminal() - case "text-size": - return TextSize() - case "three-bars": - return ThreeBars() - case "thumbsdown": - return Thumbsdown() - case "thumbsup": - return Thumbsup() - case "tools": - return Tools() - case "trashcan": - return Trashcan() - case "triangle-down": - return TriangleDown() - case "triangle-left": - return TriangleLeft() - case "triangle-right": - return TriangleRight() - case "triangle-up": - return TriangleUp() - case "unfold": - return Unfold() - case "unmute": - return Unmute() - case "unverified": - return Unverified() - case "verified": - return Verified() - case "versions": - return Versions() - case "watch": - return Watch() - case "x": - return X() - case "zap": - return Zap() - default: - return nil - } -} - -// SetSize sets size of icon, and returns a reference to it. -func SetSize(icon *html.Node, size int) *html.Node { - icon.Attr[1].Val = strconv.Itoa(size) - icon.Attr[2].Val = strconv.Itoa(size) - return icon -} - -// Alert returns an "alert" Octicon SVG node. -func Alert() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Archive returns an "archive" Octicon SVG node. -func Archive() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13 2H1v2h12V2zM0 4a1 1 0 0 0 1 1v9a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H1a1 1 0 0 0-1 1v2zm2 1h10v9H2V5zm2 3h6V7H4v1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ArrowDown returns an "arrow-down" Octicon SVG node. -func ArrowDown() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7 7V3H3v4H0l5 6 5-6H7z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ArrowLeft returns an "arrow-left" Octicon SVG node. -func ArrowLeft() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 3L0 8l6 5v-3h4V6H6V3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ArrowRight returns an "arrow-right" Octicon SVG node. -func ArrowRight() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10 8L4 3v3H0v4h4v3l6-5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ArrowSmallDown returns an "arrow-small-down" Octicon SVG node. -func ArrowSmallDown() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4 7V5H2v2H0l3 4 3-4H4z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 6 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ArrowSmallLeft returns an "arrow-small-left" Octicon SVG node. -func ArrowSmallLeft() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4 7V5L0 8l4 3V9h2V7H4z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 6 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ArrowSmallRight returns an "arrow-small-right" Octicon SVG node. -func ArrowSmallRight() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 8L2 5v2H0v2h2v2l4-3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 6 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ArrowSmallUp returns an "arrow-small-up" Octicon SVG node. -func ArrowSmallUp() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M3 5L0 9h2v2h2V9h2L3 5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 6 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ArrowUp returns an "arrow-up" Octicon SVG node. -func ArrowUp() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M5 3L0 9h3v4h4V9h3L5 3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Beaker returns an "beaker" Octicon SVG node. -func Beaker() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M14.38 14.59L11 7V3h1V2H3v1h1v4L.63 14.59A1 1 0 0 0 1.54 16h11.94c.72 0 1.2-.75.91-1.41h-.01zM3.75 10L5 7V3h5v4l1.25 3h-7.5zM8 8h1v1H8V8zM7 7H6V6h1v1zm0-3h1v1H7V4zm0-3H6V0h1v1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Bell returns an "bell" Octicon SVG node. -func Bell() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13.99 11.991v1H0v-1l.73-.58c.769-.769.809-2.547 1.189-4.416.77-3.767 4.077-4.996 4.077-4.996 0-.55.45-1 .999-1 .55 0 1 .45 1 1 0 0 3.387 1.229 4.156 4.996.38 1.879.42 3.657 1.19 4.417l.659.58h-.01zM6.995 15.99c1.11 0 1.999-.89 1.999-1.999H4.996c0 1.11.89 1.999 1.999 1.999z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Bold returns an "bold" Octicon SVG node. -func Bold() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M1 2h3.83c2.48 0 4.3.75 4.3 2.95 0 1.14-.63 2.23-1.67 2.61v.06c1.33.3 2.3 1.23 2.3 2.86 0 2.39-1.97 3.52-4.61 3.52H1V2zm3.66 4.95c1.67 0 2.38-.66 2.38-1.69 0-1.17-.78-1.61-2.34-1.61H3.13v3.3h1.53zm.27 5.39c1.77 0 2.75-.64 2.75-1.98 0-1.27-.95-1.81-2.75-1.81h-1.8v3.8h1.8v-.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Book returns an "book" Octicon SVG node. -func Book() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Bookmark returns an "bookmark" Octicon SVG node. -func Bookmark() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M9 0H1C.27 0 0 .27 0 1v15l5-3.09L10 16V1c0-.73-.27-1-1-1zm-.78 4.25L6.36 5.61l.72 2.16c.06.22-.02.28-.2.17L5 6.6 3.12 7.94c-.19.11-.25.05-.2-.17l.72-2.16-1.86-1.36c-.17-.16-.14-.23.09-.23l2.3-.03.7-2.16h.25l.7 2.16 2.3.03c.23 0 .27.08.09.23h.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Briefcase returns an "briefcase" Octicon SVG node. -func Briefcase() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M9 4V3c0-.55-.45-1-1-1H6c-.55 0-1 .45-1 1v1H1c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1H9zM6 3h2v1H6V3zm7 6H8v1H6V9H1V5h1v3h10V5h1v4z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Broadcast returns an "broadcast" Octicon SVG node. -func Broadcast() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M9 9H8c.55 0 1-.45 1-1V7c0-.55-.45-1-1-1H7c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1H6c-.55 0-1 .45-1 1v2h1v3c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-3h1v-2c0-.55-.45-1-1-1zM7 7h1v1H7V7zm2 4H8v4H7v-4H6v-1h3v1zm2.09-3.5c0-1.98-1.61-3.59-3.59-3.59A3.593 3.593 0 0 0 4 8.31v1.98c-.61-.77-1-1.73-1-2.8 0-2.48 2.02-4.5 4.5-4.5S12 5.01 12 7.49c0 1.06-.39 2.03-1 2.8V8.31c.06-.27.09-.53.09-.81zm3.91 0c0 2.88-1.63 5.38-4 6.63v-1.05a6.553 6.553 0 0 0 3.09-5.58A6.59 6.59 0 0 0 7.5.91 6.59 6.59 0 0 0 .91 7.5c0 2.36 1.23 4.42 3.09 5.58v1.05A7.497 7.497 0 0 1 7.5 0C11.64 0 15 3.36 15 7.5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Browser returns an "browser" Octicon SVG node. -func Browser() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M5 3h1v1H5V3zM3 3h1v1H3V3zM1 3h1v1H1V3zm12 10H1V5h12v8zm0-9H7V3h6v1zm1-1c0-.55-.45-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Bug returns an "bug" Octicon SVG node. -func Bug() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M11 10h3V9h-3V8l3.17-1.03-.34-.94L11 7V6c0-.55-.45-1-1-1V4c0-.48-.36-.88-.83-.97L10.2 2H12V1H9.8l-2 2h-.59L5.2 1H3v1h1.8l1.03 1.03C5.36 3.12 5 3.51 5 4v1c-.55 0-1 .45-1 1v1l-2.83-.97-.34.94L4 8v1H1v1h3v1L.83 12.03l.34.94L4 12v1c0 .55.45 1 1 1h1l1-1V6h1v7l1 1h1c.55 0 1-.45 1-1v-1l2.83.97.34-.94L11 11v-1zM9 5H6V4h3v1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Calendar returns an "calendar" Octicon SVG node. -func Calendar() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13 2h-1v1.5c0 .28-.22.5-.5.5h-2c-.28 0-.5-.22-.5-.5V2H6v1.5c0 .28-.22.5-.5.5h-2c-.28 0-.5-.22-.5-.5V2H2c-.55 0-1 .45-1 1v11c0 .55.45 1 1 1h11c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm0 12H2V5h11v9zM5 3H4V1h1v2zm6 0h-1V1h1v2zM6 7H5V6h1v1zm2 0H7V6h1v1zm2 0H9V6h1v1zm2 0h-1V6h1v1zM4 9H3V8h1v1zm2 0H5V8h1v1zm2 0H7V8h1v1zm2 0H9V8h1v1zm2 0h-1V8h1v1zm-8 2H3v-1h1v1zm2 0H5v-1h1v1zm2 0H7v-1h1v1zm2 0H9v-1h1v1zm2 0h-1v-1h1v1zm-8 2H3v-1h1v1zm2 0H5v-1h1v1zm2 0H7v-1h1v1zm2 0H9v-1h1v1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Check returns an "check" Octicon SVG node. -func Check() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5L12 5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Checklist returns an "checklist" Octicon SVG node. -func Checklist() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M16 8.5l-6 6-3-3L8.5 10l1.5 1.5L14.5 7 16 8.5zM5.7 12.2l.8.8H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h7c.55 0 1 .45 1 1v6.5l-.8-.8c-.39-.39-1.03-.39-1.42 0L5.7 10.8a.996.996 0 0 0 0 1.41v-.01zM4 4h5V3H4v1zm0 2h5V5H4v1zm0 2h3V7H4v1zM3 9H2v1h1V9zm0-2H2v1h1V7zm0-2H2v1h1V5zm0-2H2v1h1V3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ChevronDown returns an "chevron-down" Octicon SVG node. -func ChevronDown() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M5 11L0 6l1.5-1.5L5 8.25 8.5 4.5 10 6l-5 5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ChevronLeft returns an "chevron-left" Octicon SVG node. -func ChevronLeft() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M5.5 3L7 4.5 3.25 8 7 11.5 5.5 13l-5-5 5-5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 8 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ChevronRight returns an "chevron-right" Octicon SVG node. -func ChevronRight() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7.5 8l-5 5L1 11.5 4.75 8 1 4.5 2.5 3l5 5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 8 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ChevronUp returns an "chevron-up" Octicon SVG node. -func ChevronUp() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10 10l-1.5 1.5L5 7.75 1.5 11.5 0 10l5-5 5 5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// CircleSlash returns an "circle-slash" Octicon SVG node. -func CircleSlash() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm0 1.3c1.3 0 2.5.44 3.47 1.17l-8 8A5.755 5.755 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zm0 11.41c-1.3 0-2.5-.44-3.47-1.17l8-8c.73.97 1.17 2.17 1.17 3.47 0 3.14-2.56 5.7-5.7 5.7z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// CircuitBoard returns an "circuit-board" Octicon SVG node. -func CircuitBoard() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M3 5c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1zm8 0c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1zm0 6c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1zm2-10H5v2.17c.36.19.64.47.83.83h2.34c.42-.78 1.33-1.28 2.34-1.05.75.19 1.36.8 1.53 1.55.31 1.38-.72 2.59-2.05 2.59-.8 0-1.48-.44-1.83-1.09H5.83c-.42.8-1.33 1.28-2.34 1.03-.73-.17-1.34-.78-1.52-1.52C1.72 4.49 2.2 3.59 3 3.17V1H1c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1l5-5h2.17c.42-.78 1.33-1.28 2.34-1.05.75.19 1.36.8 1.53 1.55.31 1.38-.72 2.59-2.05 2.59-.8 0-1.48-.44-1.83-1.09H6.99L4 15h9c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Clippy returns an "clippy" Octicon SVG node. -func Clippy() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Clock returns an "clock" Octicon SVG node. -func Clock() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8 8h3v2H7c-.55 0-1-.45-1-1V4h2v4zM7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// CloudDownload returns an "cloud-download" Octicon SVG node. -func CloudDownload() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M9 12h2l-3 3-3-3h2V7h2v5zm3-8c0-.44-.91-3-4.5-3C5.08 1 3 2.92 3 5 1.02 5 0 6.52 0 8c0 1.53 1 3 3 3h3V9.7H3C1.38 9.7 1.3 8.28 1.3 8c0-.17.05-1.7 1.7-1.7h1.3V5c0-1.39 1.56-2.7 3.2-2.7 2.55 0 3.13 1.55 3.2 1.8v1.2H12c.81 0 2.7.22 2.7 2.2 0 2.09-2.25 2.2-2.7 2.2h-2V11h2c2.08 0 4-1.16 4-3.5C16 5.06 14.08 4 12 4z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// CloudUpload returns an "cloud-upload" Octicon SVG node. -func CloudUpload() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7 9H5l3-3 3 3H9v5H7V9zm5-4c0-.44-.91-3-4.5-3C5.08 2 3 3.92 3 6 1.02 6 0 7.52 0 9c0 1.53 1 3 3 3h3v-1.3H3c-1.62 0-1.7-1.42-1.7-1.7 0-.17.05-1.7 1.7-1.7h1.3V6c0-1.39 1.56-2.7 3.2-2.7 2.55 0 3.13 1.55 3.2 1.8v1.2H12c.81 0 2.7.22 2.7 2.2 0 2.09-2.25 2.2-2.7 2.2h-2V12h2c2.08 0 4-1.16 4-3.5C16 6.06 14.08 5 12 5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Code returns an "code" Octicon SVG node. -func Code() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Comment returns an "comment" Octicon SVG node. -func Comment() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M14 1H2c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h2v3.5L7.5 11H14c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1zm0 9H7l-2 2v-2H2V2h12v8z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// CommentDiscussion returns an "comment-discussion" Octicon SVG node. -func CommentDiscussion() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M15 1H6c-.55 0-1 .45-1 1v2H1c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h1v3l3-3h4c.55 0 1-.45 1-1V9h1l3 3V9h1c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1zM9 11H4.5L3 12.5V11H1V5h4v3c0 .55.45 1 1 1h3v2zm6-3h-2v1.5L11.5 8H6V2h9v6z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// CreditCard returns an "credit-card" Octicon SVG node. -func CreditCard() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M12 9H2V8h10v1zm4-6v9c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h14c.55 0 1 .45 1 1zm-1 3H1v6h14V6zm0-3H1v1h14V3zm-9 7H2v1h4v-1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Dash returns an "dash" Octicon SVG node. -func Dash() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M0 7v2h8V7H0z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 8 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Dashboard returns an "dashboard" Octicon SVG node. -func Dashboard() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M9 5H8V4h1v1zm4 3h-1v1h1V8zM6 5H5v1h1V5zM5 8H4v1h1V8zm11-5.5l-.5-.5L9 7c-.06-.02-1 0-1 0-.55 0-1 .45-1 1v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-.92l6-5.58zm-1.59 4.09c.19.61.3 1.25.3 1.91 0 3.42-2.78 6.2-6.2 6.2-3.42 0-6.21-2.78-6.21-6.2 0-3.42 2.78-6.2 6.2-6.2 1.2 0 2.31.34 3.27.94l.94-.94A7.459 7.459 0 0 0 8.51 1C4.36 1 1 4.36 1 8.5 1 12.64 4.36 16 8.5 16c4.14 0 7.5-3.36 7.5-7.5 0-1.03-.2-2.02-.59-2.91l-1 1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Database returns an "database" Octicon SVG node. -func Database() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 15c-3.31 0-6-.9-6-2v-2c0-.17.09-.34.21-.5.67.86 3 1.5 5.79 1.5s5.12-.64 5.79-1.5c.13.16.21.33.21.5v2c0 1.1-2.69 2-6 2zm0-4c-3.31 0-6-.9-6-2V7c0-.11.04-.21.09-.31.03-.06.07-.13.12-.19C.88 7.36 3.21 8 6 8s5.12-.64 5.79-1.5c.05.06.09.13.12.19.05.1.09.21.09.31v2c0 1.1-2.69 2-6 2zm0-4c-3.31 0-6-.9-6-2V3c0-1.1 2.69-2 6-2s6 .9 6 2v2c0 1.1-2.69 2-6 2zm0-5c-2.21 0-4 .45-4 1s1.79 1 4 1 4-.45 4-1-1.79-1-4-1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// DesktopDownload returns an "desktop-download" Octicon SVG node. -func DesktopDownload() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4 6h3V0h2v6h3l-4 4-4-4zm11-4h-4v1h4v8H1V3h4V2H1c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h5.34c-.25.61-.86 1.39-2.34 2h8c-1.48-.61-2.09-1.39-2.34-2H15c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// DeviceCamera returns an "device-camera" Octicon SVG node. -func DeviceCamera() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M15 3H7c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h14c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM6 5H2V4h4v1zm4.5 7C8.56 12 7 10.44 7 8.5S8.56 5 10.5 5 14 6.56 14 8.5 12.44 12 10.5 12zM13 8.5c0 1.38-1.13 2.5-2.5 2.5S8 9.87 8 8.5 9.13 6 10.5 6 13 7.13 13 8.5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// DeviceCameraVideo returns an "device-camera-video" Octicon SVG node. -func DeviceCameraVideo() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M15.2 2.09L10 5.72V3c0-.55-.45-1-1-1H1c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h8c.55 0 1-.45 1-1V9.28l5.2 3.63c.33.23.8 0 .8-.41v-10c0-.41-.47-.64-.8-.41z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// DeviceDesktop returns an "device-desktop" Octicon SVG node. -func DeviceDesktop() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M15 2H1c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h5.34c-.25.61-.86 1.39-2.34 2h8c-1.48-.61-2.09-1.39-2.34-2H15c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm0 9H1V3h14v8z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// DeviceMobile returns an "device-mobile" Octicon SVG node. -func DeviceMobile() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M9 0H1C.45 0 0 .45 0 1v14c0 .55.45 1 1 1h8c.55 0 1-.45 1-1V1c0-.55-.45-1-1-1zM5 15.3c-.72 0-1.3-.58-1.3-1.3 0-.72.58-1.3 1.3-1.3.72 0 1.3.58 1.3 1.3 0 .72-.58 1.3-1.3 1.3zM9 12H1V2h8v10z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Diff returns an "diff" Octicon SVG node. -func Diff() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 7h2v1H6v2H5V8H3V7h2V5h1v2zm-3 6h5v-1H3v1zM7.5 2L11 5.5V15c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h6.5zM10 6L7 3H1v12h9V6zM8.5 0H3v1h5l4 4v8h1V4.5L8.5 0z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 13 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// DiffAdded returns an "diff-added" Octicon SVG node. -func DiffAdded() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13 1H1c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1zm0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// DiffIgnored returns an "diff-ignored" Octicon SVG node. -func DiffIgnored() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13 1H1c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1zm0 13H1V2h12v12zm-8.5-2H3v-1.5L9.5 4H11v1.5L4.5 12z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// DiffModified returns an "diff-modified" Octicon SVG node. -func DiffModified() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13 1H1c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1zm0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// DiffRemoved returns an "diff-removed" Octicon SVG node. -func DiffRemoved() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13 1H1c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1zm0 13H1V2h12v12zm-2-5H3V7h8v2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// DiffRenamed returns an "diff-renamed" Octicon SVG node. -func DiffRenamed() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 9H3V7h3V4l5 4-5 4V9zm8-7v12c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h12c.55 0 1 .45 1 1zm-1 0H1v12h12V2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Ellipsis returns an "ellipsis" Octicon SVG node. -func Ellipsis() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M11 5H1c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h10c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zM4 9H2V7h2v2zm3 0H5V7h2v2zm3 0H8V7h2v2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Eye returns an "eye" Octicon SVG node. -func Eye() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// File returns an "file" Octicon SVG node. -func File() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 5H2V4h4v1zM2 8h7V7H2v1zm0 2h7V9H2v1zm0 2h7v-1H2v1zm10-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// FileBinary returns an "file-binary" Octicon SVG node. -func FileBinary() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4 12h1v1H2v-1h1v-2H2V9h2v3zm8-7.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v12h10V5zM8 4H6v1h1v2H6v1h3V7H8V4zM2 4h3v4H2V4zm1 3h1V5H3v2zm3 2h3v4H6V9zm1 3h1v-2H7v2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// FileCode returns an "file-code" Octicon SVG node. -func FileCode() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8.5 1H1c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h10c.55 0 1-.45 1-1V4.5L8.5 1zM11 14H1V2h7l3 3v9zM5 6.98L3.5 8.5 5 10l-.5 1L2 8.5 4.5 6l.5.98zM7.5 6L10 8.5 7.5 11l-.5-.98L8.5 8.5 7 7l.5-1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// FileDirectory returns an "file-directory" Octicon SVG node. -func FileDirectory() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13 4H7V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zM6 4H1V3h5v1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// FileMedia returns an "file-media" Octicon SVG node. -func FileMedia() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 5h2v2H6V5zm6-.5V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1h7.5L12 4.5zM11 5L8 2H1v11l3-5 2 4 2-2 3 3V5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// FilePdf returns an "file-pdf" Octicon SVG node. -func FilePdf() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8.5 1H1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V4.5L8.5 1zM1 2h4a.68.68 0 0 0-.31.2 1.08 1.08 0 0 0-.23.47 4.22 4.22 0 0 0-.09 1.47c.06.609.173 1.211.34 1.8A21.78 21.78 0 0 1 3.6 8.6c-.5 1-.8 1.66-.91 1.84a7.161 7.161 0 0 0-.69.3 4.19 4.19 0 0 0-1 .64V2zm4.42 4.8a5.65 5.65 0 0 0 1.17 2.09c.275.237.595.417.94.53-.64.09-1.23.2-1.81.33a12.22 12.22 0 0 0-1.81.59c-.587.243.22-.44.61-1.25.365-.74.67-1.51.91-2.3l-.01.01zM11 14H1.5a.743.743 0 0 1-.17 0 2.12 2.12 0 0 0 .73-.44 10.14 10.14 0 0 0 1.78-2.38c.31-.13.58-.23.81-.31l.42-.14c.45-.13.94-.23 1.44-.33s1-.16 1.48-.2c.447.216.912.394 1.39.53.403.11.814.188 1.23.23h.38V14H11zm0-4.86a3.74 3.74 0 0 0-.64-.28 4.22 4.22 0 0 0-.75-.11c-.411.003-.822.03-1.23.08a3 3 0 0 1-1-.64 6.07 6.07 0 0 1-1.29-2.33c.111-.662.178-1.33.2-2 .02-.25.02-.5 0-.75a1.05 1.05 0 0 0-.2-.88.82.82 0 0 0-.61-.23H8l3 3v4.14z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// FileSubmodule returns an "file-submodule" Octicon SVG node. -func FileSubmodule() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10 7H4v7h9c.55 0 1-.45 1-1V8h-4V7zM9 9H5V8h4v1zm4-5H7V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h2V7c0-.55.45-1 1-1h6c.55 0 1 .45 1 1h3V5c0-.55-.45-1-1-1zM6 4H1V3h5v1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// FileSymlinkDirectory returns an "file-symlink-directory" Octicon SVG node. -func FileSymlinkDirectory() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13 4H7V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zM1 3h5v1H1V3zm6 9v-2c-.98-.02-1.84.22-2.55.7-.71.48-1.19 1.25-1.45 2.3.02-1.64.39-2.88 1.13-3.73C4.86 8.43 5.82 8 7.01 8V6l4 3-4 3H7z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// FileSymlinkFile returns an "file-symlink-file" Octicon SVG node. -func FileSymlinkFile() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8.5 1H1c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h10c.55 0 1-.45 1-1V4.5L8.5 1zM11 14H1V2h7l3 3v9zM6 4.5l4 3-4 3v-2c-.98-.02-1.84.22-2.55.7-.71.48-1.19 1.25-1.45 2.3.02-1.64.39-2.88 1.13-3.73.73-.84 1.69-1.27 2.88-1.27v-2H6z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// FileZip returns an "file-zip" Octicon SVG node. -func FileZip() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8.5 1H1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V4.5L8.5 1zM11 14H1V2h3v1h1V2h3l3 3v9zM5 4V3h1v1H5zM4 4h1v1H4V4zm1 2V5h1v1H5zM4 6h1v1H4V6zm1 2V7h1v1H5zM4 9.28A2 2 0 0 0 3 11v1h4v-1a2 2 0 0 0-2-2V8H4v1.28zM6 10v1H4v-1h2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Flame returns an "flame" Octicon SVG node. -func Flame() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Fold returns an "fold" Octicon SVG node. -func Fold() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7 9l3 3H8v3H6v-3H4l3-3zm3-6H8V0H6v3H4l3 3 3-3zm4 2c0-.55-.45-1-1-1h-2.5l-1 1h3l-2 2h-7l-2-2h3l-1-1H1c-.55 0-1 .45-1 1l2.5 2.5L0 10c0 .55.45 1 1 1h2.5l1-1h-3l2-2h7l2 2h-3l1 1H13c.55 0 1-.45 1-1l-2.5-2.5L14 5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Gear returns an "gear" Octicon SVG node. -func Gear() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M14 8.77v-1.6l-1.94-.64-.45-1.09.88-1.84-1.13-1.13-1.81.91-1.09-.45-.69-1.92h-1.6l-.63 1.94-1.11.45-1.84-.88-1.13 1.13.91 1.81-.45 1.09L0 7.23v1.59l1.94.64.45 1.09-.88 1.84 1.13 1.13 1.81-.91 1.09.45.69 1.92h1.59l.63-1.94 1.11-.45 1.84.88 1.13-1.13-.92-1.81.47-1.09L14 8.75v.02zM7 11c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Gift returns an "gift" Octicon SVG node. -func Gift() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13 4h-1.38c.19-.33.33-.67.36-.91.06-.67-.11-1.22-.52-1.61C11.1 1.1 10.65 1 10.1 1h-.11c-.53.02-1.11.25-1.53.58-.42.33-.73.72-.97 1.2-.23-.48-.55-.88-.97-1.2-.42-.32-1-.58-1.53-.58h-.03c-.56 0-1.06.09-1.44.48-.41.39-.58.94-.52 1.61.03.23.17.58.36.91H1.98c-.55 0-1 .45-1 1v3h1v5c0 .55.45 1 1 1h9c.55 0 1-.45 1-1V8h1V5c0-.55-.45-1-1-1H13zm-4.78-.88c.17-.36.42-.67.75-.92.3-.23.72-.39 1.05-.41h.09c.45 0 .66.11.8.25s.33.39.3.95c-.05.19-.25.61-.5 1h-2.9l.41-.88v.01zM4.09 2.04c.13-.13.31-.25.91-.25.31 0 .72.17 1.03.41.33.25.58.55.75.92L7.2 4H4.3c-.25-.39-.45-.81-.5-1-.03-.56.16-.81.3-.95l-.01-.01zM7 12.99H3V8h4v5-.01zm0-6H2V5h5v2-.01zm5 6H8V8h4v5-.01zm1-6H8V5h5v2-.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Gist returns an "gist" Octicon SVG node. -func Gist() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7.5 5L10 7.5 7.5 10l-.75-.75L8.5 7.5 6.75 5.75 7.5 5zm-3 0L2 7.5 4.5 10l.75-.75L3.5 7.5l1.75-1.75L4.5 5zM0 13V2c0-.55.45-1 1-1h10c.55 0 1 .45 1 1v11c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1zm1 0h10V2H1v11z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// GistSecret returns an "gist-secret" Octicon SVG node. -func GistSecret() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8 10.5L9 14H5l1-3.5L5.25 9h3.5L8 10.5zM10 6H4L2 7h10l-2-1zM9 2L7 3 5 2 4 5h6L9 2zm4.03 7.75L10 9l1 2-2 3h3.22c.45 0 .86-.31.97-.75l.56-2.28c.14-.53-.19-1.08-.72-1.22zM4 9l-3.03.75c-.53.14-.86.69-.72 1.22l.56 2.28c.11.44.52.75.97.75H5l-2-3 1-2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// GitBranch returns an "git-branch" Octicon SVG node. -func GitBranch() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10 5c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v.3c-.02.52-.23.98-.63 1.38-.4.4-.86.61-1.38.63-.83.02-1.48.16-2 .45V4.72a1.993 1.993 0 0 0-1-3.72C.88 1 0 1.89 0 3a2 2 0 0 0 1 1.72v6.56c-.59.35-1 .99-1 1.72 0 1.11.89 2 2 2 1.11 0 2-.89 2-2 0-.53-.2-1-.53-1.36.09-.06.48-.41.59-.47.25-.11.56-.17.94-.17 1.05-.05 1.95-.45 2.75-1.25S8.95 7.77 9 6.73h-.02C9.59 6.37 10 5.73 10 5zM2 1.8c.66 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2C1.35 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2zm0 12.41c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm6-8c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// GitCommit returns an "git-commit" Octicon SVG node. -func GitCommit() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10.86 7c-.45-1.72-2-3-3.86-3-1.86 0-3.41 1.28-3.86 3H0v2h3.14c.45 1.72 2 3 3.86 3 1.86 0 3.41-1.28 3.86-3H14V7h-3.14zM7 10.2c-1.22 0-2.2-.98-2.2-2.2 0-1.22.98-2.2 2.2-2.2 1.22 0 2.2.98 2.2 2.2 0 1.22-.98 2.2-2.2 2.2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// GitCompare returns an "git-compare" Octicon SVG node. -func GitCompare() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M5 12H4c-.27-.02-.48-.11-.69-.31-.21-.2-.3-.42-.31-.69V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V11c.03.78.34 1.47.94 2.06.6.59 1.28.91 2.06.94h1v2l3-3-3-3v2zM2 1.8c.66 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2C1.35 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2zm11 9.48V5c-.03-.78-.34-1.47-.94-2.06-.6-.59-1.28-.91-2.06-.94H9V0L6 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 12 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// GitMerge returns an "git-merge" Octicon SVG node. -func GitMerge() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10 7c-.73 0-1.38.41-1.73 1.02V8C7.22 7.98 6 7.64 5.14 6.98c-.75-.58-1.5-1.61-1.89-2.44A1.993 1.993 0 0 0 2 .99C.89.99 0 1.89 0 3a2 2 0 0 0 1 1.72v6.56c-.59.35-1 .99-1 1.72 0 1.11.89 2 2 2a1.993 1.993 0 0 0 1-3.72V7.67c.67.7 1.44 1.27 2.3 1.69.86.42 2.03.63 2.97.64v-.02c.36.61 1 1.02 1.73 1.02 1.11 0 2-.89 2-2 0-1.11-.89-2-2-2zm-6.8 6c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm8 6c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// GitPullRequest returns an "git-pull-request" Octicon SVG node. -func GitPullRequest() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 10 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v6.56A1.993 1.993 0 0 0 2 15a1.993 1.993 0 0 0 1-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Globe returns an "globe" Octicon SVG node. -func Globe() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7 1C3.14 1 0 4.14 0 8s3.14 7 7 7c.48 0 .94-.05 1.38-.14-.17-.08-.2-.73-.02-1.09.19-.41.81-1.45.2-1.8-.61-.35-.44-.5-.81-.91-.37-.41-.22-.47-.25-.58-.08-.34.36-.89.39-.94.02-.06.02-.27 0-.33 0-.08-.27-.22-.34-.23-.06 0-.11.11-.2.13-.09.02-.5-.25-.59-.33-.09-.08-.14-.23-.27-.34-.13-.13-.14-.03-.33-.11s-.8-.31-1.28-.48c-.48-.19-.52-.47-.52-.66-.02-.2-.3-.47-.42-.67-.14-.2-.16-.47-.2-.41-.04.06.25.78.2.81-.05.02-.16-.2-.3-.38-.14-.19.14-.09-.3-.95s.14-1.3.17-1.75c.03-.45.38.17.19-.13-.19-.3 0-.89-.14-1.11-.13-.22-.88.25-.88.25.02-.22.69-.58 1.16-.92.47-.34.78-.06 1.16.05.39.13.41.09.28-.05-.13-.13.06-.17.36-.13.28.05.38.41.83.36.47-.03.05.09.11.22s-.06.11-.38.3c-.3.2.02.22.55.61s.38-.25.31-.55c-.07-.3.39-.06.39-.06.33.22.27.02.5.08.23.06.91.64.91.64-.83.44-.31.48-.17.59.14.11-.28.3-.28.3-.17-.17-.19.02-.3.08-.11.06-.02.22-.02.22-.56.09-.44.69-.42.83 0 .14-.38.36-.47.58-.09.2.25.64.06.66-.19.03-.34-.66-1.31-.41-.3.08-.94.41-.59 1.08.36.69.92-.19 1.11-.09.19.1-.06.53-.02.55.04.02.53.02.56.61.03.59.77.53.92.55.17 0 .7-.44.77-.45.06-.03.38-.28 1.03.09.66.36.98.31 1.2.47.22.16.08.47.28.58.2.11 1.06-.03 1.28.31.22.34-.88 2.09-1.22 2.28-.34.19-.48.64-.84.92s-.81.64-1.27.91c-.41.23-.47.66-.66.8 3.14-.7 5.48-3.5 5.48-6.84 0-3.86-3.14-7-7-7L7 1zm1.64 6.56c-.09.03-.28.22-.78-.08-.48-.3-.81-.23-.86-.28 0 0-.05-.11.17-.14.44-.05.98.41 1.11.41.13 0 .19-.13.41-.05.22.08.05.13-.05.14zM6.34 1.7c-.05-.03.03-.08.09-.14.03-.03.02-.11.05-.14.11-.11.61-.25.52.03-.11.27-.58.3-.66.25zm1.23.89c-.19-.02-.58-.05-.52-.14.3-.28-.09-.38-.34-.38-.25-.02-.34-.16-.22-.19.12-.03.61.02.7.08.08.06.52.25.55.38.02.13 0 .25-.17.25zm1.47-.05c-.14.09-.83-.41-.95-.52-.56-.48-.89-.31-1-.41-.11-.1-.08-.19.11-.34.19-.15.69.06 1 .09.3.03.66.27.66.55.02.25.33.5.19.63h-.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Grabber returns an "grabber" Octicon SVG node. -func Grabber() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8 4v1H0V4h8zM0 8h8V7H0v1zm0 3h8v-1H0v1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 8 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Graph returns an "graph" Octicon SVG node. -func Graph() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M16 14v1H0V0h1v14h15zM5 13H3V8h2v5zm4 0H7V3h2v10zm4 0h-2V6h2v7z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Heart returns an "heart" Octicon SVG node. -func Heart() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M9 2c-.97 0-1.69.42-2.2 1-.51.58-.78.92-.8 1-.02-.08-.28-.42-.8-1-.52-.58-1.17-1-2.2-1-1.632.086-2.954 1.333-3 3 0 .52.09 1.52.67 2.67C1.25 8.82 3.01 10.61 6 13c2.98-2.39 4.77-4.17 5.34-5.33C11.91 6.51 12 5.5 12 5c-.047-1.69-1.342-2.913-3-3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// History returns an "history" Octicon SVG node. -func History() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8 13H6V6h5v2H8v5zM7 1C4.81 1 2.87 2.02 1.59 3.59L0 2v4h4L2.5 4.5C3.55 3.17 5.17 2.3 7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-.34.03-.67.09-1H.08C.03 7.33 0 7.66 0 8c0 3.86 3.14 7 7 7s7-3.14 7-7-3.14-7-7-7z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Home returns an "home" Octicon SVG node. -func Home() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M16 9l-3-3V2h-2v2L8 1 0 9h2l1 5c0 .55.45 1 1 1h8c.55 0 1-.45 1-1l1-5h2zm-4 5H9v-4H7v4H4L2.81 7.69 8 2.5l5.19 5.19L12 14z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// HorizontalRule returns an "horizontal-rule" Octicon SVG node. -func HorizontalRule() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M1 7h2v2h1V3H3v3H1V3H0v6h1V7zm9 2V7H9v2h1zm0-3V4H9v2h1zM7 6V4h2V3H6v6h1V7h2V6H7zm-7 7h10v-2H0v2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Hubot returns an "hubot" Octicon SVG node. -func Hubot() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M3 6c-.55 0-1 .45-1 1v2c0 .55.45 1 1 1h8c.55 0 1-.45 1-1V7c0-.55-.45-1-1-1H3zm8 1.75L9.75 9h-1.5L7 7.75 5.75 9h-1.5L3 7.75V7h.75L5 8.25 6.25 7h1.5L9 8.25 10.25 7H11v.75zM5 11h4v1H5v-1zm2-9C3.14 2 0 4.91 0 8.5V13c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V8.5C14 4.91 10.86 2 7 2zm6 11H1V8.5c0-3.09 2.64-5.59 6-5.59s6 2.5 6 5.59V13z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Inbox returns an "inbox" Octicon SVG node. -func Inbox() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M14 9l-1.13-7.14c-.08-.48-.5-.86-1-.86H2.13c-.5 0-.92.38-1 .86L0 9v5c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V9zm-3.28.55l-.44.89c-.17.34-.52.56-.91.56H4.61c-.38 0-.72-.22-.89-.55l-.44-.91c-.17-.33-.52-.55-.89-.55H1l1-7h10l1 7h-1.38c-.39 0-.73.22-.91.55l.01.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Info returns an "info" Octicon SVG node. -func Info() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// IssueClosed returns an "issue-closed" Octicon SVG node. -func IssueClosed() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7 10h2v2H7v-2zm2-6H7v5h2V4zm1.5 1.5l-1 1L12 9l4-4.5-1-1L12 7l-1.5-1.5zM8 13.7A5.71 5.71 0 0 1 2.3 8c0-3.14 2.56-5.7 5.7-5.7 1.83 0 3.45.88 4.5 2.2l.92-.92A6.947 6.947 0 0 0 8 1C4.14 1 1 4.14 1 8s3.14 7 7 7 7-3.14 7-7l-1.52 1.52c-.66 2.41-2.86 4.19-5.48 4.19v-.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// IssueOpened returns an "issue-opened" Octicon SVG node. -func IssueOpened() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// IssueReopened returns an "issue-reopened" Octicon SVG node. -func IssueReopened() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8 9H6V4h2v5zm-2 3h2v-2H6v2zm6.33-2H10l1.5 1.5c-1.05 1.33-2.67 2.2-4.5 2.2A5.71 5.71 0 0 1 1.3 8c0-.34.03-.67.09-1H.08C.03 7.33 0 7.66 0 8c0 3.86 3.14 7 7 7 2.19 0 4.13-1.02 5.41-2.59L14 14v-4h-1.67zM1.67 6H4L2.5 4.5C3.55 3.17 5.17 2.3 7 2.3c3.14 0 5.7 2.56 5.7 5.7 0 .34-.03.67-.09 1h1.31c.05-.33.08-.66.08-1 0-3.86-3.14-7-7-7-2.19 0-4.13 1.02-5.41 2.59L0 2v4h1.67z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Italic returns an "italic" Octicon SVG node. -func Italic() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M2.81 5h1.98L3 14H1l1.81-9zm.36-2.7c0-.7.58-1.3 1.33-1.3.56 0 1.13.38 1.13 1.03 0 .75-.59 1.3-1.33 1.3-.58 0-1.13-.38-1.13-1.03z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 6 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Jersey returns an "jersey" Octicon SVG node. -func Jersey() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4.5 6l-.5.5v5l.5.5h2l.5-.5v-5L6.5 6h-2zM6 11H5V7h1v4zm6.27-7.25C12.05 2.37 11.96 1.12 12 0H9.02c0 .27-.13.48-.39.69-.25.2-.63.3-1.13.3-.5 0-.88-.09-1.13-.3-.23-.2-.36-.42-.36-.69H3c.05 1.13-.03 2.38-.25 3.75C2.55 5.13 1.95 5.88 1 6v9c.02.27.11.48.31.69.2.21.42.3.69.31h11c.27-.02.48-.11.69-.31.21-.2.3-.42.31-.69V6c-.95-.13-1.53-.88-1.75-2.25h.02zM13 15H2V7c.89-.5 1.48-1.25 1.72-2.25S4.03 2.5 4 1h1c-.02.78.16 1.47.52 2.06.36.58 1.02.89 2 .94.98-.02 1.64-.33 2-.94.36-.59.5-1.28.48-2.06h1c.02 1.42.13 2.55.33 3.38.2.81.69 2 1.67 2.63v8V15zM8.5 6l-.5.5v5l.5.5h2l.5-.5v-5l-.5-.5h-2zm1.5 5H9V7h1v4z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// KebabHorizontal returns an "kebab-horizontal" Octicon SVG node. -func KebabHorizontal() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm5 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM13 7.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 13 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// KebabVertical returns an "kebab-vertical" Octicon SVG node. -func KebabVertical() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M0 2.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zm0 5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zM1.5 14a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 3 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Key returns an "key" Octicon SVG node. -func Key() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M12.83 2.17C12.08 1.42 11.14 1.03 10 1c-1.13.03-2.08.42-2.83 1.17S6.04 3.86 6.01 5c0 .3.03.59.09.89L0 12v1l1 1h2l1-1v-1h1v-1h1v-1h2l1.09-1.11c.3.08.59.11.91.11 1.14-.03 2.08-.42 2.83-1.17S13.97 6.14 14 5c-.03-1.14-.42-2.08-1.17-2.83zM11 5.38c-.77 0-1.38-.61-1.38-1.38 0-.77.61-1.38 1.38-1.38.77 0 1.38.61 1.38 1.38 0 .77-.61 1.38-1.38 1.38z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Keyboard returns an "keyboard" Octicon SVG node. -func Keyboard() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10 5H9V4h1v1zM3 6H2v1h1V6zm5-2H7v1h1V4zM4 4H2v1h2V4zm8 7h2v-1h-2v1zM8 7h1V6H8v1zm-4 3H2v1h2v-1zm8-6h-1v1h1V4zm2 0h-1v1h1V4zm-2 5h2V6h-2v3zm4-6v9c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h14c.55 0 1 .45 1 1zm-1 0H1v9h14V3zM6 7h1V6H6v1zm0-3H5v1h1V4zM4 7h1V6H4v1zm1 4h6v-1H5v1zm5-4h1V6h-1v1zM3 8H2v1h1V8zm5 0v1h1V8H8zM6 8v1h1V8H6zM5 8H4v1h1V8zm5 1h1V8h-1v1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Law returns an "law" Octicon SVG node. -func Law() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7 4c-.83 0-1.5-.67-1.5-1.5S6.17 1 7 1s1.5.67 1.5 1.5S7.83 4 7 4zm7 6c0 1.11-.89 2-2 2h-1c-1.11 0-2-.89-2-2l2-4h-1c-.55 0-1-.45-1-1H8v8c.42 0 1 .45 1 1h1c.42 0 1 .45 1 1H3c0-.55.58-1 1-1h1c0-.55.58-1 1-1h.03L6 5H5c0 .55-.45 1-1 1H3l2 4c0 1.11-.89 2-2 2H2c-1.11 0-2-.89-2-2l2-4H1V5h3c0-.55.45-1 1-1h4c.55 0 1 .45 1 1h3v1h-1l2 4zM2.5 7L1 10h3L2.5 7zM13 10l-1.5-3-1.5 3h3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// LightBulb returns an "light-bulb" Octicon SVG node. -func LightBulb() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Link returns an "link" Octicon SVG node. -func Link() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// LinkExternal returns an "link-external" Octicon SVG node. -func LinkExternal() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M11 10h1v3c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h3v1H1v10h10v-3zM6 2l2.25 2.25L5 7.5 6.5 9l3.25-3.25L12 8V2H6z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ListOrdered returns an "list-ordered" Octicon SVG node. -func ListOrdered() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M12 12.99c0 .589 0 .998-.59.998H4.596c-.59 0-.59-.41-.59-.999 0-.59 0-.999.59-.999H11.4c.59 0 .59.41.59 1H12zM4.596 3.996H11.4c.59 0 .59-.41.59-1 0-.589 0-.999-.59-.999H4.596c-.59 0-.59.41-.59 1 0 .589 0 .999.59.999zM11.4 6.994H4.596c-.59 0-.59.41-.59 1 0 .589 0 .999.59.999H11.4c.59 0 .59-.41.59-1 0-.59 0-.999-.59-.999zM2.008 1h-.72C.99 1.19.71 1.25.26 1.34V2h.75v2.138H.17v.859h2.837v-.86h-.999V1zm.25 8.123c-.17 0-.45.03-.66.06.53-.56 1.14-1.249 1.14-1.888-.02-.78-.56-1.299-1.36-1.299-.589 0-.968.2-1.378.64l.58.579c.19-.19.38-.38.639-.38.28 0 .48.16.48.52 0 .53-.77 1.199-1.699 2.058v.58h2.998l-.09-.88h-.66l.01.01zm-.08 3.777v-.03c.44-.19.64-.47.64-.859 0-.7-.56-1.11-1.44-1.11-.479 0-.888.19-1.278.52l.55.64c.25-.2.44-.31.689-.31.27 0 .42.13.42.36 0 .27-.2.44-.86.44v.749c.83 0 .98.17.98.47 0 .25-.23.38-.58.38-.28 0-.56-.14-.81-.38l-.479.659c.3.36.77.56 1.409.56.83 0 1.529-.41 1.529-1.16 0-.5-.31-.809-.77-.939v.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ListUnordered returns an "list-unordered" Octicon SVG node. -func ListUnordered() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M2 13c0 .59 0 1-.59 1H.59C0 14 0 13.59 0 13c0-.59 0-1 .59-1h.81c.59 0 .59.41.59 1H2zm2.59-9h6.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1H4.59C4 2 4 2.41 4 3c0 .59 0 1 .59 1zM1.41 7H.59C0 7 0 7.41 0 8c0 .59 0 1 .59 1h.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1h.01zm0-5H.59C0 2 0 2.41 0 3c0 .59 0 1 .59 1h.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1h.01zm10 5H4.59C4 7 4 7.41 4 8c0 .59 0 1 .59 1h6.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1h.01zm0 5H4.59C4 12 4 12.41 4 13c0 .59 0 1 .59 1h6.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1h.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Location returns an "location" Octicon SVG node. -func Location() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 0C2.69 0 0 2.5 0 5.5 0 10.02 6 16 6 16s6-5.98 6-10.5C12 2.5 9.31 0 6 0zm0 14.55C4.14 12.52 1 8.44 1 5.5 1 3.02 3.25 1 6 1c1.34 0 2.61.48 3.56 1.36.92.86 1.44 1.97 1.44 3.14 0 2.94-3.14 7.02-5 9.05zM8 5.5c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Lock returns an "lock" Octicon SVG node. -func Lock() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4 13H3v-1h1v1zm8-6v7c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V7c0-.55.45-1 1-1h1V4c0-2.2 1.8-4 4-4s4 1.8 4 4v2h1c.55 0 1 .45 1 1zM3.8 6h4.41V4c0-1.22-.98-2.2-2.2-2.2-1.22 0-2.2.98-2.2 2.2v2H3.8zM11 7H2v7h9V7zM4 8H3v1h1V8zm0 2H3v1h1v-1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// LogoGist returns an "logo-gist" Octicon SVG node. -func LogoGist() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4.7 8.73h2.45v4.02c-.55.27-1.64.34-2.53.34-2.56 0-3.47-2.2-3.47-5.05 0-2.85.91-5.06 3.48-5.06 1.28 0 2.06.23 3.28.73V2.66C7.27 2.33 6.25 2 4.63 2 1.13 2 0 4.69 0 8.03c0 3.34 1.11 6.03 4.63 6.03 1.64 0 2.81-.27 3.59-.64V7.73H4.7v1zm6.39 3.72V6.06h-1.05v6.28c0 1.25.58 1.72 1.72 1.72v-.89c-.48 0-.67-.16-.67-.7v-.02zm.25-8.72c0-.44-.33-.78-.78-.78s-.77.34-.77.78.33.78.77.78.78-.34.78-.78zm4.34 5.69c-1.5-.13-1.78-.48-1.78-1.17 0-.77.33-1.34 1.88-1.34 1.05 0 1.66.16 2.27.36v-.94c-.69-.3-1.52-.39-2.25-.39-2.2 0-2.92 1.2-2.92 2.31 0 1.08.47 1.88 2.73 2.08 1.55.13 1.77.63 1.77 1.34 0 .73-.44 1.42-2.06 1.42-1.11 0-1.86-.19-2.33-.36v.94c.5.2 1.58.39 2.33.39 2.38 0 3.14-1.2 3.14-2.41 0-1.28-.53-2.03-2.75-2.23h-.03zm8.58-2.47v-.86h-2.42v-2.5l-1.08.31v2.11l-1.56.44v.48h1.56v5c0 1.53 1.19 2.13 2.5 2.13.19 0 .52-.02.69-.05v-.89c-.19.03-.41.03-.61.03-.97 0-1.5-.39-1.5-1.34V6.94h2.42v.02-.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 25 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// LogoGitHub returns an "logo-github" Octicon SVG node. -func LogoGitHub() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M18.53 12.03h-.02c.009 0 .015.01.024.011h.006l-.01-.01zm.004.011c-.093.001-.327.05-.574.05-.78 0-1.05-.36-1.05-.83V8.13h1.59c.09 0 .16-.08.16-.19v-1.7c0-.09-.08-.17-.16-.17h-1.59V3.96c0-.08-.05-.13-.14-.13h-2.16c-.09 0-.14.05-.14.13v2.17s-1.09.27-1.16.28c-.08.02-.13.09-.13.17v1.36c0 .11.08.19.17.19h1.11v3.28c0 2.44 1.7 2.69 2.86 2.69.53 0 1.17-.17 1.27-.22.06-.02.09-.09.09-.16v-1.5a.177.177 0 0 0-.146-.18zm23.696-2.2c0-1.81-.73-2.05-1.5-1.97-.6.04-1.08.34-1.08.34v3.52s.49.34 1.22.36c1.03.03 1.36-.34 1.36-2.25zm2.43-.16c0 3.43-1.11 4.41-3.05 4.41-1.64 0-2.52-.83-2.52-.83s-.04.46-.09.52c-.03.06-.08.08-.14.08h-1.48c-.1 0-.19-.08-.19-.17l.02-11.11c0-.09.08-.17.17-.17h2.13c.09 0 .17.08.17.17v3.77s.82-.53 2.02-.53l-.01-.02c1.2 0 2.97.45 2.97 3.88zm-8.72-3.61h-2.1c-.11 0-.17.08-.17.19v5.44s-.55.39-1.3.39-.97-.34-.97-1.09V6.25c0-.09-.08-.17-.17-.17h-2.14c-.09 0-.17.08-.17.17v5.11c0 2.2 1.23 2.75 2.92 2.75 1.39 0 2.52-.77 2.52-.77s.05.39.08.45c.02.05.09.09.16.09h1.34c.11 0 .17-.08.17-.17l.02-7.47c0-.09-.08-.17-.19-.17zm-23.7-.01h-2.13c-.09 0-.17.09-.17.2v7.34c0 .2.13.27.3.27h1.92c.2 0 .25-.09.25-.27V6.23c0-.09-.08-.17-.17-.17zm-1.05-3.38c-.77 0-1.38.61-1.38 1.38 0 .77.61 1.38 1.38 1.38.75 0 1.36-.61 1.36-1.38 0-.77-.61-1.38-1.36-1.38zm16.49-.25h-2.11c-.09 0-.17.08-.17.17v4.09h-3.31V2.6c0-.09-.08-.17-.17-.17h-2.13c-.09 0-.17.08-.17.17v11.11c0 .09.09.17.17.17h2.13c.09 0 .17-.08.17-.17V8.96h3.31l-.02 4.75c0 .09.08.17.17.17h2.13c.09 0 .17-.08.17-.17V2.6c0-.09-.08-.17-.17-.17zM8.81 7.35v5.74c0 .04-.01.11-.06.13 0 0-1.25.89-3.31.89-2.49 0-5.44-.78-5.44-5.92S2.58 1.99 5.1 2c2.18 0 3.06.49 3.2.58.04.05.06.09.06.14L7.94 4.5c0 .09-.09.2-.2.17-.36-.11-.9-.33-2.17-.33-1.47 0-3.05.42-3.05 3.73s1.5 3.7 2.58 3.7c.92 0 1.25-.11 1.25-.11v-2.3H4.88c-.11 0-.19-.08-.19-.17V7.35c0-.09.08-.17.19-.17h3.74c.11 0 .19.08.19.17z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 45 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Mail returns an "mail" Octicon SVG node. -func Mail() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M0 4v8c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1H1c-.55 0-1 .45-1 1zm13 0L7 9 1 4h12zM1 5.5l4 3-4 3v-6zM2 12l3.5-3L7 10.5 8.5 9l3.5 3H2zm11-.5l-4-3 4-3v6z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// MailRead returns an "mail-read" Octicon SVG node. -func MailRead() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 5H4V4h2v1zm3 1H4v1h5V6zm5-.48V14c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V5.52c0-.33.16-.63.42-.81L2 3.58V3c0-.55.45-1 1-1h1.2L7 0l2.8 2H11c.55 0 1 .45 1 1v.58l1.58 1.13c.27.19.42.48.42.81zM3 7.5L7 10l4-2.5V3H3v4.5zm-2 6l4.5-3-4.5-3v6zm11 .5l-5-3-5 3h10zm1-6.5l-4.5 3 4.5 3v-6z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// MarkGitHub returns an "mark-github" Octicon SVG node. -func MarkGitHub() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Markdown returns an "markdown" Octicon SVG node. -func Markdown() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Megaphone returns an "megaphone" Octicon SVG node. -func Megaphone() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10 1c-.17 0-.36.05-.52.14C8.04 2.02 4.5 4.58 3 5c-1.38 0-3 .67-3 2.5S1.63 10 3 10c.3.08.64.23 1 .41V15h2v-3.45c1.34.86 2.69 1.83 3.48 2.31.16.09.34.14.52.14.52 0 1-.42 1-1V2c0-.58-.48-1-1-1zm0 12c-.38-.23-.89-.58-1.5-1-.16-.11-.33-.22-.5-.34V3.31c.16-.11.31-.2.47-.31.61-.41 1.16-.77 1.53-1v11zm2-6h4v1h-4V7zm0 2l4 2v1l-4-2V9zm4-6v1l-4 2V5l4-2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Mention returns an "mention" Octicon SVG node. -func Mention() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6.58 15c1.25 0 2.52-.31 3.56-.94l-.42-.94c-.84.52-1.89.83-3.03.83-3.23 0-5.64-2.08-5.64-5.72 0-4.37 3.23-7.18 6.58-7.18 3.45 0 5.22 2.19 5.22 5.2 0 2.39-1.34 3.86-2.5 3.86-1.05 0-1.36-.73-1.05-2.19l.73-3.75H8.98l-.11.72c-.41-.63-.94-.83-1.56-.83-2.19 0-3.66 2.39-3.66 4.38 0 1.67.94 2.61 2.3 2.61.84 0 1.67-.53 2.3-1.25.11.94.94 1.45 1.98 1.45 1.67 0 3.77-1.67 3.77-5C14 2.61 11.59 0 7.83 0 3.66 0 0 3.33 0 8.33 0 12.71 2.92 15 6.58 15zm-.31-5c-.73 0-1.36-.52-1.36-1.67 0-1.45.94-3.22 2.41-3.22.52 0 .84.2 1.25.83l-.52 3.02c-.63.73-1.25 1.05-1.78 1.05V10z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Milestone returns an "milestone" Octicon SVG node. -func Milestone() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8 2H6V0h2v2zm4 5H2c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h10l2 2-2 2zM8 4H6v2h2V4zM6 16h2V8H6v8z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Mirror returns an "mirror" Octicon SVG node. -func Mirror() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M15.5 4.7L8.5 0l-7 4.7c-.3.19-.5.45-.5.8V16l7.5-4 7.5 4V5.5c0-.34-.2-.61-.5-.8zm-.5 9.8l-6-3.25V10H8v1.25L2 14.5v-9l6-4V6h1V1.5l6 4v9zM6 7h5V5l3 3-3 3V9H6v2L3 8l3-3v2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// MortarBoard returns an "mortar-board" Octicon SVG node. -func MortarBoard() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7.83 9.19L4 8c-4-8 0 1.5 0 2.5S5.8 12 8 12s4-.5 4-1.5V8L8.17 9.19a.73.73 0 0 1-.36 0h.02zm.28-6.39a.34.34 0 0 0-.2 0L.27 5.18a.35.35 0 0 0 0 .67L2 6.4v1.77c-.3.17-.5.5-.5.86 0 .19.05.36.14.5-.08.14-.14.31-.14.5v2.58c0 .55 2 .55 2 0v-2.58c0-.19-.05-.36-.14-.5.08-.14.14-.31.14-.5 0-.38-.2-.69-.5-.86V6.72l4.89 1.53c.06.02.14.02.2 0l7.64-2.38a.35.35 0 0 0 0-.67L8.1 2.81l.01-.01zM8.02 6c-.55 0-1-.22-1-.5s.45-.5 1-.5 1 .22 1 .5-.45.5-1 .5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Mute returns an "mute" Octicon SVG node. -func Mute() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8 2.81v10.38c0 .67-.81 1-1.28.53L3 10H1c-.55 0-1-.45-1-1V7c0-.55.45-1 1-1h2l3.72-3.72C7.19 1.81 8 2.14 8 2.81zm7.53 3.22l-1.06-1.06-1.97 1.97-1.97-1.97-1.06 1.06L11.44 8 9.47 9.97l1.06 1.06 1.97-1.97 1.97 1.97 1.06-1.06L13.56 8l1.97-1.97z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// NoNewline returns an "no-newline" Octicon SVG node. -func NoNewline() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M16 5v3c0 .55-.45 1-1 1h-3v2L9 8l3-3v2h2V5h2zM8 8c0 2.2-1.8 4-4 4s-4-1.8-4-4 1.8-4 4-4 4 1.8 4 4zM1.5 9.66L5.66 5.5C5.18 5.19 4.61 5 4 5 2.34 5 1 6.34 1 8c0 .61.19 1.17.5 1.66zM7 8c0-.61-.19-1.17-.5-1.66L2.34 10.5c.48.31 1.05.5 1.66.5 1.66 0 3-1.34 3-3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Note returns an "note" Octicon SVG node. -func Note() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M3 10h4V9H3v1zm0-2h6V7H3v1zm0-2h8V5H3v1zm10 6H1V3h12v9zM1 2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1H1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Octoface returns an "octoface" Octicon SVG node. -func Octoface() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M14.7 5.34c.13-.32.55-1.59-.13-3.31 0 0-1.05-.33-3.44 1.3-1-.28-2.07-.32-3.13-.32s-2.13.04-3.13.32c-2.39-1.64-3.44-1.3-3.44-1.3-.68 1.72-.26 2.99-.13 3.31C.49 6.21 0 7.33 0 8.69 0 13.84 3.33 15 7.98 15S16 13.84 16 8.69c0-1.36-.49-2.48-1.3-3.35zM8 14.02c-3.3 0-5.98-.15-5.98-3.35 0-.76.38-1.48 1.02-2.07 1.07-.98 2.9-.46 4.96-.46 2.07 0 3.88-.52 4.96.46.65.59 1.02 1.3 1.02 2.07 0 3.19-2.68 3.35-5.98 3.35zM5.49 9.01c-.66 0-1.2.8-1.2 1.78s.54 1.79 1.2 1.79c.66 0 1.2-.8 1.2-1.79s-.54-1.78-1.2-1.78zm5.02 0c-.66 0-1.2.79-1.2 1.78s.54 1.79 1.2 1.79c.66 0 1.2-.8 1.2-1.79s-.53-1.78-1.2-1.78z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Organization returns an "organization" Octicon SVG node. -func Organization() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M16 12.999c0 .439-.45 1-1 1H7.995c-.539 0-.994-.447-.995-.999H1c-.54 0-1-.561-1-1 0-2.634 3-4 3-4s.229-.409 0-1c-.841-.621-1.058-.59-1-3 .058-2.419 1.367-3 2.5-3s2.442.58 2.5 3c.058 2.41-.159 2.379-1 3-.229.59 0 1 0 1s1.549.711 2.42 2.088C9.196 9.369 10 8.999 10 8.999s.229-.409 0-1c-.841-.62-1.058-.59-1-3 .058-2.419 1.367-3 2.5-3s2.437.581 2.495 3c.059 2.41-.158 2.38-1 3-.229.59 0 1 0 1s3.005 1.366 3.005 4z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Package returns an "package" Octicon SVG node. -func Package() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M1 4.27v7.47c0 .45.3.84.75.97l6.5 1.73c.16.05.34.05.5 0l6.5-1.73c.45-.13.75-.52.75-.97V4.27c0-.45-.3-.84-.75-.97l-6.5-1.74a1.4 1.4 0 0 0-.5 0L1.75 3.3c-.45.13-.75.52-.75.97zm7 9.09l-6-1.59V5l6 1.61v6.75zM2 4l2.5-.67L11 5.06l-2.5.67L2 4zm13 7.77l-6 1.59V6.61l2-.55V8.5l2-.53V5.53L15 5v6.77zm-2-7.24L6.5 2.8l2-.53L15 4l-2 .53z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Paintcan returns an "paintcan" Octicon SVG node. -func Paintcan() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 0C2.69 0 0 2.69 0 6v1c0 .55.45 1 1 1v5c0 1.1 2.24 2 5 2s5-.9 5-2V8c.55 0 1-.45 1-1V6c0-3.31-2.69-6-6-6zm3 10v.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V10c0-.28-.22-.5-.5-.5s-.5.22-.5.5v2.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5v-2c0-.28-.22-.5-.5-.5s-.5.22-.5.5v.5c0 .55-.45 1-1 1s-1-.45-1-1v-1c-.55 0-1-.45-1-1V7.2c.91.49 2.36.8 4 .8 1.64 0 3.09-.31 4-.8V9c0 .55-.45 1-1 1zM6 7c-1.68 0-3.12-.41-3.71-1C2.88 5.41 4.32 5 6 5c1.68 0 3.12.41 3.71 1-.59.59-2.03 1-3.71 1zm0-3c-2.76 0-5 .89-5 2 0-2.76 2.24-5 5-5s5 2.24 5 5c0-1.1-2.24-2-5-2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Pencil returns an "pencil" Octicon SVG node. -func Pencil() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M0 12v3h3l8-8-3-3-8 8zm3 2H1v-2h1v1h1v1zm10.3-9.3L12 6 9 3l1.3-1.3a.996.996 0 0 1 1.41 0l1.59 1.59c.39.39.39 1.02 0 1.41z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Person returns an "person" Octicon SVG node. -func Person() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M12 14.002a.998.998 0 0 1-.998.998H1.001A1 1 0 0 1 0 13.999V13c0-2.633 4-4 4-4s.229-.409 0-1c-.841-.62-.944-1.59-1-4 .173-2.413 1.867-3 3-3s2.827.586 3 3c-.056 2.41-.159 3.38-1 4-.229.59 0 1 0 1s4 1.367 4 4v1.002z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Pin returns an "pin" Octicon SVG node. -func Pin() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10 1.2V2l.5 1L6 6H2.2c-.44 0-.67.53-.34.86L5 10l-4 5 5-4 3.14 3.14a.5.5 0 0 0 .86-.34V10l3-4.5 1 .5h.8c.44 0 .67-.53.34-.86L10.86.86a.5.5 0 0 0-.86.34z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Plug returns an "plug" Octicon SVG node. -func Plug() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M14 6V5h-4V3H8v1H6c-1.03 0-1.77.81-2 2L3 7c-1.66 0-3 1.34-3 3v2h1v-2c0-1.11.89-2 2-2l1 1c.25 1.16.98 2 2 2h2v1h2v-2h4V9h-4V6h4z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Plus returns an "plus" Octicon SVG node. -func Plus() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M12 9H7v5H5V9H0V7h5V2h2v5h5v2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// PlusSmall returns an "plus-small" Octicon SVG node. -func PlusSmall() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4 4H3v3H0v1h3v3h1V8h3V7H4V4z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 7 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// PrimitiveDot returns an "primitive-dot" Octicon SVG node. -func PrimitiveDot() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M0 8c0-2.2 1.8-4 4-4s4 1.8 4 4-1.8 4-4 4-4-1.8-4-4z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 8 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// PrimitiveSquare returns an "primitive-square" Octicon SVG node. -func PrimitiveSquare() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8 12H0V4h8v8z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 8 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Project returns an "project" Octicon SVG node. -func Project() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10 12h3V2h-3v10zm-4-2h3V2H6v8zm-4 4h3V2H2v12zm-1 1h13V1H1v14zM14 0H1a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 15 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Pulse returns an "pulse" Octicon SVG node. -func Pulse() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M11.5 8L8.8 5.4 6.6 8.5 5.5 1.6 2.38 8H0v2h3.6l.9-1.8.9 5.4L9 8.5l1.6 1.5H14V8h-2.5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Question returns an "question" Octicon SVG node. -func Question() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 10h2v2H6v-2zm4-3.5C10 8.64 8 9 8 9H6c0-.55.45-1 1-1h.5c.28 0 .5-.22.5-.5v-1c0-.28-.22-.5-.5-.5h-1c-.28 0-.5.22-.5.5V7H4c0-1.5 1.5-3 3-3s3 1 3 2.5zM7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Quote returns an "quote" Octicon SVG node. -func Quote() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6.16 3.5C3.73 5.06 2.55 6.67 2.55 9.36c.16-.05.3-.05.44-.05 1.27 0 2.5.86 2.5 2.41 0 1.61-1.03 2.61-2.5 2.61-1.9 0-2.99-1.52-2.99-4.25 0-3.8 1.75-6.53 5.02-8.42L6.16 3.5zm7 0c-2.43 1.56-3.61 3.17-3.61 5.86.16-.05.3-.05.44-.05 1.27 0 2.5.86 2.5 2.41 0 1.61-1.03 2.61-2.5 2.61-1.89 0-2.98-1.52-2.98-4.25 0-3.8 1.75-6.53 5.02-8.42l1.14 1.84h-.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// RadioTower returns an "radio-tower" Octicon SVG node. -func RadioTower() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4.79 6.11c.25-.25.25-.67 0-.92-.32-.33-.48-.76-.48-1.19 0-.43.16-.86.48-1.19.25-.26.25-.67 0-.92a.613.613 0 0 0-.45-.19c-.16 0-.33.06-.45.19-.57.58-.85 1.35-.85 2.11 0 .76.29 1.53.85 2.11.25.25.66.25.9 0zM2.33.52a.651.651 0 0 0-.92 0C.48 1.48.01 2.74.01 3.99c0 1.26.47 2.52 1.4 3.48.25.26.66.26.91 0s.25-.68 0-.94c-.68-.7-1.02-1.62-1.02-2.54 0-.92.34-1.84 1.02-2.54a.66.66 0 0 0 .01-.93zm5.69 5.1A1.62 1.62 0 1 0 6.4 4c-.01.89.72 1.62 1.62 1.62zM14.59.53a.628.628 0 0 0-.91 0c-.25.26-.25.68 0 .94.68.7 1.02 1.62 1.02 2.54 0 .92-.34 1.83-1.02 2.54-.25.26-.25.68 0 .94a.651.651 0 0 0 .92 0c.93-.96 1.4-2.22 1.4-3.48A5.048 5.048 0 0 0 14.59.53zM8.02 6.92c-.41 0-.83-.1-1.2-.3l-3.15 8.37h1.49l.86-1h4l.84 1h1.49L9.21 6.62c-.38.2-.78.3-1.19.3zm-.01.48L9.02 11h-2l.99-3.6zm-1.99 5.59l1-1h2l1 1h-4zm5.19-11.1c-.25.25-.25.67 0 .92.32.33.48.76.48 1.19 0 .43-.16.86-.48 1.19-.25.26-.25.67 0 .92a.63.63 0 0 0 .9 0c.57-.58.85-1.35.85-2.11 0-.76-.28-1.53-.85-2.11a.634.634 0 0 0-.9 0z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Reply returns an "reply" Octicon SVG node. -func Reply() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 3.5c3.92.44 8 3.125 8 10-2.312-5.062-4.75-6-8-6V11L.5 5.5 6 0v3.5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Repo returns an "repo" Octicon SVG node. -func Repo() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// RepoClone returns an "repo-clone" Octicon SVG node. -func RepoClone() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M15 0H9v7c0 .55.45 1 1 1h1v1h1V8h3c.55 0 1-.45 1-1V1c0-.55-.45-1-1-1zm-4 7h-1V6h1v1zm4 0h-3V6h3v1zm0-2h-4V1h4v4zM4 5H3V4h1v1zm0-2H3V2h1v1zM2 1h6V0H1C.45 0 0 .45 0 1v12c0 .55.45 1 1 1h2v2l1.5-1.5L6 16v-2h5c.55 0 1-.45 1-1v-3H2V1zm9 10v2H6v-1H3v1H1v-2h10zM3 8h1v1H3V8zm1-1H3V6h1v1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// RepoForcePush returns an "repo-force-push" Octicon SVG node. -func RepoForcePush() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10 9H8v7H6V9H4l2.25-3H4l3-4 3 4H7.75L10 9zm1-9H1C.45 0 0 .45 0 1v12c0 .55.45 1 1 1h4v-1H1v-2h4v-1H2V1h9v9H9v1h2v2H9v1h2c.55 0 1-.45 1-1V1c0-.55-.45-1-1-1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// RepoForked returns an "repo-forked" Octicon SVG node. -func RepoForked() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8 1a1.993 1.993 0 0 0-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V6.5l3 3v1.78A1.993 1.993 0 0 0 5 15a1.993 1.993 0 0 0 1-3.72V9.5l3-3V4.72A1.993 1.993 0 0 0 8 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// RepoPull returns an "repo-pull" Octicon SVG node. -func RepoPull() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13 8V6H7V4h6V2l3 3-3 3zM4 2H3v1h1V2zm7 5h1v6c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1v2h-1V1H2v9h9V7zm0 4H1v2h2v-1h3v1h5v-2zM4 6H3v1h1V6zm0-2H3v1h1V4zM3 9h1V8H3v1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// RepoPush returns an "repo-push" Octicon SVG node. -func RepoPush() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4 3H3V2h1v1zM3 5h1V4H3v1zm4 0L4 9h2v7h2V9h2L7 5zm4-5H1C.45 0 0 .45 0 1v12c0 .55.45 1 1 1h4v-1H1v-2h4v-1H2V1h9.02L11 10H9v1h2v2H9v1h2c.55 0 1-.45 1-1V1c0-.55-.45-1-1-1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Report returns an "report" Octicon SVG node. -func Report() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M0 2a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H7l-4 4v-4H1a1 1 0 0 1-1-1V2zm1 0h14v9H6.5L4 13.5V11H1V2zm6 6h2v2H7V8zm0-5h2v4H7V3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Rocket returns an "rocket" Octicon SVG node. -func Rocket() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M12.17 3.83c-.27-.27-.47-.55-.63-.88-.16-.31-.27-.66-.34-1.02-.58.33-1.16.7-1.73 1.13-.58.44-1.14.94-1.69 1.48-.7.7-1.33 1.81-1.78 2.45H3L0 10h3l2-2c-.34.77-1.02 2.98-1 3l1 1c.02.02 2.23-.64 3-1l-2 2v3l3-3v-3c.64-.45 1.75-1.09 2.45-1.78.55-.55 1.05-1.13 1.47-1.7.44-.58.81-1.16 1.14-1.72-.36-.08-.7-.19-1.03-.34a3.39 3.39 0 0 1-.86-.63zM16 0s-.09.38-.3 1.06c-.2.7-.55 1.58-1.06 2.66-.7-.08-1.27-.33-1.66-.72-.39-.39-.63-.94-.7-1.64C13.36.84 14.23.48 14.92.28 15.62.08 16 0 16 0z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// RSS returns an "rss" Octicon SVG node. -func RSS() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M2 13H0v-2c1.11 0 2 .89 2 2zM0 3v1a9 9 0 0 1 9 9h1C10 7.48 5.52 3 0 3zm0 4v1c2.75 0 5 2.25 5 5h1c0-3.31-2.69-6-6-6z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Ruby returns an "ruby" Octicon SVG node. -func Ruby() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13 6l-5 5V4h3l2 2zm3 0l-8 8-8-8 4-4h8l4 4zm-8 6.5L14.5 6l-3-3h-7l-3 3L8 12.5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ScreenFull returns an "screen-full" Octicon SVG node. -func ScreenFull() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13 10h1v3c0 .547-.453 1-1 1h-3v-1h3v-3zM1 10H0v3c0 .547.453 1 1 1h3v-1H1v-3zm0-7h3V2H1c-.547 0-1 .453-1 1v3h1V3zm1 1h10v8H2V4zm2 6h6V6H4v4zm6-8v1h3v3h1V3c0-.547-.453-1-1-1h-3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ScreenNormal returns an "screen-normal" Octicon SVG node. -func ScreenNormal() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M2 4H0V3h2V1h1v2c0 .547-.453 1-1 1zm0 8H0v1h2v2h1v-2c0-.547-.453-1-1-1zm9-2c0 .547-.453 1-1 1H4c-.547 0-1-.453-1-1V6c0-.547.453-1 1-1h6c.547 0 1 .453 1 1v4zM9 7H5v2h4V7zm2 6v2h1v-2h2v-1h-2c-.547 0-1 .453-1 1zm1-10V1h-1v2c0 .547.453 1 1 1h2V3h-2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Search returns an "search" Octicon SVG node. -func Search() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M15.7 13.3l-3.81-3.83A5.93 5.93 0 0 0 13 6c0-3.31-2.69-6-6-6S1 2.69 1 6s2.69 6 6 6c1.3 0 2.48-.41 3.47-1.11l3.83 3.81c.19.2.45.3.7.3.25 0 .52-.09.7-.3a.996.996 0 0 0 0-1.41v.01zM7 10.7c-2.59 0-4.7-2.11-4.7-4.7 0-2.59 2.11-4.7 4.7-4.7 2.59 0 4.7 2.11 4.7 4.7 0 2.59-2.11 4.7-4.7 4.7z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Server returns an "server" Octicon SVG node. -func Server() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M11 6H1c-.55 0-1 .45-1 1v2c0 .55.45 1 1 1h10c.55 0 1-.45 1-1V7c0-.55-.45-1-1-1zM2 9H1V7h1v2zm2 0H3V7h1v2zm2 0H5V7h1v2zm2 0H7V7h1v2zm3-8H1c-.55 0-1 .45-1 1v2c0 .55.45 1 1 1h10c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1zM2 4H1V2h1v2zm2 0H3V2h1v2zm2 0H5V2h1v2zm2 0H7V2h1v2zm3-1h-1V2h1v1zm0 8H1c-.55 0-1 .45-1 1v2c0 .55.45 1 1 1h10c.55 0 1-.45 1-1v-2c0-.55-.45-1-1-1zm-9 3H1v-2h1v2zm2 0H3v-2h1v2zm2 0H5v-2h1v2zm2 0H7v-2h1v2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Settings returns an "settings" Octicon SVG node. -func Settings() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4 7H3V2h1v5zm-1 7h1v-3H3v3zm5 0h1V8H8v6zm5 0h1v-2h-1v2zm1-12h-1v6h1V2zM9 2H8v2h1V2zM5 8H2c-.55 0-1 .45-1 1s.45 1 1 1h3c.55 0 1-.45 1-1s-.45-1-1-1zm5-3H7c-.55 0-1 .45-1 1s.45 1 1 1h3c.55 0 1-.45 1-1s-.45-1-1-1zm5 4h-3c-.55 0-1 .45-1 1s.45 1 1 1h3c.55 0 1-.45 1-1s-.45-1-1-1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Shield returns an "shield" Octicon SVG node. -func Shield() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7 0L0 2v6.02C0 12.69 5.31 16 7 16c1.69 0 7-3.31 7-7.98V2L7 0zM5 11l1.14-2.8a.568.568 0 0 0-.25-.59C5.33 7.25 5 6.66 5 6c0-1.09.89-2 1.98-2C8.06 4 9 4.91 9 6c0 .66-.33 1.25-.89 1.61-.19.13-.3.36-.25.59L9 11H5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// SignIn returns an "sign-in" Octicon SVG node. -func SignIn() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7 6.75V12h4V8h1v4c0 .55-.45 1-1 1H7v3l-5.45-2.72c-.33-.17-.55-.52-.55-.91V1c0-.55.45-1 1-1h9c.55 0 1 .45 1 1v3h-1V1H3l4 2v2.25L10 3v2h4v2h-4v2L7 6.75z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// SignOut returns an "sign-out" Octicon SVG node. -func SignOut() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M11.992 8.994V6.996H7.995v-2h3.997V2.999l3.998 2.998-3.998 2.998zm-1.998 2.998H5.996V2.998L2 1h7.995v2.998h1V1c0-.55-.45-.999-1-.999H.999A1.001 1.001 0 0 0 0 1v11.372c0 .39.22.73.55.91L5.996 16v-3.008h3.998c.55 0 1-.45 1-1V7.996h-1v3.998z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Smiley returns an "smiley" Octicon SVG node. -func Smiley() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8 0C3.58 0 0 3.58 0 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm4.81 12.81a6.72 6.72 0 0 1-2.17 1.45c-.83.36-1.72.53-2.64.53-.92 0-1.81-.17-2.64-.53-.81-.34-1.55-.83-2.17-1.45a6.773 6.773 0 0 1-1.45-2.17A6.59 6.59 0 0 1 1.21 8c0-.92.17-1.81.53-2.64.34-.81.83-1.55 1.45-2.17.62-.62 1.36-1.11 2.17-1.45A6.59 6.59 0 0 1 8 1.21c.92 0 1.81.17 2.64.53.81.34 1.55.83 2.17 1.45.62.62 1.11 1.36 1.45 2.17.36.83.53 1.72.53 2.64 0 .92-.17 1.81-.53 2.64-.34.81-.83 1.55-1.45 2.17zM4 6.8v-.59c0-.66.53-1.19 1.2-1.19h.59c.66 0 1.19.53 1.19 1.19v.59c0 .67-.53 1.2-1.19 1.2H5.2C4.53 8 4 7.47 4 6.8zm5 0v-.59c0-.66.53-1.19 1.2-1.19h.59c.66 0 1.19.53 1.19 1.19v.59c0 .67-.53 1.2-1.19 1.2h-.59C9.53 8 9 7.47 9 6.8zm4 3.2c-.72 1.88-2.91 3-5 3s-4.28-1.13-5-3c-.14-.39.23-1 .66-1h8.59c.41 0 .89.61.75 1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Squirrel returns an "squirrel" Octicon SVG node. -func Squirrel() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M12 1C9.79 1 8 2.31 8 3.92c0 1.94.5 3.03 0 6.08 0-4.5-2.77-6.34-4-6.34.05-.5-.48-.66-.48-.66s-.22.11-.3.34c-.27-.31-.56-.27-.56-.27l-.13.58S.7 4.29.68 6.87c.2.33 1.53.6 2.47.43.89.05.67.79.47.99C2.78 9.13 2 8 1 8S0 9 1 9s1 1 3 1c-3.09 1.2 0 4 0 4H3c-1 0-1 1-1 1h6c3 0 5-1 5-3.47 0-.85-.43-1.79-1-2.53-1.11-1.46.23-2.68 1-2 .77.68 3 1 3-2 0-2.21-1.79-4-4-4zM2.5 6c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Star returns an "star" Octicon SVG node. -func Star() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74L14 6z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Stop returns an "stop" Octicon SVG node. -func Stop() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10 1H4L0 5v6l4 4h6l4-4V5l-4-4zm3 9.5L9.5 14h-5L1 10.5v-5L4.5 2h5L13 5.5v5zM6 4h2v5H6V4zm0 6h2v2H6v-2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Sync returns an "sync" Octicon SVG node. -func Sync() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10.24 7.4a4.15 4.15 0 0 1-1.2 3.6 4.346 4.346 0 0 1-5.41.54L4.8 10.4.5 9.8l.6 4.2 1.31-1.26c2.36 1.74 5.7 1.57 7.84-.54a5.876 5.876 0 0 0 1.74-4.46l-1.75-.34zM2.96 5a4.346 4.346 0 0 1 5.41-.54L7.2 5.6l4.3.6-.6-4.2-1.31 1.26c-2.36-1.74-5.7-1.57-7.85.54C.5 5.03-.06 6.65.01 8.26l1.75.35A4.17 4.17 0 0 1 2.96 5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Tag returns an "tag" Octicon SVG node. -func Tag() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7.685 1.72a2.49 2.49 0 0 0-1.76-.726H3.48A2.5 2.5 0 0 0 .994 3.48v2.456c0 .656.269 1.292.726 1.76l6.024 6.024a.99.99 0 0 0 1.402 0l4.563-4.563a.99.99 0 0 0 0-1.402L7.685 1.72zM2.366 7.048A1.54 1.54 0 0 1 1.9 5.925V3.48c0-.874.716-1.58 1.58-1.58h2.456c.418 0 .825.159 1.123.467l6.104 6.094-4.702 4.702-6.094-6.114zm.626-4.066h1.989v1.989H2.982V2.982h.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Tasklist returns an "tasklist" Octicon SVG node. -func Tasklist() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M15.41 9H7.59C7 9 7 8.59 7 8c0-.59 0-1 .59-1h7.81c.59 0 .59.41.59 1 0 .59 0 1-.59 1h.01zM9.59 4C9 4 9 3.59 9 3c0-.59 0-1 .59-1h5.81c.59 0 .59.41.59 1 0 .59 0 1-.59 1H9.59zM0 3.91l1.41-1.3L3 4.2 7.09 0 8.5 1.41 3 6.91l-3-3zM7.59 12h7.81c.59 0 .59.41.59 1 0 .59 0 1-.59 1H7.59C7 14 7 13.59 7 13c0-.59 0-1 .59-1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Telescope returns an "telescope" Octicon SVG node. -func Telescope() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M8 9l3 6h-1l-2-4v5H7v-6l-2 5H4l2-5 2-1zM7 0H6v1h1V0zM5 3H4v1h1V3zM2 1H1v1h1V1zM.63 9a.52.52 0 0 0-.16.67l.55.92c.13.23.41.31.64.2l1.39-.66-1.16-2-1.27.86.01.01zm7.89-5.39l-5.8 3.95L3.95 9.7l6.33-3.03-1.77-3.06h.01zm4.22 1.28l-1.47-2.52a.51.51 0 0 0-.72-.17l-1.2.83 1.84 3.2 1.33-.64c.27-.13.36-.44.22-.7z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Terminal returns an "terminal" Octicon SVG node. -func Terminal() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7 10h4v1H7v-1zm-3 1l3-3-3-3-.75.75L5.5 8l-2.25 2.25L4 11zm10-8v10c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h12c.55 0 1 .45 1 1zm-1 0H1v10h12V3z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// TextSize returns an "text-size" Octicon SVG node. -func TextSize() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13.62 9.08L12.1 3.66h-.06l-1.5 5.42h3.08zM5.7 10.13S4.68 6.52 4.53 6.02h-.08l-1.13 4.11H5.7zM17.31 14h-2.25l-.95-3.25h-4.07L9.09 14H6.84l-.69-2.33H2.87L2.17 14H0l3.3-9.59h2.5l2.17 6.34L10.86 2h2.52l3.94 12h-.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 18 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// ThreeBars returns an "three-bars" Octicon SVG node. -func ThreeBars() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M11.41 9H.59C0 9 0 8.59 0 8c0-.59 0-1 .59-1H11.4c.59 0 .59.41.59 1 0 .59 0 1-.59 1h.01zm0-4H.59C0 5 0 4.59 0 4c0-.59 0-1 .59-1H11.4c.59 0 .59.41.59 1 0 .59 0 1-.59 1h.01zM.59 11H11.4c.59 0 .59.41.59 1 0 .59 0 1-.59 1H.59C0 13 0 12.59 0 12c0-.59 0-1 .59-1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Thumbsdown returns an "thumbsdown" Octicon SVG node. -func Thumbsdown() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M15.97 7.825L15 1.88C14.83.499 13.123 0 11.994 0H5.686c-.2 0-.38.05-.53.14L3.719 1h-1.72C.94 1 0 1.938 0 2.997v3.998c0 1.059.94 2.018 1.999 1.998h1.999c.909 0 1.389.45 2.388 1.55.91.999.88 1.798.63 3.267-.08.5.06 1 .42 1.42.39.47.979.769 1.558.769 1.83 0 2.999-3.718 2.999-5.017l-.02-.98h2.038c1.16 0 1.949-.799 1.979-1.968 0-.06.02-.13-.02-.2v-.01zm-1.969 1.19h-1.989c-.7 0-1.029.28-1.029.969l.03 1.03c0 1.268-1.17 3.997-1.999 3.997-.5 0-1.079-.5-.999-1 .25-1.579.34-2.778-.89-4.137-1.019-1.13-1.768-1.879-3.127-1.879V1.999l1.668-1h6.327c.729 0 1.948.31 1.998 1l.02.02 1 5.996c-.03.64-.38 1-1 1h-.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Thumbsup returns an "thumbsup" Octicon SVG node. -func Thumbsup() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13.991 13.991c-.05.69-1.269 1-1.998 1H5.666l-1.668-1V7.995c1.359 0 2.108-.75 3.128-1.879 1.229-1.359 1.139-2.558.879-4.127-.08-.5.5-1 1-1 .829 0 1.998 2.729 1.998 3.998l-.02 1.03c0 .689.33.969 1.02.969H14c.63 0 .98.36 1 .999l-1 5.996-.01.01zm0-7.995h-2.018l.02-.98C11.993 3.719 10.823 0 8.994 0c-.58 0-1.169.3-1.559.77-.36.41-.5.909-.42 1.409.25 1.479.28 2.278-.629 3.278-1 1.089-1.48 1.549-2.388 1.549h-2C.94 6.996 0 7.935 0 8.994v3.998c0 1.06.94 1.999 1.999 1.999h1.719l1.439.86c.16.089.33.139.52.139h6.325c1.13 0 2.839-.5 2.999-1.879l.979-5.946c.02-.08.02-.14.02-.2-.03-1.17-.84-1.969-1.999-1.969h-.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Tools returns an "tools" Octicon SVG node. -func Tools() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M4.48 7.27c.26.26 1.28 1.33 1.28 1.33l.56-.58-.88-.91 1.69-1.8s-.76-.74-.43-.45c.32-1.19.03-2.51-.87-3.44C4.93.5 3.66.2 2.52.51l1.93 2-.51 1.96-1.89.52-1.93-2C-.19 4.17.1 5.48 1 6.4c.94.98 2.29 1.26 3.48.87zm6.44 1.94l-2.33 2.3 3.84 3.98c.31.33.73.49 1.14.49.41 0 .82-.16 1.14-.49.63-.65.63-1.7 0-2.35l-3.79-3.93zM16 2.53L13.55 0 6.33 7.46l.88.91-4.31 4.46-.99.53-1.39 2.27.35.37 2.2-1.44.51-1.02L7.9 9.08l.88.91L16 2.53z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Trashcan returns an "trashcan" Octicon SVG node. -func Trashcan() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// TriangleDown returns an "triangle-down" Octicon SVG node. -func TriangleDown() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M0 5l6 6 6-6H0z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// TriangleLeft returns an "triangle-left" Octicon SVG node. -func TriangleLeft() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 2L0 8l6 6V2z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 6 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// TriangleRight returns an "triangle-right" Octicon SVG node. -func TriangleRight() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M0 14l6-6-6-6v12z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 6 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// TriangleUp returns an "triangle-up" Octicon SVG node. -func TriangleUp() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M12 11L6 5l-6 6h12z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Unfold returns an "unfold" Octicon SVG node. -func Unfold() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M11.5 7.5L14 10c0 .55-.45 1-1 1H9v-1h3.5l-2-2h-7l-2 2H5v1H1c-.55 0-1-.45-1-1l2.5-2.5L0 5c0-.55.45-1 1-1h4v1H1.5l2 2h7l2-2H9V4h4c.55 0 1 .45 1 1l-2.5 2.5zM6 6h2V3h2L7 0 4 3h2v3zm2 3H6v3H4l3 3 3-3H8V9z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Unmute returns an "unmute" Octicon SVG node. -func Unmute() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M12 8.02c0 1.09-.45 2.09-1.17 2.83l-.67-.67c.55-.56.89-1.31.89-2.16 0-.85-.34-1.61-.89-2.16l.67-.67A3.99 3.99 0 0 1 12 8.02zM7.72 2.28L4 6H2c-.55 0-1 .45-1 1v2c0 .55.45 1 1 1h2l3.72 3.72c.47.47 1.28.14 1.28-.53V2.81c0-.67-.81-1-1.28-.53zm5.94.08l-.67.67a6.996 6.996 0 0 1 2.06 4.98c0 1.94-.78 3.7-2.06 4.98l.67.67A7.973 7.973 0 0 0 16 8c0-2.22-.89-4.22-2.34-5.66v.02zm-1.41 1.41l-.69.67a5.05 5.05 0 0 1 1.48 3.58c0 1.39-.56 2.66-1.48 3.56l.69.67A5.97 5.97 0 0 0 14 8.02c0-1.65-.67-3.16-1.75-4.25z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Unverified returns an "unverified" Octicon SVG node. -func Unverified() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M15.67 7.066l-1.08-1.34a1.5 1.5 0 0 1-.309-.77l-.19-1.698a1.51 1.51 0 0 0-1.329-1.33l-1.699-.19c-.3-.03-.56-.159-.78-.329L8.945.33a1.504 1.504 0 0 0-1.878 0l-1.34 1.08a1.5 1.5 0 0 1-.77.31l-1.698.19c-.7.08-1.25.63-1.33 1.329l-.19 1.699c-.03.3-.159.56-.329.78L.33 7.055a1.504 1.504 0 0 0 0 1.878l1.08 1.34c.17.22.28.48.31.77l.19 1.698c.08.7.63 1.25 1.329 1.33l1.699.19c.3.03.56.159.78.329l1.339 1.08c.55.439 1.329.439 1.878 0l1.34-1.08c.22-.17.48-.28.77-.31l1.698-.19c.7-.08 1.25-.63 1.33-1.329l.19-1.699c.03-.3.159-.56.329-.78l1.08-1.339a1.504 1.504 0 0 0 0-1.878zm-6.666 4.437c0 .28-.22.5-.5.5h-.999c-.27 0-.5-.22-.5-.5v-1c0-.28.23-.5.5-.5h1c.28 0 .5.22.5.5v1zm1.56-4.887c-.06.17-.17.33-.3.47-.13.16-.14.19-.33.38-.16.17-.31.3-.52.45-.11.089-.2.189-.28.269-.08.08-.14.17-.19.27-.05.1-.08.19-.11.3-.03.11-.03.13-.03.25H7.136c0-.22 0-.31.03-.48.03-.19.08-.36.14-.52.06-.14.14-.28.25-.42.11-.13.23-.25.409-.38.27-.19.36-.3.48-.52.12-.219.2-.379.2-.589 0-.27-.06-.45-.2-.58-.13-.13-.31-.19-.58-.19-.09 0-.19.02-.3.05-.11.03-.17.09-.25.16-.08.07-.14.11-.2.2a.41.41 0 0 0-.09.28H5.028c0-.38.13-.56.27-.83.16-.27.36-.499.61-.669.25-.17.549-.3.879-.38.33-.08.7-.13 1.09-.13.439 0 .829.05 1.168.13.34.09.63.22.88.39.23.17.41.38.55.63.13.25.19.55.19.88 0 .22 0 .419-.08.589l-.02-.01z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Verified returns an "verified" Octicon SVG node. -func Verified() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M15.67 7.066l-1.08-1.34a1.5 1.5 0 0 1-.309-.77l-.19-1.698a1.51 1.51 0 0 0-1.329-1.33l-1.699-.19c-.3-.03-.56-.159-.78-.329L8.945.33a1.504 1.504 0 0 0-1.878 0l-1.34 1.08a1.5 1.5 0 0 1-.77.31l-1.698.19c-.7.08-1.25.63-1.33 1.329l-.19 1.699c-.03.3-.159.56-.329.78L.33 7.055a1.504 1.504 0 0 0 0 1.878l1.08 1.34c.17.22.28.48.31.77l.19 1.698c.08.7.63 1.25 1.329 1.33l1.699.19c.3.03.56.159.78.329l1.339 1.08c.55.439 1.329.439 1.878 0l1.34-1.08c.22-.17.48-.28.77-.31l1.698-.19c.7-.08 1.25-.63 1.33-1.329l.19-1.699c.03-.3.159-.56.329-.78l1.08-1.339a1.504 1.504 0 0 0 0-1.878zm-9.164 4.936L3.008 8.505l1.5-1.5 1.998 2 4.997-4.997 1.499 1.549-6.496 6.445z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 16 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Versions returns an "versions" Octicon SVG node. -func Versions() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M13 3H7c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h6c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zm-1 8H8V5h4v6zM4 4h1v1H4v6h1v1H4c-.55 0-1-.45-1-1V5c0-.55.45-1 1-1zM1 5h1v1H1v4h1v1H1c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 14 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Watch returns an "watch" Octicon SVG node. -func Watch() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M6 8h2v1H5V5h1v3zm6 0c0 2.22-1.2 4.16-3 5.19V15c0 .55-.45 1-1 1H4c-.55 0-1-.45-1-1v-1.81C1.2 12.16 0 10.22 0 8s1.2-4.16 3-5.19V1c0-.55.45-1 1-1h4c.55 0 1 .45 1 1v1.81c1.8 1.03 3 2.97 3 5.19zm-1 0c0-2.77-2.23-5-5-5S1 5.23 1 8s2.23 5 5 5 5-2.23 5-5z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// X returns an "x" Octicon SVG node. -func X() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 12 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} - -// Zap returns an "zap" Octicon SVG node. -func Zap() *html.Node { - return &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: &html.Node{ - Parent: (*html.Node)(nil), - FirstChild: (*html.Node)(nil), - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(0), - Data: (string)("path"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("d"), - Val: (string)("M10 7H6l3-7-9 9h4l-3 7 9-9z"), - }, - }, - }, - LastChild: (*html.Node)(nil), - PrevSibling: (*html.Node)(nil), - NextSibling: (*html.Node)(nil), - Type: (html.NodeType)(3), - DataAtom: (atom.Atom)(462339), - Data: (string)("svg"), - Namespace: (string)("svg"), - Attr: []html.Attribute{ - { - Namespace: (string)(""), - Key: (string)("xmlns"), - Val: (string)("http://www.w3.org/2000/svg"), - }, - { - Namespace: (string)(""), - Key: (string)("width"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("height"), - Val: (string)("16"), - }, - { - Namespace: (string)(""), - Key: (string)("viewBox"), - Val: (string)("0 0 10 16"), - }, - { - Namespace: (string)(""), - Key: (string)("style"), - Val: (string)("fill: currentColor; vertical-align: top;"), - }, - }, - } -} diff --git a/vendor/github.com/shurcooL/sanitized_anchor_name/.travis.yml b/vendor/github.com/shurcooL/sanitized_anchor_name/.travis.yml deleted file mode 100644 index 93b1fcd..0000000 --- a/vendor/github.com/shurcooL/sanitized_anchor_name/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -sudo: false -language: go -go: - - 1.x - - master -matrix: - allow_failures: - - go: master - fast_finish: true -install: - - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). -script: - - go get -t -v ./... - - diff -u <(echo -n) <(gofmt -d -s .) - - go tool vet . - - go test -v -race ./... diff --git a/vendor/github.com/shurcooL/sanitized_anchor_name/LICENSE b/vendor/github.com/shurcooL/sanitized_anchor_name/LICENSE deleted file mode 100644 index c35c17a..0000000 --- a/vendor/github.com/shurcooL/sanitized_anchor_name/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2015 Dmitri Shuralyov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/shurcooL/sanitized_anchor_name/README.md b/vendor/github.com/shurcooL/sanitized_anchor_name/README.md deleted file mode 100644 index 670bf0f..0000000 --- a/vendor/github.com/shurcooL/sanitized_anchor_name/README.md +++ /dev/null @@ -1,36 +0,0 @@ -sanitized_anchor_name -===================== - -[![Build Status](https://travis-ci.org/shurcooL/sanitized_anchor_name.svg?branch=master)](https://travis-ci.org/shurcooL/sanitized_anchor_name) [![GoDoc](https://godoc.org/github.com/shurcooL/sanitized_anchor_name?status.svg)](https://godoc.org/github.com/shurcooL/sanitized_anchor_name) - -Package sanitized_anchor_name provides a func to create sanitized anchor names. - -Its logic can be reused by multiple packages to create interoperable anchor names -and links to those anchors. - -At this time, it does not try to ensure that generated anchor names -are unique, that responsibility falls on the caller. - -Installation ------------- - -```bash -go get -u github.com/shurcooL/sanitized_anchor_name -``` - -Example -------- - -```Go -anchorName := sanitized_anchor_name.Create("This is a header") - -fmt.Println(anchorName) - -// Output: -// this-is-a-header -``` - -License -------- - -- [MIT License](LICENSE) diff --git a/vendor/github.com/shurcooL/sanitized_anchor_name/main.go b/vendor/github.com/shurcooL/sanitized_anchor_name/main.go deleted file mode 100644 index 6a77d12..0000000 --- a/vendor/github.com/shurcooL/sanitized_anchor_name/main.go +++ /dev/null @@ -1,29 +0,0 @@ -// Package sanitized_anchor_name provides a func to create sanitized anchor names. -// -// Its logic can be reused by multiple packages to create interoperable anchor names -// and links to those anchors. -// -// At this time, it does not try to ensure that generated anchor names -// are unique, that responsibility falls on the caller. -package sanitized_anchor_name // import "github.com/shurcooL/sanitized_anchor_name" - -import "unicode" - -// Create returns a sanitized anchor name for the given text. -func Create(text string) string { - var anchorName []rune - var futureDash = false - for _, r := range text { - switch { - case unicode.IsLetter(r) || unicode.IsNumber(r): - if futureDash && len(anchorName) > 0 { - anchorName = append(anchorName, '-') - } - futureDash = false - anchorName = append(anchorName, unicode.ToLower(r)) - default: - futureDash = true - } - } - return string(anchorName) -} diff --git a/vendor/github.com/sirupsen/logrus/.gitignore b/vendor/github.com/sirupsen/logrus/.gitignore deleted file mode 100644 index 66be63a..0000000 --- a/vendor/github.com/sirupsen/logrus/.gitignore +++ /dev/null @@ -1 +0,0 @@ -logrus diff --git a/vendor/github.com/sirupsen/logrus/.travis.yml b/vendor/github.com/sirupsen/logrus/.travis.yml deleted file mode 100644 index 1f953be..0000000 --- a/vendor/github.com/sirupsen/logrus/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -language: go -env: - - GOMAXPROCS=4 GORACE=halt_on_error=1 -matrix: - include: - - go: 1.10.x - install: - - go get github.com/stretchr/testify/assert - - go get golang.org/x/crypto/ssh/terminal - - go get golang.org/x/sys/unix - - go get golang.org/x/sys/windows - script: - - go test -race -v ./... - - go: 1.11.x - env: GO111MODULE=on - install: - - go mod download - script: - - go test -race -v ./... - - go: 1.11.x - env: GO111MODULE=off - install: - - go get github.com/stretchr/testify/assert - - go get golang.org/x/crypto/ssh/terminal - - go get golang.org/x/sys/unix - - go get golang.org/x/sys/windows - script: - - go test -race -v ./... - - go: 1.10.x - install: - - go get github.com/stretchr/testify/assert - - go get golang.org/x/crypto/ssh/terminal - - go get golang.org/x/sys/unix - - go get golang.org/x/sys/windows - script: - - go test -race -v -tags appengine ./... - - go: 1.11.x - env: GO111MODULE=on - install: - - go mod download - script: - - go test -race -v -tags appengine ./... - - go: 1.11.x - env: GO111MODULE=off - install: - - go get github.com/stretchr/testify/assert - - go get golang.org/x/crypto/ssh/terminal - - go get golang.org/x/sys/unix - - go get golang.org/x/sys/windows - script: - - go test -race -v -tags appengine ./... diff --git a/vendor/github.com/sirupsen/logrus/CHANGELOG.md b/vendor/github.com/sirupsen/logrus/CHANGELOG.md deleted file mode 100644 index 1702696..0000000 --- a/vendor/github.com/sirupsen/logrus/CHANGELOG.md +++ /dev/null @@ -1,153 +0,0 @@ -# 1.1.0 -This new release introduces: - * several fixes: - * a fix for a race condition on entry formatting - * proper cleanup of previously used entries before putting them back in the pool - * the extra new line at the end of message in text formatter has been removed - * a new global public API to check if a level is activated: IsLevelEnabled - * the following methods have been added to the Logger object - * IsLevelEnabled - * SetFormatter - * SetOutput - * ReplaceHooks - * introduction of go module - * an indent configuration for the json formatter - * output colour support for windows - * the field sort function is now configurable for text formatter - * the CLICOLOR and CLICOLOR\_FORCE environment variable support in text formater - -# 1.0.6 - -This new release introduces: - * a new api WithTime which allows to easily force the time of the log entry - which is mostly useful for logger wrapper - * a fix reverting the immutability of the entry given as parameter to the hooks - a new configuration field of the json formatter in order to put all the fields - in a nested dictionnary - * a new SetOutput method in the Logger - * a new configuration of the textformatter to configure the name of the default keys - * a new configuration of the text formatter to disable the level truncation - -# 1.0.5 - -* Fix hooks race (#707) -* Fix panic deadlock (#695) - -# 1.0.4 - -* Fix race when adding hooks (#612) -* Fix terminal check in AppEngine (#635) - -# 1.0.3 - -* Replace example files with testable examples - -# 1.0.2 - -* bug: quote non-string values in text formatter (#583) -* Make (*Logger) SetLevel a public method - -# 1.0.1 - -* bug: fix escaping in text formatter (#575) - -# 1.0.0 - -* Officially changed name to lower-case -* bug: colors on Windows 10 (#541) -* bug: fix race in accessing level (#512) - -# 0.11.5 - -* feature: add writer and writerlevel to entry (#372) - -# 0.11.4 - -* bug: fix undefined variable on solaris (#493) - -# 0.11.3 - -* formatter: configure quoting of empty values (#484) -* formatter: configure quoting character (default is `"`) (#484) -* bug: fix not importing io correctly in non-linux environments (#481) - -# 0.11.2 - -* bug: fix windows terminal detection (#476) - -# 0.11.1 - -* bug: fix tty detection with custom out (#471) - -# 0.11.0 - -* performance: Use bufferpool to allocate (#370) -* terminal: terminal detection for app-engine (#343) -* feature: exit handler (#375) - -# 0.10.0 - -* feature: Add a test hook (#180) -* feature: `ParseLevel` is now case-insensitive (#326) -* feature: `FieldLogger` interface that generalizes `Logger` and `Entry` (#308) -* performance: avoid re-allocations on `WithFields` (#335) - -# 0.9.0 - -* logrus/text_formatter: don't emit empty msg -* logrus/hooks/airbrake: move out of main repository -* logrus/hooks/sentry: move out of main repository -* logrus/hooks/papertrail: move out of main repository -* logrus/hooks/bugsnag: move out of main repository -* logrus/core: run tests with `-race` -* logrus/core: detect TTY based on `stderr` -* logrus/core: support `WithError` on logger -* logrus/core: Solaris support - -# 0.8.7 - -* logrus/core: fix possible race (#216) -* logrus/doc: small typo fixes and doc improvements - - -# 0.8.6 - -* hooks/raven: allow passing an initialized client - -# 0.8.5 - -* logrus/core: revert #208 - -# 0.8.4 - -* formatter/text: fix data race (#218) - -# 0.8.3 - -* logrus/core: fix entry log level (#208) -* logrus/core: improve performance of text formatter by 40% -* logrus/core: expose `LevelHooks` type -* logrus/core: add support for DragonflyBSD and NetBSD -* formatter/text: print structs more verbosely - -# 0.8.2 - -* logrus: fix more Fatal family functions - -# 0.8.1 - -* logrus: fix not exiting on `Fatalf` and `Fatalln` - -# 0.8.0 - -* logrus: defaults to stderr instead of stdout -* hooks/sentry: add special field for `*http.Request` -* formatter/text: ignore Windows for colors - -# 0.7.3 - -* formatter/\*: allow configuration of timestamp layout - -# 0.7.2 - -* formatter/text: Add configuration option for time format (#158) diff --git a/vendor/github.com/sirupsen/logrus/LICENSE b/vendor/github.com/sirupsen/logrus/LICENSE deleted file mode 100644 index f090cb4..0000000 --- a/vendor/github.com/sirupsen/logrus/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Simon Eskildsen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md deleted file mode 100644 index 072e99b..0000000 --- a/vendor/github.com/sirupsen/logrus/README.md +++ /dev/null @@ -1,461 +0,0 @@ -# Logrus :walrus: [![Build Status](https://travis-ci.org/sirupsen/logrus.svg?branch=master)](https://travis-ci.org/sirupsen/logrus) [![GoDoc](https://godoc.org/github.com/sirupsen/logrus?status.svg)](https://godoc.org/github.com/sirupsen/logrus) - -Logrus is a structured logger for Go (golang), completely API compatible with -the standard library logger. - -**Seeing weird case-sensitive problems?** It's in the past been possible to -import Logrus as both upper- and lower-case. Due to the Go package environment, -this caused issues in the community and we needed a standard. Some environments -experienced problems with the upper-case variant, so the lower-case was decided. -Everything using `logrus` will need to use the lower-case: -`github.com/sirupsen/logrus`. Any package that isn't, should be changed. - -To fix Glide, see [these -comments](https://github.com/sirupsen/logrus/issues/553#issuecomment-306591437). -For an in-depth explanation of the casing issue, see [this -comment](https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276). - -**Are you interested in assisting in maintaining Logrus?** Currently I have a -lot of obligations, and I am unable to provide Logrus with the maintainership it -needs. If you'd like to help, please reach out to me at `simon at author's -username dot com`. - -Nicely color-coded in development (when a TTY is attached, otherwise just -plain text): - -![Colored](http://i.imgur.com/PY7qMwd.png) - -With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash -or Splunk: - -```json -{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the -ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"} - -{"level":"warning","msg":"The group's number increased tremendously!", -"number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"} - -{"animal":"walrus","level":"info","msg":"A giant walrus appears!", -"size":10,"time":"2014-03-10 19:57:38.562500591 -0400 EDT"} - -{"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.", -"size":9,"time":"2014-03-10 19:57:38.562527896 -0400 EDT"} - -{"level":"fatal","msg":"The ice breaks!","number":100,"omg":true, -"time":"2014-03-10 19:57:38.562543128 -0400 EDT"} -``` - -With the default `log.SetFormatter(&log.TextFormatter{})` when a TTY is not -attached, the output is compatible with the -[logfmt](http://godoc.org/github.com/kr/logfmt) format: - -```text -time="2015-03-26T01:27:38-04:00" level=debug msg="Started observing beach" animal=walrus number=8 -time="2015-03-26T01:27:38-04:00" level=info msg="A group of walrus emerges from the ocean" animal=walrus size=10 -time="2015-03-26T01:27:38-04:00" level=warning msg="The group's number increased tremendously!" number=122 omg=true -time="2015-03-26T01:27:38-04:00" level=debug msg="Temperature changes" temperature=-4 -time="2015-03-26T01:27:38-04:00" level=panic msg="It's over 9000!" animal=orca size=9009 -time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" err=&{0x2082280c0 map[animal:orca size:9009] 2015-03-26 01:27:38.441574009 -0400 EDT panic It's over 9000!} number=100 omg=true -exit status 1 -``` - -#### Case-sensitivity - -The organization's name was changed to lower-case--and this will not be changed -back. If you are getting import conflicts due to case sensitivity, please use -the lower-case import: `github.com/sirupsen/logrus`. - -#### Example - -The simplest way to use Logrus is simply the package-level exported logger: - -```go -package main - -import ( - log "github.com/sirupsen/logrus" -) - -func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - }).Info("A walrus appears") -} -``` - -Note that it's completely api-compatible with the stdlib logger, so you can -replace your `log` imports everywhere with `log "github.com/sirupsen/logrus"` -and you'll now have the flexibility of Logrus. You can customize it all you -want: - -```go -package main - -import ( - "os" - log "github.com/sirupsen/logrus" -) - -func init() { - // Log as JSON instead of the default ASCII formatter. - log.SetFormatter(&log.JSONFormatter{}) - - // Output to stdout instead of the default stderr - // Can be any io.Writer, see below for File example - log.SetOutput(os.Stdout) - - // Only log the warning severity or above. - log.SetLevel(log.WarnLevel) -} - -func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") - - log.WithFields(log.Fields{ - "omg": true, - "number": 122, - }).Warn("The group's number increased tremendously!") - - log.WithFields(log.Fields{ - "omg": true, - "number": 100, - }).Fatal("The ice breaks!") - - // A common pattern is to re-use fields between logging statements by re-using - // the logrus.Entry returned from WithFields() - contextLogger := log.WithFields(log.Fields{ - "common": "this is a common field", - "other": "I also should be logged always", - }) - - contextLogger.Info("I'll be logged with common and other field") - contextLogger.Info("Me too") -} -``` - -For more advanced usage such as logging to multiple locations from the same -application, you can also create an instance of the `logrus` Logger: - -```go -package main - -import ( - "os" - "github.com/sirupsen/logrus" -) - -// Create a new instance of the logger. You can have any number of instances. -var log = logrus.New() - -func main() { - // The API for setting attributes is a little different than the package level - // exported logger. See Godoc. - log.Out = os.Stdout - - // You could set this to any `io.Writer` such as a file - // file, err := os.OpenFile("logrus.log", os.O_CREATE|os.O_WRONLY, 0666) - // if err == nil { - // log.Out = file - // } else { - // log.Info("Failed to log to file, using default stderr") - // } - - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") -} -``` - -#### Fields - -Logrus encourages careful, structured logging through logging fields instead of -long, unparseable error messages. For example, instead of: `log.Fatalf("Failed -to send event %s to topic %s with key %d")`, you should log the much more -discoverable: - -```go -log.WithFields(log.Fields{ - "event": event, - "topic": topic, - "key": key, -}).Fatal("Failed to send event") -``` - -We've found this API forces you to think about logging in a way that produces -much more useful logging messages. We've been in countless situations where just -a single added field to a log statement that was already there would've saved us -hours. The `WithFields` call is optional. - -In general, with Logrus using any of the `printf`-family functions should be -seen as a hint you should add a field, however, you can still use the -`printf`-family functions with Logrus. - -#### Default Fields - -Often it's helpful to have fields _always_ attached to log statements in an -application or parts of one. For example, you may want to always log the -`request_id` and `user_ip` in the context of a request. Instead of writing -`log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip})` on -every line, you can create a `logrus.Entry` to pass around instead: - -```go -requestLogger := log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip}) -requestLogger.Info("something happened on that request") # will log request_id and user_ip -requestLogger.Warn("something not great happened") -``` - -#### Hooks - -You can add hooks for logging levels. For example to send errors to an exception -tracking service on `Error`, `Fatal` and `Panic`, info to StatsD or log to -multiple places simultaneously, e.g. syslog. - -Logrus comes with [built-in hooks](hooks/). Add those, or your custom hook, in -`init`: - -```go -import ( - log "github.com/sirupsen/logrus" - "gopkg.in/gemnasium/logrus-airbrake-hook.v2" // the package is named "airbrake" - logrus_syslog "github.com/sirupsen/logrus/hooks/syslog" - "log/syslog" -) - -func init() { - - // Use the Airbrake hook to report errors that have Error severity or above to - // an exception tracker. You can create custom hooks, see the Hooks section. - log.AddHook(airbrake.NewHook(123, "xyz", "production")) - - hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") - if err != nil { - log.Error("Unable to connect to local syslog daemon") - } else { - log.AddHook(hook) - } -} -``` -Note: Syslog hook also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md). - -A list of currently known of service hook can be found in this wiki [page](https://github.com/sirupsen/logrus/wiki/Hooks) - - -#### Level logging - -Logrus has six logging levels: Debug, Info, Warning, Error, Fatal and Panic. - -```go -log.Debug("Useful debugging information.") -log.Info("Something noteworthy happened!") -log.Warn("You should probably take a look at this.") -log.Error("Something failed but I'm not quitting.") -// Calls os.Exit(1) after logging -log.Fatal("Bye.") -// Calls panic() after logging -log.Panic("I'm bailing.") -``` - -You can set the logging level on a `Logger`, then it will only log entries with -that severity or anything above it: - -```go -// Will log anything that is info or above (warn, error, fatal, panic). Default. -log.SetLevel(log.InfoLevel) -``` - -It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose -environment if your application has that. - -#### Entries - -Besides the fields added with `WithField` or `WithFields` some fields are -automatically added to all logging events: - -1. `time`. The timestamp when the entry was created. -2. `msg`. The logging message passed to `{Info,Warn,Error,Fatal,Panic}` after - the `AddFields` call. E.g. `Failed to send event.` -3. `level`. The logging level. E.g. `info`. - -#### Environments - -Logrus has no notion of environment. - -If you wish for hooks and formatters to only be used in specific environments, -you should handle that yourself. For example, if your application has a global -variable `Environment`, which is a string representation of the environment you -could do: - -```go -import ( - log "github.com/sirupsen/logrus" -) - -init() { - // do something here to set environment depending on an environment variable - // or command-line flag - if Environment == "production" { - log.SetFormatter(&log.JSONFormatter{}) - } else { - // The TextFormatter is default, you don't actually have to do this. - log.SetFormatter(&log.TextFormatter{}) - } -} -``` - -This configuration is how `logrus` was intended to be used, but JSON in -production is mostly only useful if you do log aggregation with tools like -Splunk or Logstash. - -#### Formatters - -The built-in logging formatters are: - -* `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise - without colors. - * *Note:* to force colored output when there is no TTY, set the `ForceColors` - field to `true`. To force no colored output even if there is a TTY set the - `DisableColors` field to `true`. For Windows, see - [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable). - * When colors are enabled, levels are truncated to 4 characters by default. To disable - truncation set the `DisableLevelTruncation` field to `true`. - * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#TextFormatter). -* `logrus.JSONFormatter`. Logs fields as JSON. - * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#JSONFormatter). - -Third party logging formatters: - -* [`FluentdFormatter`](https://github.com/joonix/log). Formats entries that can be parsed by Kubernetes and Google Container Engine. -* [`logstash`](https://github.com/bshuster-repo/logrus-logstash-hook). Logs fields as [Logstash](http://logstash.net) Events. -* [`prefixed`](https://github.com/x-cray/logrus-prefixed-formatter). Displays log entry source along with alternative layout. -* [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the P͉̫o̳̼̊w̖͈̰͎e̬͔̭͂r͚̼̹̲ ̫͓͉̳͈ō̠͕͖̚f̝͍̠ ͕̲̞͖͑Z̖̫̤̫ͪa͉̬͈̗l͖͎g̳̥o̰̥̅!̣͔̲̻͊̄ ̙̘̦̹̦. - -You can define your formatter by implementing the `Formatter` interface, -requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a -`Fields` type (`map[string]interface{}`) with all your fields as well as the -default ones (see Entries section above): - -```go -type MyJSONFormatter struct { -} - -log.SetFormatter(new(MyJSONFormatter)) - -func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) { - // Note this doesn't include Time, Level and Message which are available on - // the Entry. Consult `godoc` on information about those fields or read the - // source of the official loggers. - serialized, err := json.Marshal(entry.Data) - if err != nil { - return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) - } - return append(serialized, '\n'), nil -} -``` - -#### Logger as an `io.Writer` - -Logrus can be transformed into an `io.Writer`. That writer is the end of an `io.Pipe` and it is your responsibility to close it. - -```go -w := logger.Writer() -defer w.Close() - -srv := http.Server{ - // create a stdlib log.Logger that writes to - // logrus.Logger. - ErrorLog: log.New(w, "", 0), -} -``` - -Each line written to that writer will be printed the usual way, using formatters -and hooks. The level for those entries is `info`. - -This means that we can override the standard library logger easily: - -```go -logger := logrus.New() -logger.Formatter = &logrus.JSONFormatter{} - -// Use logrus for standard log output -// Note that `log` here references stdlib's log -// Not logrus imported under the name `log`. -log.SetOutput(logger.Writer()) -``` - -#### Rotation - -Log rotation is not provided with Logrus. Log rotation should be done by an -external program (like `logrotate(8)`) that can compress and delete old log -entries. It should not be a feature of the application-level logger. - -#### Tools - -| Tool | Description | -| ---- | ----------- | -|[Logrus Mate](https://github.com/gogap/logrus_mate)|Logrus mate is a tool for Logrus to manage loggers, you can initial logger's level, hook and formatter by config file, the logger will generated with different config at different environment.| -|[Logrus Viper Helper](https://github.com/heirko/go-contrib/tree/master/logrusHelper)|An Helper around Logrus to wrap with spf13/Viper to load configuration with fangs! And to simplify Logrus configuration use some behavior of [Logrus Mate](https://github.com/gogap/logrus_mate). [sample](https://github.com/heirko/iris-contrib/blob/master/middleware/logrus-logger/example) | - -#### Testing - -Logrus has a built in facility for asserting the presence of log messages. This is implemented through the `test` hook and provides: - -* decorators for existing logger (`test.NewLocal` and `test.NewGlobal`) which basically just add the `test` hook -* a test logger (`test.NewNullLogger`) that just records log messages (and does not output any): - -```go -import( - "github.com/sirupsen/logrus" - "github.com/sirupsen/logrus/hooks/test" - "github.com/stretchr/testify/assert" - "testing" -) - -func TestSomething(t*testing.T){ - logger, hook := test.NewNullLogger() - logger.Error("Helloerror") - - assert.Equal(t, 1, len(hook.Entries)) - assert.Equal(t, logrus.ErrorLevel, hook.LastEntry().Level) - assert.Equal(t, "Helloerror", hook.LastEntry().Message) - - hook.Reset() - assert.Nil(t, hook.LastEntry()) -} -``` - -#### Fatal handlers - -Logrus can register one or more functions that will be called when any `fatal` -level message is logged. The registered handlers will be executed before -logrus performs a `os.Exit(1)`. This behavior may be helpful if callers need -to gracefully shutdown. Unlike a `panic("Something went wrong...")` call which can be intercepted with a deferred `recover` a call to `os.Exit(1)` can not be intercepted. - -``` -... -handler := func() { - // gracefully shutdown something... -} -logrus.RegisterExitHandler(handler) -... -``` - -#### Thread safety - -By default, Logger is protected by a mutex for concurrent writes. The mutex is held when calling hooks and writing logs. -If you are sure such locking is not needed, you can call logger.SetNoLock() to disable the locking. - -Situation when locking is not needed includes: - -* You have no hooks registered, or hooks calling is already thread-safe. - -* Writing to logger.Out is already thread-safe, for example: - - 1) logger.Out is protected by locks. - - 2) logger.Out is a os.File handler opened with `O_APPEND` flag, and every write is smaller than 4k. (This allow multi-thread/multi-process writing) - - (Refer to http://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/) diff --git a/vendor/github.com/sirupsen/logrus/alt_exit.go b/vendor/github.com/sirupsen/logrus/alt_exit.go deleted file mode 100644 index 8af9063..0000000 --- a/vendor/github.com/sirupsen/logrus/alt_exit.go +++ /dev/null @@ -1,64 +0,0 @@ -package logrus - -// The following code was sourced and modified from the -// https://github.com/tebeka/atexit package governed by the following license: -// -// Copyright (c) 2012 Miki Tebeka . -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -// the Software, and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -import ( - "fmt" - "os" -) - -var handlers = []func(){} - -func runHandler(handler func()) { - defer func() { - if err := recover(); err != nil { - fmt.Fprintln(os.Stderr, "Error: Logrus exit handler error:", err) - } - }() - - handler() -} - -func runHandlers() { - for _, handler := range handlers { - runHandler(handler) - } -} - -// Exit runs all the Logrus atexit handlers and then terminates the program using os.Exit(code) -func Exit(code int) { - runHandlers() - os.Exit(code) -} - -// RegisterExitHandler adds a Logrus Exit handler, call logrus.Exit to invoke -// all handlers. The handlers will also be invoked when any Fatal log entry is -// made. -// -// This method is useful when a caller wishes to use logrus to log a fatal -// message but also needs to gracefully shutdown. An example usecase could be -// closing database connections, or sending a alert that the application is -// closing. -func RegisterExitHandler(handler func()) { - handlers = append(handlers, handler) -} diff --git a/vendor/github.com/sirupsen/logrus/appveyor.yml b/vendor/github.com/sirupsen/logrus/appveyor.yml deleted file mode 100644 index 96c2ce1..0000000 --- a/vendor/github.com/sirupsen/logrus/appveyor.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: "{build}" -platform: x64 -clone_folder: c:\gopath\src\github.com\sirupsen\logrus -environment: - GOPATH: c:\gopath -branches: - only: - - master -install: - - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% - - go version -build_script: - - go get -t - - go test diff --git a/vendor/github.com/sirupsen/logrus/doc.go b/vendor/github.com/sirupsen/logrus/doc.go deleted file mode 100644 index da67aba..0000000 --- a/vendor/github.com/sirupsen/logrus/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -Package logrus is a structured logger for Go, completely API compatible with the standard library logger. - - -The simplest way to use Logrus is simply the package-level exported logger: - - package main - - import ( - log "github.com/sirupsen/logrus" - ) - - func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - "number": 1, - "size": 10, - }).Info("A walrus appears") - } - -Output: - time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 - -For a full guide visit https://github.com/sirupsen/logrus -*/ -package logrus diff --git a/vendor/github.com/sirupsen/logrus/entry.go b/vendor/github.com/sirupsen/logrus/entry.go deleted file mode 100644 index 4efeddd..0000000 --- a/vendor/github.com/sirupsen/logrus/entry.go +++ /dev/null @@ -1,300 +0,0 @@ -package logrus - -import ( - "bytes" - "fmt" - "os" - "sync" - "time" -) - -var bufferPool *sync.Pool - -func init() { - bufferPool = &sync.Pool{ - New: func() interface{} { - return new(bytes.Buffer) - }, - } -} - -// Defines the key when adding errors using WithError. -var ErrorKey = "error" - -// An entry is the final or intermediate Logrus logging entry. It contains all -// the fields passed with WithField{,s}. It's finally logged when Debug, Info, -// Warn, Error, Fatal or Panic is called on it. These objects can be reused and -// passed around as much as you wish to avoid field duplication. -type Entry struct { - Logger *Logger - - // Contains all the fields set by the user. - Data Fields - - // Time at which the log entry was created - Time time.Time - - // Level the log entry was logged at: Debug, Info, Warn, Error, Fatal or Panic - // This field will be set on entry firing and the value will be equal to the one in Logger struct field. - Level Level - - // Message passed to Debug, Info, Warn, Error, Fatal or Panic - Message string - - // When formatter is called in entry.log(), a Buffer may be set to entry - Buffer *bytes.Buffer -} - -func NewEntry(logger *Logger) *Entry { - return &Entry{ - Logger: logger, - // Default is five fields, give a little extra room - Data: make(Fields, 5), - } -} - -// Returns the string representation from the reader and ultimately the -// formatter. -func (entry *Entry) String() (string, error) { - serialized, err := entry.Logger.Formatter.Format(entry) - if err != nil { - return "", err - } - str := string(serialized) - return str, nil -} - -// Add an error as single field (using the key defined in ErrorKey) to the Entry. -func (entry *Entry) WithError(err error) *Entry { - return entry.WithField(ErrorKey, err) -} - -// Add a single field to the Entry. -func (entry *Entry) WithField(key string, value interface{}) *Entry { - return entry.WithFields(Fields{key: value}) -} - -// Add a map of fields to the Entry. -func (entry *Entry) WithFields(fields Fields) *Entry { - data := make(Fields, len(entry.Data)+len(fields)) - for k, v := range entry.Data { - data[k] = v - } - for k, v := range fields { - data[k] = v - } - return &Entry{Logger: entry.Logger, Data: data, Time: entry.Time} -} - -// Overrides the time of the Entry. -func (entry *Entry) WithTime(t time.Time) *Entry { - return &Entry{Logger: entry.Logger, Data: entry.Data, Time: t} -} - -// This function is not declared with a pointer value because otherwise -// race conditions will occur when using multiple goroutines -func (entry Entry) log(level Level, msg string) { - var buffer *bytes.Buffer - - // Default to now, but allow users to override if they want. - // - // We don't have to worry about polluting future calls to Entry#log() - // with this assignment because this function is declared with a - // non-pointer receiver. - if entry.Time.IsZero() { - entry.Time = time.Now() - } - - entry.Level = level - entry.Message = msg - - entry.fireHooks() - - buffer = bufferPool.Get().(*bytes.Buffer) - buffer.Reset() - defer bufferPool.Put(buffer) - entry.Buffer = buffer - - entry.write() - - entry.Buffer = nil - - // To avoid Entry#log() returning a value that only would make sense for - // panic() to use in Entry#Panic(), we avoid the allocation by checking - // directly here. - if level <= PanicLevel { - panic(&entry) - } -} - -func (entry *Entry) fireHooks() { - entry.Logger.mu.Lock() - defer entry.Logger.mu.Unlock() - err := entry.Logger.Hooks.Fire(entry.Level, entry) - if err != nil { - fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err) - } -} - -func (entry *Entry) write() { - entry.Logger.mu.Lock() - defer entry.Logger.mu.Unlock() - serialized, err := entry.Logger.Formatter.Format(entry) - if err != nil { - fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err) - } else { - _, err = entry.Logger.Out.Write(serialized) - if err != nil { - fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err) - } - } -} - -func (entry *Entry) Debug(args ...interface{}) { - if entry.Logger.IsLevelEnabled(DebugLevel) { - entry.log(DebugLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Print(args ...interface{}) { - entry.Info(args...) -} - -func (entry *Entry) Info(args ...interface{}) { - if entry.Logger.IsLevelEnabled(InfoLevel) { - entry.log(InfoLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Warn(args ...interface{}) { - if entry.Logger.IsLevelEnabled(WarnLevel) { - entry.log(WarnLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Warning(args ...interface{}) { - entry.Warn(args...) -} - -func (entry *Entry) Error(args ...interface{}) { - if entry.Logger.IsLevelEnabled(ErrorLevel) { - entry.log(ErrorLevel, fmt.Sprint(args...)) - } -} - -func (entry *Entry) Fatal(args ...interface{}) { - if entry.Logger.IsLevelEnabled(FatalLevel) { - entry.log(FatalLevel, fmt.Sprint(args...)) - } - Exit(1) -} - -func (entry *Entry) Panic(args ...interface{}) { - if entry.Logger.IsLevelEnabled(PanicLevel) { - entry.log(PanicLevel, fmt.Sprint(args...)) - } - panic(fmt.Sprint(args...)) -} - -// Entry Printf family functions - -func (entry *Entry) Debugf(format string, args ...interface{}) { - if entry.Logger.IsLevelEnabled(DebugLevel) { - entry.Debug(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Infof(format string, args ...interface{}) { - if entry.Logger.IsLevelEnabled(InfoLevel) { - entry.Info(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Printf(format string, args ...interface{}) { - entry.Infof(format, args...) -} - -func (entry *Entry) Warnf(format string, args ...interface{}) { - if entry.Logger.IsLevelEnabled(WarnLevel) { - entry.Warn(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Warningf(format string, args ...interface{}) { - entry.Warnf(format, args...) -} - -func (entry *Entry) Errorf(format string, args ...interface{}) { - if entry.Logger.IsLevelEnabled(ErrorLevel) { - entry.Error(fmt.Sprintf(format, args...)) - } -} - -func (entry *Entry) Fatalf(format string, args ...interface{}) { - if entry.Logger.IsLevelEnabled(FatalLevel) { - entry.Fatal(fmt.Sprintf(format, args...)) - } - Exit(1) -} - -func (entry *Entry) Panicf(format string, args ...interface{}) { - if entry.Logger.IsLevelEnabled(PanicLevel) { - entry.Panic(fmt.Sprintf(format, args...)) - } -} - -// Entry Println family functions - -func (entry *Entry) Debugln(args ...interface{}) { - if entry.Logger.IsLevelEnabled(DebugLevel) { - entry.Debug(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Infoln(args ...interface{}) { - if entry.Logger.IsLevelEnabled(InfoLevel) { - entry.Info(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Println(args ...interface{}) { - entry.Infoln(args...) -} - -func (entry *Entry) Warnln(args ...interface{}) { - if entry.Logger.IsLevelEnabled(WarnLevel) { - entry.Warn(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Warningln(args ...interface{}) { - entry.Warnln(args...) -} - -func (entry *Entry) Errorln(args ...interface{}) { - if entry.Logger.IsLevelEnabled(ErrorLevel) { - entry.Error(entry.sprintlnn(args...)) - } -} - -func (entry *Entry) Fatalln(args ...interface{}) { - if entry.Logger.IsLevelEnabled(FatalLevel) { - entry.Fatal(entry.sprintlnn(args...)) - } - Exit(1) -} - -func (entry *Entry) Panicln(args ...interface{}) { - if entry.Logger.IsLevelEnabled(PanicLevel) { - entry.Panic(entry.sprintlnn(args...)) - } -} - -// Sprintlnn => Sprint no newline. This is to get the behavior of how -// fmt.Sprintln where spaces are always added between operands, regardless of -// their type. Instead of vendoring the Sprintln implementation to spare a -// string allocation, we do the simplest thing. -func (entry *Entry) sprintlnn(args ...interface{}) string { - msg := fmt.Sprintln(args...) - return msg[:len(msg)-1] -} diff --git a/vendor/github.com/sirupsen/logrus/exported.go b/vendor/github.com/sirupsen/logrus/exported.go deleted file mode 100644 index fb2a7a1..0000000 --- a/vendor/github.com/sirupsen/logrus/exported.go +++ /dev/null @@ -1,198 +0,0 @@ -package logrus - -import ( - "io" - "time" -) - -var ( - // std is the name of the standard logger in stdlib `log` - std = New() -) - -func StandardLogger() *Logger { - return std -} - -// SetOutput sets the standard logger output. -func SetOutput(out io.Writer) { - std.SetOutput(out) -} - -// SetFormatter sets the standard logger formatter. -func SetFormatter(formatter Formatter) { - std.SetFormatter(formatter) -} - -// SetLevel sets the standard logger level. -func SetLevel(level Level) { - std.SetLevel(level) -} - -// GetLevel returns the standard logger level. -func GetLevel() Level { - return std.GetLevel() -} - -// IsLevelEnabled checks if the log level of the standard logger is greater than the level param -func IsLevelEnabled(level Level) bool { - return std.IsLevelEnabled(level) -} - -// AddHook adds a hook to the standard logger hooks. -func AddHook(hook Hook) { - std.AddHook(hook) -} - -// WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key. -func WithError(err error) *Entry { - return std.WithField(ErrorKey, err) -} - -// WithField creates an entry from the standard logger and adds a field to -// it. If you want multiple fields, use `WithFields`. -// -// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal -// or Panic on the Entry it returns. -func WithField(key string, value interface{}) *Entry { - return std.WithField(key, value) -} - -// WithFields creates an entry from the standard logger and adds multiple -// fields to it. This is simply a helper for `WithField`, invoking it -// once for each field. -// -// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal -// or Panic on the Entry it returns. -func WithFields(fields Fields) *Entry { - return std.WithFields(fields) -} - -// WithTime creats an entry from the standard logger and overrides the time of -// logs generated with it. -// -// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal -// or Panic on the Entry it returns. -func WithTime(t time.Time) *Entry { - return std.WithTime(t) -} - -// Debug logs a message at level Debug on the standard logger. -func Debug(args ...interface{}) { - std.Debug(args...) -} - -// Print logs a message at level Info on the standard logger. -func Print(args ...interface{}) { - std.Print(args...) -} - -// Info logs a message at level Info on the standard logger. -func Info(args ...interface{}) { - std.Info(args...) -} - -// Warn logs a message at level Warn on the standard logger. -func Warn(args ...interface{}) { - std.Warn(args...) -} - -// Warning logs a message at level Warn on the standard logger. -func Warning(args ...interface{}) { - std.Warning(args...) -} - -// Error logs a message at level Error on the standard logger. -func Error(args ...interface{}) { - std.Error(args...) -} - -// Panic logs a message at level Panic on the standard logger. -func Panic(args ...interface{}) { - std.Panic(args...) -} - -// Fatal logs a message at level Fatal on the standard logger then the process will exit with status set to 1. -func Fatal(args ...interface{}) { - std.Fatal(args...) -} - -// Debugf logs a message at level Debug on the standard logger. -func Debugf(format string, args ...interface{}) { - std.Debugf(format, args...) -} - -// Printf logs a message at level Info on the standard logger. -func Printf(format string, args ...interface{}) { - std.Printf(format, args...) -} - -// Infof logs a message at level Info on the standard logger. -func Infof(format string, args ...interface{}) { - std.Infof(format, args...) -} - -// Warnf logs a message at level Warn on the standard logger. -func Warnf(format string, args ...interface{}) { - std.Warnf(format, args...) -} - -// Warningf logs a message at level Warn on the standard logger. -func Warningf(format string, args ...interface{}) { - std.Warningf(format, args...) -} - -// Errorf logs a message at level Error on the standard logger. -func Errorf(format string, args ...interface{}) { - std.Errorf(format, args...) -} - -// Panicf logs a message at level Panic on the standard logger. -func Panicf(format string, args ...interface{}) { - std.Panicf(format, args...) -} - -// Fatalf logs a message at level Fatal on the standard logger then the process will exit with status set to 1. -func Fatalf(format string, args ...interface{}) { - std.Fatalf(format, args...) -} - -// Debugln logs a message at level Debug on the standard logger. -func Debugln(args ...interface{}) { - std.Debugln(args...) -} - -// Println logs a message at level Info on the standard logger. -func Println(args ...interface{}) { - std.Println(args...) -} - -// Infoln logs a message at level Info on the standard logger. -func Infoln(args ...interface{}) { - std.Infoln(args...) -} - -// Warnln logs a message at level Warn on the standard logger. -func Warnln(args ...interface{}) { - std.Warnln(args...) -} - -// Warningln logs a message at level Warn on the standard logger. -func Warningln(args ...interface{}) { - std.Warningln(args...) -} - -// Errorln logs a message at level Error on the standard logger. -func Errorln(args ...interface{}) { - std.Errorln(args...) -} - -// Panicln logs a message at level Panic on the standard logger. -func Panicln(args ...interface{}) { - std.Panicln(args...) -} - -// Fatalln logs a message at level Fatal on the standard logger then the process will exit with status set to 1. -func Fatalln(args ...interface{}) { - std.Fatalln(args...) -} diff --git a/vendor/github.com/sirupsen/logrus/formatter.go b/vendor/github.com/sirupsen/logrus/formatter.go deleted file mode 100644 index 83c7494..0000000 --- a/vendor/github.com/sirupsen/logrus/formatter.go +++ /dev/null @@ -1,51 +0,0 @@ -package logrus - -import "time" - -const defaultTimestampFormat = time.RFC3339 - -// The Formatter interface is used to implement a custom Formatter. It takes an -// `Entry`. It exposes all the fields, including the default ones: -// -// * `entry.Data["msg"]`. The message passed from Info, Warn, Error .. -// * `entry.Data["time"]`. The timestamp. -// * `entry.Data["level"]. The level the entry was logged at. -// -// Any additional fields added with `WithField` or `WithFields` are also in -// `entry.Data`. Format is expected to return an array of bytes which are then -// logged to `logger.Out`. -type Formatter interface { - Format(*Entry) ([]byte, error) -} - -// This is to not silently overwrite `time`, `msg` and `level` fields when -// dumping it. If this code wasn't there doing: -// -// logrus.WithField("level", 1).Info("hello") -// -// Would just silently drop the user provided level. Instead with this code -// it'll logged as: -// -// {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."} -// -// It's not exported because it's still using Data in an opinionated way. It's to -// avoid code duplication between the two default formatters. -func prefixFieldClashes(data Fields, fieldMap FieldMap) { - timeKey := fieldMap.resolve(FieldKeyTime) - if t, ok := data[timeKey]; ok { - data["fields."+timeKey] = t - delete(data, timeKey) - } - - msgKey := fieldMap.resolve(FieldKeyMsg) - if m, ok := data[msgKey]; ok { - data["fields."+msgKey] = m - delete(data, msgKey) - } - - levelKey := fieldMap.resolve(FieldKeyLevel) - if l, ok := data[levelKey]; ok { - data["fields."+levelKey] = l - delete(data, levelKey) - } -} diff --git a/vendor/github.com/sirupsen/logrus/go.mod b/vendor/github.com/sirupsen/logrus/go.mod deleted file mode 100644 index f4fed02..0000000 --- a/vendor/github.com/sirupsen/logrus/go.mod +++ /dev/null @@ -1,10 +0,0 @@ -module github.com/sirupsen/logrus - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/testify v1.2.2 - golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 - golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 -) diff --git a/vendor/github.com/sirupsen/logrus/go.sum b/vendor/github.com/sirupsen/logrus/go.sum deleted file mode 100644 index 1f0d719..0000000 --- a/vendor/github.com/sirupsen/logrus/go.sum +++ /dev/null @@ -1,12 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe h1:CHRGQ8V7OlCYtwaKPJi3iA7J+YdNKdo8j7nG5IgDhjs= -github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/vendor/github.com/sirupsen/logrus/hooks.go b/vendor/github.com/sirupsen/logrus/hooks.go deleted file mode 100644 index 3f151cd..0000000 --- a/vendor/github.com/sirupsen/logrus/hooks.go +++ /dev/null @@ -1,34 +0,0 @@ -package logrus - -// A hook to be fired when logging on the logging levels returned from -// `Levels()` on your implementation of the interface. Note that this is not -// fired in a goroutine or a channel with workers, you should handle such -// functionality yourself if your call is non-blocking and you don't wish for -// the logging calls for levels returned from `Levels()` to block. -type Hook interface { - Levels() []Level - Fire(*Entry) error -} - -// Internal type for storing the hooks on a logger instance. -type LevelHooks map[Level][]Hook - -// Add a hook to an instance of logger. This is called with -// `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. -func (hooks LevelHooks) Add(hook Hook) { - for _, level := range hook.Levels() { - hooks[level] = append(hooks[level], hook) - } -} - -// Fire all the hooks for the passed level. Used by `entry.log` to fire -// appropriate hooks for a log entry. -func (hooks LevelHooks) Fire(level Level, entry *Entry) error { - for _, hook := range hooks[level] { - if err := hook.Fire(entry); err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/sirupsen/logrus/json_formatter.go b/vendor/github.com/sirupsen/logrus/json_formatter.go deleted file mode 100644 index d3dadef..0000000 --- a/vendor/github.com/sirupsen/logrus/json_formatter.go +++ /dev/null @@ -1,104 +0,0 @@ -package logrus - -import ( - "bytes" - "encoding/json" - "fmt" -) - -type fieldKey string - -// FieldMap allows customization of the key names for default fields. -type FieldMap map[fieldKey]string - -// Default key names for the default fields -const ( - FieldKeyMsg = "msg" - FieldKeyLevel = "level" - FieldKeyTime = "time" -) - -func (f FieldMap) resolve(key fieldKey) string { - if k, ok := f[key]; ok { - return k - } - - return string(key) -} - -// JSONFormatter formats logs into parsable json -type JSONFormatter struct { - // TimestampFormat sets the format used for marshaling timestamps. - TimestampFormat string - - // DisableTimestamp allows disabling automatic timestamps in output - DisableTimestamp bool - - // DataKey allows users to put all the log entry parameters into a nested dictionary at a given key. - DataKey string - - // FieldMap allows users to customize the names of keys for default fields. - // As an example: - // formatter := &JSONFormatter{ - // FieldMap: FieldMap{ - // FieldKeyTime: "@timestamp", - // FieldKeyLevel: "@level", - // FieldKeyMsg: "@message", - // }, - // } - FieldMap FieldMap - - // PrettyPrint will indent all json logs - PrettyPrint bool -} - -// Format renders a single log entry -func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { - data := make(Fields, len(entry.Data)+3) - for k, v := range entry.Data { - switch v := v.(type) { - case error: - // Otherwise errors are ignored by `encoding/json` - // https://github.com/sirupsen/logrus/issues/137 - data[k] = v.Error() - default: - data[k] = v - } - } - - if f.DataKey != "" { - newData := make(Fields, 4) - newData[f.DataKey] = data - data = newData - } - - prefixFieldClashes(data, f.FieldMap) - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = defaultTimestampFormat - } - - if !f.DisableTimestamp { - data[f.FieldMap.resolve(FieldKeyTime)] = entry.Time.Format(timestampFormat) - } - data[f.FieldMap.resolve(FieldKeyMsg)] = entry.Message - data[f.FieldMap.resolve(FieldKeyLevel)] = entry.Level.String() - - var b *bytes.Buffer - if entry.Buffer != nil { - b = entry.Buffer - } else { - b = &bytes.Buffer{} - } - - encoder := json.NewEncoder(b) - if f.PrettyPrint { - encoder.SetIndent("", " ") - } - if err := encoder.Encode(data); err != nil { - return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) - } - - return b.Bytes(), nil -} diff --git a/vendor/github.com/sirupsen/logrus/logger.go b/vendor/github.com/sirupsen/logrus/logger.go deleted file mode 100644 index b67bfcb..0000000 --- a/vendor/github.com/sirupsen/logrus/logger.go +++ /dev/null @@ -1,367 +0,0 @@ -package logrus - -import ( - "io" - "os" - "sync" - "sync/atomic" - "time" -) - -type Logger struct { - // The logs are `io.Copy`'d to this in a mutex. It's common to set this to a - // file, or leave it default which is `os.Stderr`. You can also set this to - // something more adventurous, such as logging to Kafka. - Out io.Writer - // Hooks for the logger instance. These allow firing events based on logging - // levels and log entries. For example, to send errors to an error tracking - // service, log to StatsD or dump the core on fatal errors. - Hooks LevelHooks - // All log entries pass through the formatter before logged to Out. The - // included formatters are `TextFormatter` and `JSONFormatter` for which - // TextFormatter is the default. In development (when a TTY is attached) it - // logs with colors, but to a file it wouldn't. You can easily implement your - // own that implements the `Formatter` interface, see the `README` or included - // formatters for examples. - Formatter Formatter - // The logging level the logger should log at. This is typically (and defaults - // to) `logrus.Info`, which allows Info(), Warn(), Error() and Fatal() to be - // logged. - Level Level - // Used to sync writing to the log. Locking is enabled by Default - mu MutexWrap - // Reusable empty entry - entryPool sync.Pool -} - -type MutexWrap struct { - lock sync.Mutex - disabled bool -} - -func (mw *MutexWrap) Lock() { - if !mw.disabled { - mw.lock.Lock() - } -} - -func (mw *MutexWrap) Unlock() { - if !mw.disabled { - mw.lock.Unlock() - } -} - -func (mw *MutexWrap) Disable() { - mw.disabled = true -} - -// Creates a new logger. Configuration should be set by changing `Formatter`, -// `Out` and `Hooks` directly on the default logger instance. You can also just -// instantiate your own: -// -// var log = &Logger{ -// Out: os.Stderr, -// Formatter: new(JSONFormatter), -// Hooks: make(LevelHooks), -// Level: logrus.DebugLevel, -// } -// -// It's recommended to make this a global instance called `log`. -func New() *Logger { - return &Logger{ - Out: os.Stderr, - Formatter: new(TextFormatter), - Hooks: make(LevelHooks), - Level: InfoLevel, - } -} - -func (logger *Logger) newEntry() *Entry { - entry, ok := logger.entryPool.Get().(*Entry) - if ok { - return entry - } - return NewEntry(logger) -} - -func (logger *Logger) releaseEntry(entry *Entry) { - entry.Data = map[string]interface{}{} - logger.entryPool.Put(entry) -} - -// Adds a field to the log entry, note that it doesn't log until you call -// Debug, Print, Info, Warn, Error, Fatal or Panic. It only creates a log entry. -// If you want multiple fields, use `WithFields`. -func (logger *Logger) WithField(key string, value interface{}) *Entry { - entry := logger.newEntry() - defer logger.releaseEntry(entry) - return entry.WithField(key, value) -} - -// Adds a struct of fields to the log entry. All it does is call `WithField` for -// each `Field`. -func (logger *Logger) WithFields(fields Fields) *Entry { - entry := logger.newEntry() - defer logger.releaseEntry(entry) - return entry.WithFields(fields) -} - -// Add an error as single field to the log entry. All it does is call -// `WithError` for the given `error`. -func (logger *Logger) WithError(err error) *Entry { - entry := logger.newEntry() - defer logger.releaseEntry(entry) - return entry.WithError(err) -} - -// Overrides the time of the log entry. -func (logger *Logger) WithTime(t time.Time) *Entry { - entry := logger.newEntry() - defer logger.releaseEntry(entry) - return entry.WithTime(t) -} - -func (logger *Logger) Debugf(format string, args ...interface{}) { - if logger.IsLevelEnabled(DebugLevel) { - entry := logger.newEntry() - entry.Debugf(format, args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Infof(format string, args ...interface{}) { - if logger.IsLevelEnabled(InfoLevel) { - entry := logger.newEntry() - entry.Infof(format, args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Printf(format string, args ...interface{}) { - entry := logger.newEntry() - entry.Printf(format, args...) - logger.releaseEntry(entry) -} - -func (logger *Logger) Warnf(format string, args ...interface{}) { - if logger.IsLevelEnabled(WarnLevel) { - entry := logger.newEntry() - entry.Warnf(format, args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Warningf(format string, args ...interface{}) { - if logger.IsLevelEnabled(WarnLevel) { - entry := logger.newEntry() - entry.Warnf(format, args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Errorf(format string, args ...interface{}) { - if logger.IsLevelEnabled(ErrorLevel) { - entry := logger.newEntry() - entry.Errorf(format, args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Fatalf(format string, args ...interface{}) { - if logger.IsLevelEnabled(FatalLevel) { - entry := logger.newEntry() - entry.Fatalf(format, args...) - logger.releaseEntry(entry) - } - Exit(1) -} - -func (logger *Logger) Panicf(format string, args ...interface{}) { - if logger.IsLevelEnabled(PanicLevel) { - entry := logger.newEntry() - entry.Panicf(format, args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Debug(args ...interface{}) { - if logger.IsLevelEnabled(DebugLevel) { - entry := logger.newEntry() - entry.Debug(args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Info(args ...interface{}) { - if logger.IsLevelEnabled(InfoLevel) { - entry := logger.newEntry() - entry.Info(args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Print(args ...interface{}) { - entry := logger.newEntry() - entry.Info(args...) - logger.releaseEntry(entry) -} - -func (logger *Logger) Warn(args ...interface{}) { - if logger.IsLevelEnabled(WarnLevel) { - entry := logger.newEntry() - entry.Warn(args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Warning(args ...interface{}) { - if logger.IsLevelEnabled(WarnLevel) { - entry := logger.newEntry() - entry.Warn(args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Error(args ...interface{}) { - if logger.IsLevelEnabled(ErrorLevel) { - entry := logger.newEntry() - entry.Error(args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Fatal(args ...interface{}) { - if logger.IsLevelEnabled(FatalLevel) { - entry := logger.newEntry() - entry.Fatal(args...) - logger.releaseEntry(entry) - } - Exit(1) -} - -func (logger *Logger) Panic(args ...interface{}) { - if logger.IsLevelEnabled(PanicLevel) { - entry := logger.newEntry() - entry.Panic(args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Debugln(args ...interface{}) { - if logger.IsLevelEnabled(DebugLevel) { - entry := logger.newEntry() - entry.Debugln(args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Infoln(args ...interface{}) { - if logger.IsLevelEnabled(InfoLevel) { - entry := logger.newEntry() - entry.Infoln(args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Println(args ...interface{}) { - entry := logger.newEntry() - entry.Println(args...) - logger.releaseEntry(entry) -} - -func (logger *Logger) Warnln(args ...interface{}) { - if logger.IsLevelEnabled(WarnLevel) { - entry := logger.newEntry() - entry.Warnln(args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Warningln(args ...interface{}) { - if logger.IsLevelEnabled(WarnLevel) { - entry := logger.newEntry() - entry.Warnln(args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Errorln(args ...interface{}) { - if logger.IsLevelEnabled(ErrorLevel) { - entry := logger.newEntry() - entry.Errorln(args...) - logger.releaseEntry(entry) - } -} - -func (logger *Logger) Fatalln(args ...interface{}) { - if logger.IsLevelEnabled(FatalLevel) { - entry := logger.newEntry() - entry.Fatalln(args...) - logger.releaseEntry(entry) - } - Exit(1) -} - -func (logger *Logger) Panicln(args ...interface{}) { - if logger.IsLevelEnabled(PanicLevel) { - entry := logger.newEntry() - entry.Panicln(args...) - logger.releaseEntry(entry) - } -} - -//When file is opened with appending mode, it's safe to -//write concurrently to a file (within 4k message on Linux). -//In these cases user can choose to disable the lock. -func (logger *Logger) SetNoLock() { - logger.mu.Disable() -} - -func (logger *Logger) level() Level { - return Level(atomic.LoadUint32((*uint32)(&logger.Level))) -} - -// SetLevel sets the logger level. -func (logger *Logger) SetLevel(level Level) { - atomic.StoreUint32((*uint32)(&logger.Level), uint32(level)) -} - -// GetLevel returns the logger level. -func (logger *Logger) GetLevel() Level { - return logger.level() -} - -// AddHook adds a hook to the logger hooks. -func (logger *Logger) AddHook(hook Hook) { - logger.mu.Lock() - defer logger.mu.Unlock() - logger.Hooks.Add(hook) -} - -// IsLevelEnabled checks if the log level of the logger is greater than the level param -func (logger *Logger) IsLevelEnabled(level Level) bool { - return logger.level() >= level -} - -// SetFormatter sets the logger formatter. -func (logger *Logger) SetFormatter(formatter Formatter) { - logger.mu.Lock() - defer logger.mu.Unlock() - logger.Formatter = formatter -} - -// SetOutput sets the logger output. -func (logger *Logger) SetOutput(output io.Writer) { - logger.mu.Lock() - defer logger.mu.Unlock() - logger.Out = output -} - -// ReplaceHooks replaces the logger hooks and returns the old ones -func (logger *Logger) ReplaceHooks(hooks LevelHooks) LevelHooks { - logger.mu.Lock() - oldHooks := logger.Hooks - logger.Hooks = hooks - logger.mu.Unlock() - return oldHooks -} diff --git a/vendor/github.com/sirupsen/logrus/logrus.go b/vendor/github.com/sirupsen/logrus/logrus.go deleted file mode 100644 index fa0b9de..0000000 --- a/vendor/github.com/sirupsen/logrus/logrus.go +++ /dev/null @@ -1,150 +0,0 @@ -package logrus - -import ( - "fmt" - "log" - "strings" -) - -// Fields type, used to pass to `WithFields`. -type Fields map[string]interface{} - -// Level type -type Level uint32 - -// Convert the Level to a string. E.g. PanicLevel becomes "panic". -func (level Level) String() string { - switch level { - case DebugLevel: - return "debug" - case InfoLevel: - return "info" - case WarnLevel: - return "warning" - case ErrorLevel: - return "error" - case FatalLevel: - return "fatal" - case PanicLevel: - return "panic" - } - - return "unknown" -} - -// ParseLevel takes a string level and returns the Logrus log level constant. -func ParseLevel(lvl string) (Level, error) { - switch strings.ToLower(lvl) { - case "panic": - return PanicLevel, nil - case "fatal": - return FatalLevel, nil - case "error": - return ErrorLevel, nil - case "warn", "warning": - return WarnLevel, nil - case "info": - return InfoLevel, nil - case "debug": - return DebugLevel, nil - } - - var l Level - return l, fmt.Errorf("not a valid logrus Level: %q", lvl) -} - -// A constant exposing all logging levels -var AllLevels = []Level{ - PanicLevel, - FatalLevel, - ErrorLevel, - WarnLevel, - InfoLevel, - DebugLevel, -} - -// These are the different logging levels. You can set the logging level to log -// on your instance of logger, obtained with `logrus.New()`. -const ( - // PanicLevel level, highest level of severity. Logs and then calls panic with the - // message passed to Debug, Info, ... - PanicLevel Level = iota - // FatalLevel level. Logs and then calls `os.Exit(1)`. It will exit even if the - // logging level is set to Panic. - FatalLevel - // ErrorLevel level. Logs. Used for errors that should definitely be noted. - // Commonly used for hooks to send errors to an error tracking service. - ErrorLevel - // WarnLevel level. Non-critical entries that deserve eyes. - WarnLevel - // InfoLevel level. General operational entries about what's going on inside the - // application. - InfoLevel - // DebugLevel level. Usually only enabled when debugging. Very verbose logging. - DebugLevel -) - -// Won't compile if StdLogger can't be realized by a log.Logger -var ( - _ StdLogger = &log.Logger{} - _ StdLogger = &Entry{} - _ StdLogger = &Logger{} -) - -// StdLogger is what your logrus-enabled library should take, that way -// it'll accept a stdlib logger and a logrus logger. There's no standard -// interface, this is the closest we get, unfortunately. -type StdLogger interface { - Print(...interface{}) - Printf(string, ...interface{}) - Println(...interface{}) - - Fatal(...interface{}) - Fatalf(string, ...interface{}) - Fatalln(...interface{}) - - Panic(...interface{}) - Panicf(string, ...interface{}) - Panicln(...interface{}) -} - -// The FieldLogger interface generalizes the Entry and Logger types -type FieldLogger interface { - WithField(key string, value interface{}) *Entry - WithFields(fields Fields) *Entry - WithError(err error) *Entry - - Debugf(format string, args ...interface{}) - Infof(format string, args ...interface{}) - Printf(format string, args ...interface{}) - Warnf(format string, args ...interface{}) - Warningf(format string, args ...interface{}) - Errorf(format string, args ...interface{}) - Fatalf(format string, args ...interface{}) - Panicf(format string, args ...interface{}) - - Debug(args ...interface{}) - Info(args ...interface{}) - Print(args ...interface{}) - Warn(args ...interface{}) - Warning(args ...interface{}) - Error(args ...interface{}) - Fatal(args ...interface{}) - Panic(args ...interface{}) - - Debugln(args ...interface{}) - Infoln(args ...interface{}) - Println(args ...interface{}) - Warnln(args ...interface{}) - Warningln(args ...interface{}) - Errorln(args ...interface{}) - Fatalln(args ...interface{}) - Panicln(args ...interface{}) - - // IsDebugEnabled() bool - // IsInfoEnabled() bool - // IsWarnEnabled() bool - // IsErrorEnabled() bool - // IsFatalEnabled() bool - // IsPanicEnabled() bool -} diff --git a/vendor/github.com/sirupsen/logrus/terminal_appengine.go b/vendor/github.com/sirupsen/logrus/terminal_appengine.go deleted file mode 100644 index 72f679c..0000000 --- a/vendor/github.com/sirupsen/logrus/terminal_appengine.go +++ /dev/null @@ -1,13 +0,0 @@ -// Based on ssh/terminal: -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build appengine - -package logrus - -import "io" - -func initTerminal(w io.Writer) { -} diff --git a/vendor/github.com/sirupsen/logrus/terminal_bsd.go b/vendor/github.com/sirupsen/logrus/terminal_bsd.go deleted file mode 100644 index 62ca252..0000000 --- a/vendor/github.com/sirupsen/logrus/terminal_bsd.go +++ /dev/null @@ -1,17 +0,0 @@ -// +build darwin freebsd openbsd netbsd dragonfly -// +build !appengine,!js - -package logrus - -import ( - "io" - - "golang.org/x/sys/unix" -) - -const ioctlReadTermios = unix.TIOCGETA - -type Termios unix.Termios - -func initTerminal(w io.Writer) { -} diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go b/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go deleted file mode 100644 index 2403de9..0000000 --- a/vendor/github.com/sirupsen/logrus/terminal_check_appengine.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build appengine - -package logrus - -import ( - "io" -) - -func checkIfTerminal(w io.Writer) bool { - return true -} diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_js.go b/vendor/github.com/sirupsen/logrus/terminal_check_js.go deleted file mode 100644 index 0c20975..0000000 --- a/vendor/github.com/sirupsen/logrus/terminal_check_js.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build js - -package logrus - -import ( - "io" -) - -func checkIfTerminal(w io.Writer) bool { - return false -} diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go b/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go deleted file mode 100644 index cf309d6..0000000 --- a/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go +++ /dev/null @@ -1,19 +0,0 @@ -// +build !appengine,!js,!windows - -package logrus - -import ( - "io" - "os" - - "golang.org/x/crypto/ssh/terminal" -) - -func checkIfTerminal(w io.Writer) bool { - switch v := w.(type) { - case *os.File: - return terminal.IsTerminal(int(v.Fd())) - default: - return false - } -} diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go b/vendor/github.com/sirupsen/logrus/terminal_check_windows.go deleted file mode 100644 index 3b9d286..0000000 --- a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go +++ /dev/null @@ -1,20 +0,0 @@ -// +build !appengine,!js,windows - -package logrus - -import ( - "io" - "os" - "syscall" -) - -func checkIfTerminal(w io.Writer) bool { - switch v := w.(type) { - case *os.File: - var mode uint32 - err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode) - return err == nil - default: - return false - } -} diff --git a/vendor/github.com/sirupsen/logrus/terminal_linux.go b/vendor/github.com/sirupsen/logrus/terminal_linux.go deleted file mode 100644 index 18066f0..0000000 --- a/vendor/github.com/sirupsen/logrus/terminal_linux.go +++ /dev/null @@ -1,21 +0,0 @@ -// Based on ssh/terminal: -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !appengine,!js - -package logrus - -import ( - "io" - - "golang.org/x/sys/unix" -) - -const ioctlReadTermios = unix.TCGETS - -type Termios unix.Termios - -func initTerminal(w io.Writer) { -} diff --git a/vendor/github.com/sirupsen/logrus/terminal_windows.go b/vendor/github.com/sirupsen/logrus/terminal_windows.go deleted file mode 100644 index b4ef528..0000000 --- a/vendor/github.com/sirupsen/logrus/terminal_windows.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build !appengine,!js,windows - -package logrus - -import ( - "io" - "os" - "syscall" - - sequences "github.com/konsorten/go-windows-terminal-sequences" -) - -func initTerminal(w io.Writer) { - switch v := w.(type) { - case *os.File: - sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true) - } -} diff --git a/vendor/github.com/sirupsen/logrus/text_formatter.go b/vendor/github.com/sirupsen/logrus/text_formatter.go deleted file mode 100644 index 67fb686..0000000 --- a/vendor/github.com/sirupsen/logrus/text_formatter.go +++ /dev/null @@ -1,249 +0,0 @@ -package logrus - -import ( - "bytes" - "fmt" - "os" - "sort" - "strings" - "sync" - "time" -) - -const ( - nocolor = 0 - red = 31 - green = 32 - yellow = 33 - blue = 36 - gray = 37 -) - -var ( - baseTimestamp time.Time - emptyFieldMap FieldMap -) - -func init() { - baseTimestamp = time.Now() -} - -// TextFormatter formats logs into text -type TextFormatter struct { - // Set to true to bypass checking for a TTY before outputting colors. - ForceColors bool - - // Force disabling colors. - DisableColors bool - - // Override coloring based on CLICOLOR and CLICOLOR_FORCE. - https://bixense.com/clicolors/ - EnvironmentOverrideColors bool - - // Disable timestamp logging. useful when output is redirected to logging - // system that already adds timestamps. - DisableTimestamp bool - - // Enable logging the full timestamp when a TTY is attached instead of just - // the time passed since beginning of execution. - FullTimestamp bool - - // TimestampFormat to use for display when a full timestamp is printed - TimestampFormat string - - // The fields are sorted by default for a consistent output. For applications - // that log extremely frequently and don't use the JSON formatter this may not - // be desired. - DisableSorting bool - - // The keys sorting function, when uninitialized it uses sort.Strings. - SortingFunc func([]string) - - // Disables the truncation of the level text to 4 characters. - DisableLevelTruncation bool - - // QuoteEmptyFields will wrap empty fields in quotes if true - QuoteEmptyFields bool - - // Whether the logger's out is to a terminal - isTerminal bool - - // FieldMap allows users to customize the names of keys for default fields. - // As an example: - // formatter := &TextFormatter{ - // FieldMap: FieldMap{ - // FieldKeyTime: "@timestamp", - // FieldKeyLevel: "@level", - // FieldKeyMsg: "@message"}} - FieldMap FieldMap - - terminalInitOnce sync.Once -} - -func (f *TextFormatter) init(entry *Entry) { - if entry.Logger != nil { - f.isTerminal = checkIfTerminal(entry.Logger.Out) - - if f.isTerminal { - initTerminal(entry.Logger.Out) - } - } -} - -func (f *TextFormatter) isColored() bool { - isColored := f.ForceColors || f.isTerminal - - if f.EnvironmentOverrideColors { - if force, ok := os.LookupEnv("CLICOLOR_FORCE"); ok && force != "0" { - isColored = true - } else if ok && force == "0" { - isColored = false - } else if os.Getenv("CLICOLOR") == "0" { - isColored = false - } - } - - return isColored && !f.DisableColors -} - -// Format renders a single log entry -func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { - prefixFieldClashes(entry.Data, f.FieldMap) - - keys := make([]string, 0, len(entry.Data)) - for k := range entry.Data { - keys = append(keys, k) - } - - fixedKeys := make([]string, 0, 3+len(entry.Data)) - if !f.DisableTimestamp { - fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyTime)) - } - fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyLevel)) - if entry.Message != "" { - fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyMsg)) - } - - if !f.DisableSorting { - if f.SortingFunc == nil { - sort.Strings(keys) - fixedKeys = append(fixedKeys, keys...) - } else { - if !f.isColored() { - fixedKeys = append(fixedKeys, keys...) - f.SortingFunc(fixedKeys) - } else { - f.SortingFunc(keys) - } - } - } else { - fixedKeys = append(fixedKeys, keys...) - } - - var b *bytes.Buffer - if entry.Buffer != nil { - b = entry.Buffer - } else { - b = &bytes.Buffer{} - } - - f.terminalInitOnce.Do(func() { f.init(entry) }) - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = defaultTimestampFormat - } - if f.isColored() { - f.printColored(b, entry, keys, timestampFormat) - } else { - for _, key := range fixedKeys { - var value interface{} - switch key { - case f.FieldMap.resolve(FieldKeyTime): - value = entry.Time.Format(timestampFormat) - case f.FieldMap.resolve(FieldKeyLevel): - value = entry.Level.String() - case f.FieldMap.resolve(FieldKeyMsg): - value = entry.Message - default: - value = entry.Data[key] - } - f.appendKeyValue(b, key, value) - } - } - - b.WriteByte('\n') - return b.Bytes(), nil -} - -func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []string, timestampFormat string) { - var levelColor int - switch entry.Level { - case DebugLevel: - levelColor = gray - case WarnLevel: - levelColor = yellow - case ErrorLevel, FatalLevel, PanicLevel: - levelColor = red - default: - levelColor = blue - } - - levelText := strings.ToUpper(entry.Level.String()) - if !f.DisableLevelTruncation { - levelText = levelText[0:4] - } - - // Remove a single newline if it already exists in the message to keep - // the behavior of logrus text_formatter the same as the stdlib log package - entry.Message = strings.TrimSuffix(entry.Message, "\n") - - if f.DisableTimestamp { - fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m %-44s ", levelColor, levelText, entry.Message) - } else if !f.FullTimestamp { - fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%04d] %-44s ", levelColor, levelText, int(entry.Time.Sub(baseTimestamp)/time.Second), entry.Message) - } else { - fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%s] %-44s ", levelColor, levelText, entry.Time.Format(timestampFormat), entry.Message) - } - for _, k := range keys { - v := entry.Data[k] - fmt.Fprintf(b, " \x1b[%dm%s\x1b[0m=", levelColor, k) - f.appendValue(b, v) - } -} - -func (f *TextFormatter) needsQuoting(text string) bool { - if f.QuoteEmptyFields && len(text) == 0 { - return true - } - for _, ch := range text { - if !((ch >= 'a' && ch <= 'z') || - (ch >= 'A' && ch <= 'Z') || - (ch >= '0' && ch <= '9') || - ch == '-' || ch == '.' || ch == '_' || ch == '/' || ch == '@' || ch == '^' || ch == '+') { - return true - } - } - return false -} - -func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}) { - if b.Len() > 0 { - b.WriteByte(' ') - } - b.WriteString(key) - b.WriteByte('=') - f.appendValue(b, value) -} - -func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) { - stringVal, ok := value.(string) - if !ok { - stringVal = fmt.Sprint(value) - } - - if !f.needsQuoting(stringVal) { - b.WriteString(stringVal) - } else { - b.WriteString(fmt.Sprintf("%q", stringVal)) - } -} diff --git a/vendor/github.com/sirupsen/logrus/writer.go b/vendor/github.com/sirupsen/logrus/writer.go deleted file mode 100644 index 7bdebed..0000000 --- a/vendor/github.com/sirupsen/logrus/writer.go +++ /dev/null @@ -1,62 +0,0 @@ -package logrus - -import ( - "bufio" - "io" - "runtime" -) - -func (logger *Logger) Writer() *io.PipeWriter { - return logger.WriterLevel(InfoLevel) -} - -func (logger *Logger) WriterLevel(level Level) *io.PipeWriter { - return NewEntry(logger).WriterLevel(level) -} - -func (entry *Entry) Writer() *io.PipeWriter { - return entry.WriterLevel(InfoLevel) -} - -func (entry *Entry) WriterLevel(level Level) *io.PipeWriter { - reader, writer := io.Pipe() - - var printFunc func(args ...interface{}) - - switch level { - case DebugLevel: - printFunc = entry.Debug - case InfoLevel: - printFunc = entry.Info - case WarnLevel: - printFunc = entry.Warn - case ErrorLevel: - printFunc = entry.Error - case FatalLevel: - printFunc = entry.Fatal - case PanicLevel: - printFunc = entry.Panic - default: - printFunc = entry.Print - } - - go entry.writerScanner(reader, printFunc) - runtime.SetFinalizer(writer, writerFinalizer) - - return writer -} - -func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) { - scanner := bufio.NewScanner(reader) - for scanner.Scan() { - printFunc(scanner.Text()) - } - if err := scanner.Err(); err != nil { - entry.Errorf("Error while reading from Writer: %s", err) - } - reader.Close() -} - -func writerFinalizer(writer *io.PipeWriter) { - writer.Close() -} diff --git a/vendor/github.com/sourcegraph/annotate/.travis.yml b/vendor/github.com/sourcegraph/annotate/.travis.yml deleted file mode 100644 index 036daec..0000000 --- a/vendor/github.com/sourcegraph/annotate/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: go - -go: - - 1.2 diff --git a/vendor/github.com/sourcegraph/annotate/LICENSE b/vendor/github.com/sourcegraph/annotate/LICENSE deleted file mode 100644 index d8cf637..0000000 --- a/vendor/github.com/sourcegraph/annotate/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2013, Sourcegraph, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. Redistributions -in binary form must reproduce the above copyright notice, this list of -conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -Neither the name of Sourcegraph nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/vendor/github.com/sourcegraph/annotate/Makefile b/vendor/github.com/sourcegraph/annotate/Makefile deleted file mode 100644 index 016aed1..0000000 --- a/vendor/github.com/sourcegraph/annotate/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -.PHONY: benchmark.txt - -benchmark.txt: - go test -test.run='^$$' -test.bench='.*' -test.benchmem > $@ 2>&1 - cat $@ - -profile: - go test -test.run='^$$' -test.bench='.*' -test.cpuprofile=/tmp/annotate.prof - go tool pprof ./annotate.test /tmp/annotate.prof diff --git a/vendor/github.com/sourcegraph/annotate/README.md b/vendor/github.com/sourcegraph/annotate/README.md deleted file mode 100644 index 7fb2759..0000000 --- a/vendor/github.com/sourcegraph/annotate/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# annotate - -A Go package for applying multiple sets of annotations to a region of text. - -**[Documentation on Sourcegraph](https://sourcegraph.com/github.com/sourcegraph/annotate)** - -[![Build Status](https://travis-ci.org/sourcegraph/annotate.png?branch=master)](https://travis-ci.org/sourcegraph/annotate) -[![status](https://sourcegraph.com/api/repos/github.com/sourcegraph/annotate/badges/status.png)](https://sourcegraph.com/github.com/sourcegraph/annotate) -[![authors](https://sourcegraph.com/api/repos/github.com/sourcegraph/annotate/badges/authors.png)](https://sourcegraph.com/github.com/sourcegraph/annotate) -[![Total views](https://sourcegraph.com/api/repos/github.com/sourcegraph/annotate/counters/views.png)](https://sourcegraph.com/github.com/sourcegraph/annotate) diff --git a/vendor/github.com/sourcegraph/annotate/annotate.go b/vendor/github.com/sourcegraph/annotate/annotate.go deleted file mode 100644 index 627dfe9..0000000 --- a/vendor/github.com/sourcegraph/annotate/annotate.go +++ /dev/null @@ -1,159 +0,0 @@ -package annotate - -import ( - "bytes" - "errors" - "io" -) - -type Annotation struct { - // Start and End byte offsets (not rune offsets). - Start, End int - - Left, Right []byte - WantInner int -} - -type Annotations []*Annotation - -func (a Annotations) Len() int { return len(a) } -func (a Annotations) Less(i, j int) bool { - // Sort by start position, breaking ties by preferring longer - // matches. - ai, aj := a[i], a[j] - if ai.Start == aj.Start { - if ai.End == aj.End { - return ai.WantInner < aj.WantInner - } - return ai.End > aj.End - } else { - return ai.Start < aj.Start - } -} -func (a Annotations) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -// Annotates src with annotations in anns. -// -// Annotating an empty byte array always returns an empty byte array. -// -// Assumes anns is sorted (using sort.Sort(anns)). -func Annotate(src []byte, anns Annotations, writeContent func(io.Writer, []byte)) ([]byte, error) { - out := bytes.NewBuffer(make([]byte, 0, len(src)+20*len(anns))) - var err error - - // Keep a stack of open annotations (i.e., that have been opened and not yet - // closed). - var open []*Annotation - - for b := range src { - // Open annotations that begin here. - for i, a := range anns { - if a.Start < 0 || a.Start == b { - if a.Start < 0 { - err = ErrStartOutOfBounds - } - - out.Write(a.Left) - - if a.Start == a.End { - out.Write(a.Right) - } else { - // Put this annotation on the stack of annotations that will need - // to be closed. We remove it from anns at the end of the loop - // (to avoid modifying anns while we're iterating over it). - open = append(open, a) - } - } else if a.Start > b { - // Remove all annotations that we opened (we already put them on the - // stack of annotations that will need to be closed). - anns = anns[i:] - break - } - } - - if writeContent == nil { - out.Write(src[b : b+1]) - } else { - writeContent(out, src[b:b+1]) - } - - // Close annotations that end after this byte, handling overlapping - // elements as described below. Elements of open are ordered by their - // annotation start position. - - // We need to close all annotatations ending after this byte, as well as - // annotations that overlap this annotation's end and should reopen - // after it closes. - var toClose []*Annotation - - // Find annotations ending after this byte. - minStart := 0 // start of the leftmost annotation closing here - for i := len(open) - 1; i >= 0; i-- { - a := open[i] - if a.End == b+1 { - toClose = append(toClose, a) - if minStart == 0 || a.Start < minStart { - minStart = a.Start - } - open = append(open[:i], open[i+1:]...) - } - } - - // Find annotations that overlap annotations closing after this and - // that should reopen after it closes. - if toClose != nil { - for i := len(open) - 1; i >= 0; i-- { - if a := open[i]; a.Start > minStart { - out.Write(a.Right) - } - } - } - - for _, a := range toClose { - out.Write(a.Right) - } - - if toClose != nil { - for _, a := range open { - if a.Start > minStart { - out.Write(a.Left) - } - } - } - } - - if len(open) > 0 { - if err == ErrStartOutOfBounds { - err = ErrStartAndEndOutOfBounds - } else { - err = ErrEndOutOfBounds - } - - // Clean up by closing unclosed annotations, in the order they would - // have been closed in. - for i := len(open) - 1; i >= 0; i-- { - a := open[i] - out.Write(a.Right) - } - } - - return out.Bytes(), err -} - -var ( - ErrStartOutOfBounds = errors.New("annotation start out of bounds") - ErrEndOutOfBounds = errors.New("annotation end out of bounds") - ErrStartAndEndOutOfBounds = errors.New("annotations start and end out of bounds") -) - -func IsOutOfBounds(err error) bool { - return err == ErrStartOutOfBounds || err == ErrEndOutOfBounds || err == ErrStartAndEndOutOfBounds -} - -func annLefts(as []*Annotation) []string { - ls := make([]string, len(as)) - for i, a := range as { - ls[i] = string(a.Left) - } - return ls -} diff --git a/vendor/github.com/sourcegraph/annotate/benchmark.txt b/vendor/github.com/sourcegraph/annotate/benchmark.txt deleted file mode 100644 index 44c5ba0..0000000 --- a/vendor/github.com/sourcegraph/annotate/benchmark.txt +++ /dev/null @@ -1,3 +0,0 @@ -PASS -BenchmarkAnnotate-12 5000 648826 ns/op 82921 B/op 979 allocs/op -ok github.com/sourcegraph/annotate 3.316s diff --git a/vendor/github.com/sourcegraph/syntaxhighlight/.travis.yml b/vendor/github.com/sourcegraph/syntaxhighlight/.travis.yml deleted file mode 100644 index 7cc29ff..0000000 --- a/vendor/github.com/sourcegraph/syntaxhighlight/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: go -go_import_path: github.com/sourcegraph/syntaxhighlight -go: - - 1.6.x - - 1.7.x - - 1.8.x - - master -install: - - go get -t -v ./... -script: - - diff -u <(echo -n) <(gofmt -d ./) - - go tool vet -composites=false ./*.go - - go tool vet -composites=false ./cmd/ - - go test -v -race -bench=. -benchmem ./... diff --git a/vendor/github.com/sourcegraph/syntaxhighlight/LICENSE b/vendor/github.com/sourcegraph/syntaxhighlight/LICENSE deleted file mode 100644 index d8cf637..0000000 --- a/vendor/github.com/sourcegraph/syntaxhighlight/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2013, Sourcegraph, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. Redistributions -in binary form must reproduce the above copyright notice, this list of -conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -Neither the name of Sourcegraph nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/vendor/github.com/sourcegraph/syntaxhighlight/Makefile b/vendor/github.com/sourcegraph/syntaxhighlight/Makefile deleted file mode 100644 index 63d8ecf..0000000 --- a/vendor/github.com/sourcegraph/syntaxhighlight/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -.PHONY: benchmark.txt - -benchmark.txt: - go test -test.run='^$$' -test.bench='.*' -test.benchmem > $@ 2>&1 - cat $@ diff --git a/vendor/github.com/sourcegraph/syntaxhighlight/README.md b/vendor/github.com/sourcegraph/syntaxhighlight/README.md deleted file mode 100644 index 7bfad10..0000000 --- a/vendor/github.com/sourcegraph/syntaxhighlight/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# syntaxhighlight - -Package syntaxhighlight provides syntax highlighting for code. It currently uses a language-independent lexer and performs decently on JavaScript, Java, Ruby, Python, Go, and C. - -The main [`AsHTML(src []byte) ([]byte, error)`](https://sourcegraph.com/sourcegraph.com/sourcegraph/syntaxhighlight@master/.GoPackage/sourcegraph.com/sourcegraph/syntaxhighlight/.def/AsHTML) function outputs HTML that uses the same CSS classes as [google-code-prettify](https://code.google.com/p/google-code-prettify/), so any stylesheets for that should also work with this package. - -**[Documentation on Sourcegraph](https://sourcegraph.com/github.com/sourcegraph/syntaxhighlight)** - -[![Build Status](https://travis-ci.org/sourcegraph/syntaxhighlight.png?branch=master)](https://travis-ci.org/sourcegraph/syntaxhighlight) -[![status](https://sourcegraph.com/api/repos/github.com/sourcegraph/syntaxhighlight/badges/status.png)](https://sourcegraph.com/github.com/sourcegraph/syntaxhighlight) - -## Installation - -``` -go get -u github.com/sourcegraph/syntaxhighlight -``` -First you should install the golang evironment, you can download it [here](https://golang.org/dl) or you can follow the [getting started](https://golang.org/doc/install) - -Remember you should set the environment variables correctly (GOPATH and PATH) - -## Example usage - -The function [`AsHTML(src []byte, options ...Option) ([]byte, error)`](https://sourcegraph.com/sourcegraph.com/sourcegraph/syntaxhighlight@master/.GoPackage/sourcegraph.com/sourcegraph/syntaxhighlight/.def/AsHTML) returns an HTML-highlighted version of `src`. The input source code can be in any language; the lexer is language independent. An `OrderedList()` option can be passed to produce an `
    ...
`-wrapped list to display line numbers. - -```go -package syntaxhighlight_test - -import ( - "fmt" - "os" - - "github.com/sourcegraph/syntaxhighlight" -) - -func Example() { - src := []byte(` -/* hello, world! */ -var a = 3; - -// b is a cool function -function b() { - return 7; -}`) - - highlighted, err := syntaxhighlight.AsHTML(src) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - fmt.Println(string(highlighted)) - - // Output: - // /* hello, world! */ - // var a = 3; - // - // // b is a cool function - // function b() { - // return 7; - // } -} -``` - -## Contributors - -* [Quinn Slack](https://sourcegraph.com/sqs) - -Contributions are welcome! Submit a pull request on GitHub. diff --git a/vendor/github.com/sourcegraph/syntaxhighlight/benchmark.txt b/vendor/github.com/sourcegraph/syntaxhighlight/benchmark.txt deleted file mode 100644 index 2923a0f..0000000 --- a/vendor/github.com/sourcegraph/syntaxhighlight/benchmark.txt +++ /dev/null @@ -1,3 +0,0 @@ -PASS -BenchmarkAnnotate-12 20000 80528 ns/op 18192 B/op 428 allocs/op -ok github.com/sourcegraph/syntaxhighlight 2.424s diff --git a/vendor/github.com/sourcegraph/syntaxhighlight/highlight.go b/vendor/github.com/sourcegraph/syntaxhighlight/highlight.go deleted file mode 100644 index 9ff794c..0000000 --- a/vendor/github.com/sourcegraph/syntaxhighlight/highlight.go +++ /dev/null @@ -1,295 +0,0 @@ -// Package syntaxhighlight provides syntax highlighting for code. It currently -// uses a language-independent lexer and performs decently on JavaScript, Java, -// Ruby, Python, Go, and C. -package syntaxhighlight - -import ( - "bytes" - "io" - "strings" - "text/scanner" - "text/template" - "unicode" - "unicode/utf8" - - "github.com/sourcegraph/annotate" -) - -// Kind represents a syntax highlighting kind (class) which will be assigned to tokens. -// A syntax highlighting scheme (style) maps text style properties to each token kind. -type Kind uint8 - -// A set of supported highlighting kinds -const ( - Whitespace Kind = iota - String - Keyword - Comment - Type - Literal - Punctuation - Plaintext - Tag - HTMLTag - HTMLAttrName - HTMLAttrValue - Decimal -) - -//go:generate gostringer -type=Kind - -// Printer implements an interface to render highlighted output -// (see HTMLPrinter for the implementation of this interface) -type Printer interface { - Print(w io.Writer, kind Kind, tokText string) error -} - -// HTMLConfig holds the HTML class configuration to be used by annotators when -// highlighting code. -type HTMLConfig struct { - String string - Keyword string - Comment string - Type string - Literal string - Punctuation string - Plaintext string - Tag string - HTMLTag string - HTMLAttrName string - HTMLAttrValue string - Decimal string - Whitespace string - - AsOrderedList bool -} - -// HTMLPrinter implements Printer interface and is used to produce -// HTML-based highligher -type HTMLPrinter HTMLConfig - -// Class returns the set class for a given token Kind. -func (c HTMLConfig) Class(kind Kind) string { - switch kind { - case String: - return c.String - case Keyword: - return c.Keyword - case Comment: - return c.Comment - case Type: - return c.Type - case Literal: - return c.Literal - case Punctuation: - return c.Punctuation - case Plaintext: - return c.Plaintext - case Tag: - return c.Tag - case HTMLTag: - return c.HTMLTag - case HTMLAttrName: - return c.HTMLAttrName - case HTMLAttrValue: - return c.HTMLAttrValue - case Decimal: - return c.Decimal - } - return "" -} - -// Print is the function that emits highlighted source code using -// ... wrapper tags -func (p HTMLPrinter) Print(w io.Writer, kind Kind, tokText string) error { - if p.AsOrderedList { - if i := strings.Index(tokText, "\n"); i > -1 { - if err := p.Print(w, kind, tokText[:i]); err != nil { - return err - } - w.Write([]byte("\n
  • ")) - if err := p.Print(w, kind, tokText[i+1:]); err != nil { - return err - } - return nil - } - } - - class := ((HTMLConfig)(p)).Class(kind) - if class != "" { - _, err := w.Write([]byte(``)) - if err != nil { - return err - } - } - template.HTMLEscape(w, []byte(tokText)) - if class != "" { - _, err := w.Write([]byte(``)) - if err != nil { - return err - } - } - return nil -} - -type Annotator interface { - Annotate(start int, kind Kind, tokText string) (*annotate.Annotation, error) -} - -type HTMLAnnotator HTMLConfig - -func (a HTMLAnnotator) Annotate(start int, kind Kind, tokText string) (*annotate.Annotation, error) { - class := ((HTMLConfig)(a)).Class(kind) - if class != "" { - left := []byte(``)...) - return &annotate.Annotation{ - Start: start, End: start + len(tokText), - Left: left, Right: []byte(""), - }, nil - } - return nil, nil -} - -// Option is a type of the function that can modify -// one or more of the options in the HTMLConfig structure. -type Option func(options *HTMLConfig) - -// OrderedList allows you to format the output as an ordered list -// to have line numbers in the output. -// -// Example: -// AsHTML(input, OrderedList()) -func OrderedList() Option { - return func(o *HTMLConfig) { - o.AsOrderedList = true - } -} - -// DefaultHTMLConfig provides class names that match those of google-code-prettify -// (https://code.google.com/p/google-code-prettify/). -var DefaultHTMLConfig = HTMLConfig{ - String: "str", - Keyword: "kwd", - Comment: "com", - Type: "typ", - Literal: "lit", - Punctuation: "pun", - Plaintext: "pln", - Tag: "tag", - HTMLTag: "htm", - HTMLAttrName: "atn", - HTMLAttrValue: "atv", - Decimal: "dec", - Whitespace: "", -} - -func Print(s *scanner.Scanner, w io.Writer, p Printer) error { - tok := s.Scan() - for tok != scanner.EOF { - tokText := s.TokenText() - err := p.Print(w, tokenKind(tok, tokText), tokText) - if err != nil { - return err - } - - tok = s.Scan() - } - - return nil -} - -func Annotate(src []byte, a Annotator) (annotate.Annotations, error) { - s := NewScanner(src) - - var anns annotate.Annotations - read := 0 - - tok := s.Scan() - for tok != scanner.EOF { - tokText := s.TokenText() - - ann, err := a.Annotate(read, tokenKind(tok, tokText), tokText) - if err != nil { - return nil, err - } - read += len(tokText) - if ann != nil { - anns = append(anns, ann) - } - - tok = s.Scan() - } - - return anns, nil -} - -// AsHTML converts source code into an HTML-highlighted version; -// It accepts optional configuration parameters to control rendering -// (see OrderedList as one example) -func AsHTML(src []byte, options ...Option) ([]byte, error) { - opt := DefaultHTMLConfig - for _, f := range options { - f(&opt) - } - - var buf bytes.Buffer - if opt.AsOrderedList { - buf.Write([]byte("
      \n
    1. ")) - } - err := Print(NewScanner(src), &buf, HTMLPrinter(opt)) - if opt.AsOrderedList { - buf.Write([]byte("
    2. \n
    ")) - } - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} - -// NewScanner is a helper that takes a []byte src, wraps it in a reader and creates a Scanner. -func NewScanner(src []byte) *scanner.Scanner { - return NewScannerReader(bytes.NewReader(src)) -} - -// NewScannerReader takes a reader src and creates a Scanner. -func NewScannerReader(src io.Reader) *scanner.Scanner { - var s scanner.Scanner - s.Init(src) - s.Error = func(_ *scanner.Scanner, _ string) {} - s.Whitespace = 0 - s.Mode = s.Mode ^ scanner.SkipComments - return &s -} - -func tokenKind(tok rune, tokText string) Kind { - switch tok { - case scanner.Ident: - if _, isKW := keywords[tokText]; isKW { - return Keyword - } - if r, _ := utf8.DecodeRuneInString(tokText); unicode.IsUpper(r) { - return Type - } - return Plaintext - case scanner.Float, scanner.Int: - return Decimal - case scanner.Char, scanner.String, scanner.RawString: - return String - case scanner.Comment: - return Comment - } - if unicode.IsSpace(tok) { - return Whitespace - } - return Punctuation -} diff --git a/vendor/github.com/sourcegraph/syntaxhighlight/keywords.go b/vendor/github.com/sourcegraph/syntaxhighlight/keywords.go deleted file mode 100644 index 85729d6..0000000 --- a/vendor/github.com/sourcegraph/syntaxhighlight/keywords.go +++ /dev/null @@ -1,177 +0,0 @@ -package syntaxhighlight - -var keywords = map[string]struct{}{ - "BEGIN": {}, - "END": {}, - "False": {}, - "Infinity": {}, - "NaN": {}, - "None": {}, - "True": {}, - "abstract": {}, - "alias": {}, - "align_union": {}, - "alignof": {}, - "and": {}, - "append": {}, - "as": {}, - "asm": {}, - "assert": {}, - "auto": {}, - "axiom": {}, - "begin": {}, - "bool": {}, - "boolean": {}, - "break": {}, - "byte": {}, - "caller": {}, - "case": {}, - "catch": {}, - "char": {}, - "class": {}, - "concept": {}, - "concept_map": {}, - "const": {}, - "const_cast": {}, - "constexpr": {}, - "continue": {}, - "debugger": {}, - "decltype": {}, - "def": {}, - "default": {}, - "defined": {}, - "del": {}, - "delegate": {}, - "delete": {}, - "die": {}, - "do": {}, - "double": {}, - "dump": {}, - "dynamic_cast": {}, - "elif": {}, - "else": {}, - "elsif": {}, - "end": {}, - "ensure": {}, - "enum": {}, - "eval": {}, - "except": {}, - "exec": {}, - "exit": {}, - "explicit": {}, - "export": {}, - "extends": {}, - "extern": {}, - "false": {}, - "final": {}, - "finally": {}, - "float": {}, - "float32": {}, - "float64": {}, - "for": {}, - "foreach": {}, - "friend": {}, - "from": {}, - "func": {}, - "function": {}, - "generic": {}, - "get": {}, - "global": {}, - "goto": {}, - "if": {}, - "implements": {}, - "import": {}, - "in": {}, - "inline": {}, - "instanceof": {}, - "int": {}, - "int8": {}, - "int16": {}, - "int32": {}, - "int64": {}, - "interface": {}, - "is": {}, - "lambda": {}, - "last": {}, - "late_check": {}, - "local": {}, - "long": {}, - "make": {}, - "map": {}, - "module": {}, - "mutable": {}, - "my": {}, - "namespace": {}, - "native": {}, - "new": {}, - "next": {}, - "nil": {}, - "no": {}, - "nonlocal": {}, - "not": {}, - "null": {}, - "nullptr": {}, - "operator": {}, - "or": {}, - "our": {}, - "package": {}, - "pass": {}, - "print": {}, - "private": {}, - "property": {}, - "protected": {}, - "public": {}, - "raise": {}, - "redo": {}, - "register": {}, - "reinterpret_cast": {}, - "require": {}, - "rescue": {}, - "retry": {}, - "return": {}, - "self": {}, - "set": {}, - "short": {}, - "signed": {}, - "sizeof": {}, - "static": {}, - "static_assert": {}, - "static_cast": {}, - "strictfp": {}, - "struct": {}, - "sub": {}, - "super": {}, - "switch": {}, - "synchronized": {}, - "template": {}, - "then": {}, - "this": {}, - "throw": {}, - "throws": {}, - "transient": {}, - "true": {}, - "try": {}, - "type": {}, - "typedef": {}, - "typeid": {}, - "typename": {}, - "typeof": {}, - "undef": {}, - "undefined": {}, - "union": {}, - "unless": {}, - "unsigned": {}, - "until": {}, - "use": {}, - "using": {}, - "var": {}, - "virtual": {}, - "void": {}, - "volatile": {}, - "wantarray": {}, - "when": {}, - "where": {}, - "while": {}, - "with": {}, - "yield": {}, -} diff --git a/vendor/github.com/sourcegraph/syntaxhighlight/kind_gostring.go b/vendor/github.com/sourcegraph/syntaxhighlight/kind_gostring.go deleted file mode 100644 index 2fc73ec..0000000 --- a/vendor/github.com/sourcegraph/syntaxhighlight/kind_gostring.go +++ /dev/null @@ -1,16 +0,0 @@ -// generated by gostringer -type=Kind; DO NOT EDIT - -package syntaxhighlight - -import "fmt" - -const _Kind_name = "WhitespaceStringKeywordCommentTypeLiteralPunctuationPlaintextTagHTMLTagHTMLAttrNameHTMLAttrValueDecimal" - -var _Kind_index = [...]uint8{0, 10, 16, 23, 30, 34, 41, 52, 61, 64, 71, 83, 96, 103} - -func (i Kind) GoString() string { - if i+1 >= Kind(len(_Kind_index)) { - return fmt.Sprintf("syntaxhighlight.Kind(%d)", i) - } - return "syntaxhighlight." + _Kind_name[_Kind_index[i]:_Kind_index[i+1]] -} diff --git a/vendor/github.com/spf13/cobra/.gitignore b/vendor/github.com/spf13/cobra/.gitignore deleted file mode 100644 index 1b8c7c2..0000000 --- a/vendor/github.com/spf13/cobra/.gitignore +++ /dev/null @@ -1,36 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -# Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore -# swap -[._]*.s[a-w][a-z] -[._]s[a-w][a-z] -# session -Session.vim -# temporary -.netrwhist -*~ -# auto-generated tag files -tags - -*.exe - -cobra.test diff --git a/vendor/github.com/spf13/cobra/.mailmap b/vendor/github.com/spf13/cobra/.mailmap deleted file mode 100644 index 94ec530..0000000 --- a/vendor/github.com/spf13/cobra/.mailmap +++ /dev/null @@ -1,3 +0,0 @@ -Steve Francia -Bjørn Erik Pedersen -Fabiano Franz diff --git a/vendor/github.com/spf13/cobra/.travis.yml b/vendor/github.com/spf13/cobra/.travis.yml deleted file mode 100644 index 5afcb20..0000000 --- a/vendor/github.com/spf13/cobra/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: go - -matrix: - include: - - go: 1.9.4 - - go: 1.10.0 - - go: tip - allow_failures: - - go: tip - -before_install: - - mkdir -p bin - - curl -Lso bin/shellcheck https://github.com/caarlos0/shellcheck-docker/releases/download/v0.4.3/shellcheck - - chmod +x bin/shellcheck -script: - - PATH=$PATH:$PWD/bin go test -v ./... - - go build - - diff -u <(echo -n) <(gofmt -d -s .) - - if [ -z $NOVET ]; then - diff -u <(echo -n) <(go tool vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint'); - fi diff --git a/vendor/github.com/spf13/cobra/LICENSE.txt b/vendor/github.com/spf13/cobra/LICENSE.txt deleted file mode 100644 index 298f0e2..0000000 --- a/vendor/github.com/spf13/cobra/LICENSE.txt +++ /dev/null @@ -1,174 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. diff --git a/vendor/github.com/spf13/cobra/README.md b/vendor/github.com/spf13/cobra/README.md deleted file mode 100644 index 851fcc0..0000000 --- a/vendor/github.com/spf13/cobra/README.md +++ /dev/null @@ -1,736 +0,0 @@ -![cobra logo](https://cloud.githubusercontent.com/assets/173412/10886352/ad566232-814f-11e5-9cd0-aa101788c117.png) - -Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files. - -Many of the most widely used Go projects are built using Cobra including: - -* [Kubernetes](http://kubernetes.io/) -* [Hugo](http://gohugo.io) -* [rkt](https://github.com/coreos/rkt) -* [etcd](https://github.com/coreos/etcd) -* [Moby (former Docker)](https://github.com/moby/moby) -* [Docker (distribution)](https://github.com/docker/distribution) -* [OpenShift](https://www.openshift.com/) -* [Delve](https://github.com/derekparker/delve) -* [GopherJS](http://www.gopherjs.org/) -* [CockroachDB](http://www.cockroachlabs.com/) -* [Bleve](http://www.blevesearch.com/) -* [ProjectAtomic (enterprise)](http://www.projectatomic.io/) -* [GiantSwarm's swarm](https://github.com/giantswarm/cli) -* [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack) -* [rclone](http://rclone.org/) -* [nehm](https://github.com/bogem/nehm) -* [Pouch](https://github.com/alibaba/pouch) - -[![Build Status](https://travis-ci.org/spf13/cobra.svg "Travis CI status")](https://travis-ci.org/spf13/cobra) -[![CircleCI status](https://circleci.com/gh/spf13/cobra.png?circle-token=:circle-token "CircleCI status")](https://circleci.com/gh/spf13/cobra) -[![GoDoc](https://godoc.org/github.com/spf13/cobra?status.svg)](https://godoc.org/github.com/spf13/cobra) - -# Table of Contents - -- [Overview](#overview) -- [Concepts](#concepts) - * [Commands](#commands) - * [Flags](#flags) -- [Installing](#installing) -- [Getting Started](#getting-started) - * [Using the Cobra Generator](#using-the-cobra-generator) - * [Using the Cobra Library](#using-the-cobra-library) - * [Working with Flags](#working-with-flags) - * [Positional and Custom Arguments](#positional-and-custom-arguments) - * [Example](#example) - * [Help Command](#help-command) - * [Usage Message](#usage-message) - * [PreRun and PostRun Hooks](#prerun-and-postrun-hooks) - * [Suggestions when "unknown command" happens](#suggestions-when-unknown-command-happens) - * [Generating documentation for your command](#generating-documentation-for-your-command) - * [Generating bash completions](#generating-bash-completions) -- [Contributing](#contributing) -- [License](#license) - -# Overview - -Cobra is a library providing a simple interface to create powerful modern CLI -interfaces similar to git & go tools. - -Cobra is also an application that will generate your application scaffolding to rapidly -develop a Cobra-based application. - -Cobra provides: -* Easy subcommand-based CLIs: `app server`, `app fetch`, etc. -* Fully POSIX-compliant flags (including short & long versions) -* Nested subcommands -* Global, local and cascading flags -* Easy generation of applications & commands with `cobra init appname` & `cobra add cmdname` -* Intelligent suggestions (`app srver`... did you mean `app server`?) -* Automatic help generation for commands and flags -* Automatic help flag recognition of `-h`, `--help`, etc. -* Automatically generated bash autocomplete for your application -* Automatically generated man pages for your application -* Command aliases so you can change things without breaking them -* The flexibility to define your own help, usage, etc. -* Optional tight integration with [viper](http://github.com/spf13/viper) for 12-factor apps - -# Concepts - -Cobra is built on a structure of commands, arguments & flags. - -**Commands** represent actions, **Args** are things and **Flags** are modifiers for those actions. - -The best applications will read like sentences when used. Users will know how -to use the application because they will natively understand how to use it. - -The pattern to follow is -`APPNAME VERB NOUN --ADJECTIVE.` - or -`APPNAME COMMAND ARG --FLAG` - -A few good real world examples may better illustrate this point. - -In the following example, 'server' is a command, and 'port' is a flag: - - hugo server --port=1313 - -In this command we are telling Git to clone the url bare. - - git clone URL --bare - -## Commands - -Command is the central point of the application. Each interaction that -the application supports will be contained in a Command. A command can -have children commands and optionally run an action. - -In the example above, 'server' is the command. - -[More about cobra.Command](https://godoc.org/github.com/spf13/cobra#Command) - -## Flags - -A flag is a way to modify the behavior of a command. Cobra supports -fully POSIX-compliant flags as well as the Go [flag package](https://golang.org/pkg/flag/). -A Cobra command can define flags that persist through to children commands -and flags that are only available to that command. - -In the example above, 'port' is the flag. - -Flag functionality is provided by the [pflag -library](https://github.com/spf13/pflag), a fork of the flag standard library -which maintains the same interface while adding POSIX compliance. - -# Installing -Using Cobra is easy. First, use `go get` to install the latest version -of the library. This command will install the `cobra` generator executable -along with the library and its dependencies: - - go get -u github.com/spf13/cobra/cobra - -Next, include Cobra in your application: - -```go -import "github.com/spf13/cobra" -``` - -# Getting Started - -While you are welcome to provide your own organization, typically a Cobra-based -application will follow the following organizational structure: - -``` - ▾ appName/ - ▾ cmd/ - add.go - your.go - commands.go - here.go - main.go -``` - -In a Cobra app, typically the main.go file is very bare. It serves one purpose: initializing Cobra. - -```go -package main - -import ( - "fmt" - "os" - - "{pathToYourApp}/cmd" -) - -func main() { - cmd.Execute() -} -``` - -## Using the Cobra Generator - -Cobra provides its own program that will create your application and add any -commands you want. It's the easiest way to incorporate Cobra into your application. - -[Here](https://github.com/spf13/cobra/blob/master/cobra/README.md) you can find more information about it. - -## Using the Cobra Library - -To manually implement Cobra you need to create a bare main.go file and a rootCmd file. -You will optionally provide additional commands as you see fit. - -### Create rootCmd - -Cobra doesn't require any special constructors. Simply create your commands. - -Ideally you place this in app/cmd/root.go: - -```go -var rootCmd = &cobra.Command{ - Use: "hugo", - Short: "Hugo is a very fast static site generator", - Long: `A Fast and Flexible Static Site Generator built with - love by spf13 and friends in Go. - Complete documentation is available at http://hugo.spf13.com`, - Run: func(cmd *cobra.Command, args []string) { - // Do Stuff Here - }, -} - -func Execute() { - if err := rootCmd.Execute(); err != nil { - fmt.Println(err) - os.Exit(1) - } -} -``` - -You will additionally define flags and handle configuration in your init() function. - -For example cmd/root.go: - -```go -import ( - "fmt" - "os" - - homedir "github.com/mitchellh/go-homedir" - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -func init() { - cobra.OnInitialize(initConfig) - rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cobra.yaml)") - rootCmd.PersistentFlags().StringVarP(&projectBase, "projectbase", "b", "", "base project directory eg. github.com/spf13/") - rootCmd.PersistentFlags().StringP("author", "a", "YOUR NAME", "Author name for copyright attribution") - rootCmd.PersistentFlags().StringVarP(&userLicense, "license", "l", "", "Name of license for the project (can provide `licensetext` in config)") - rootCmd.PersistentFlags().Bool("viper", true, "Use Viper for configuration") - viper.BindPFlag("author", rootCmd.PersistentFlags().Lookup("author")) - viper.BindPFlag("projectbase", rootCmd.PersistentFlags().Lookup("projectbase")) - viper.BindPFlag("useViper", rootCmd.PersistentFlags().Lookup("viper")) - viper.SetDefault("author", "NAME HERE ") - viper.SetDefault("license", "apache") -} - -func initConfig() { - // Don't forget to read config either from cfgFile or from home directory! - if cfgFile != "" { - // Use config file from the flag. - viper.SetConfigFile(cfgFile) - } else { - // Find home directory. - home, err := homedir.Dir() - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - // Search config in home directory with name ".cobra" (without extension). - viper.AddConfigPath(home) - viper.SetConfigName(".cobra") - } - - if err := viper.ReadInConfig(); err != nil { - fmt.Println("Can't read config:", err) - os.Exit(1) - } -} -``` - -### Create your main.go - -With the root command you need to have your main function execute it. -Execute should be run on the root for clarity, though it can be called on any command. - -In a Cobra app, typically the main.go file is very bare. It serves, one purpose, to initialize Cobra. - -```go -package main - -import ( - "fmt" - "os" - - "{pathToYourApp}/cmd" -) - -func main() { - cmd.Execute() -} -``` - -### Create additional commands - -Additional commands can be defined and typically are each given their own file -inside of the cmd/ directory. - -If you wanted to create a version command you would create cmd/version.go and -populate it with the following: - -```go -package cmd - -import ( - "fmt" - - "github.com/spf13/cobra" -) - -func init() { - rootCmd.AddCommand(versionCmd) -} - -var versionCmd = &cobra.Command{ - Use: "version", - Short: "Print the version number of Hugo", - Long: `All software has versions. This is Hugo's`, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Hugo Static Site Generator v0.9 -- HEAD") - }, -} -``` - -## Working with Flags - -Flags provide modifiers to control how the action command operates. - -### Assign flags to a command - -Since the flags are defined and used in different locations, we need to -define a variable outside with the correct scope to assign the flag to -work with. - -```go -var Verbose bool -var Source string -``` - -There are two different approaches to assign a flag. - -### Persistent Flags - -A flag can be 'persistent' meaning that this flag will be available to the -command it's assigned to as well as every command under that command. For -global flags, assign a flag as a persistent flag on the root. - -```go -rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose output") -``` - -### Local Flags - -A flag can also be assigned locally which will only apply to that specific command. - -```go -rootCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") -``` - -### Local Flag on Parent Commands - -By default Cobra only parses local flags on the target command, any local flags on -parent commands are ignored. By enabling `Command.TraverseChildren` Cobra will -parse local flags on each command before executing the target command. - -```go -command := cobra.Command{ - Use: "print [OPTIONS] [COMMANDS]", - TraverseChildren: true, -} -``` - -### Bind Flags with Config - -You can also bind your flags with [viper](https://github.com/spf13/viper): -```go -var author string - -func init() { - rootCmd.PersistentFlags().StringVar(&author, "author", "YOUR NAME", "Author name for copyright attribution") - viper.BindPFlag("author", rootCmd.PersistentFlags().Lookup("author")) -} -``` - -In this example the persistent flag `author` is bound with `viper`. -**Note**, that the variable `author` will not be set to the value from config, -when the `--author` flag is not provided by user. - -More in [viper documentation](https://github.com/spf13/viper#working-with-flags). - -### Required flags - -Flags are optional by default. If instead you wish your command to report an error -when a flag has not been set, mark it as required: -```go -rootCmd.Flags().StringVarP(&Region, "region", "r", "", "AWS region (required)") -rootCmd.MarkFlagRequired("region") -``` - -## Positional and Custom Arguments - -Validation of positional arguments can be specified using the `Args` field -of `Command`. - -The following validators are built in: - -- `NoArgs` - the command will report an error if there are any positional args. -- `ArbitraryArgs` - the command will accept any args. -- `OnlyValidArgs` - the command will report an error if there are any positional args that are not in the `ValidArgs` field of `Command`. -- `MinimumNArgs(int)` - the command will report an error if there are not at least N positional args. -- `MaximumNArgs(int)` - the command will report an error if there are more than N positional args. -- `ExactArgs(int)` - the command will report an error if there are not exactly N positional args. -- `RangeArgs(min, max)` - the command will report an error if the number of args is not between the minimum and maximum number of expected args. - -An example of setting the custom validator: - -```go -var cmd = &cobra.Command{ - Short: "hello", - Args: func(cmd *cobra.Command, args []string) error { - if len(args) < 1 { - return errors.New("requires at least one arg") - } - if myapp.IsValidColor(args[0]) { - return nil - } - return fmt.Errorf("invalid color specified: %s", args[0]) - }, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Hello, World!") - }, -} -``` - -## Example - -In the example below, we have defined three commands. Two are at the top level -and one (cmdTimes) is a child of one of the top commands. In this case the root -is not executable meaning that a subcommand is required. This is accomplished -by not providing a 'Run' for the 'rootCmd'. - -We have only defined one flag for a single command. - -More documentation about flags is available at https://github.com/spf13/pflag - -```go -package main - -import ( - "fmt" - "strings" - - "github.com/spf13/cobra" -) - -func main() { - var echoTimes int - - var cmdPrint = &cobra.Command{ - Use: "print [string to print]", - Short: "Print anything to the screen", - Long: `print is for printing anything back to the screen. -For many years people have printed back to the screen.`, - Args: cobra.MinimumNArgs(1), - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Print: " + strings.Join(args, " ")) - }, - } - - var cmdEcho = &cobra.Command{ - Use: "echo [string to echo]", - Short: "Echo anything to the screen", - Long: `echo is for echoing anything back. -Echo works a lot like print, except it has a child command.`, - Args: cobra.MinimumNArgs(1), - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Print: " + strings.Join(args, " ")) - }, - } - - var cmdTimes = &cobra.Command{ - Use: "times [# times] [string to echo]", - Short: "Echo anything to the screen more times", - Long: `echo things multiple times back to the user by providing -a count and a string.`, - Args: cobra.MinimumNArgs(1), - Run: func(cmd *cobra.Command, args []string) { - for i := 0; i < echoTimes; i++ { - fmt.Println("Echo: " + strings.Join(args, " ")) - } - }, - } - - cmdTimes.Flags().IntVarP(&echoTimes, "times", "t", 1, "times to echo the input") - - var rootCmd = &cobra.Command{Use: "app"} - rootCmd.AddCommand(cmdPrint, cmdEcho) - cmdEcho.AddCommand(cmdTimes) - rootCmd.Execute() -} -``` - -For a more complete example of a larger application, please checkout [Hugo](http://gohugo.io/). - -## Help Command - -Cobra automatically adds a help command to your application when you have subcommands. -This will be called when a user runs 'app help'. Additionally, help will also -support all other commands as input. Say, for instance, you have a command called -'create' without any additional configuration; Cobra will work when 'app help -create' is called. Every command will automatically have the '--help' flag added. - -### Example - -The following output is automatically generated by Cobra. Nothing beyond the -command and flag definitions are needed. - - $ cobra help - - Cobra is a CLI library for Go that empowers applications. - This application is a tool to generate the needed files - to quickly create a Cobra application. - - Usage: - cobra [command] - - Available Commands: - add Add a command to a Cobra Application - help Help about any command - init Initialize a Cobra Application - - Flags: - -a, --author string author name for copyright attribution (default "YOUR NAME") - --config string config file (default is $HOME/.cobra.yaml) - -h, --help help for cobra - -l, --license string name of license for the project - --viper use Viper for configuration (default true) - - Use "cobra [command] --help" for more information about a command. - - -Help is just a command like any other. There is no special logic or behavior -around it. In fact, you can provide your own if you want. - -### Defining your own help - -You can provide your own Help command or your own template for the default command to use -with following functions: - -```go -cmd.SetHelpCommand(cmd *Command) -cmd.SetHelpFunc(f func(*Command, []string)) -cmd.SetHelpTemplate(s string) -``` - -The latter two will also apply to any children commands. - -## Usage Message - -When the user provides an invalid flag or invalid command, Cobra responds by -showing the user the 'usage'. - -### Example -You may recognize this from the help above. That's because the default help -embeds the usage as part of its output. - - $ cobra --invalid - Error: unknown flag: --invalid - Usage: - cobra [command] - - Available Commands: - add Add a command to a Cobra Application - help Help about any command - init Initialize a Cobra Application - - Flags: - -a, --author string author name for copyright attribution (default "YOUR NAME") - --config string config file (default is $HOME/.cobra.yaml) - -h, --help help for cobra - -l, --license string name of license for the project - --viper use Viper for configuration (default true) - - Use "cobra [command] --help" for more information about a command. - -### Defining your own usage -You can provide your own usage function or template for Cobra to use. -Like help, the function and template are overridable through public methods: - -```go -cmd.SetUsageFunc(f func(*Command) error) -cmd.SetUsageTemplate(s string) -``` - -## Version Flag - -Cobra adds a top-level '--version' flag if the Version field is set on the root command. -Running an application with the '--version' flag will print the version to stdout using -the version template. The template can be customized using the -`cmd.SetVersionTemplate(s string)` function. - -## PreRun and PostRun Hooks - -It is possible to run functions before or after the main `Run` function of your command. The `PersistentPreRun` and `PreRun` functions will be executed before `Run`. `PersistentPostRun` and `PostRun` will be executed after `Run`. The `Persistent*Run` functions will be inherited by children if they do not declare their own. These functions are run in the following order: - -- `PersistentPreRun` -- `PreRun` -- `Run` -- `PostRun` -- `PersistentPostRun` - -An example of two commands which use all of these features is below. When the subcommand is executed, it will run the root command's `PersistentPreRun` but not the root command's `PersistentPostRun`: - -```go -package main - -import ( - "fmt" - - "github.com/spf13/cobra" -) - -func main() { - - var rootCmd = &cobra.Command{ - Use: "root [sub]", - Short: "My root command", - PersistentPreRun: func(cmd *cobra.Command, args []string) { - fmt.Printf("Inside rootCmd PersistentPreRun with args: %v\n", args) - }, - PreRun: func(cmd *cobra.Command, args []string) { - fmt.Printf("Inside rootCmd PreRun with args: %v\n", args) - }, - Run: func(cmd *cobra.Command, args []string) { - fmt.Printf("Inside rootCmd Run with args: %v\n", args) - }, - PostRun: func(cmd *cobra.Command, args []string) { - fmt.Printf("Inside rootCmd PostRun with args: %v\n", args) - }, - PersistentPostRun: func(cmd *cobra.Command, args []string) { - fmt.Printf("Inside rootCmd PersistentPostRun with args: %v\n", args) - }, - } - - var subCmd = &cobra.Command{ - Use: "sub [no options!]", - Short: "My subcommand", - PreRun: func(cmd *cobra.Command, args []string) { - fmt.Printf("Inside subCmd PreRun with args: %v\n", args) - }, - Run: func(cmd *cobra.Command, args []string) { - fmt.Printf("Inside subCmd Run with args: %v\n", args) - }, - PostRun: func(cmd *cobra.Command, args []string) { - fmt.Printf("Inside subCmd PostRun with args: %v\n", args) - }, - PersistentPostRun: func(cmd *cobra.Command, args []string) { - fmt.Printf("Inside subCmd PersistentPostRun with args: %v\n", args) - }, - } - - rootCmd.AddCommand(subCmd) - - rootCmd.SetArgs([]string{""}) - rootCmd.Execute() - fmt.Println() - rootCmd.SetArgs([]string{"sub", "arg1", "arg2"}) - rootCmd.Execute() -} -``` - -Output: -``` -Inside rootCmd PersistentPreRun with args: [] -Inside rootCmd PreRun with args: [] -Inside rootCmd Run with args: [] -Inside rootCmd PostRun with args: [] -Inside rootCmd PersistentPostRun with args: [] - -Inside rootCmd PersistentPreRun with args: [arg1 arg2] -Inside subCmd PreRun with args: [arg1 arg2] -Inside subCmd Run with args: [arg1 arg2] -Inside subCmd PostRun with args: [arg1 arg2] -Inside subCmd PersistentPostRun with args: [arg1 arg2] -``` - -## Suggestions when "unknown command" happens - -Cobra will print automatic suggestions when "unknown command" errors happen. This allows Cobra to behave similarly to the `git` command when a typo happens. For example: - -``` -$ hugo srever -Error: unknown command "srever" for "hugo" - -Did you mean this? - server - -Run 'hugo --help' for usage. -``` - -Suggestions are automatic based on every subcommand registered and use an implementation of [Levenshtein distance](http://en.wikipedia.org/wiki/Levenshtein_distance). Every registered command that matches a minimum distance of 2 (ignoring case) will be displayed as a suggestion. - -If you need to disable suggestions or tweak the string distance in your command, use: - -```go -command.DisableSuggestions = true -``` - -or - -```go -command.SuggestionsMinimumDistance = 1 -``` - -You can also explicitly set names for which a given command will be suggested using the `SuggestFor` attribute. This allows suggestions for strings that are not close in terms of string distance, but makes sense in your set of commands and for some which you don't want aliases. Example: - -``` -$ kubectl remove -Error: unknown command "remove" for "kubectl" - -Did you mean this? - delete - -Run 'kubectl help' for usage. -``` - -## Generating documentation for your command - -Cobra can generate documentation based on subcommands, flags, etc. in the following formats: - -- [Markdown](doc/md_docs.md) -- [ReStructured Text](doc/rest_docs.md) -- [Man Page](doc/man_docs.md) - -## Generating bash completions - -Cobra can generate a bash-completion file. If you add more information to your command, these completions can be amazingly powerful and flexible. Read more about it in [Bash Completions](bash_completions.md). - -# Contributing - -1. Fork it -2. Download your fork to your PC (`git clone https://github.com/your_username/cobra && cd cobra`) -3. Create your feature branch (`git checkout -b my-new-feature`) -4. Make changes and add them (`git add .`) -5. Commit your changes (`git commit -m 'Add some feature'`) -6. Push to the branch (`git push origin my-new-feature`) -7. Create new pull request - -# License - -Cobra is released under the Apache 2.0 license. See [LICENSE.txt](https://github.com/spf13/cobra/blob/master/LICENSE.txt) diff --git a/vendor/github.com/spf13/cobra/args.go b/vendor/github.com/spf13/cobra/args.go deleted file mode 100644 index a5d8a92..0000000 --- a/vendor/github.com/spf13/cobra/args.go +++ /dev/null @@ -1,89 +0,0 @@ -package cobra - -import ( - "fmt" -) - -type PositionalArgs func(cmd *Command, args []string) error - -// Legacy arg validation has the following behaviour: -// - root commands with no subcommands can take arbitrary arguments -// - root commands with subcommands will do subcommand validity checking -// - subcommands will always accept arbitrary arguments -func legacyArgs(cmd *Command, args []string) error { - // no subcommand, always take args - if !cmd.HasSubCommands() { - return nil - } - - // root command with subcommands, do subcommand checking. - if !cmd.HasParent() && len(args) > 0 { - return fmt.Errorf("unknown command %q for %q%s", args[0], cmd.CommandPath(), cmd.findSuggestions(args[0])) - } - return nil -} - -// NoArgs returns an error if any args are included. -func NoArgs(cmd *Command, args []string) error { - if len(args) > 0 { - return fmt.Errorf("unknown command %q for %q", args[0], cmd.CommandPath()) - } - return nil -} - -// OnlyValidArgs returns an error if any args are not in the list of ValidArgs. -func OnlyValidArgs(cmd *Command, args []string) error { - if len(cmd.ValidArgs) > 0 { - for _, v := range args { - if !stringInSlice(v, cmd.ValidArgs) { - return fmt.Errorf("invalid argument %q for %q%s", v, cmd.CommandPath(), cmd.findSuggestions(args[0])) - } - } - } - return nil -} - -// ArbitraryArgs never returns an error. -func ArbitraryArgs(cmd *Command, args []string) error { - return nil -} - -// MinimumNArgs returns an error if there is not at least N args. -func MinimumNArgs(n int) PositionalArgs { - return func(cmd *Command, args []string) error { - if len(args) < n { - return fmt.Errorf("requires at least %d arg(s), only received %d", n, len(args)) - } - return nil - } -} - -// MaximumNArgs returns an error if there are more than N args. -func MaximumNArgs(n int) PositionalArgs { - return func(cmd *Command, args []string) error { - if len(args) > n { - return fmt.Errorf("accepts at most %d arg(s), received %d", n, len(args)) - } - return nil - } -} - -// ExactArgs returns an error if there are not exactly n args. -func ExactArgs(n int) PositionalArgs { - return func(cmd *Command, args []string) error { - if len(args) != n { - return fmt.Errorf("accepts %d arg(s), received %d", n, len(args)) - } - return nil - } -} - -// RangeArgs returns an error if the number of args is not within the expected range. -func RangeArgs(min int, max int) PositionalArgs { - return func(cmd *Command, args []string) error { - if len(args) < min || len(args) > max { - return fmt.Errorf("accepts between %d and %d arg(s), received %d", min, max, len(args)) - } - return nil - } -} diff --git a/vendor/github.com/spf13/cobra/bash_completions.go b/vendor/github.com/spf13/cobra/bash_completions.go deleted file mode 100644 index 8fa8f48..0000000 --- a/vendor/github.com/spf13/cobra/bash_completions.go +++ /dev/null @@ -1,584 +0,0 @@ -package cobra - -import ( - "bytes" - "fmt" - "io" - "os" - "sort" - "strings" - - "github.com/spf13/pflag" -) - -// Annotations for Bash completion. -const ( - BashCompFilenameExt = "cobra_annotation_bash_completion_filename_extensions" - BashCompCustom = "cobra_annotation_bash_completion_custom" - BashCompOneRequiredFlag = "cobra_annotation_bash_completion_one_required_flag" - BashCompSubdirsInDir = "cobra_annotation_bash_completion_subdirs_in_dir" -) - -func writePreamble(buf *bytes.Buffer, name string) { - buf.WriteString(fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name)) - buf.WriteString(fmt.Sprintf(` -__%[1]s_debug() -{ - if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then - echo "$*" >> "${BASH_COMP_DEBUG_FILE}" - fi -} - -# Homebrew on Macs have version 1.3 of bash-completion which doesn't include -# _init_completion. This is a very minimal version of that function. -__%[1]s_init_completion() -{ - COMPREPLY=() - _get_comp_words_by_ref "$@" cur prev words cword -} - -__%[1]s_index_of_word() -{ - local w word=$1 - shift - index=0 - for w in "$@"; do - [[ $w = "$word" ]] && return - index=$((index+1)) - done - index=-1 -} - -__%[1]s_contains_word() -{ - local w word=$1; shift - for w in "$@"; do - [[ $w = "$word" ]] && return - done - return 1 -} - -__%[1]s_handle_reply() -{ - __%[1]s_debug "${FUNCNAME[0]}" - case $cur in - -*) - if [[ $(type -t compopt) = "builtin" ]]; then - compopt -o nospace - fi - local allflags - if [ ${#must_have_one_flag[@]} -ne 0 ]; then - allflags=("${must_have_one_flag[@]}") - else - allflags=("${flags[*]} ${two_word_flags[*]}") - fi - COMPREPLY=( $(compgen -W "${allflags[*]}" -- "$cur") ) - if [[ $(type -t compopt) = "builtin" ]]; then - [[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace - fi - - # complete after --flag=abc - if [[ $cur == *=* ]]; then - if [[ $(type -t compopt) = "builtin" ]]; then - compopt +o nospace - fi - - local index flag - flag="${cur%%=*}" - __%[1]s_index_of_word "${flag}" "${flags_with_completion[@]}" - COMPREPLY=() - if [[ ${index} -ge 0 ]]; then - PREFIX="" - cur="${cur#*=}" - ${flags_completion[${index}]} - if [ -n "${ZSH_VERSION}" ]; then - # zsh completion needs --flag= prefix - eval "COMPREPLY=( \"\${COMPREPLY[@]/#/${flag}=}\" )" - fi - fi - fi - return 0; - ;; - esac - - # check if we are handling a flag with special work handling - local index - __%[1]s_index_of_word "${prev}" "${flags_with_completion[@]}" - if [[ ${index} -ge 0 ]]; then - ${flags_completion[${index}]} - return - fi - - # we are parsing a flag and don't have a special handler, no completion - if [[ ${cur} != "${words[cword]}" ]]; then - return - fi - - local completions - completions=("${commands[@]}") - if [[ ${#must_have_one_noun[@]} -ne 0 ]]; then - completions=("${must_have_one_noun[@]}") - fi - if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then - completions+=("${must_have_one_flag[@]}") - fi - COMPREPLY=( $(compgen -W "${completions[*]}" -- "$cur") ) - - if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then - COMPREPLY=( $(compgen -W "${noun_aliases[*]}" -- "$cur") ) - fi - - if [[ ${#COMPREPLY[@]} -eq 0 ]]; then - declare -F __custom_func >/dev/null && __custom_func - fi - - # available in bash-completion >= 2, not always present on macOS - if declare -F __ltrim_colon_completions >/dev/null; then - __ltrim_colon_completions "$cur" - fi - - # If there is only 1 completion and it is a flag with an = it will be completed - # but we don't want a space after the = - if [[ "${#COMPREPLY[@]}" -eq "1" ]] && [[ $(type -t compopt) = "builtin" ]] && [[ "${COMPREPLY[0]}" == --*= ]]; then - compopt -o nospace - fi -} - -# The arguments should be in the form "ext1|ext2|extn" -__%[1]s_handle_filename_extension_flag() -{ - local ext="$1" - _filedir "@(${ext})" -} - -__%[1]s_handle_subdirs_in_dir_flag() -{ - local dir="$1" - pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 -} - -__%[1]s_handle_flag() -{ - __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" - - # if a command required a flag, and we found it, unset must_have_one_flag() - local flagname=${words[c]} - local flagvalue - # if the word contained an = - if [[ ${words[c]} == *"="* ]]; then - flagvalue=${flagname#*=} # take in as flagvalue after the = - flagname=${flagname%%=*} # strip everything after the = - flagname="${flagname}=" # but put the = back - fi - __%[1]s_debug "${FUNCNAME[0]}: looking for ${flagname}" - if __%[1]s_contains_word "${flagname}" "${must_have_one_flag[@]}"; then - must_have_one_flag=() - fi - - # if you set a flag which only applies to this command, don't show subcommands - if __%[1]s_contains_word "${flagname}" "${local_nonpersistent_flags[@]}"; then - commands=() - fi - - # keep flag value with flagname as flaghash - # flaghash variable is an associative array which is only supported in bash > 3. - if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then - if [ -n "${flagvalue}" ] ; then - flaghash[${flagname}]=${flagvalue} - elif [ -n "${words[ $((c+1)) ]}" ] ; then - flaghash[${flagname}]=${words[ $((c+1)) ]} - else - flaghash[${flagname}]="true" # pad "true" for bool flag - fi - fi - - # skip the argument to a two word flag - if __%[1]s_contains_word "${words[c]}" "${two_word_flags[@]}"; then - c=$((c+1)) - # if we are looking for a flags value, don't show commands - if [[ $c -eq $cword ]]; then - commands=() - fi - fi - - c=$((c+1)) - -} - -__%[1]s_handle_noun() -{ - __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" - - if __%[1]s_contains_word "${words[c]}" "${must_have_one_noun[@]}"; then - must_have_one_noun=() - elif __%[1]s_contains_word "${words[c]}" "${noun_aliases[@]}"; then - must_have_one_noun=() - fi - - nouns+=("${words[c]}") - c=$((c+1)) -} - -__%[1]s_handle_command() -{ - __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" - - local next_command - if [[ -n ${last_command} ]]; then - next_command="_${last_command}_${words[c]//:/__}" - else - if [[ $c -eq 0 ]]; then - next_command="_%[1]s_root_command" - else - next_command="_${words[c]//:/__}" - fi - fi - c=$((c+1)) - __%[1]s_debug "${FUNCNAME[0]}: looking for ${next_command}" - declare -F "$next_command" >/dev/null && $next_command -} - -__%[1]s_handle_word() -{ - if [[ $c -ge $cword ]]; then - __%[1]s_handle_reply - return - fi - __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" - if [[ "${words[c]}" == -* ]]; then - __%[1]s_handle_flag - elif __%[1]s_contains_word "${words[c]}" "${commands[@]}"; then - __%[1]s_handle_command - elif [[ $c -eq 0 ]]; then - __%[1]s_handle_command - elif __%[1]s_contains_word "${words[c]}" "${command_aliases[@]}"; then - # aliashash variable is an associative array which is only supported in bash > 3. - if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then - words[c]=${aliashash[${words[c]}]} - __%[1]s_handle_command - else - __%[1]s_handle_noun - fi - else - __%[1]s_handle_noun - fi - __%[1]s_handle_word -} - -`, name)) -} - -func writePostscript(buf *bytes.Buffer, name string) { - name = strings.Replace(name, ":", "__", -1) - buf.WriteString(fmt.Sprintf("__start_%s()\n", name)) - buf.WriteString(fmt.Sprintf(`{ - local cur prev words cword - declare -A flaghash 2>/dev/null || : - declare -A aliashash 2>/dev/null || : - if declare -F _init_completion >/dev/null 2>&1; then - _init_completion -s || return - else - __%[1]s_init_completion -n "=" || return - fi - - local c=0 - local flags=() - local two_word_flags=() - local local_nonpersistent_flags=() - local flags_with_completion=() - local flags_completion=() - local commands=("%[1]s") - local must_have_one_flag=() - local must_have_one_noun=() - local last_command - local nouns=() - - __%[1]s_handle_word -} - -`, name)) - buf.WriteString(fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then - complete -o default -F __start_%s %s -else - complete -o default -o nospace -F __start_%s %s -fi - -`, name, name, name, name)) - buf.WriteString("# ex: ts=4 sw=4 et filetype=sh\n") -} - -func writeCommands(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" commands=()\n") - for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c == cmd.helpCommand { - continue - } - buf.WriteString(fmt.Sprintf(" commands+=(%q)\n", c.Name())) - writeCmdAliases(buf, c) - } - buf.WriteString("\n") -} - -func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]string, cmd *Command) { - for key, value := range annotations { - switch key { - case BashCompFilenameExt: - buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) - - var ext string - if len(value) > 0 { - ext = fmt.Sprintf("__%s_handle_filename_extension_flag ", cmd.Root().Name()) + strings.Join(value, "|") - } else { - ext = "_filedir" - } - buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext)) - case BashCompCustom: - buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) - if len(value) > 0 { - handlers := strings.Join(value, "; ") - buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", handlers)) - } else { - buf.WriteString(" flags_completion+=(:)\n") - } - case BashCompSubdirsInDir: - buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) - - var ext string - if len(value) == 1 { - ext = fmt.Sprintf("__%s_handle_subdirs_in_dir_flag ", cmd.Root().Name()) + value[0] - } else { - ext = "_filedir -d" - } - buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext)) - } - } -} - -func writeShortFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) { - name := flag.Shorthand - format := " " - if len(flag.NoOptDefVal) == 0 { - format += "two_word_" - } - format += "flags+=(\"-%s\")\n" - buf.WriteString(fmt.Sprintf(format, name)) - writeFlagHandler(buf, "-"+name, flag.Annotations, cmd) -} - -func writeFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) { - name := flag.Name - format := " flags+=(\"--%s" - if len(flag.NoOptDefVal) == 0 { - format += "=" - } - format += "\")\n" - buf.WriteString(fmt.Sprintf(format, name)) - writeFlagHandler(buf, "--"+name, flag.Annotations, cmd) -} - -func writeLocalNonPersistentFlag(buf *bytes.Buffer, flag *pflag.Flag) { - name := flag.Name - format := " local_nonpersistent_flags+=(\"--%s" - if len(flag.NoOptDefVal) == 0 { - format += "=" - } - format += "\")\n" - buf.WriteString(fmt.Sprintf(format, name)) -} - -func writeFlags(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(` flags=() - two_word_flags=() - local_nonpersistent_flags=() - flags_with_completion=() - flags_completion=() - -`) - localNonPersistentFlags := cmd.LocalNonPersistentFlags() - cmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { - if nonCompletableFlag(flag) { - return - } - writeFlag(buf, flag, cmd) - if len(flag.Shorthand) > 0 { - writeShortFlag(buf, flag, cmd) - } - if localNonPersistentFlags.Lookup(flag.Name) != nil { - writeLocalNonPersistentFlag(buf, flag) - } - }) - cmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) { - if nonCompletableFlag(flag) { - return - } - writeFlag(buf, flag, cmd) - if len(flag.Shorthand) > 0 { - writeShortFlag(buf, flag, cmd) - } - }) - - buf.WriteString("\n") -} - -func writeRequiredFlag(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" must_have_one_flag=()\n") - flags := cmd.NonInheritedFlags() - flags.VisitAll(func(flag *pflag.Flag) { - if nonCompletableFlag(flag) { - return - } - for key := range flag.Annotations { - switch key { - case BashCompOneRequiredFlag: - format := " must_have_one_flag+=(\"--%s" - if flag.Value.Type() != "bool" { - format += "=" - } - format += "\")\n" - buf.WriteString(fmt.Sprintf(format, flag.Name)) - - if len(flag.Shorthand) > 0 { - buf.WriteString(fmt.Sprintf(" must_have_one_flag+=(\"-%s\")\n", flag.Shorthand)) - } - } - } - }) -} - -func writeRequiredNouns(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" must_have_one_noun=()\n") - sort.Sort(sort.StringSlice(cmd.ValidArgs)) - for _, value := range cmd.ValidArgs { - buf.WriteString(fmt.Sprintf(" must_have_one_noun+=(%q)\n", value)) - } -} - -func writeCmdAliases(buf *bytes.Buffer, cmd *Command) { - if len(cmd.Aliases) == 0 { - return - } - - sort.Sort(sort.StringSlice(cmd.Aliases)) - - buf.WriteString(fmt.Sprint(` if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then`, "\n")) - for _, value := range cmd.Aliases { - buf.WriteString(fmt.Sprintf(" command_aliases+=(%q)\n", value)) - buf.WriteString(fmt.Sprintf(" aliashash[%q]=%q\n", value, cmd.Name())) - } - buf.WriteString(` fi`) - buf.WriteString("\n") -} -func writeArgAliases(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" noun_aliases=()\n") - sort.Sort(sort.StringSlice(cmd.ArgAliases)) - for _, value := range cmd.ArgAliases { - buf.WriteString(fmt.Sprintf(" noun_aliases+=(%q)\n", value)) - } -} - -func gen(buf *bytes.Buffer, cmd *Command) { - for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c == cmd.helpCommand { - continue - } - gen(buf, c) - } - commandName := cmd.CommandPath() - commandName = strings.Replace(commandName, " ", "_", -1) - commandName = strings.Replace(commandName, ":", "__", -1) - - if cmd.Root() == cmd { - buf.WriteString(fmt.Sprintf("_%s_root_command()\n{\n", commandName)) - } else { - buf.WriteString(fmt.Sprintf("_%s()\n{\n", commandName)) - } - - buf.WriteString(fmt.Sprintf(" last_command=%q\n", commandName)) - buf.WriteString("\n") - buf.WriteString(" command_aliases=()\n") - buf.WriteString("\n") - - writeCommands(buf, cmd) - writeFlags(buf, cmd) - writeRequiredFlag(buf, cmd) - writeRequiredNouns(buf, cmd) - writeArgAliases(buf, cmd) - buf.WriteString("}\n\n") -} - -// GenBashCompletion generates bash completion file and writes to the passed writer. -func (c *Command) GenBashCompletion(w io.Writer) error { - buf := new(bytes.Buffer) - writePreamble(buf, c.Name()) - if len(c.BashCompletionFunction) > 0 { - buf.WriteString(c.BashCompletionFunction + "\n") - } - gen(buf, c) - writePostscript(buf, c.Name()) - - _, err := buf.WriteTo(w) - return err -} - -func nonCompletableFlag(flag *pflag.Flag) bool { - return flag.Hidden || len(flag.Deprecated) > 0 -} - -// GenBashCompletionFile generates bash completion file. -func (c *Command) GenBashCompletionFile(filename string) error { - outFile, err := os.Create(filename) - if err != nil { - return err - } - defer outFile.Close() - - return c.GenBashCompletion(outFile) -} - -// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag if it exists, -// and causes your command to report an error if invoked without the flag. -func (c *Command) MarkFlagRequired(name string) error { - return MarkFlagRequired(c.Flags(), name) -} - -// MarkPersistentFlagRequired adds the BashCompOneRequiredFlag annotation to the named persistent flag if it exists, -// and causes your command to report an error if invoked without the flag. -func (c *Command) MarkPersistentFlagRequired(name string) error { - return MarkFlagRequired(c.PersistentFlags(), name) -} - -// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag if it exists, -// and causes your command to report an error if invoked without the flag. -func MarkFlagRequired(flags *pflag.FlagSet, name string) error { - return flags.SetAnnotation(name, BashCompOneRequiredFlag, []string{"true"}) -} - -// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag, if it exists. -// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. -func (c *Command) MarkFlagFilename(name string, extensions ...string) error { - return MarkFlagFilename(c.Flags(), name, extensions...) -} - -// MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. -// Generated bash autocompletion will call the bash function f for the flag. -func (c *Command) MarkFlagCustom(name string, f string) error { - return MarkFlagCustom(c.Flags(), name, f) -} - -// MarkPersistentFlagFilename adds the BashCompFilenameExt annotation to the named persistent flag, if it exists. -// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. -func (c *Command) MarkPersistentFlagFilename(name string, extensions ...string) error { - return MarkFlagFilename(c.PersistentFlags(), name, extensions...) -} - -// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag in the flag set, if it exists. -// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. -func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error { - return flags.SetAnnotation(name, BashCompFilenameExt, extensions) -} - -// MarkFlagCustom adds the BashCompCustom annotation to the named flag in the flag set, if it exists. -// Generated bash autocompletion will call the bash function f for the flag. -func MarkFlagCustom(flags *pflag.FlagSet, name string, f string) error { - return flags.SetAnnotation(name, BashCompCustom, []string{f}) -} diff --git a/vendor/github.com/spf13/cobra/bash_completions.md b/vendor/github.com/spf13/cobra/bash_completions.md deleted file mode 100644 index e79d476..0000000 --- a/vendor/github.com/spf13/cobra/bash_completions.md +++ /dev/null @@ -1,221 +0,0 @@ -# Generating Bash Completions For Your Own cobra.Command - -Generating bash completions from a cobra command is incredibly easy. An actual program which does so for the kubernetes kubectl binary is as follows: - -```go -package main - -import ( - "io/ioutil" - "os" - - "k8s.io/kubernetes/pkg/kubectl/cmd" - "k8s.io/kubernetes/pkg/kubectl/cmd/util" -) - -func main() { - kubectl := cmd.NewKubectlCommand(util.NewFactory(nil), os.Stdin, ioutil.Discard, ioutil.Discard) - kubectl.GenBashCompletionFile("out.sh") -} -``` - -`out.sh` will get you completions of subcommands and flags. Copy it to `/etc/bash_completion.d/` as described [here](https://debian-administration.org/article/316/An_introduction_to_bash_completion_part_1) and reset your terminal to use autocompletion. If you make additional annotations to your code, you can get even more intelligent and flexible behavior. - -## Creating your own custom functions - -Some more actual code that works in kubernetes: - -```bash -const ( - bash_completion_func = `__kubectl_parse_get() -{ - local kubectl_output out - if kubectl_output=$(kubectl get --no-headers "$1" 2>/dev/null); then - out=($(echo "${kubectl_output}" | awk '{print $1}')) - COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) ) - fi -} - -__kubectl_get_resource() -{ - if [[ ${#nouns[@]} -eq 0 ]]; then - return 1 - fi - __kubectl_parse_get ${nouns[${#nouns[@]} -1]} - if [[ $? -eq 0 ]]; then - return 0 - fi -} - -__custom_func() { - case ${last_command} in - kubectl_get | kubectl_describe | kubectl_delete | kubectl_stop) - __kubectl_get_resource - return - ;; - *) - ;; - esac -} -`) -``` - -And then I set that in my command definition: - -```go -cmds := &cobra.Command{ - Use: "kubectl", - Short: "kubectl controls the Kubernetes cluster manager", - Long: `kubectl controls the Kubernetes cluster manager. - -Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`, - Run: runHelp, - BashCompletionFunction: bash_completion_func, -} -``` - -The `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__custom_func()` to be called when the built in processor was unable to find a solution. In the case of kubernetes a valid command might look something like `kubectl get pod [mypod]`. If you type `kubectl get pod [tab][tab]` the `__customc_func()` will run because the cobra.Command only understood "kubectl" and "get." `__custom_func()` will see that the cobra.Command is "kubectl_get" and will thus call another helper `__kubectl_get_resource()`. `__kubectl_get_resource` will look at the 'nouns' collected. In our example the only noun will be `pod`. So it will call `__kubectl_parse_get pod`. `__kubectl_parse_get` will actually call out to kubernetes and get any pods. It will then set `COMPREPLY` to valid pods! - -## Have the completions code complete your 'nouns' - -In the above example "pod" was assumed to already be typed. But if you want `kubectl get [tab][tab]` to show a list of valid "nouns" you have to set them. Simplified code from `kubectl get` looks like: - -```go -validArgs []string = { "pod", "node", "service", "replicationcontroller" } - -cmd := &cobra.Command{ - Use: "get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | RESOURCE/NAME ...)", - Short: "Display one or many resources", - Long: get_long, - Example: get_example, - Run: func(cmd *cobra.Command, args []string) { - err := RunGet(f, out, cmd, args) - util.CheckErr(err) - }, - ValidArgs: validArgs, -} -``` - -Notice we put the "ValidArgs" on the "get" subcommand. Doing so will give results like - -```bash -# kubectl get [tab][tab] -node pod replicationcontroller service -``` - -## Plural form and shortcuts for nouns - -If your nouns have a number of aliases, you can define them alongside `ValidArgs` using `ArgAliases`: - -```go -argAliases []string = { "pods", "nodes", "services", "svc", "replicationcontrollers", "rc" } - -cmd := &cobra.Command{ - ... - ValidArgs: validArgs, - ArgAliases: argAliases -} -``` - -The aliases are not shown to the user on tab completion, but they are accepted as valid nouns by -the completion algorithm if entered manually, e.g. in: - -```bash -# kubectl get rc [tab][tab] -backend frontend database -``` - -Note that without declaring `rc` as an alias, the completion algorithm would show the list of nouns -in this example again instead of the replication controllers. - -## Mark flags as required - -Most of the time completions will only show subcommands. But if a flag is required to make a subcommand work, you probably want it to show up when the user types [tab][tab]. Marking a flag as 'Required' is incredibly easy. - -```go -cmd.MarkFlagRequired("pod") -cmd.MarkFlagRequired("container") -``` - -and you'll get something like - -```bash -# kubectl exec [tab][tab][tab] --c --container= -p --pod= -``` - -# Specify valid filename extensions for flags that take a filename - -In this example we use --filename= and expect to get a json or yaml file as the argument. To make this easier we annotate the --filename flag with valid filename extensions. - -```go - annotations := []string{"json", "yaml", "yml"} - annotation := make(map[string][]string) - annotation[cobra.BashCompFilenameExt] = annotations - - flag := &pflag.Flag{ - Name: "filename", - Shorthand: "f", - Usage: usage, - Value: value, - DefValue: value.String(), - Annotations: annotation, - } - cmd.Flags().AddFlag(flag) -``` - -Now when you run a command with this filename flag you'll get something like - -```bash -# kubectl create -f -test/ example/ rpmbuild/ -hello.yml test.json -``` - -So while there are many other files in the CWD it only shows me subdirs and those with valid extensions. - -# Specify custom flag completion - -Similar to the filename completion and filtering using cobra.BashCompFilenameExt, you can specify -a custom flag completion function with cobra.BashCompCustom: - -```go - annotation := make(map[string][]string) - annotation[cobra.BashCompCustom] = []string{"__kubectl_get_namespaces"} - - flag := &pflag.Flag{ - Name: "namespace", - Usage: usage, - Annotations: annotation, - } - cmd.Flags().AddFlag(flag) -``` - -In addition add the `__handle_namespace_flag` implementation in the `BashCompletionFunction` -value, e.g.: - -```bash -__kubectl_get_namespaces() -{ - local template - template="{{ range .items }}{{ .metadata.name }} {{ end }}" - local kubectl_out - if kubectl_out=$(kubectl get -o template --template="${template}" namespace 2>/dev/null); then - COMPREPLY=( $( compgen -W "${kubectl_out}[*]" -- "$cur" ) ) - fi -} -``` -# Using bash aliases for commands - -You can also configure the `bash aliases` for the commands and they will also support completions. - -```bash -alias aliasname=origcommand -complete -o default -F __start_origcommand aliasname - -# and now when you run `aliasname` completion will make -# suggestions as it did for `origcommand`. - -$) aliasname -completion firstcommand secondcommand -``` diff --git a/vendor/github.com/spf13/cobra/cobra.go b/vendor/github.com/spf13/cobra/cobra.go deleted file mode 100644 index 7010fd1..0000000 --- a/vendor/github.com/spf13/cobra/cobra.go +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright © 2013 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Commands similar to git, go tools and other modern CLI tools -// inspired by go, go-Commander, gh and subcommand - -package cobra - -import ( - "fmt" - "io" - "reflect" - "strconv" - "strings" - "text/template" - "unicode" -) - -var templateFuncs = template.FuncMap{ - "trim": strings.TrimSpace, - "trimRightSpace": trimRightSpace, - "trimTrailingWhitespaces": trimRightSpace, - "appendIfNotPresent": appendIfNotPresent, - "rpad": rpad, - "gt": Gt, - "eq": Eq, -} - -var initializers []func() - -// EnablePrefixMatching allows to set automatic prefix matching. Automatic prefix matching can be a dangerous thing -// to automatically enable in CLI tools. -// Set this to true to enable it. -var EnablePrefixMatching = false - -// EnableCommandSorting controls sorting of the slice of commands, which is turned on by default. -// To disable sorting, set it to false. -var EnableCommandSorting = true - -// MousetrapHelpText enables an information splash screen on Windows -// if the CLI is started from explorer.exe. -// To disable the mousetrap, just set this variable to blank string (""). -// Works only on Microsoft Windows. -var MousetrapHelpText string = `This is a command line tool. - -You need to open cmd.exe and run it from there. -` - -// AddTemplateFunc adds a template function that's available to Usage and Help -// template generation. -func AddTemplateFunc(name string, tmplFunc interface{}) { - templateFuncs[name] = tmplFunc -} - -// AddTemplateFuncs adds multiple template functions that are available to Usage and -// Help template generation. -func AddTemplateFuncs(tmplFuncs template.FuncMap) { - for k, v := range tmplFuncs { - templateFuncs[k] = v - } -} - -// OnInitialize sets the passed functions to be run when each command's -// Execute method is called. -func OnInitialize(y ...func()) { - initializers = append(initializers, y...) -} - -// FIXME Gt is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra. - -// Gt takes two types and checks whether the first type is greater than the second. In case of types Arrays, Chans, -// Maps and Slices, Gt will compare their lengths. Ints are compared directly while strings are first parsed as -// ints and then compared. -func Gt(a interface{}, b interface{}) bool { - var left, right int64 - av := reflect.ValueOf(a) - - switch av.Kind() { - case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice: - left = int64(av.Len()) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - left = av.Int() - case reflect.String: - left, _ = strconv.ParseInt(av.String(), 10, 64) - } - - bv := reflect.ValueOf(b) - - switch bv.Kind() { - case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice: - right = int64(bv.Len()) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - right = bv.Int() - case reflect.String: - right, _ = strconv.ParseInt(bv.String(), 10, 64) - } - - return left > right -} - -// FIXME Eq is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra. - -// Eq takes two types and checks whether they are equal. Supported types are int and string. Unsupported types will panic. -func Eq(a interface{}, b interface{}) bool { - av := reflect.ValueOf(a) - bv := reflect.ValueOf(b) - - switch av.Kind() { - case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice: - panic("Eq called on unsupported type") - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return av.Int() == bv.Int() - case reflect.String: - return av.String() == bv.String() - } - return false -} - -func trimRightSpace(s string) string { - return strings.TrimRightFunc(s, unicode.IsSpace) -} - -// FIXME appendIfNotPresent is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra. - -// appendIfNotPresent will append stringToAppend to the end of s, but only if it's not yet present in s. -func appendIfNotPresent(s, stringToAppend string) string { - if strings.Contains(s, stringToAppend) { - return s - } - return s + " " + stringToAppend -} - -// rpad adds padding to the right of a string. -func rpad(s string, padding int) string { - template := fmt.Sprintf("%%-%ds", padding) - return fmt.Sprintf(template, s) -} - -// tmpl executes the given template text on data, writing the result to w. -func tmpl(w io.Writer, text string, data interface{}) error { - t := template.New("top") - t.Funcs(templateFuncs) - template.Must(t.Parse(text)) - return t.Execute(w, data) -} - -// ld compares two strings and returns the levenshtein distance between them. -func ld(s, t string, ignoreCase bool) int { - if ignoreCase { - s = strings.ToLower(s) - t = strings.ToLower(t) - } - d := make([][]int, len(s)+1) - for i := range d { - d[i] = make([]int, len(t)+1) - } - for i := range d { - d[i][0] = i - } - for j := range d[0] { - d[0][j] = j - } - for j := 1; j <= len(t); j++ { - for i := 1; i <= len(s); i++ { - if s[i-1] == t[j-1] { - d[i][j] = d[i-1][j-1] - } else { - min := d[i-1][j] - if d[i][j-1] < min { - min = d[i][j-1] - } - if d[i-1][j-1] < min { - min = d[i-1][j-1] - } - d[i][j] = min + 1 - } - } - - } - return d[len(s)][len(t)] -} - -func stringInSlice(a string, list []string) bool { - for _, b := range list { - if b == a { - return true - } - } - return false -} diff --git a/vendor/github.com/spf13/cobra/command.go b/vendor/github.com/spf13/cobra/command.go deleted file mode 100644 index 34d1bf3..0000000 --- a/vendor/github.com/spf13/cobra/command.go +++ /dev/null @@ -1,1517 +0,0 @@ -// Copyright © 2013 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. -// In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. -package cobra - -import ( - "bytes" - "fmt" - "io" - "os" - "path/filepath" - "sort" - "strings" - - flag "github.com/spf13/pflag" -) - -// FParseErrWhitelist configures Flag parse errors to be ignored -type FParseErrWhitelist flag.ParseErrorsWhitelist - -// Command is just that, a command for your application. -// E.g. 'go run ...' - 'run' is the command. Cobra requires -// you to define the usage and description as part of your command -// definition to ensure usability. -type Command struct { - // Use is the one-line usage message. - Use string - - // Aliases is an array of aliases that can be used instead of the first word in Use. - Aliases []string - - // SuggestFor is an array of command names for which this command will be suggested - - // similar to aliases but only suggests. - SuggestFor []string - - // Short is the short description shown in the 'help' output. - Short string - - // Long is the long message shown in the 'help ' output. - Long string - - // Example is examples of how to use the command. - Example string - - // ValidArgs is list of all valid non-flag arguments that are accepted in bash completions - ValidArgs []string - - // Expected arguments - Args PositionalArgs - - // ArgAliases is List of aliases for ValidArgs. - // These are not suggested to the user in the bash completion, - // but accepted if entered manually. - ArgAliases []string - - // BashCompletionFunction is custom functions used by the bash autocompletion generator. - BashCompletionFunction string - - // Deprecated defines, if this command is deprecated and should print this string when used. - Deprecated string - - // Hidden defines, if this command is hidden and should NOT show up in the list of available commands. - Hidden bool - - // Annotations are key/value pairs that can be used by applications to identify or - // group commands. - Annotations map[string]string - - // Version defines the version for this command. If this value is non-empty and the command does not - // define a "version" flag, a "version" boolean flag will be added to the command and, if specified, - // will print content of the "Version" variable. - Version string - - // The *Run functions are executed in the following order: - // * PersistentPreRun() - // * PreRun() - // * Run() - // * PostRun() - // * PersistentPostRun() - // All functions get the same args, the arguments after the command name. - // - // PersistentPreRun: children of this command will inherit and execute. - PersistentPreRun func(cmd *Command, args []string) - // PersistentPreRunE: PersistentPreRun but returns an error. - PersistentPreRunE func(cmd *Command, args []string) error - // PreRun: children of this command will not inherit. - PreRun func(cmd *Command, args []string) - // PreRunE: PreRun but returns an error. - PreRunE func(cmd *Command, args []string) error - // Run: Typically the actual work function. Most commands will only implement this. - Run func(cmd *Command, args []string) - // RunE: Run but returns an error. - RunE func(cmd *Command, args []string) error - // PostRun: run after the Run command. - PostRun func(cmd *Command, args []string) - // PostRunE: PostRun but returns an error. - PostRunE func(cmd *Command, args []string) error - // PersistentPostRun: children of this command will inherit and execute after PostRun. - PersistentPostRun func(cmd *Command, args []string) - // PersistentPostRunE: PersistentPostRun but returns an error. - PersistentPostRunE func(cmd *Command, args []string) error - - // SilenceErrors is an option to quiet errors down stream. - SilenceErrors bool - - // SilenceUsage is an option to silence usage when an error occurs. - SilenceUsage bool - - // DisableFlagParsing disables the flag parsing. - // If this is true all flags will be passed to the command as arguments. - DisableFlagParsing bool - - // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") - // will be printed by generating docs for this command. - DisableAutoGenTag bool - - // DisableFlagsInUseLine will disable the addition of [flags] to the usage - // line of a command when printing help or generating docs - DisableFlagsInUseLine bool - - // DisableSuggestions disables the suggestions based on Levenshtein distance - // that go along with 'unknown command' messages. - DisableSuggestions bool - // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. - // Must be > 0. - SuggestionsMinimumDistance int - - // TraverseChildren parses flags on all parents before executing child command. - TraverseChildren bool - - //FParseErrWhitelist flag parse errors to be ignored - FParseErrWhitelist FParseErrWhitelist - - // commands is the list of commands supported by this program. - commands []*Command - // parent is a parent command for this command. - parent *Command - // Max lengths of commands' string lengths for use in padding. - commandsMaxUseLen int - commandsMaxCommandPathLen int - commandsMaxNameLen int - // commandsAreSorted defines, if command slice are sorted or not. - commandsAreSorted bool - // commandCalledAs is the name or alias value used to call this command. - commandCalledAs struct { - name string - called bool - } - - // args is actual args parsed from flags. - args []string - // flagErrorBuf contains all error messages from pflag. - flagErrorBuf *bytes.Buffer - // flags is full set of flags. - flags *flag.FlagSet - // pflags contains persistent flags. - pflags *flag.FlagSet - // lflags contains local flags. - lflags *flag.FlagSet - // iflags contains inherited flags. - iflags *flag.FlagSet - // parentsPflags is all persistent flags of cmd's parents. - parentsPflags *flag.FlagSet - // globNormFunc is the global normalization function - // that we can use on every pflag set and children commands - globNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName - - // output is an output writer defined by user. - output io.Writer - // usageFunc is usage func defined by user. - usageFunc func(*Command) error - // usageTemplate is usage template defined by user. - usageTemplate string - // flagErrorFunc is func defined by user and it's called when the parsing of - // flags returns an error. - flagErrorFunc func(*Command, error) error - // helpTemplate is help template defined by user. - helpTemplate string - // helpFunc is help func defined by user. - helpFunc func(*Command, []string) - // helpCommand is command with usage 'help'. If it's not defined by user, - // cobra uses default help command. - helpCommand *Command - // versionTemplate is the version template defined by user. - versionTemplate string -} - -// SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden -// particularly useful when testing. -func (c *Command) SetArgs(a []string) { - c.args = a -} - -// SetOutput sets the destination for usage and error messages. -// If output is nil, os.Stderr is used. -func (c *Command) SetOutput(output io.Writer) { - c.output = output -} - -// SetUsageFunc sets usage function. Usage can be defined by application. -func (c *Command) SetUsageFunc(f func(*Command) error) { - c.usageFunc = f -} - -// SetUsageTemplate sets usage template. Can be defined by Application. -func (c *Command) SetUsageTemplate(s string) { - c.usageTemplate = s -} - -// SetFlagErrorFunc sets a function to generate an error when flag parsing -// fails. -func (c *Command) SetFlagErrorFunc(f func(*Command, error) error) { - c.flagErrorFunc = f -} - -// SetHelpFunc sets help function. Can be defined by Application. -func (c *Command) SetHelpFunc(f func(*Command, []string)) { - c.helpFunc = f -} - -// SetHelpCommand sets help command. -func (c *Command) SetHelpCommand(cmd *Command) { - c.helpCommand = cmd -} - -// SetHelpTemplate sets help template to be used. Application can use it to set custom template. -func (c *Command) SetHelpTemplate(s string) { - c.helpTemplate = s -} - -// SetVersionTemplate sets version template to be used. Application can use it to set custom template. -func (c *Command) SetVersionTemplate(s string) { - c.versionTemplate = s -} - -// SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands. -// The user should not have a cyclic dependency on commands. -func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, name string) flag.NormalizedName) { - c.Flags().SetNormalizeFunc(n) - c.PersistentFlags().SetNormalizeFunc(n) - c.globNormFunc = n - - for _, command := range c.commands { - command.SetGlobalNormalizationFunc(n) - } -} - -// OutOrStdout returns output to stdout. -func (c *Command) OutOrStdout() io.Writer { - return c.getOut(os.Stdout) -} - -// OutOrStderr returns output to stderr -func (c *Command) OutOrStderr() io.Writer { - return c.getOut(os.Stderr) -} - -func (c *Command) getOut(def io.Writer) io.Writer { - if c.output != nil { - return c.output - } - if c.HasParent() { - return c.parent.getOut(def) - } - return def -} - -// UsageFunc returns either the function set by SetUsageFunc for this command -// or a parent, or it returns a default usage function. -func (c *Command) UsageFunc() (f func(*Command) error) { - if c.usageFunc != nil { - return c.usageFunc - } - if c.HasParent() { - return c.Parent().UsageFunc() - } - return func(c *Command) error { - c.mergePersistentFlags() - err := tmpl(c.OutOrStderr(), c.UsageTemplate(), c) - if err != nil { - c.Println(err) - } - return err - } -} - -// Usage puts out the usage for the command. -// Used when a user provides invalid input. -// Can be defined by user by overriding UsageFunc. -func (c *Command) Usage() error { - return c.UsageFunc()(c) -} - -// HelpFunc returns either the function set by SetHelpFunc for this command -// or a parent, or it returns a function with default help behavior. -func (c *Command) HelpFunc() func(*Command, []string) { - if c.helpFunc != nil { - return c.helpFunc - } - if c.HasParent() { - return c.Parent().HelpFunc() - } - return func(c *Command, a []string) { - c.mergePersistentFlags() - err := tmpl(c.OutOrStdout(), c.HelpTemplate(), c) - if err != nil { - c.Println(err) - } - } -} - -// Help puts out the help for the command. -// Used when a user calls help [command]. -// Can be defined by user by overriding HelpFunc. -func (c *Command) Help() error { - c.HelpFunc()(c, []string{}) - return nil -} - -// UsageString return usage string. -func (c *Command) UsageString() string { - tmpOutput := c.output - bb := new(bytes.Buffer) - c.SetOutput(bb) - c.Usage() - c.output = tmpOutput - return bb.String() -} - -// FlagErrorFunc returns either the function set by SetFlagErrorFunc for this -// command or a parent, or it returns a function which returns the original -// error. -func (c *Command) FlagErrorFunc() (f func(*Command, error) error) { - if c.flagErrorFunc != nil { - return c.flagErrorFunc - } - - if c.HasParent() { - return c.parent.FlagErrorFunc() - } - return func(c *Command, err error) error { - return err - } -} - -var minUsagePadding = 25 - -// UsagePadding return padding for the usage. -func (c *Command) UsagePadding() int { - if c.parent == nil || minUsagePadding > c.parent.commandsMaxUseLen { - return minUsagePadding - } - return c.parent.commandsMaxUseLen -} - -var minCommandPathPadding = 11 - -// CommandPathPadding return padding for the command path. -func (c *Command) CommandPathPadding() int { - if c.parent == nil || minCommandPathPadding > c.parent.commandsMaxCommandPathLen { - return minCommandPathPadding - } - return c.parent.commandsMaxCommandPathLen -} - -var minNamePadding = 11 - -// NamePadding returns padding for the name. -func (c *Command) NamePadding() int { - if c.parent == nil || minNamePadding > c.parent.commandsMaxNameLen { - return minNamePadding - } - return c.parent.commandsMaxNameLen -} - -// UsageTemplate returns usage template for the command. -func (c *Command) UsageTemplate() string { - if c.usageTemplate != "" { - return c.usageTemplate - } - - if c.HasParent() { - return c.parent.UsageTemplate() - } - return `Usage:{{if .Runnable}} - {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}} - {{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}} - -Aliases: - {{.NameAndAliases}}{{end}}{{if .HasExample}} - -Examples: -{{.Example}}{{end}}{{if .HasAvailableSubCommands}} - -Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}} - {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} - -Flags: -{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}} - -Global Flags: -{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}} - -Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}} - {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}} - -Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}} -` -} - -// HelpTemplate return help template for the command. -func (c *Command) HelpTemplate() string { - if c.helpTemplate != "" { - return c.helpTemplate - } - - if c.HasParent() { - return c.parent.HelpTemplate() - } - return `{{with (or .Long .Short)}}{{. | trimTrailingWhitespaces}} - -{{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}` -} - -// VersionTemplate return version template for the command. -func (c *Command) VersionTemplate() string { - if c.versionTemplate != "" { - return c.versionTemplate - } - - if c.HasParent() { - return c.parent.VersionTemplate() - } - return `{{with .Name}}{{printf "%s " .}}{{end}}{{printf "version %s" .Version}} -` -} - -func hasNoOptDefVal(name string, fs *flag.FlagSet) bool { - flag := fs.Lookup(name) - if flag == nil { - return false - } - return flag.NoOptDefVal != "" -} - -func shortHasNoOptDefVal(name string, fs *flag.FlagSet) bool { - if len(name) == 0 { - return false - } - - flag := fs.ShorthandLookup(name[:1]) - if flag == nil { - return false - } - return flag.NoOptDefVal != "" -} - -func stripFlags(args []string, c *Command) []string { - if len(args) == 0 { - return args - } - c.mergePersistentFlags() - - commands := []string{} - flags := c.Flags() - -Loop: - for len(args) > 0 { - s := args[0] - args = args[1:] - switch { - case s == "--": - // "--" terminates the flags - break Loop - case strings.HasPrefix(s, "--") && !strings.Contains(s, "=") && !hasNoOptDefVal(s[2:], flags): - // If '--flag arg' then - // delete arg from args. - fallthrough // (do the same as below) - case strings.HasPrefix(s, "-") && !strings.Contains(s, "=") && len(s) == 2 && !shortHasNoOptDefVal(s[1:], flags): - // If '-f arg' then - // delete 'arg' from args or break the loop if len(args) <= 1. - if len(args) <= 1 { - break Loop - } else { - args = args[1:] - continue - } - case s != "" && !strings.HasPrefix(s, "-"): - commands = append(commands, s) - } - } - - return commands -} - -// argsMinusFirstX removes only the first x from args. Otherwise, commands that look like -// openshift admin policy add-role-to-user admin my-user, lose the admin argument (arg[4]). -func argsMinusFirstX(args []string, x string) []string { - for i, y := range args { - if x == y { - ret := []string{} - ret = append(ret, args[:i]...) - ret = append(ret, args[i+1:]...) - return ret - } - } - return args -} - -func isFlagArg(arg string) bool { - return ((len(arg) >= 3 && arg[1] == '-') || - (len(arg) >= 2 && arg[0] == '-' && arg[1] != '-')) -} - -// Find the target command given the args and command tree -// Meant to be run on the highest node. Only searches down. -func (c *Command) Find(args []string) (*Command, []string, error) { - var innerfind func(*Command, []string) (*Command, []string) - - innerfind = func(c *Command, innerArgs []string) (*Command, []string) { - argsWOflags := stripFlags(innerArgs, c) - if len(argsWOflags) == 0 { - return c, innerArgs - } - nextSubCmd := argsWOflags[0] - - cmd := c.findNext(nextSubCmd) - if cmd != nil { - return innerfind(cmd, argsMinusFirstX(innerArgs, nextSubCmd)) - } - return c, innerArgs - } - - commandFound, a := innerfind(c, args) - if commandFound.Args == nil { - return commandFound, a, legacyArgs(commandFound, stripFlags(a, commandFound)) - } - return commandFound, a, nil -} - -func (c *Command) findSuggestions(arg string) string { - if c.DisableSuggestions { - return "" - } - if c.SuggestionsMinimumDistance <= 0 { - c.SuggestionsMinimumDistance = 2 - } - suggestionsString := "" - if suggestions := c.SuggestionsFor(arg); len(suggestions) > 0 { - suggestionsString += "\n\nDid you mean this?\n" - for _, s := range suggestions { - suggestionsString += fmt.Sprintf("\t%v\n", s) - } - } - return suggestionsString -} - -func (c *Command) findNext(next string) *Command { - matches := make([]*Command, 0) - for _, cmd := range c.commands { - if cmd.Name() == next || cmd.HasAlias(next) { - cmd.commandCalledAs.name = next - return cmd - } - if EnablePrefixMatching && cmd.hasNameOrAliasPrefix(next) { - matches = append(matches, cmd) - } - } - - if len(matches) == 1 { - return matches[0] - } - - return nil -} - -// Traverse the command tree to find the command, and parse args for -// each parent. -func (c *Command) Traverse(args []string) (*Command, []string, error) { - flags := []string{} - inFlag := false - - for i, arg := range args { - switch { - // A long flag with a space separated value - case strings.HasPrefix(arg, "--") && !strings.Contains(arg, "="): - // TODO: this isn't quite right, we should really check ahead for 'true' or 'false' - inFlag = !hasNoOptDefVal(arg[2:], c.Flags()) - flags = append(flags, arg) - continue - // A short flag with a space separated value - case strings.HasPrefix(arg, "-") && !strings.Contains(arg, "=") && len(arg) == 2 && !shortHasNoOptDefVal(arg[1:], c.Flags()): - inFlag = true - flags = append(flags, arg) - continue - // The value for a flag - case inFlag: - inFlag = false - flags = append(flags, arg) - continue - // A flag without a value, or with an `=` separated value - case isFlagArg(arg): - flags = append(flags, arg) - continue - } - - cmd := c.findNext(arg) - if cmd == nil { - return c, args, nil - } - - if err := c.ParseFlags(flags); err != nil { - return nil, args, err - } - return cmd.Traverse(args[i+1:]) - } - return c, args, nil -} - -// SuggestionsFor provides suggestions for the typedName. -func (c *Command) SuggestionsFor(typedName string) []string { - suggestions := []string{} - for _, cmd := range c.commands { - if cmd.IsAvailableCommand() { - levenshteinDistance := ld(typedName, cmd.Name(), true) - suggestByLevenshtein := levenshteinDistance <= c.SuggestionsMinimumDistance - suggestByPrefix := strings.HasPrefix(strings.ToLower(cmd.Name()), strings.ToLower(typedName)) - if suggestByLevenshtein || suggestByPrefix { - suggestions = append(suggestions, cmd.Name()) - } - for _, explicitSuggestion := range cmd.SuggestFor { - if strings.EqualFold(typedName, explicitSuggestion) { - suggestions = append(suggestions, cmd.Name()) - } - } - } - } - return suggestions -} - -// VisitParents visits all parents of the command and invokes fn on each parent. -func (c *Command) VisitParents(fn func(*Command)) { - if c.HasParent() { - fn(c.Parent()) - c.Parent().VisitParents(fn) - } -} - -// Root finds root command. -func (c *Command) Root() *Command { - if c.HasParent() { - return c.Parent().Root() - } - return c -} - -// ArgsLenAtDash will return the length of c.Flags().Args at the moment -// when a -- was found during args parsing. -func (c *Command) ArgsLenAtDash() int { - return c.Flags().ArgsLenAtDash() -} - -func (c *Command) execute(a []string) (err error) { - if c == nil { - return fmt.Errorf("Called Execute() on a nil Command") - } - - if len(c.Deprecated) > 0 { - c.Printf("Command %q is deprecated, %s\n", c.Name(), c.Deprecated) - } - - // initialize help and version flag at the last point possible to allow for user - // overriding - c.InitDefaultHelpFlag() - c.InitDefaultVersionFlag() - - err = c.ParseFlags(a) - if err != nil { - return c.FlagErrorFunc()(c, err) - } - - // If help is called, regardless of other flags, return we want help. - // Also say we need help if the command isn't runnable. - helpVal, err := c.Flags().GetBool("help") - if err != nil { - // should be impossible to get here as we always declare a help - // flag in InitDefaultHelpFlag() - c.Println("\"help\" flag declared as non-bool. Please correct your code") - return err - } - - if helpVal { - return flag.ErrHelp - } - - // for back-compat, only add version flag behavior if version is defined - if c.Version != "" { - versionVal, err := c.Flags().GetBool("version") - if err != nil { - c.Println("\"version\" flag declared as non-bool. Please correct your code") - return err - } - if versionVal { - err := tmpl(c.OutOrStdout(), c.VersionTemplate(), c) - if err != nil { - c.Println(err) - } - return err - } - } - - if !c.Runnable() { - return flag.ErrHelp - } - - c.preRun() - - argWoFlags := c.Flags().Args() - if c.DisableFlagParsing { - argWoFlags = a - } - - if err := c.ValidateArgs(argWoFlags); err != nil { - return err - } - - for p := c; p != nil; p = p.Parent() { - if p.PersistentPreRunE != nil { - if err := p.PersistentPreRunE(c, argWoFlags); err != nil { - return err - } - break - } else if p.PersistentPreRun != nil { - p.PersistentPreRun(c, argWoFlags) - break - } - } - if c.PreRunE != nil { - if err := c.PreRunE(c, argWoFlags); err != nil { - return err - } - } else if c.PreRun != nil { - c.PreRun(c, argWoFlags) - } - - if err := c.validateRequiredFlags(); err != nil { - return err - } - if c.RunE != nil { - if err := c.RunE(c, argWoFlags); err != nil { - return err - } - } else { - c.Run(c, argWoFlags) - } - if c.PostRunE != nil { - if err := c.PostRunE(c, argWoFlags); err != nil { - return err - } - } else if c.PostRun != nil { - c.PostRun(c, argWoFlags) - } - for p := c; p != nil; p = p.Parent() { - if p.PersistentPostRunE != nil { - if err := p.PersistentPostRunE(c, argWoFlags); err != nil { - return err - } - break - } else if p.PersistentPostRun != nil { - p.PersistentPostRun(c, argWoFlags) - break - } - } - - return nil -} - -func (c *Command) preRun() { - for _, x := range initializers { - x() - } -} - -// Execute uses the args (os.Args[1:] by default) -// and run through the command tree finding appropriate matches -// for commands and then corresponding flags. -func (c *Command) Execute() error { - _, err := c.ExecuteC() - return err -} - -// ExecuteC executes the command. -func (c *Command) ExecuteC() (cmd *Command, err error) { - // Regardless of what command execute is called on, run on Root only - if c.HasParent() { - return c.Root().ExecuteC() - } - - // windows hook - if preExecHookFn != nil { - preExecHookFn(c) - } - - // initialize help as the last point possible to allow for user - // overriding - c.InitDefaultHelpCmd() - - var args []string - - // Workaround FAIL with "go test -v" or "cobra.test -test.v", see #155 - if c.args == nil && filepath.Base(os.Args[0]) != "cobra.test" { - args = os.Args[1:] - } else { - args = c.args - } - - var flags []string - if c.TraverseChildren { - cmd, flags, err = c.Traverse(args) - } else { - cmd, flags, err = c.Find(args) - } - if err != nil { - // If found parse to a subcommand and then failed, talk about the subcommand - if cmd != nil { - c = cmd - } - if !c.SilenceErrors { - c.Println("Error:", err.Error()) - c.Printf("Run '%v --help' for usage.\n", c.CommandPath()) - } - return c, err - } - - cmd.commandCalledAs.called = true - if cmd.commandCalledAs.name == "" { - cmd.commandCalledAs.name = cmd.Name() - } - - err = cmd.execute(flags) - if err != nil { - // Always show help if requested, even if SilenceErrors is in - // effect - if err == flag.ErrHelp { - cmd.HelpFunc()(cmd, args) - return cmd, nil - } - - // If root command has SilentErrors flagged, - // all subcommands should respect it - if !cmd.SilenceErrors && !c.SilenceErrors { - c.Println("Error:", err.Error()) - } - - // If root command has SilentUsage flagged, - // all subcommands should respect it - if !cmd.SilenceUsage && !c.SilenceUsage { - c.Println(cmd.UsageString()) - } - } - return cmd, err -} - -func (c *Command) ValidateArgs(args []string) error { - if c.Args == nil { - return nil - } - return c.Args(c, args) -} - -func (c *Command) validateRequiredFlags() error { - flags := c.Flags() - missingFlagNames := []string{} - flags.VisitAll(func(pflag *flag.Flag) { - requiredAnnotation, found := pflag.Annotations[BashCompOneRequiredFlag] - if !found { - return - } - if (requiredAnnotation[0] == "true") && !pflag.Changed { - missingFlagNames = append(missingFlagNames, pflag.Name) - } - }) - - if len(missingFlagNames) > 0 { - return fmt.Errorf(`required flag(s) "%s" not set`, strings.Join(missingFlagNames, `", "`)) - } - return nil -} - -// InitDefaultHelpFlag adds default help flag to c. -// It is called automatically by executing the c or by calling help and usage. -// If c already has help flag, it will do nothing. -func (c *Command) InitDefaultHelpFlag() { - c.mergePersistentFlags() - if c.Flags().Lookup("help") == nil { - usage := "help for " - if c.Name() == "" { - usage += "this command" - } else { - usage += c.Name() - } - c.Flags().BoolP("help", "h", false, usage) - } -} - -// InitDefaultVersionFlag adds default version flag to c. -// It is called automatically by executing the c. -// If c already has a version flag, it will do nothing. -// If c.Version is empty, it will do nothing. -func (c *Command) InitDefaultVersionFlag() { - if c.Version == "" { - return - } - - c.mergePersistentFlags() - if c.Flags().Lookup("version") == nil { - usage := "version for " - if c.Name() == "" { - usage += "this command" - } else { - usage += c.Name() - } - c.Flags().Bool("version", false, usage) - } -} - -// InitDefaultHelpCmd adds default help command to c. -// It is called automatically by executing the c or by calling help and usage. -// If c already has help command or c has no subcommands, it will do nothing. -func (c *Command) InitDefaultHelpCmd() { - if !c.HasSubCommands() { - return - } - - if c.helpCommand == nil { - c.helpCommand = &Command{ - Use: "help [command]", - Short: "Help about any command", - Long: `Help provides help for any command in the application. -Simply type ` + c.Name() + ` help [path to command] for full details.`, - - Run: func(c *Command, args []string) { - cmd, _, e := c.Root().Find(args) - if cmd == nil || e != nil { - c.Printf("Unknown help topic %#q\n", args) - c.Root().Usage() - } else { - cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown - cmd.Help() - } - }, - } - } - c.RemoveCommand(c.helpCommand) - c.AddCommand(c.helpCommand) -} - -// ResetCommands delete parent, subcommand and help command from c. -func (c *Command) ResetCommands() { - c.parent = nil - c.commands = nil - c.helpCommand = nil - c.parentsPflags = nil -} - -// Sorts commands by their names. -type commandSorterByName []*Command - -func (c commandSorterByName) Len() int { return len(c) } -func (c commandSorterByName) Swap(i, j int) { c[i], c[j] = c[j], c[i] } -func (c commandSorterByName) Less(i, j int) bool { return c[i].Name() < c[j].Name() } - -// Commands returns a sorted slice of child commands. -func (c *Command) Commands() []*Command { - // do not sort commands if it already sorted or sorting was disabled - if EnableCommandSorting && !c.commandsAreSorted { - sort.Sort(commandSorterByName(c.commands)) - c.commandsAreSorted = true - } - return c.commands -} - -// AddCommand adds one or more commands to this parent command. -func (c *Command) AddCommand(cmds ...*Command) { - for i, x := range cmds { - if cmds[i] == c { - panic("Command can't be a child of itself") - } - cmds[i].parent = c - // update max lengths - usageLen := len(x.Use) - if usageLen > c.commandsMaxUseLen { - c.commandsMaxUseLen = usageLen - } - commandPathLen := len(x.CommandPath()) - if commandPathLen > c.commandsMaxCommandPathLen { - c.commandsMaxCommandPathLen = commandPathLen - } - nameLen := len(x.Name()) - if nameLen > c.commandsMaxNameLen { - c.commandsMaxNameLen = nameLen - } - // If global normalization function exists, update all children - if c.globNormFunc != nil { - x.SetGlobalNormalizationFunc(c.globNormFunc) - } - c.commands = append(c.commands, x) - c.commandsAreSorted = false - } -} - -// RemoveCommand removes one or more commands from a parent command. -func (c *Command) RemoveCommand(cmds ...*Command) { - commands := []*Command{} -main: - for _, command := range c.commands { - for _, cmd := range cmds { - if command == cmd { - command.parent = nil - continue main - } - } - commands = append(commands, command) - } - c.commands = commands - // recompute all lengths - c.commandsMaxUseLen = 0 - c.commandsMaxCommandPathLen = 0 - c.commandsMaxNameLen = 0 - for _, command := range c.commands { - usageLen := len(command.Use) - if usageLen > c.commandsMaxUseLen { - c.commandsMaxUseLen = usageLen - } - commandPathLen := len(command.CommandPath()) - if commandPathLen > c.commandsMaxCommandPathLen { - c.commandsMaxCommandPathLen = commandPathLen - } - nameLen := len(command.Name()) - if nameLen > c.commandsMaxNameLen { - c.commandsMaxNameLen = nameLen - } - } -} - -// Print is a convenience method to Print to the defined output, fallback to Stderr if not set. -func (c *Command) Print(i ...interface{}) { - fmt.Fprint(c.OutOrStderr(), i...) -} - -// Println is a convenience method to Println to the defined output, fallback to Stderr if not set. -func (c *Command) Println(i ...interface{}) { - c.Print(fmt.Sprintln(i...)) -} - -// Printf is a convenience method to Printf to the defined output, fallback to Stderr if not set. -func (c *Command) Printf(format string, i ...interface{}) { - c.Print(fmt.Sprintf(format, i...)) -} - -// CommandPath returns the full path to this command. -func (c *Command) CommandPath() string { - if c.HasParent() { - return c.Parent().CommandPath() + " " + c.Name() - } - return c.Name() -} - -// UseLine puts out the full usage for a given command (including parents). -func (c *Command) UseLine() string { - var useline string - if c.HasParent() { - useline = c.parent.CommandPath() + " " + c.Use - } else { - useline = c.Use - } - if c.DisableFlagsInUseLine { - return useline - } - if c.HasAvailableFlags() && !strings.Contains(useline, "[flags]") { - useline += " [flags]" - } - return useline -} - -// DebugFlags used to determine which flags have been assigned to which commands -// and which persist. -func (c *Command) DebugFlags() { - c.Println("DebugFlags called on", c.Name()) - var debugflags func(*Command) - - debugflags = func(x *Command) { - if x.HasFlags() || x.HasPersistentFlags() { - c.Println(x.Name()) - } - if x.HasFlags() { - x.flags.VisitAll(func(f *flag.Flag) { - if x.HasPersistentFlags() && x.persistentFlag(f.Name) != nil { - c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [LP]") - } else { - c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [L]") - } - }) - } - if x.HasPersistentFlags() { - x.pflags.VisitAll(func(f *flag.Flag) { - if x.HasFlags() { - if x.flags.Lookup(f.Name) == nil { - c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [P]") - } - } else { - c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [P]") - } - }) - } - c.Println(x.flagErrorBuf) - if x.HasSubCommands() { - for _, y := range x.commands { - debugflags(y) - } - } - } - - debugflags(c) -} - -// Name returns the command's name: the first word in the use line. -func (c *Command) Name() string { - name := c.Use - i := strings.Index(name, " ") - if i >= 0 { - name = name[:i] - } - return name -} - -// HasAlias determines if a given string is an alias of the command. -func (c *Command) HasAlias(s string) bool { - for _, a := range c.Aliases { - if a == s { - return true - } - } - return false -} - -// CalledAs returns the command name or alias that was used to invoke -// this command or an empty string if the command has not been called. -func (c *Command) CalledAs() string { - if c.commandCalledAs.called { - return c.commandCalledAs.name - } - return "" -} - -// hasNameOrAliasPrefix returns true if the Name or any of aliases start -// with prefix -func (c *Command) hasNameOrAliasPrefix(prefix string) bool { - if strings.HasPrefix(c.Name(), prefix) { - c.commandCalledAs.name = c.Name() - return true - } - for _, alias := range c.Aliases { - if strings.HasPrefix(alias, prefix) { - c.commandCalledAs.name = alias - return true - } - } - return false -} - -// NameAndAliases returns a list of the command name and all aliases -func (c *Command) NameAndAliases() string { - return strings.Join(append([]string{c.Name()}, c.Aliases...), ", ") -} - -// HasExample determines if the command has example. -func (c *Command) HasExample() bool { - return len(c.Example) > 0 -} - -// Runnable determines if the command is itself runnable. -func (c *Command) Runnable() bool { - return c.Run != nil || c.RunE != nil -} - -// HasSubCommands determines if the command has children commands. -func (c *Command) HasSubCommands() bool { - return len(c.commands) > 0 -} - -// IsAvailableCommand determines if a command is available as a non-help command -// (this includes all non deprecated/hidden commands). -func (c *Command) IsAvailableCommand() bool { - if len(c.Deprecated) != 0 || c.Hidden { - return false - } - - if c.HasParent() && c.Parent().helpCommand == c { - return false - } - - if c.Runnable() || c.HasAvailableSubCommands() { - return true - } - - return false -} - -// IsAdditionalHelpTopicCommand determines if a command is an additional -// help topic command; additional help topic command is determined by the -// fact that it is NOT runnable/hidden/deprecated, and has no sub commands that -// are runnable/hidden/deprecated. -// Concrete example: https://github.com/spf13/cobra/issues/393#issuecomment-282741924. -func (c *Command) IsAdditionalHelpTopicCommand() bool { - // if a command is runnable, deprecated, or hidden it is not a 'help' command - if c.Runnable() || len(c.Deprecated) != 0 || c.Hidden { - return false - } - - // if any non-help sub commands are found, the command is not a 'help' command - for _, sub := range c.commands { - if !sub.IsAdditionalHelpTopicCommand() { - return false - } - } - - // the command either has no sub commands, or no non-help sub commands - return true -} - -// HasHelpSubCommands determines if a command has any available 'help' sub commands -// that need to be shown in the usage/help default template under 'additional help -// topics'. -func (c *Command) HasHelpSubCommands() bool { - // return true on the first found available 'help' sub command - for _, sub := range c.commands { - if sub.IsAdditionalHelpTopicCommand() { - return true - } - } - - // the command either has no sub commands, or no available 'help' sub commands - return false -} - -// HasAvailableSubCommands determines if a command has available sub commands that -// need to be shown in the usage/help default template under 'available commands'. -func (c *Command) HasAvailableSubCommands() bool { - // return true on the first found available (non deprecated/help/hidden) - // sub command - for _, sub := range c.commands { - if sub.IsAvailableCommand() { - return true - } - } - - // the command either has no sub commands, or no available (non deprecated/help/hidden) - // sub commands - return false -} - -// HasParent determines if the command is a child command. -func (c *Command) HasParent() bool { - return c.parent != nil -} - -// GlobalNormalizationFunc returns the global normalization function or nil if it doesn't exist. -func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name string) flag.NormalizedName { - return c.globNormFunc -} - -// Flags returns the complete FlagSet that applies -// to this command (local and persistent declared here and by all parents). -func (c *Command) Flags() *flag.FlagSet { - if c.flags == nil { - c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) - if c.flagErrorBuf == nil { - c.flagErrorBuf = new(bytes.Buffer) - } - c.flags.SetOutput(c.flagErrorBuf) - } - - return c.flags -} - -// LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands. -func (c *Command) LocalNonPersistentFlags() *flag.FlagSet { - persistentFlags := c.PersistentFlags() - - out := flag.NewFlagSet(c.Name(), flag.ContinueOnError) - c.LocalFlags().VisitAll(func(f *flag.Flag) { - if persistentFlags.Lookup(f.Name) == nil { - out.AddFlag(f) - } - }) - return out -} - -// LocalFlags returns the local FlagSet specifically set in the current command. -func (c *Command) LocalFlags() *flag.FlagSet { - c.mergePersistentFlags() - - if c.lflags == nil { - c.lflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) - if c.flagErrorBuf == nil { - c.flagErrorBuf = new(bytes.Buffer) - } - c.lflags.SetOutput(c.flagErrorBuf) - } - c.lflags.SortFlags = c.Flags().SortFlags - if c.globNormFunc != nil { - c.lflags.SetNormalizeFunc(c.globNormFunc) - } - - addToLocal := func(f *flag.Flag) { - if c.lflags.Lookup(f.Name) == nil && c.parentsPflags.Lookup(f.Name) == nil { - c.lflags.AddFlag(f) - } - } - c.Flags().VisitAll(addToLocal) - c.PersistentFlags().VisitAll(addToLocal) - return c.lflags -} - -// InheritedFlags returns all flags which were inherited from parents commands. -func (c *Command) InheritedFlags() *flag.FlagSet { - c.mergePersistentFlags() - - if c.iflags == nil { - c.iflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) - if c.flagErrorBuf == nil { - c.flagErrorBuf = new(bytes.Buffer) - } - c.iflags.SetOutput(c.flagErrorBuf) - } - - local := c.LocalFlags() - if c.globNormFunc != nil { - c.iflags.SetNormalizeFunc(c.globNormFunc) - } - - c.parentsPflags.VisitAll(func(f *flag.Flag) { - if c.iflags.Lookup(f.Name) == nil && local.Lookup(f.Name) == nil { - c.iflags.AddFlag(f) - } - }) - return c.iflags -} - -// NonInheritedFlags returns all flags which were not inherited from parent commands. -func (c *Command) NonInheritedFlags() *flag.FlagSet { - return c.LocalFlags() -} - -// PersistentFlags returns the persistent FlagSet specifically set in the current command. -func (c *Command) PersistentFlags() *flag.FlagSet { - if c.pflags == nil { - c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) - if c.flagErrorBuf == nil { - c.flagErrorBuf = new(bytes.Buffer) - } - c.pflags.SetOutput(c.flagErrorBuf) - } - return c.pflags -} - -// ResetFlags deletes all flags from command. -func (c *Command) ResetFlags() { - c.flagErrorBuf = new(bytes.Buffer) - c.flagErrorBuf.Reset() - c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) - c.flags.SetOutput(c.flagErrorBuf) - c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) - c.pflags.SetOutput(c.flagErrorBuf) - - c.lflags = nil - c.iflags = nil - c.parentsPflags = nil -} - -// HasFlags checks if the command contains any flags (local plus persistent from the entire structure). -func (c *Command) HasFlags() bool { - return c.Flags().HasFlags() -} - -// HasPersistentFlags checks if the command contains persistent flags. -func (c *Command) HasPersistentFlags() bool { - return c.PersistentFlags().HasFlags() -} - -// HasLocalFlags checks if the command has flags specifically declared locally. -func (c *Command) HasLocalFlags() bool { - return c.LocalFlags().HasFlags() -} - -// HasInheritedFlags checks if the command has flags inherited from its parent command. -func (c *Command) HasInheritedFlags() bool { - return c.InheritedFlags().HasFlags() -} - -// HasAvailableFlags checks if the command contains any flags (local plus persistent from the entire -// structure) which are not hidden or deprecated. -func (c *Command) HasAvailableFlags() bool { - return c.Flags().HasAvailableFlags() -} - -// HasAvailablePersistentFlags checks if the command contains persistent flags which are not hidden or deprecated. -func (c *Command) HasAvailablePersistentFlags() bool { - return c.PersistentFlags().HasAvailableFlags() -} - -// HasAvailableLocalFlags checks if the command has flags specifically declared locally which are not hidden -// or deprecated. -func (c *Command) HasAvailableLocalFlags() bool { - return c.LocalFlags().HasAvailableFlags() -} - -// HasAvailableInheritedFlags checks if the command has flags inherited from its parent command which are -// not hidden or deprecated. -func (c *Command) HasAvailableInheritedFlags() bool { - return c.InheritedFlags().HasAvailableFlags() -} - -// Flag climbs up the command tree looking for matching flag. -func (c *Command) Flag(name string) (flag *flag.Flag) { - flag = c.Flags().Lookup(name) - - if flag == nil { - flag = c.persistentFlag(name) - } - - return -} - -// Recursively find matching persistent flag. -func (c *Command) persistentFlag(name string) (flag *flag.Flag) { - if c.HasPersistentFlags() { - flag = c.PersistentFlags().Lookup(name) - } - - if flag == nil { - c.updateParentsPflags() - flag = c.parentsPflags.Lookup(name) - } - return -} - -// ParseFlags parses persistent flag tree and local flags. -func (c *Command) ParseFlags(args []string) error { - if c.DisableFlagParsing { - return nil - } - - if c.flagErrorBuf == nil { - c.flagErrorBuf = new(bytes.Buffer) - } - beforeErrorBufLen := c.flagErrorBuf.Len() - c.mergePersistentFlags() - - //do it here after merging all flags and just before parse - c.Flags().ParseErrorsWhitelist = flag.ParseErrorsWhitelist(c.FParseErrWhitelist) - - err := c.Flags().Parse(args) - // Print warnings if they occurred (e.g. deprecated flag messages). - if c.flagErrorBuf.Len()-beforeErrorBufLen > 0 && err == nil { - c.Print(c.flagErrorBuf.String()) - } - - return err -} - -// Parent returns a commands parent command. -func (c *Command) Parent() *Command { - return c.parent -} - -// mergePersistentFlags merges c.PersistentFlags() to c.Flags() -// and adds missing persistent flags of all parents. -func (c *Command) mergePersistentFlags() { - c.updateParentsPflags() - c.Flags().AddFlagSet(c.PersistentFlags()) - c.Flags().AddFlagSet(c.parentsPflags) -} - -// updateParentsPflags updates c.parentsPflags by adding -// new persistent flags of all parents. -// If c.parentsPflags == nil, it makes new. -func (c *Command) updateParentsPflags() { - if c.parentsPflags == nil { - c.parentsPflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) - c.parentsPflags.SetOutput(c.flagErrorBuf) - c.parentsPflags.SortFlags = false - } - - if c.globNormFunc != nil { - c.parentsPflags.SetNormalizeFunc(c.globNormFunc) - } - - c.Root().PersistentFlags().AddFlagSet(flag.CommandLine) - - c.VisitParents(func(parent *Command) { - c.parentsPflags.AddFlagSet(parent.PersistentFlags()) - }) -} diff --git a/vendor/github.com/spf13/cobra/command_notwin.go b/vendor/github.com/spf13/cobra/command_notwin.go deleted file mode 100644 index 6159c1c..0000000 --- a/vendor/github.com/spf13/cobra/command_notwin.go +++ /dev/null @@ -1,5 +0,0 @@ -// +build !windows - -package cobra - -var preExecHookFn func(*Command) diff --git a/vendor/github.com/spf13/cobra/command_win.go b/vendor/github.com/spf13/cobra/command_win.go deleted file mode 100644 index edec728..0000000 --- a/vendor/github.com/spf13/cobra/command_win.go +++ /dev/null @@ -1,20 +0,0 @@ -// +build windows - -package cobra - -import ( - "os" - "time" - - "github.com/inconshreveable/mousetrap" -) - -var preExecHookFn = preExecHook - -func preExecHook(c *Command) { - if MousetrapHelpText != "" && mousetrap.StartedByExplorer() { - c.Print(MousetrapHelpText) - time.Sleep(5 * time.Second) - os.Exit(1) - } -} diff --git a/vendor/github.com/spf13/cobra/zsh_completions.go b/vendor/github.com/spf13/cobra/zsh_completions.go deleted file mode 100644 index 889c22e..0000000 --- a/vendor/github.com/spf13/cobra/zsh_completions.go +++ /dev/null @@ -1,126 +0,0 @@ -package cobra - -import ( - "bytes" - "fmt" - "io" - "os" - "strings" -) - -// GenZshCompletionFile generates zsh completion file. -func (c *Command) GenZshCompletionFile(filename string) error { - outFile, err := os.Create(filename) - if err != nil { - return err - } - defer outFile.Close() - - return c.GenZshCompletion(outFile) -} - -// GenZshCompletion generates a zsh completion file and writes to the passed writer. -func (c *Command) GenZshCompletion(w io.Writer) error { - buf := new(bytes.Buffer) - - writeHeader(buf, c) - maxDepth := maxDepth(c) - writeLevelMapping(buf, maxDepth) - writeLevelCases(buf, maxDepth, c) - - _, err := buf.WriteTo(w) - return err -} - -func writeHeader(w io.Writer, cmd *Command) { - fmt.Fprintf(w, "#compdef %s\n\n", cmd.Name()) -} - -func maxDepth(c *Command) int { - if len(c.Commands()) == 0 { - return 0 - } - maxDepthSub := 0 - for _, s := range c.Commands() { - subDepth := maxDepth(s) - if subDepth > maxDepthSub { - maxDepthSub = subDepth - } - } - return 1 + maxDepthSub -} - -func writeLevelMapping(w io.Writer, numLevels int) { - fmt.Fprintln(w, `_arguments \`) - for i := 1; i <= numLevels; i++ { - fmt.Fprintf(w, ` '%d: :->level%d' \`, i, i) - fmt.Fprintln(w) - } - fmt.Fprintf(w, ` '%d: :%s'`, numLevels+1, "_files") - fmt.Fprintln(w) -} - -func writeLevelCases(w io.Writer, maxDepth int, root *Command) { - fmt.Fprintln(w, "case $state in") - defer fmt.Fprintln(w, "esac") - - for i := 1; i <= maxDepth; i++ { - fmt.Fprintf(w, " level%d)\n", i) - writeLevel(w, root, i) - fmt.Fprintln(w, " ;;") - } - fmt.Fprintln(w, " *)") - fmt.Fprintln(w, " _arguments '*: :_files'") - fmt.Fprintln(w, " ;;") -} - -func writeLevel(w io.Writer, root *Command, i int) { - fmt.Fprintf(w, " case $words[%d] in\n", i) - defer fmt.Fprintln(w, " esac") - - commands := filterByLevel(root, i) - byParent := groupByParent(commands) - - for p, c := range byParent { - names := names(c) - fmt.Fprintf(w, " %s)\n", p) - fmt.Fprintf(w, " _arguments '%d: :(%s)'\n", i, strings.Join(names, " ")) - fmt.Fprintln(w, " ;;") - } - fmt.Fprintln(w, " *)") - fmt.Fprintln(w, " _arguments '*: :_files'") - fmt.Fprintln(w, " ;;") - -} - -func filterByLevel(c *Command, l int) []*Command { - cs := make([]*Command, 0) - if l == 0 { - cs = append(cs, c) - return cs - } - for _, s := range c.Commands() { - cs = append(cs, filterByLevel(s, l-1)...) - } - return cs -} - -func groupByParent(commands []*Command) map[string][]*Command { - m := make(map[string][]*Command) - for _, c := range commands { - parent := c.Parent() - if parent == nil { - continue - } - m[parent.Name()] = append(m[parent.Name()], c) - } - return m -} - -func names(commands []*Command) []string { - ns := make([]string, len(commands)) - for i, c := range commands { - ns[i] = c.Name() - } - return ns -} diff --git a/vendor/github.com/spf13/pflag/.gitignore b/vendor/github.com/spf13/pflag/.gitignore deleted file mode 100644 index c3da290..0000000 --- a/vendor/github.com/spf13/pflag/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.idea/* - diff --git a/vendor/github.com/spf13/pflag/.travis.yml b/vendor/github.com/spf13/pflag/.travis.yml deleted file mode 100644 index f8a63b3..0000000 --- a/vendor/github.com/spf13/pflag/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -sudo: false - -language: go - -go: - - 1.7.3 - - 1.8.1 - - tip - -matrix: - allow_failures: - - go: tip - -install: - - go get github.com/golang/lint/golint - - export PATH=$GOPATH/bin:$PATH - - go install ./... - -script: - - verify/all.sh -v - - go test ./... diff --git a/vendor/github.com/spf13/pflag/LICENSE b/vendor/github.com/spf13/pflag/LICENSE deleted file mode 100644 index 63ed1cf..0000000 --- a/vendor/github.com/spf13/pflag/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2012 Alex Ogier. All rights reserved. -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/spf13/pflag/README.md b/vendor/github.com/spf13/pflag/README.md deleted file mode 100644 index b052414..0000000 --- a/vendor/github.com/spf13/pflag/README.md +++ /dev/null @@ -1,296 +0,0 @@ -[![Build Status](https://travis-ci.org/spf13/pflag.svg?branch=master)](https://travis-ci.org/spf13/pflag) -[![Go Report Card](https://goreportcard.com/badge/github.com/spf13/pflag)](https://goreportcard.com/report/github.com/spf13/pflag) -[![GoDoc](https://godoc.org/github.com/spf13/pflag?status.svg)](https://godoc.org/github.com/spf13/pflag) - -## Description - -pflag is a drop-in replacement for Go's flag package, implementing -POSIX/GNU-style --flags. - -pflag is compatible with the [GNU extensions to the POSIX recommendations -for command-line options][1]. For a more precise description, see the -"Command-line flag syntax" section below. - -[1]: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html - -pflag is available under the same style of BSD license as the Go language, -which can be found in the LICENSE file. - -## Installation - -pflag is available using the standard `go get` command. - -Install by running: - - go get github.com/spf13/pflag - -Run tests by running: - - go test github.com/spf13/pflag - -## Usage - -pflag is a drop-in replacement of Go's native flag package. If you import -pflag under the name "flag" then all code should continue to function -with no changes. - -``` go -import flag "github.com/spf13/pflag" -``` - -There is one exception to this: if you directly instantiate the Flag struct -there is one more field "Shorthand" that you will need to set. -Most code never instantiates this struct directly, and instead uses -functions such as String(), BoolVar(), and Var(), and is therefore -unaffected. - -Define flags using flag.String(), Bool(), Int(), etc. - -This declares an integer flag, -flagname, stored in the pointer ip, with type *int. - -``` go -var ip *int = flag.Int("flagname", 1234, "help message for flagname") -``` - -If you like, you can bind the flag to a variable using the Var() functions. - -``` go -var flagvar int -func init() { - flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname") -} -``` - -Or you can create custom flags that satisfy the Value interface (with -pointer receivers) and couple them to flag parsing by - -``` go -flag.Var(&flagVal, "name", "help message for flagname") -``` - -For such flags, the default value is just the initial value of the variable. - -After all flags are defined, call - -``` go -flag.Parse() -``` - -to parse the command line into the defined flags. - -Flags may then be used directly. If you're using the flags themselves, -they are all pointers; if you bind to variables, they're values. - -``` go -fmt.Println("ip has value ", *ip) -fmt.Println("flagvar has value ", flagvar) -``` - -There are helpers function to get values later if you have the FlagSet but -it was difficult to keep up with all of the flag pointers in your code. -If you have a pflag.FlagSet with a flag called 'flagname' of type int you -can use GetInt() to get the int value. But notice that 'flagname' must exist -and it must be an int. GetString("flagname") will fail. - -``` go -i, err := flagset.GetInt("flagname") -``` - -After parsing, the arguments after the flag are available as the -slice flag.Args() or individually as flag.Arg(i). -The arguments are indexed from 0 through flag.NArg()-1. - -The pflag package also defines some new functions that are not in flag, -that give one-letter shorthands for flags. You can use these by appending -'P' to the name of any function that defines a flag. - -``` go -var ip = flag.IntP("flagname", "f", 1234, "help message") -var flagvar bool -func init() { - flag.BoolVarP(&flagvar, "boolname", "b", true, "help message") -} -flag.VarP(&flagVal, "varname", "v", "help message") -``` - -Shorthand letters can be used with single dashes on the command line. -Boolean shorthand flags can be combined with other shorthand flags. - -The default set of command-line flags is controlled by -top-level functions. The FlagSet type allows one to define -independent sets of flags, such as to implement subcommands -in a command-line interface. The methods of FlagSet are -analogous to the top-level functions for the command-line -flag set. - -## Setting no option default values for flags - -After you create a flag it is possible to set the pflag.NoOptDefVal for -the given flag. Doing this changes the meaning of the flag slightly. If -a flag has a NoOptDefVal and the flag is set on the command line without -an option the flag will be set to the NoOptDefVal. For example given: - -``` go -var ip = flag.IntP("flagname", "f", 1234, "help message") -flag.Lookup("flagname").NoOptDefVal = "4321" -``` - -Would result in something like - -| Parsed Arguments | Resulting Value | -| ------------- | ------------- | -| --flagname=1357 | ip=1357 | -| --flagname | ip=4321 | -| [nothing] | ip=1234 | - -## Command line flag syntax - -``` ---flag // boolean flags, or flags with no option default values ---flag x // only on flags without a default value ---flag=x -``` - -Unlike the flag package, a single dash before an option means something -different than a double dash. Single dashes signify a series of shorthand -letters for flags. All but the last shorthand letter must be boolean flags -or a flag with a default value - -``` -// boolean or flags where the 'no option default value' is set --f --f=true --abc -but --b true is INVALID - -// non-boolean and flags without a 'no option default value' --n 1234 --n=1234 --n1234 - -// mixed --abcs "hello" --absd="hello" --abcs1234 -``` - -Flag parsing stops after the terminator "--". Unlike the flag package, -flags can be interspersed with arguments anywhere on the command line -before this terminator. - -Integer flags accept 1234, 0664, 0x1234 and may be negative. -Boolean flags (in their long form) accept 1, 0, t, f, true, false, -TRUE, FALSE, True, False. -Duration flags accept any input valid for time.ParseDuration. - -## Mutating or "Normalizing" Flag names - -It is possible to set a custom flag name 'normalization function.' It allows flag names to be mutated both when created in the code and when used on the command line to some 'normalized' form. The 'normalized' form is used for comparison. Two examples of using the custom normalization func follow. - -**Example #1**: You want -, _, and . in flags to compare the same. aka --my-flag == --my_flag == --my.flag - -``` go -func wordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { - from := []string{"-", "_"} - to := "." - for _, sep := range from { - name = strings.Replace(name, sep, to, -1) - } - return pflag.NormalizedName(name) -} - -myFlagSet.SetNormalizeFunc(wordSepNormalizeFunc) -``` - -**Example #2**: You want to alias two flags. aka --old-flag-name == --new-flag-name - -``` go -func aliasNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { - switch name { - case "old-flag-name": - name = "new-flag-name" - break - } - return pflag.NormalizedName(name) -} - -myFlagSet.SetNormalizeFunc(aliasNormalizeFunc) -``` - -## Deprecating a flag or its shorthand -It is possible to deprecate a flag, or just its shorthand. Deprecating a flag/shorthand hides it from help text and prints a usage message when the deprecated flag/shorthand is used. - -**Example #1**: You want to deprecate a flag named "badflag" as well as inform the users what flag they should use instead. -```go -// deprecate a flag by specifying its name and a usage message -flags.MarkDeprecated("badflag", "please use --good-flag instead") -``` -This hides "badflag" from help text, and prints `Flag --badflag has been deprecated, please use --good-flag instead` when "badflag" is used. - -**Example #2**: You want to keep a flag name "noshorthandflag" but deprecate its shortname "n". -```go -// deprecate a flag shorthand by specifying its flag name and a usage message -flags.MarkShorthandDeprecated("noshorthandflag", "please use --noshorthandflag only") -``` -This hides the shortname "n" from help text, and prints `Flag shorthand -n has been deprecated, please use --noshorthandflag only` when the shorthand "n" is used. - -Note that usage message is essential here, and it should not be empty. - -## Hidden flags -It is possible to mark a flag as hidden, meaning it will still function as normal, however will not show up in usage/help text. - -**Example**: You have a flag named "secretFlag" that you need for internal use only and don't want it showing up in help text, or for its usage text to be available. -```go -// hide a flag by specifying its name -flags.MarkHidden("secretFlag") -``` - -## Disable sorting of flags -`pflag` allows you to disable sorting of flags for help and usage message. - -**Example**: -```go -flags.BoolP("verbose", "v", false, "verbose output") -flags.String("coolflag", "yeaah", "it's really cool flag") -flags.Int("usefulflag", 777, "sometimes it's very useful") -flags.SortFlags = false -flags.PrintDefaults() -``` -**Output**: -``` - -v, --verbose verbose output - --coolflag string it's really cool flag (default "yeaah") - --usefulflag int sometimes it's very useful (default 777) -``` - - -## Supporting Go flags when using pflag -In order to support flags defined using Go's `flag` package, they must be added to the `pflag` flagset. This is usually necessary -to support flags defined by third-party dependencies (e.g. `golang/glog`). - -**Example**: You want to add the Go flags to the `CommandLine` flagset -```go -import ( - goflag "flag" - flag "github.com/spf13/pflag" -) - -var ip *int = flag.Int("flagname", 1234, "help message for flagname") - -func main() { - flag.CommandLine.AddGoFlagSet(goflag.CommandLine) - flag.Parse() -} -``` - -## More info - -You can see the full reference documentation of the pflag package -[at godoc.org][3], or through go's standard documentation system by -running `godoc -http=:6060` and browsing to -[http://localhost:6060/pkg/github.com/spf13/pflag][2] after -installation. - -[2]: http://localhost:6060/pkg/github.com/spf13/pflag -[3]: http://godoc.org/github.com/spf13/pflag diff --git a/vendor/github.com/spf13/pflag/bool.go b/vendor/github.com/spf13/pflag/bool.go deleted file mode 100644 index c4c5c0b..0000000 --- a/vendor/github.com/spf13/pflag/bool.go +++ /dev/null @@ -1,94 +0,0 @@ -package pflag - -import "strconv" - -// optional interface to indicate boolean flags that can be -// supplied without "=value" text -type boolFlag interface { - Value - IsBoolFlag() bool -} - -// -- bool Value -type boolValue bool - -func newBoolValue(val bool, p *bool) *boolValue { - *p = val - return (*boolValue)(p) -} - -func (b *boolValue) Set(s string) error { - v, err := strconv.ParseBool(s) - *b = boolValue(v) - return err -} - -func (b *boolValue) Type() string { - return "bool" -} - -func (b *boolValue) String() string { return strconv.FormatBool(bool(*b)) } - -func (b *boolValue) IsBoolFlag() bool { return true } - -func boolConv(sval string) (interface{}, error) { - return strconv.ParseBool(sval) -} - -// GetBool return the bool value of a flag with the given name -func (f *FlagSet) GetBool(name string) (bool, error) { - val, err := f.getFlagType(name, "bool", boolConv) - if err != nil { - return false, err - } - return val.(bool), nil -} - -// BoolVar defines a bool flag with specified name, default value, and usage string. -// The argument p points to a bool variable in which to store the value of the flag. -func (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string) { - f.BoolVarP(p, name, "", value, usage) -} - -// BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) BoolVarP(p *bool, name, shorthand string, value bool, usage string) { - flag := f.VarPF(newBoolValue(value, p), name, shorthand, usage) - flag.NoOptDefVal = "true" -} - -// BoolVar defines a bool flag with specified name, default value, and usage string. -// The argument p points to a bool variable in which to store the value of the flag. -func BoolVar(p *bool, name string, value bool, usage string) { - BoolVarP(p, name, "", value, usage) -} - -// BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash. -func BoolVarP(p *bool, name, shorthand string, value bool, usage string) { - flag := CommandLine.VarPF(newBoolValue(value, p), name, shorthand, usage) - flag.NoOptDefVal = "true" -} - -// Bool defines a bool flag with specified name, default value, and usage string. -// The return value is the address of a bool variable that stores the value of the flag. -func (f *FlagSet) Bool(name string, value bool, usage string) *bool { - return f.BoolP(name, "", value, usage) -} - -// BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) BoolP(name, shorthand string, value bool, usage string) *bool { - p := new(bool) - f.BoolVarP(p, name, shorthand, value, usage) - return p -} - -// Bool defines a bool flag with specified name, default value, and usage string. -// The return value is the address of a bool variable that stores the value of the flag. -func Bool(name string, value bool, usage string) *bool { - return BoolP(name, "", value, usage) -} - -// BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash. -func BoolP(name, shorthand string, value bool, usage string) *bool { - b := CommandLine.BoolP(name, shorthand, value, usage) - return b -} diff --git a/vendor/github.com/spf13/pflag/bool_slice.go b/vendor/github.com/spf13/pflag/bool_slice.go deleted file mode 100644 index 5af02f1..0000000 --- a/vendor/github.com/spf13/pflag/bool_slice.go +++ /dev/null @@ -1,147 +0,0 @@ -package pflag - -import ( - "io" - "strconv" - "strings" -) - -// -- boolSlice Value -type boolSliceValue struct { - value *[]bool - changed bool -} - -func newBoolSliceValue(val []bool, p *[]bool) *boolSliceValue { - bsv := new(boolSliceValue) - bsv.value = p - *bsv.value = val - return bsv -} - -// Set converts, and assigns, the comma-separated boolean argument string representation as the []bool value of this flag. -// If Set is called on a flag that already has a []bool assigned, the newly converted values will be appended. -func (s *boolSliceValue) Set(val string) error { - - // remove all quote characters - rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "") - - // read flag arguments with CSV parser - boolStrSlice, err := readAsCSV(rmQuote.Replace(val)) - if err != nil && err != io.EOF { - return err - } - - // parse boolean values into slice - out := make([]bool, 0, len(boolStrSlice)) - for _, boolStr := range boolStrSlice { - b, err := strconv.ParseBool(strings.TrimSpace(boolStr)) - if err != nil { - return err - } - out = append(out, b) - } - - if !s.changed { - *s.value = out - } else { - *s.value = append(*s.value, out...) - } - - s.changed = true - - return nil -} - -// Type returns a string that uniquely represents this flag's type. -func (s *boolSliceValue) Type() string { - return "boolSlice" -} - -// String defines a "native" format for this boolean slice flag value. -func (s *boolSliceValue) String() string { - - boolStrSlice := make([]string, len(*s.value)) - for i, b := range *s.value { - boolStrSlice[i] = strconv.FormatBool(b) - } - - out, _ := writeAsCSV(boolStrSlice) - - return "[" + out + "]" -} - -func boolSliceConv(val string) (interface{}, error) { - val = strings.Trim(val, "[]") - // Empty string would cause a slice with one (empty) entry - if len(val) == 0 { - return []bool{}, nil - } - ss := strings.Split(val, ",") - out := make([]bool, len(ss)) - for i, t := range ss { - var err error - out[i], err = strconv.ParseBool(t) - if err != nil { - return nil, err - } - } - return out, nil -} - -// GetBoolSlice returns the []bool value of a flag with the given name. -func (f *FlagSet) GetBoolSlice(name string) ([]bool, error) { - val, err := f.getFlagType(name, "boolSlice", boolSliceConv) - if err != nil { - return []bool{}, err - } - return val.([]bool), nil -} - -// BoolSliceVar defines a boolSlice flag with specified name, default value, and usage string. -// The argument p points to a []bool variable in which to store the value of the flag. -func (f *FlagSet) BoolSliceVar(p *[]bool, name string, value []bool, usage string) { - f.VarP(newBoolSliceValue(value, p), name, "", usage) -} - -// BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) { - f.VarP(newBoolSliceValue(value, p), name, shorthand, usage) -} - -// BoolSliceVar defines a []bool flag with specified name, default value, and usage string. -// The argument p points to a []bool variable in which to store the value of the flag. -func BoolSliceVar(p *[]bool, name string, value []bool, usage string) { - CommandLine.VarP(newBoolSliceValue(value, p), name, "", usage) -} - -// BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash. -func BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) { - CommandLine.VarP(newBoolSliceValue(value, p), name, shorthand, usage) -} - -// BoolSlice defines a []bool flag with specified name, default value, and usage string. -// The return value is the address of a []bool variable that stores the value of the flag. -func (f *FlagSet) BoolSlice(name string, value []bool, usage string) *[]bool { - p := []bool{} - f.BoolSliceVarP(&p, name, "", value, usage) - return &p -} - -// BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool { - p := []bool{} - f.BoolSliceVarP(&p, name, shorthand, value, usage) - return &p -} - -// BoolSlice defines a []bool flag with specified name, default value, and usage string. -// The return value is the address of a []bool variable that stores the value of the flag. -func BoolSlice(name string, value []bool, usage string) *[]bool { - return CommandLine.BoolSliceP(name, "", value, usage) -} - -// BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash. -func BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool { - return CommandLine.BoolSliceP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/bytes.go b/vendor/github.com/spf13/pflag/bytes.go deleted file mode 100644 index 67d5304..0000000 --- a/vendor/github.com/spf13/pflag/bytes.go +++ /dev/null @@ -1,209 +0,0 @@ -package pflag - -import ( - "encoding/base64" - "encoding/hex" - "fmt" - "strings" -) - -// BytesHex adapts []byte for use as a flag. Value of flag is HEX encoded -type bytesHexValue []byte - -// String implements pflag.Value.String. -func (bytesHex bytesHexValue) String() string { - return fmt.Sprintf("%X", []byte(bytesHex)) -} - -// Set implements pflag.Value.Set. -func (bytesHex *bytesHexValue) Set(value string) error { - bin, err := hex.DecodeString(strings.TrimSpace(value)) - - if err != nil { - return err - } - - *bytesHex = bin - - return nil -} - -// Type implements pflag.Value.Type. -func (*bytesHexValue) Type() string { - return "bytesHex" -} - -func newBytesHexValue(val []byte, p *[]byte) *bytesHexValue { - *p = val - return (*bytesHexValue)(p) -} - -func bytesHexConv(sval string) (interface{}, error) { - - bin, err := hex.DecodeString(sval) - - if err == nil { - return bin, nil - } - - return nil, fmt.Errorf("invalid string being converted to Bytes: %s %s", sval, err) -} - -// GetBytesHex return the []byte value of a flag with the given name -func (f *FlagSet) GetBytesHex(name string) ([]byte, error) { - val, err := f.getFlagType(name, "bytesHex", bytesHexConv) - - if err != nil { - return []byte{}, err - } - - return val.([]byte), nil -} - -// BytesHexVar defines an []byte flag with specified name, default value, and usage string. -// The argument p points to an []byte variable in which to store the value of the flag. -func (f *FlagSet) BytesHexVar(p *[]byte, name string, value []byte, usage string) { - f.VarP(newBytesHexValue(value, p), name, "", usage) -} - -// BytesHexVarP is like BytesHexVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) BytesHexVarP(p *[]byte, name, shorthand string, value []byte, usage string) { - f.VarP(newBytesHexValue(value, p), name, shorthand, usage) -} - -// BytesHexVar defines an []byte flag with specified name, default value, and usage string. -// The argument p points to an []byte variable in which to store the value of the flag. -func BytesHexVar(p *[]byte, name string, value []byte, usage string) { - CommandLine.VarP(newBytesHexValue(value, p), name, "", usage) -} - -// BytesHexVarP is like BytesHexVar, but accepts a shorthand letter that can be used after a single dash. -func BytesHexVarP(p *[]byte, name, shorthand string, value []byte, usage string) { - CommandLine.VarP(newBytesHexValue(value, p), name, shorthand, usage) -} - -// BytesHex defines an []byte flag with specified name, default value, and usage string. -// The return value is the address of an []byte variable that stores the value of the flag. -func (f *FlagSet) BytesHex(name string, value []byte, usage string) *[]byte { - p := new([]byte) - f.BytesHexVarP(p, name, "", value, usage) - return p -} - -// BytesHexP is like BytesHex, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) BytesHexP(name, shorthand string, value []byte, usage string) *[]byte { - p := new([]byte) - f.BytesHexVarP(p, name, shorthand, value, usage) - return p -} - -// BytesHex defines an []byte flag with specified name, default value, and usage string. -// The return value is the address of an []byte variable that stores the value of the flag. -func BytesHex(name string, value []byte, usage string) *[]byte { - return CommandLine.BytesHexP(name, "", value, usage) -} - -// BytesHexP is like BytesHex, but accepts a shorthand letter that can be used after a single dash. -func BytesHexP(name, shorthand string, value []byte, usage string) *[]byte { - return CommandLine.BytesHexP(name, shorthand, value, usage) -} - -// BytesBase64 adapts []byte for use as a flag. Value of flag is Base64 encoded -type bytesBase64Value []byte - -// String implements pflag.Value.String. -func (bytesBase64 bytesBase64Value) String() string { - return base64.StdEncoding.EncodeToString([]byte(bytesBase64)) -} - -// Set implements pflag.Value.Set. -func (bytesBase64 *bytesBase64Value) Set(value string) error { - bin, err := base64.StdEncoding.DecodeString(strings.TrimSpace(value)) - - if err != nil { - return err - } - - *bytesBase64 = bin - - return nil -} - -// Type implements pflag.Value.Type. -func (*bytesBase64Value) Type() string { - return "bytesBase64" -} - -func newBytesBase64Value(val []byte, p *[]byte) *bytesBase64Value { - *p = val - return (*bytesBase64Value)(p) -} - -func bytesBase64ValueConv(sval string) (interface{}, error) { - - bin, err := base64.StdEncoding.DecodeString(sval) - if err == nil { - return bin, nil - } - - return nil, fmt.Errorf("invalid string being converted to Bytes: %s %s", sval, err) -} - -// GetBytesBase64 return the []byte value of a flag with the given name -func (f *FlagSet) GetBytesBase64(name string) ([]byte, error) { - val, err := f.getFlagType(name, "bytesBase64", bytesBase64ValueConv) - - if err != nil { - return []byte{}, err - } - - return val.([]byte), nil -} - -// BytesBase64Var defines an []byte flag with specified name, default value, and usage string. -// The argument p points to an []byte variable in which to store the value of the flag. -func (f *FlagSet) BytesBase64Var(p *[]byte, name string, value []byte, usage string) { - f.VarP(newBytesBase64Value(value, p), name, "", usage) -} - -// BytesBase64VarP is like BytesBase64Var, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) BytesBase64VarP(p *[]byte, name, shorthand string, value []byte, usage string) { - f.VarP(newBytesBase64Value(value, p), name, shorthand, usage) -} - -// BytesBase64Var defines an []byte flag with specified name, default value, and usage string. -// The argument p points to an []byte variable in which to store the value of the flag. -func BytesBase64Var(p *[]byte, name string, value []byte, usage string) { - CommandLine.VarP(newBytesBase64Value(value, p), name, "", usage) -} - -// BytesBase64VarP is like BytesBase64Var, but accepts a shorthand letter that can be used after a single dash. -func BytesBase64VarP(p *[]byte, name, shorthand string, value []byte, usage string) { - CommandLine.VarP(newBytesBase64Value(value, p), name, shorthand, usage) -} - -// BytesBase64 defines an []byte flag with specified name, default value, and usage string. -// The return value is the address of an []byte variable that stores the value of the flag. -func (f *FlagSet) BytesBase64(name string, value []byte, usage string) *[]byte { - p := new([]byte) - f.BytesBase64VarP(p, name, "", value, usage) - return p -} - -// BytesBase64P is like BytesBase64, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) BytesBase64P(name, shorthand string, value []byte, usage string) *[]byte { - p := new([]byte) - f.BytesBase64VarP(p, name, shorthand, value, usage) - return p -} - -// BytesBase64 defines an []byte flag with specified name, default value, and usage string. -// The return value is the address of an []byte variable that stores the value of the flag. -func BytesBase64(name string, value []byte, usage string) *[]byte { - return CommandLine.BytesBase64P(name, "", value, usage) -} - -// BytesBase64P is like BytesBase64, but accepts a shorthand letter that can be used after a single dash. -func BytesBase64P(name, shorthand string, value []byte, usage string) *[]byte { - return CommandLine.BytesBase64P(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/count.go b/vendor/github.com/spf13/pflag/count.go deleted file mode 100644 index aa126e4..0000000 --- a/vendor/github.com/spf13/pflag/count.go +++ /dev/null @@ -1,96 +0,0 @@ -package pflag - -import "strconv" - -// -- count Value -type countValue int - -func newCountValue(val int, p *int) *countValue { - *p = val - return (*countValue)(p) -} - -func (i *countValue) Set(s string) error { - // "+1" means that no specific value was passed, so increment - if s == "+1" { - *i = countValue(*i + 1) - return nil - } - v, err := strconv.ParseInt(s, 0, 0) - *i = countValue(v) - return err -} - -func (i *countValue) Type() string { - return "count" -} - -func (i *countValue) String() string { return strconv.Itoa(int(*i)) } - -func countConv(sval string) (interface{}, error) { - i, err := strconv.Atoi(sval) - if err != nil { - return nil, err - } - return i, nil -} - -// GetCount return the int value of a flag with the given name -func (f *FlagSet) GetCount(name string) (int, error) { - val, err := f.getFlagType(name, "count", countConv) - if err != nil { - return 0, err - } - return val.(int), nil -} - -// CountVar defines a count flag with specified name, default value, and usage string. -// The argument p points to an int variable in which to store the value of the flag. -// A count flag will add 1 to its value evey time it is found on the command line -func (f *FlagSet) CountVar(p *int, name string, usage string) { - f.CountVarP(p, name, "", usage) -} - -// CountVarP is like CountVar only take a shorthand for the flag name. -func (f *FlagSet) CountVarP(p *int, name, shorthand string, usage string) { - flag := f.VarPF(newCountValue(0, p), name, shorthand, usage) - flag.NoOptDefVal = "+1" -} - -// CountVar like CountVar only the flag is placed on the CommandLine instead of a given flag set -func CountVar(p *int, name string, usage string) { - CommandLine.CountVar(p, name, usage) -} - -// CountVarP is like CountVar only take a shorthand for the flag name. -func CountVarP(p *int, name, shorthand string, usage string) { - CommandLine.CountVarP(p, name, shorthand, usage) -} - -// Count defines a count flag with specified name, default value, and usage string. -// The return value is the address of an int variable that stores the value of the flag. -// A count flag will add 1 to its value evey time it is found on the command line -func (f *FlagSet) Count(name string, usage string) *int { - p := new(int) - f.CountVarP(p, name, "", usage) - return p -} - -// CountP is like Count only takes a shorthand for the flag name. -func (f *FlagSet) CountP(name, shorthand string, usage string) *int { - p := new(int) - f.CountVarP(p, name, shorthand, usage) - return p -} - -// Count defines a count flag with specified name, default value, and usage string. -// The return value is the address of an int variable that stores the value of the flag. -// A count flag will add 1 to its value evey time it is found on the command line -func Count(name string, usage string) *int { - return CommandLine.CountP(name, "", usage) -} - -// CountP is like Count only takes a shorthand for the flag name. -func CountP(name, shorthand string, usage string) *int { - return CommandLine.CountP(name, shorthand, usage) -} diff --git a/vendor/github.com/spf13/pflag/duration.go b/vendor/github.com/spf13/pflag/duration.go deleted file mode 100644 index e9debef..0000000 --- a/vendor/github.com/spf13/pflag/duration.go +++ /dev/null @@ -1,86 +0,0 @@ -package pflag - -import ( - "time" -) - -// -- time.Duration Value -type durationValue time.Duration - -func newDurationValue(val time.Duration, p *time.Duration) *durationValue { - *p = val - return (*durationValue)(p) -} - -func (d *durationValue) Set(s string) error { - v, err := time.ParseDuration(s) - *d = durationValue(v) - return err -} - -func (d *durationValue) Type() string { - return "duration" -} - -func (d *durationValue) String() string { return (*time.Duration)(d).String() } - -func durationConv(sval string) (interface{}, error) { - return time.ParseDuration(sval) -} - -// GetDuration return the duration value of a flag with the given name -func (f *FlagSet) GetDuration(name string) (time.Duration, error) { - val, err := f.getFlagType(name, "duration", durationConv) - if err != nil { - return 0, err - } - return val.(time.Duration), nil -} - -// DurationVar defines a time.Duration flag with specified name, default value, and usage string. -// The argument p points to a time.Duration variable in which to store the value of the flag. -func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string) { - f.VarP(newDurationValue(value, p), name, "", usage) -} - -// DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) { - f.VarP(newDurationValue(value, p), name, shorthand, usage) -} - -// DurationVar defines a time.Duration flag with specified name, default value, and usage string. -// The argument p points to a time.Duration variable in which to store the value of the flag. -func DurationVar(p *time.Duration, name string, value time.Duration, usage string) { - CommandLine.VarP(newDurationValue(value, p), name, "", usage) -} - -// DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash. -func DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) { - CommandLine.VarP(newDurationValue(value, p), name, shorthand, usage) -} - -// Duration defines a time.Duration flag with specified name, default value, and usage string. -// The return value is the address of a time.Duration variable that stores the value of the flag. -func (f *FlagSet) Duration(name string, value time.Duration, usage string) *time.Duration { - p := new(time.Duration) - f.DurationVarP(p, name, "", value, usage) - return p -} - -// DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration { - p := new(time.Duration) - f.DurationVarP(p, name, shorthand, value, usage) - return p -} - -// Duration defines a time.Duration flag with specified name, default value, and usage string. -// The return value is the address of a time.Duration variable that stores the value of the flag. -func Duration(name string, value time.Duration, usage string) *time.Duration { - return CommandLine.DurationP(name, "", value, usage) -} - -// DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash. -func DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration { - return CommandLine.DurationP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/duration_slice.go b/vendor/github.com/spf13/pflag/duration_slice.go deleted file mode 100644 index 52c6b6d..0000000 --- a/vendor/github.com/spf13/pflag/duration_slice.go +++ /dev/null @@ -1,128 +0,0 @@ -package pflag - -import ( - "fmt" - "strings" - "time" -) - -// -- durationSlice Value -type durationSliceValue struct { - value *[]time.Duration - changed bool -} - -func newDurationSliceValue(val []time.Duration, p *[]time.Duration) *durationSliceValue { - dsv := new(durationSliceValue) - dsv.value = p - *dsv.value = val - return dsv -} - -func (s *durationSliceValue) Set(val string) error { - ss := strings.Split(val, ",") - out := make([]time.Duration, len(ss)) - for i, d := range ss { - var err error - out[i], err = time.ParseDuration(d) - if err != nil { - return err - } - - } - if !s.changed { - *s.value = out - } else { - *s.value = append(*s.value, out...) - } - s.changed = true - return nil -} - -func (s *durationSliceValue) Type() string { - return "durationSlice" -} - -func (s *durationSliceValue) String() string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = fmt.Sprintf("%s", d) - } - return "[" + strings.Join(out, ",") + "]" -} - -func durationSliceConv(val string) (interface{}, error) { - val = strings.Trim(val, "[]") - // Empty string would cause a slice with one (empty) entry - if len(val) == 0 { - return []time.Duration{}, nil - } - ss := strings.Split(val, ",") - out := make([]time.Duration, len(ss)) - for i, d := range ss { - var err error - out[i], err = time.ParseDuration(d) - if err != nil { - return nil, err - } - - } - return out, nil -} - -// GetDurationSlice returns the []time.Duration value of a flag with the given name -func (f *FlagSet) GetDurationSlice(name string) ([]time.Duration, error) { - val, err := f.getFlagType(name, "durationSlice", durationSliceConv) - if err != nil { - return []time.Duration{}, err - } - return val.([]time.Duration), nil -} - -// DurationSliceVar defines a durationSlice flag with specified name, default value, and usage string. -// The argument p points to a []time.Duration variable in which to store the value of the flag. -func (f *FlagSet) DurationSliceVar(p *[]time.Duration, name string, value []time.Duration, usage string) { - f.VarP(newDurationSliceValue(value, p), name, "", usage) -} - -// DurationSliceVarP is like DurationSliceVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) DurationSliceVarP(p *[]time.Duration, name, shorthand string, value []time.Duration, usage string) { - f.VarP(newDurationSliceValue(value, p), name, shorthand, usage) -} - -// DurationSliceVar defines a duration[] flag with specified name, default value, and usage string. -// The argument p points to a duration[] variable in which to store the value of the flag. -func DurationSliceVar(p *[]time.Duration, name string, value []time.Duration, usage string) { - CommandLine.VarP(newDurationSliceValue(value, p), name, "", usage) -} - -// DurationSliceVarP is like DurationSliceVar, but accepts a shorthand letter that can be used after a single dash. -func DurationSliceVarP(p *[]time.Duration, name, shorthand string, value []time.Duration, usage string) { - CommandLine.VarP(newDurationSliceValue(value, p), name, shorthand, usage) -} - -// DurationSlice defines a []time.Duration flag with specified name, default value, and usage string. -// The return value is the address of a []time.Duration variable that stores the value of the flag. -func (f *FlagSet) DurationSlice(name string, value []time.Duration, usage string) *[]time.Duration { - p := []time.Duration{} - f.DurationSliceVarP(&p, name, "", value, usage) - return &p -} - -// DurationSliceP is like DurationSlice, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) DurationSliceP(name, shorthand string, value []time.Duration, usage string) *[]time.Duration { - p := []time.Duration{} - f.DurationSliceVarP(&p, name, shorthand, value, usage) - return &p -} - -// DurationSlice defines a []time.Duration flag with specified name, default value, and usage string. -// The return value is the address of a []time.Duration variable that stores the value of the flag. -func DurationSlice(name string, value []time.Duration, usage string) *[]time.Duration { - return CommandLine.DurationSliceP(name, "", value, usage) -} - -// DurationSliceP is like DurationSlice, but accepts a shorthand letter that can be used after a single dash. -func DurationSliceP(name, shorthand string, value []time.Duration, usage string) *[]time.Duration { - return CommandLine.DurationSliceP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go deleted file mode 100644 index 5cc710c..0000000 --- a/vendor/github.com/spf13/pflag/flag.go +++ /dev/null @@ -1,1224 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package pflag is a drop-in replacement for Go's flag package, implementing -POSIX/GNU-style --flags. - -pflag is compatible with the GNU extensions to the POSIX recommendations -for command-line options. See -http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html - -Usage: - -pflag is a drop-in replacement of Go's native flag package. If you import -pflag under the name "flag" then all code should continue to function -with no changes. - - import flag "github.com/spf13/pflag" - -There is one exception to this: if you directly instantiate the Flag struct -there is one more field "Shorthand" that you will need to set. -Most code never instantiates this struct directly, and instead uses -functions such as String(), BoolVar(), and Var(), and is therefore -unaffected. - -Define flags using flag.String(), Bool(), Int(), etc. - -This declares an integer flag, -flagname, stored in the pointer ip, with type *int. - var ip = flag.Int("flagname", 1234, "help message for flagname") -If you like, you can bind the flag to a variable using the Var() functions. - var flagvar int - func init() { - flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname") - } -Or you can create custom flags that satisfy the Value interface (with -pointer receivers) and couple them to flag parsing by - flag.Var(&flagVal, "name", "help message for flagname") -For such flags, the default value is just the initial value of the variable. - -After all flags are defined, call - flag.Parse() -to parse the command line into the defined flags. - -Flags may then be used directly. If you're using the flags themselves, -they are all pointers; if you bind to variables, they're values. - fmt.Println("ip has value ", *ip) - fmt.Println("flagvar has value ", flagvar) - -After parsing, the arguments after the flag are available as the -slice flag.Args() or individually as flag.Arg(i). -The arguments are indexed from 0 through flag.NArg()-1. - -The pflag package also defines some new functions that are not in flag, -that give one-letter shorthands for flags. You can use these by appending -'P' to the name of any function that defines a flag. - var ip = flag.IntP("flagname", "f", 1234, "help message") - var flagvar bool - func init() { - flag.BoolVarP("boolname", "b", true, "help message") - } - flag.VarP(&flagVar, "varname", "v", 1234, "help message") -Shorthand letters can be used with single dashes on the command line. -Boolean shorthand flags can be combined with other shorthand flags. - -Command line flag syntax: - --flag // boolean flags only - --flag=x - -Unlike the flag package, a single dash before an option means something -different than a double dash. Single dashes signify a series of shorthand -letters for flags. All but the last shorthand letter must be boolean flags. - // boolean flags - -f - -abc - // non-boolean flags - -n 1234 - -Ifile - // mixed - -abcs "hello" - -abcn1234 - -Flag parsing stops after the terminator "--". Unlike the flag package, -flags can be interspersed with arguments anywhere on the command line -before this terminator. - -Integer flags accept 1234, 0664, 0x1234 and may be negative. -Boolean flags (in their long form) accept 1, 0, t, f, true, false, -TRUE, FALSE, True, False. -Duration flags accept any input valid for time.ParseDuration. - -The default set of command-line flags is controlled by -top-level functions. The FlagSet type allows one to define -independent sets of flags, such as to implement subcommands -in a command-line interface. The methods of FlagSet are -analogous to the top-level functions for the command-line -flag set. -*/ -package pflag - -import ( - "bytes" - "errors" - goflag "flag" - "fmt" - "io" - "os" - "sort" - "strings" -) - -// ErrHelp is the error returned if the flag -help is invoked but no such flag is defined. -var ErrHelp = errors.New("pflag: help requested") - -// ErrorHandling defines how to handle flag parsing errors. -type ErrorHandling int - -const ( - // ContinueOnError will return an err from Parse() if an error is found - ContinueOnError ErrorHandling = iota - // ExitOnError will call os.Exit(2) if an error is found when parsing - ExitOnError - // PanicOnError will panic() if an error is found when parsing flags - PanicOnError -) - -// ParseErrorsWhitelist defines the parsing errors that can be ignored -type ParseErrorsWhitelist struct { - // UnknownFlags will ignore unknown flags errors and continue parsing rest of the flags - UnknownFlags bool -} - -// NormalizedName is a flag name that has been normalized according to rules -// for the FlagSet (e.g. making '-' and '_' equivalent). -type NormalizedName string - -// A FlagSet represents a set of defined flags. -type FlagSet struct { - // Usage is the function called when an error occurs while parsing flags. - // The field is a function (not a method) that may be changed to point to - // a custom error handler. - Usage func() - - // SortFlags is used to indicate, if user wants to have sorted flags in - // help/usage messages. - SortFlags bool - - // ParseErrorsWhitelist is used to configure a whitelist of errors - ParseErrorsWhitelist ParseErrorsWhitelist - - name string - parsed bool - actual map[NormalizedName]*Flag - orderedActual []*Flag - sortedActual []*Flag - formal map[NormalizedName]*Flag - orderedFormal []*Flag - sortedFormal []*Flag - shorthands map[byte]*Flag - args []string // arguments after flags - argsLenAtDash int // len(args) when a '--' was located when parsing, or -1 if no -- - errorHandling ErrorHandling - output io.Writer // nil means stderr; use out() accessor - interspersed bool // allow interspersed option/non-option args - normalizeNameFunc func(f *FlagSet, name string) NormalizedName - - addedGoFlagSets []*goflag.FlagSet -} - -// A Flag represents the state of a flag. -type Flag struct { - Name string // name as it appears on command line - Shorthand string // one-letter abbreviated flag - Usage string // help message - Value Value // value as set - DefValue string // default value (as text); for usage message - Changed bool // If the user set the value (or if left to default) - NoOptDefVal string // default value (as text); if the flag is on the command line without any options - Deprecated string // If this flag is deprecated, this string is the new or now thing to use - Hidden bool // used by cobra.Command to allow flags to be hidden from help/usage text - ShorthandDeprecated string // If the shorthand of this flag is deprecated, this string is the new or now thing to use - Annotations map[string][]string // used by cobra.Command bash autocomple code -} - -// Value is the interface to the dynamic value stored in a flag. -// (The default value is represented as a string.) -type Value interface { - String() string - Set(string) error - Type() string -} - -// sortFlags returns the flags as a slice in lexicographical sorted order. -func sortFlags(flags map[NormalizedName]*Flag) []*Flag { - list := make(sort.StringSlice, len(flags)) - i := 0 - for k := range flags { - list[i] = string(k) - i++ - } - list.Sort() - result := make([]*Flag, len(list)) - for i, name := range list { - result[i] = flags[NormalizedName(name)] - } - return result -} - -// SetNormalizeFunc allows you to add a function which can translate flag names. -// Flags added to the FlagSet will be translated and then when anything tries to -// look up the flag that will also be translated. So it would be possible to create -// a flag named "getURL" and have it translated to "geturl". A user could then pass -// "--getUrl" which may also be translated to "geturl" and everything will work. -func (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) NormalizedName) { - f.normalizeNameFunc = n - f.sortedFormal = f.sortedFormal[:0] - for fname, flag := range f.formal { - nname := f.normalizeFlagName(flag.Name) - if fname == nname { - continue - } - flag.Name = string(nname) - delete(f.formal, fname) - f.formal[nname] = flag - if _, set := f.actual[fname]; set { - delete(f.actual, fname) - f.actual[nname] = flag - } - } -} - -// GetNormalizeFunc returns the previously set NormalizeFunc of a function which -// does no translation, if not set previously. -func (f *FlagSet) GetNormalizeFunc() func(f *FlagSet, name string) NormalizedName { - if f.normalizeNameFunc != nil { - return f.normalizeNameFunc - } - return func(f *FlagSet, name string) NormalizedName { return NormalizedName(name) } -} - -func (f *FlagSet) normalizeFlagName(name string) NormalizedName { - n := f.GetNormalizeFunc() - return n(f, name) -} - -func (f *FlagSet) out() io.Writer { - if f.output == nil { - return os.Stderr - } - return f.output -} - -// SetOutput sets the destination for usage and error messages. -// If output is nil, os.Stderr is used. -func (f *FlagSet) SetOutput(output io.Writer) { - f.output = output -} - -// VisitAll visits the flags in lexicographical order or -// in primordial order if f.SortFlags is false, calling fn for each. -// It visits all flags, even those not set. -func (f *FlagSet) VisitAll(fn func(*Flag)) { - if len(f.formal) == 0 { - return - } - - var flags []*Flag - if f.SortFlags { - if len(f.formal) != len(f.sortedFormal) { - f.sortedFormal = sortFlags(f.formal) - } - flags = f.sortedFormal - } else { - flags = f.orderedFormal - } - - for _, flag := range flags { - fn(flag) - } -} - -// HasFlags returns a bool to indicate if the FlagSet has any flags defined. -func (f *FlagSet) HasFlags() bool { - return len(f.formal) > 0 -} - -// HasAvailableFlags returns a bool to indicate if the FlagSet has any flags -// that are not hidden. -func (f *FlagSet) HasAvailableFlags() bool { - for _, flag := range f.formal { - if !flag.Hidden { - return true - } - } - return false -} - -// VisitAll visits the command-line flags in lexicographical order or -// in primordial order if f.SortFlags is false, calling fn for each. -// It visits all flags, even those not set. -func VisitAll(fn func(*Flag)) { - CommandLine.VisitAll(fn) -} - -// Visit visits the flags in lexicographical order or -// in primordial order if f.SortFlags is false, calling fn for each. -// It visits only those flags that have been set. -func (f *FlagSet) Visit(fn func(*Flag)) { - if len(f.actual) == 0 { - return - } - - var flags []*Flag - if f.SortFlags { - if len(f.actual) != len(f.sortedActual) { - f.sortedActual = sortFlags(f.actual) - } - flags = f.sortedActual - } else { - flags = f.orderedActual - } - - for _, flag := range flags { - fn(flag) - } -} - -// Visit visits the command-line flags in lexicographical order or -// in primordial order if f.SortFlags is false, calling fn for each. -// It visits only those flags that have been set. -func Visit(fn func(*Flag)) { - CommandLine.Visit(fn) -} - -// Lookup returns the Flag structure of the named flag, returning nil if none exists. -func (f *FlagSet) Lookup(name string) *Flag { - return f.lookup(f.normalizeFlagName(name)) -} - -// ShorthandLookup returns the Flag structure of the short handed flag, -// returning nil if none exists. -// It panics, if len(name) > 1. -func (f *FlagSet) ShorthandLookup(name string) *Flag { - if name == "" { - return nil - } - if len(name) > 1 { - msg := fmt.Sprintf("can not look up shorthand which is more than one ASCII character: %q", name) - fmt.Fprintf(f.out(), msg) - panic(msg) - } - c := name[0] - return f.shorthands[c] -} - -// lookup returns the Flag structure of the named flag, returning nil if none exists. -func (f *FlagSet) lookup(name NormalizedName) *Flag { - return f.formal[name] -} - -// func to return a given type for a given flag name -func (f *FlagSet) getFlagType(name string, ftype string, convFunc func(sval string) (interface{}, error)) (interface{}, error) { - flag := f.Lookup(name) - if flag == nil { - err := fmt.Errorf("flag accessed but not defined: %s", name) - return nil, err - } - - if flag.Value.Type() != ftype { - err := fmt.Errorf("trying to get %s value of flag of type %s", ftype, flag.Value.Type()) - return nil, err - } - - sval := flag.Value.String() - result, err := convFunc(sval) - if err != nil { - return nil, err - } - return result, nil -} - -// ArgsLenAtDash will return the length of f.Args at the moment when a -- was -// found during arg parsing. This allows your program to know which args were -// before the -- and which came after. -func (f *FlagSet) ArgsLenAtDash() int { - return f.argsLenAtDash -} - -// MarkDeprecated indicated that a flag is deprecated in your program. It will -// continue to function but will not show up in help or usage messages. Using -// this flag will also print the given usageMessage. -func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error { - flag := f.Lookup(name) - if flag == nil { - return fmt.Errorf("flag %q does not exist", name) - } - if usageMessage == "" { - return fmt.Errorf("deprecated message for flag %q must be set", name) - } - flag.Deprecated = usageMessage - flag.Hidden = true - return nil -} - -// MarkShorthandDeprecated will mark the shorthand of a flag deprecated in your -// program. It will continue to function but will not show up in help or usage -// messages. Using this flag will also print the given usageMessage. -func (f *FlagSet) MarkShorthandDeprecated(name string, usageMessage string) error { - flag := f.Lookup(name) - if flag == nil { - return fmt.Errorf("flag %q does not exist", name) - } - if usageMessage == "" { - return fmt.Errorf("deprecated message for flag %q must be set", name) - } - flag.ShorthandDeprecated = usageMessage - return nil -} - -// MarkHidden sets a flag to 'hidden' in your program. It will continue to -// function but will not show up in help or usage messages. -func (f *FlagSet) MarkHidden(name string) error { - flag := f.Lookup(name) - if flag == nil { - return fmt.Errorf("flag %q does not exist", name) - } - flag.Hidden = true - return nil -} - -// Lookup returns the Flag structure of the named command-line flag, -// returning nil if none exists. -func Lookup(name string) *Flag { - return CommandLine.Lookup(name) -} - -// ShorthandLookup returns the Flag structure of the short handed flag, -// returning nil if none exists. -func ShorthandLookup(name string) *Flag { - return CommandLine.ShorthandLookup(name) -} - -// Set sets the value of the named flag. -func (f *FlagSet) Set(name, value string) error { - normalName := f.normalizeFlagName(name) - flag, ok := f.formal[normalName] - if !ok { - return fmt.Errorf("no such flag -%v", name) - } - - err := flag.Value.Set(value) - if err != nil { - var flagName string - if flag.Shorthand != "" && flag.ShorthandDeprecated == "" { - flagName = fmt.Sprintf("-%s, --%s", flag.Shorthand, flag.Name) - } else { - flagName = fmt.Sprintf("--%s", flag.Name) - } - return fmt.Errorf("invalid argument %q for %q flag: %v", value, flagName, err) - } - - if !flag.Changed { - if f.actual == nil { - f.actual = make(map[NormalizedName]*Flag) - } - f.actual[normalName] = flag - f.orderedActual = append(f.orderedActual, flag) - - flag.Changed = true - } - - if flag.Deprecated != "" { - fmt.Fprintf(f.out(), "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated) - } - return nil -} - -// SetAnnotation allows one to set arbitrary annotations on a flag in the FlagSet. -// This is sometimes used by spf13/cobra programs which want to generate additional -// bash completion information. -func (f *FlagSet) SetAnnotation(name, key string, values []string) error { - normalName := f.normalizeFlagName(name) - flag, ok := f.formal[normalName] - if !ok { - return fmt.Errorf("no such flag -%v", name) - } - if flag.Annotations == nil { - flag.Annotations = map[string][]string{} - } - flag.Annotations[key] = values - return nil -} - -// Changed returns true if the flag was explicitly set during Parse() and false -// otherwise -func (f *FlagSet) Changed(name string) bool { - flag := f.Lookup(name) - // If a flag doesn't exist, it wasn't changed.... - if flag == nil { - return false - } - return flag.Changed -} - -// Set sets the value of the named command-line flag. -func Set(name, value string) error { - return CommandLine.Set(name, value) -} - -// PrintDefaults prints, to standard error unless configured -// otherwise, the default values of all defined flags in the set. -func (f *FlagSet) PrintDefaults() { - usages := f.FlagUsages() - fmt.Fprint(f.out(), usages) -} - -// defaultIsZeroValue returns true if the default value for this flag represents -// a zero value. -func (f *Flag) defaultIsZeroValue() bool { - switch f.Value.(type) { - case boolFlag: - return f.DefValue == "false" - case *durationValue: - // Beginning in Go 1.7, duration zero values are "0s" - return f.DefValue == "0" || f.DefValue == "0s" - case *intValue, *int8Value, *int32Value, *int64Value, *uintValue, *uint8Value, *uint16Value, *uint32Value, *uint64Value, *countValue, *float32Value, *float64Value: - return f.DefValue == "0" - case *stringValue: - return f.DefValue == "" - case *ipValue, *ipMaskValue, *ipNetValue: - return f.DefValue == "" - case *intSliceValue, *stringSliceValue, *stringArrayValue: - return f.DefValue == "[]" - default: - switch f.Value.String() { - case "false": - return true - case "": - return true - case "": - return true - case "0": - return true - } - return false - } -} - -// UnquoteUsage extracts a back-quoted name from the usage -// string for a flag and returns it and the un-quoted usage. -// Given "a `name` to show" it returns ("name", "a name to show"). -// If there are no back quotes, the name is an educated guess of the -// type of the flag's value, or the empty string if the flag is boolean. -func UnquoteUsage(flag *Flag) (name string, usage string) { - // Look for a back-quoted name, but avoid the strings package. - usage = flag.Usage - for i := 0; i < len(usage); i++ { - if usage[i] == '`' { - for j := i + 1; j < len(usage); j++ { - if usage[j] == '`' { - name = usage[i+1 : j] - usage = usage[:i] + name + usage[j+1:] - return name, usage - } - } - break // Only one back quote; use type name. - } - } - - name = flag.Value.Type() - switch name { - case "bool": - name = "" - case "float64": - name = "float" - case "int64": - name = "int" - case "uint64": - name = "uint" - case "stringSlice": - name = "strings" - case "intSlice": - name = "ints" - case "uintSlice": - name = "uints" - case "boolSlice": - name = "bools" - } - - return -} - -// Splits the string `s` on whitespace into an initial substring up to -// `i` runes in length and the remainder. Will go `slop` over `i` if -// that encompasses the entire string (which allows the caller to -// avoid short orphan words on the final line). -func wrapN(i, slop int, s string) (string, string) { - if i+slop > len(s) { - return s, "" - } - - w := strings.LastIndexAny(s[:i], " \t\n") - if w <= 0 { - return s, "" - } - nlPos := strings.LastIndex(s[:i], "\n") - if nlPos > 0 && nlPos < w { - return s[:nlPos], s[nlPos+1:] - } - return s[:w], s[w+1:] -} - -// Wraps the string `s` to a maximum width `w` with leading indent -// `i`. The first line is not indented (this is assumed to be done by -// caller). Pass `w` == 0 to do no wrapping -func wrap(i, w int, s string) string { - if w == 0 { - return strings.Replace(s, "\n", "\n"+strings.Repeat(" ", i), -1) - } - - // space between indent i and end of line width w into which - // we should wrap the text. - wrap := w - i - - var r, l string - - // Not enough space for sensible wrapping. Wrap as a block on - // the next line instead. - if wrap < 24 { - i = 16 - wrap = w - i - r += "\n" + strings.Repeat(" ", i) - } - // If still not enough space then don't even try to wrap. - if wrap < 24 { - return strings.Replace(s, "\n", r, -1) - } - - // Try to avoid short orphan words on the final line, by - // allowing wrapN to go a bit over if that would fit in the - // remainder of the line. - slop := 5 - wrap = wrap - slop - - // Handle first line, which is indented by the caller (or the - // special case above) - l, s = wrapN(wrap, slop, s) - r = r + strings.Replace(l, "\n", "\n"+strings.Repeat(" ", i), -1) - - // Now wrap the rest - for s != "" { - var t string - - t, s = wrapN(wrap, slop, s) - r = r + "\n" + strings.Repeat(" ", i) + strings.Replace(t, "\n", "\n"+strings.Repeat(" ", i), -1) - } - - return r - -} - -// FlagUsagesWrapped returns a string containing the usage information -// for all flags in the FlagSet. Wrapped to `cols` columns (0 for no -// wrapping) -func (f *FlagSet) FlagUsagesWrapped(cols int) string { - buf := new(bytes.Buffer) - - lines := make([]string, 0, len(f.formal)) - - maxlen := 0 - f.VisitAll(func(flag *Flag) { - if flag.Hidden { - return - } - - line := "" - if flag.Shorthand != "" && flag.ShorthandDeprecated == "" { - line = fmt.Sprintf(" -%s, --%s", flag.Shorthand, flag.Name) - } else { - line = fmt.Sprintf(" --%s", flag.Name) - } - - varname, usage := UnquoteUsage(flag) - if varname != "" { - line += " " + varname - } - if flag.NoOptDefVal != "" { - switch flag.Value.Type() { - case "string": - line += fmt.Sprintf("[=\"%s\"]", flag.NoOptDefVal) - case "bool": - if flag.NoOptDefVal != "true" { - line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) - } - case "count": - if flag.NoOptDefVal != "+1" { - line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) - } - default: - line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) - } - } - - // This special character will be replaced with spacing once the - // correct alignment is calculated - line += "\x00" - if len(line) > maxlen { - maxlen = len(line) - } - - line += usage - if !flag.defaultIsZeroValue() { - if flag.Value.Type() == "string" { - line += fmt.Sprintf(" (default %q)", flag.DefValue) - } else { - line += fmt.Sprintf(" (default %s)", flag.DefValue) - } - } - if len(flag.Deprecated) != 0 { - line += fmt.Sprintf(" (DEPRECATED: %s)", flag.Deprecated) - } - - lines = append(lines, line) - }) - - for _, line := range lines { - sidx := strings.Index(line, "\x00") - spacing := strings.Repeat(" ", maxlen-sidx) - // maxlen + 2 comes from + 1 for the \x00 and + 1 for the (deliberate) off-by-one in maxlen-sidx - fmt.Fprintln(buf, line[:sidx], spacing, wrap(maxlen+2, cols, line[sidx+1:])) - } - - return buf.String() -} - -// FlagUsages returns a string containing the usage information for all flags in -// the FlagSet -func (f *FlagSet) FlagUsages() string { - return f.FlagUsagesWrapped(0) -} - -// PrintDefaults prints to standard error the default values of all defined command-line flags. -func PrintDefaults() { - CommandLine.PrintDefaults() -} - -// defaultUsage is the default function to print a usage message. -func defaultUsage(f *FlagSet) { - fmt.Fprintf(f.out(), "Usage of %s:\n", f.name) - f.PrintDefaults() -} - -// NOTE: Usage is not just defaultUsage(CommandLine) -// because it serves (via godoc flag Usage) as the example -// for how to write your own usage function. - -// Usage prints to standard error a usage message documenting all defined command-line flags. -// The function is a variable that may be changed to point to a custom function. -// By default it prints a simple header and calls PrintDefaults; for details about the -// format of the output and how to control it, see the documentation for PrintDefaults. -var Usage = func() { - fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) - PrintDefaults() -} - -// NFlag returns the number of flags that have been set. -func (f *FlagSet) NFlag() int { return len(f.actual) } - -// NFlag returns the number of command-line flags that have been set. -func NFlag() int { return len(CommandLine.actual) } - -// Arg returns the i'th argument. Arg(0) is the first remaining argument -// after flags have been processed. -func (f *FlagSet) Arg(i int) string { - if i < 0 || i >= len(f.args) { - return "" - } - return f.args[i] -} - -// Arg returns the i'th command-line argument. Arg(0) is the first remaining argument -// after flags have been processed. -func Arg(i int) string { - return CommandLine.Arg(i) -} - -// NArg is the number of arguments remaining after flags have been processed. -func (f *FlagSet) NArg() int { return len(f.args) } - -// NArg is the number of arguments remaining after flags have been processed. -func NArg() int { return len(CommandLine.args) } - -// Args returns the non-flag arguments. -func (f *FlagSet) Args() []string { return f.args } - -// Args returns the non-flag command-line arguments. -func Args() []string { return CommandLine.args } - -// Var defines a flag with the specified name and usage string. The type and -// value of the flag are represented by the first argument, of type Value, which -// typically holds a user-defined implementation of Value. For instance, the -// caller could create a flag that turns a comma-separated string into a slice -// of strings by giving the slice the methods of Value; in particular, Set would -// decompose the comma-separated string into the slice. -func (f *FlagSet) Var(value Value, name string, usage string) { - f.VarP(value, name, "", usage) -} - -// VarPF is like VarP, but returns the flag created -func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag { - // Remember the default value as a string; it won't change. - flag := &Flag{ - Name: name, - Shorthand: shorthand, - Usage: usage, - Value: value, - DefValue: value.String(), - } - f.AddFlag(flag) - return flag -} - -// VarP is like Var, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) VarP(value Value, name, shorthand, usage string) { - f.VarPF(value, name, shorthand, usage) -} - -// AddFlag will add the flag to the FlagSet -func (f *FlagSet) AddFlag(flag *Flag) { - normalizedFlagName := f.normalizeFlagName(flag.Name) - - _, alreadyThere := f.formal[normalizedFlagName] - if alreadyThere { - msg := fmt.Sprintf("%s flag redefined: %s", f.name, flag.Name) - fmt.Fprintln(f.out(), msg) - panic(msg) // Happens only if flags are declared with identical names - } - if f.formal == nil { - f.formal = make(map[NormalizedName]*Flag) - } - - flag.Name = string(normalizedFlagName) - f.formal[normalizedFlagName] = flag - f.orderedFormal = append(f.orderedFormal, flag) - - if flag.Shorthand == "" { - return - } - if len(flag.Shorthand) > 1 { - msg := fmt.Sprintf("%q shorthand is more than one ASCII character", flag.Shorthand) - fmt.Fprintf(f.out(), msg) - panic(msg) - } - if f.shorthands == nil { - f.shorthands = make(map[byte]*Flag) - } - c := flag.Shorthand[0] - used, alreadyThere := f.shorthands[c] - if alreadyThere { - msg := fmt.Sprintf("unable to redefine %q shorthand in %q flagset: it's already used for %q flag", c, f.name, used.Name) - fmt.Fprintf(f.out(), msg) - panic(msg) - } - f.shorthands[c] = flag -} - -// AddFlagSet adds one FlagSet to another. If a flag is already present in f -// the flag from newSet will be ignored. -func (f *FlagSet) AddFlagSet(newSet *FlagSet) { - if newSet == nil { - return - } - newSet.VisitAll(func(flag *Flag) { - if f.Lookup(flag.Name) == nil { - f.AddFlag(flag) - } - }) -} - -// Var defines a flag with the specified name and usage string. The type and -// value of the flag are represented by the first argument, of type Value, which -// typically holds a user-defined implementation of Value. For instance, the -// caller could create a flag that turns a comma-separated string into a slice -// of strings by giving the slice the methods of Value; in particular, Set would -// decompose the comma-separated string into the slice. -func Var(value Value, name string, usage string) { - CommandLine.VarP(value, name, "", usage) -} - -// VarP is like Var, but accepts a shorthand letter that can be used after a single dash. -func VarP(value Value, name, shorthand, usage string) { - CommandLine.VarP(value, name, shorthand, usage) -} - -// failf prints to standard error a formatted error and usage message and -// returns the error. -func (f *FlagSet) failf(format string, a ...interface{}) error { - err := fmt.Errorf(format, a...) - if f.errorHandling != ContinueOnError { - fmt.Fprintln(f.out(), err) - f.usage() - } - return err -} - -// usage calls the Usage method for the flag set, or the usage function if -// the flag set is CommandLine. -func (f *FlagSet) usage() { - if f == CommandLine { - Usage() - } else if f.Usage == nil { - defaultUsage(f) - } else { - f.Usage() - } -} - -//--unknown (args will be empty) -//--unknown --next-flag ... (args will be --next-flag ...) -//--unknown arg ... (args will be arg ...) -func stripUnknownFlagValue(args []string) []string { - if len(args) == 0 { - //--unknown - return args - } - - first := args[0] - if first[0] == '-' { - //--unknown --next-flag ... - return args - } - - //--unknown arg ... (args will be arg ...) - return args[1:] -} - -func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []string, err error) { - a = args - name := s[2:] - if len(name) == 0 || name[0] == '-' || name[0] == '=' { - err = f.failf("bad flag syntax: %s", s) - return - } - - split := strings.SplitN(name, "=", 2) - name = split[0] - flag, exists := f.formal[f.normalizeFlagName(name)] - - if !exists { - switch { - case name == "help": - f.usage() - return a, ErrHelp - case f.ParseErrorsWhitelist.UnknownFlags: - // --unknown=unknownval arg ... - // we do not want to lose arg in this case - if len(split) >= 2 { - return a, nil - } - - return stripUnknownFlagValue(a), nil - default: - err = f.failf("unknown flag: --%s", name) - return - } - } - - var value string - if len(split) == 2 { - // '--flag=arg' - value = split[1] - } else if flag.NoOptDefVal != "" { - // '--flag' (arg was optional) - value = flag.NoOptDefVal - } else if len(a) > 0 { - // '--flag arg' - value = a[0] - a = a[1:] - } else { - // '--flag' (arg was required) - err = f.failf("flag needs an argument: %s", s) - return - } - - err = fn(flag, value) - if err != nil { - f.failf(err.Error()) - } - return -} - -func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parseFunc) (outShorts string, outArgs []string, err error) { - outArgs = args - - if strings.HasPrefix(shorthands, "test.") { - return - } - - outShorts = shorthands[1:] - c := shorthands[0] - - flag, exists := f.shorthands[c] - if !exists { - switch { - case c == 'h': - f.usage() - err = ErrHelp - return - case f.ParseErrorsWhitelist.UnknownFlags: - // '-f=arg arg ...' - // we do not want to lose arg in this case - if len(shorthands) > 2 && shorthands[1] == '=' { - outShorts = "" - return - } - - outArgs = stripUnknownFlagValue(outArgs) - return - default: - err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands) - return - } - } - - var value string - if len(shorthands) > 2 && shorthands[1] == '=' { - // '-f=arg' - value = shorthands[2:] - outShorts = "" - } else if flag.NoOptDefVal != "" { - // '-f' (arg was optional) - value = flag.NoOptDefVal - } else if len(shorthands) > 1 { - // '-farg' - value = shorthands[1:] - outShorts = "" - } else if len(args) > 0 { - // '-f arg' - value = args[0] - outArgs = args[1:] - } else { - // '-f' (arg was required) - err = f.failf("flag needs an argument: %q in -%s", c, shorthands) - return - } - - if flag.ShorthandDeprecated != "" { - fmt.Fprintf(f.out(), "Flag shorthand -%s has been deprecated, %s\n", flag.Shorthand, flag.ShorthandDeprecated) - } - - err = fn(flag, value) - if err != nil { - f.failf(err.Error()) - } - return -} - -func (f *FlagSet) parseShortArg(s string, args []string, fn parseFunc) (a []string, err error) { - a = args - shorthands := s[1:] - - // "shorthands" can be a series of shorthand letters of flags (e.g. "-vvv"). - for len(shorthands) > 0 { - shorthands, a, err = f.parseSingleShortArg(shorthands, args, fn) - if err != nil { - return - } - } - - return -} - -func (f *FlagSet) parseArgs(args []string, fn parseFunc) (err error) { - for len(args) > 0 { - s := args[0] - args = args[1:] - if len(s) == 0 || s[0] != '-' || len(s) == 1 { - if !f.interspersed { - f.args = append(f.args, s) - f.args = append(f.args, args...) - return nil - } - f.args = append(f.args, s) - continue - } - - if s[1] == '-' { - if len(s) == 2 { // "--" terminates the flags - f.argsLenAtDash = len(f.args) - f.args = append(f.args, args...) - break - } - args, err = f.parseLongArg(s, args, fn) - } else { - args, err = f.parseShortArg(s, args, fn) - } - if err != nil { - return - } - } - return -} - -// Parse parses flag definitions from the argument list, which should not -// include the command name. Must be called after all flags in the FlagSet -// are defined and before flags are accessed by the program. -// The return value will be ErrHelp if -help was set but not defined. -func (f *FlagSet) Parse(arguments []string) error { - if f.addedGoFlagSets != nil { - for _, goFlagSet := range f.addedGoFlagSets { - goFlagSet.Parse(nil) - } - } - f.parsed = true - - if len(arguments) < 0 { - return nil - } - - f.args = make([]string, 0, len(arguments)) - - set := func(flag *Flag, value string) error { - return f.Set(flag.Name, value) - } - - err := f.parseArgs(arguments, set) - if err != nil { - switch f.errorHandling { - case ContinueOnError: - return err - case ExitOnError: - fmt.Println(err) - os.Exit(2) - case PanicOnError: - panic(err) - } - } - return nil -} - -type parseFunc func(flag *Flag, value string) error - -// ParseAll parses flag definitions from the argument list, which should not -// include the command name. The arguments for fn are flag and value. Must be -// called after all flags in the FlagSet are defined and before flags are -// accessed by the program. The return value will be ErrHelp if -help was set -// but not defined. -func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string) error) error { - f.parsed = true - f.args = make([]string, 0, len(arguments)) - - err := f.parseArgs(arguments, fn) - if err != nil { - switch f.errorHandling { - case ContinueOnError: - return err - case ExitOnError: - os.Exit(2) - case PanicOnError: - panic(err) - } - } - return nil -} - -// Parsed reports whether f.Parse has been called. -func (f *FlagSet) Parsed() bool { - return f.parsed -} - -// Parse parses the command-line flags from os.Args[1:]. Must be called -// after all flags are defined and before flags are accessed by the program. -func Parse() { - // Ignore errors; CommandLine is set for ExitOnError. - CommandLine.Parse(os.Args[1:]) -} - -// ParseAll parses the command-line flags from os.Args[1:] and called fn for each. -// The arguments for fn are flag and value. Must be called after all flags are -// defined and before flags are accessed by the program. -func ParseAll(fn func(flag *Flag, value string) error) { - // Ignore errors; CommandLine is set for ExitOnError. - CommandLine.ParseAll(os.Args[1:], fn) -} - -// SetInterspersed sets whether to support interspersed option/non-option arguments. -func SetInterspersed(interspersed bool) { - CommandLine.SetInterspersed(interspersed) -} - -// Parsed returns true if the command-line flags have been parsed. -func Parsed() bool { - return CommandLine.Parsed() -} - -// CommandLine is the default set of command-line flags, parsed from os.Args. -var CommandLine = NewFlagSet(os.Args[0], ExitOnError) - -// NewFlagSet returns a new, empty flag set with the specified name, -// error handling property and SortFlags set to true. -func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet { - f := &FlagSet{ - name: name, - errorHandling: errorHandling, - argsLenAtDash: -1, - interspersed: true, - SortFlags: true, - } - return f -} - -// SetInterspersed sets whether to support interspersed option/non-option arguments. -func (f *FlagSet) SetInterspersed(interspersed bool) { - f.interspersed = interspersed -} - -// Init sets the name and error handling property for a flag set. -// By default, the zero FlagSet uses an empty name and the -// ContinueOnError error handling policy. -func (f *FlagSet) Init(name string, errorHandling ErrorHandling) { - f.name = name - f.errorHandling = errorHandling - f.argsLenAtDash = -1 -} diff --git a/vendor/github.com/spf13/pflag/float32.go b/vendor/github.com/spf13/pflag/float32.go deleted file mode 100644 index a243f81..0000000 --- a/vendor/github.com/spf13/pflag/float32.go +++ /dev/null @@ -1,88 +0,0 @@ -package pflag - -import "strconv" - -// -- float32 Value -type float32Value float32 - -func newFloat32Value(val float32, p *float32) *float32Value { - *p = val - return (*float32Value)(p) -} - -func (f *float32Value) Set(s string) error { - v, err := strconv.ParseFloat(s, 32) - *f = float32Value(v) - return err -} - -func (f *float32Value) Type() string { - return "float32" -} - -func (f *float32Value) String() string { return strconv.FormatFloat(float64(*f), 'g', -1, 32) } - -func float32Conv(sval string) (interface{}, error) { - v, err := strconv.ParseFloat(sval, 32) - if err != nil { - return 0, err - } - return float32(v), nil -} - -// GetFloat32 return the float32 value of a flag with the given name -func (f *FlagSet) GetFloat32(name string) (float32, error) { - val, err := f.getFlagType(name, "float32", float32Conv) - if err != nil { - return 0, err - } - return val.(float32), nil -} - -// Float32Var defines a float32 flag with specified name, default value, and usage string. -// The argument p points to a float32 variable in which to store the value of the flag. -func (f *FlagSet) Float32Var(p *float32, name string, value float32, usage string) { - f.VarP(newFloat32Value(value, p), name, "", usage) -} - -// Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Float32VarP(p *float32, name, shorthand string, value float32, usage string) { - f.VarP(newFloat32Value(value, p), name, shorthand, usage) -} - -// Float32Var defines a float32 flag with specified name, default value, and usage string. -// The argument p points to a float32 variable in which to store the value of the flag. -func Float32Var(p *float32, name string, value float32, usage string) { - CommandLine.VarP(newFloat32Value(value, p), name, "", usage) -} - -// Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash. -func Float32VarP(p *float32, name, shorthand string, value float32, usage string) { - CommandLine.VarP(newFloat32Value(value, p), name, shorthand, usage) -} - -// Float32 defines a float32 flag with specified name, default value, and usage string. -// The return value is the address of a float32 variable that stores the value of the flag. -func (f *FlagSet) Float32(name string, value float32, usage string) *float32 { - p := new(float32) - f.Float32VarP(p, name, "", value, usage) - return p -} - -// Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Float32P(name, shorthand string, value float32, usage string) *float32 { - p := new(float32) - f.Float32VarP(p, name, shorthand, value, usage) - return p -} - -// Float32 defines a float32 flag with specified name, default value, and usage string. -// The return value is the address of a float32 variable that stores the value of the flag. -func Float32(name string, value float32, usage string) *float32 { - return CommandLine.Float32P(name, "", value, usage) -} - -// Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash. -func Float32P(name, shorthand string, value float32, usage string) *float32 { - return CommandLine.Float32P(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/float64.go b/vendor/github.com/spf13/pflag/float64.go deleted file mode 100644 index 04b5492..0000000 --- a/vendor/github.com/spf13/pflag/float64.go +++ /dev/null @@ -1,84 +0,0 @@ -package pflag - -import "strconv" - -// -- float64 Value -type float64Value float64 - -func newFloat64Value(val float64, p *float64) *float64Value { - *p = val - return (*float64Value)(p) -} - -func (f *float64Value) Set(s string) error { - v, err := strconv.ParseFloat(s, 64) - *f = float64Value(v) - return err -} - -func (f *float64Value) Type() string { - return "float64" -} - -func (f *float64Value) String() string { return strconv.FormatFloat(float64(*f), 'g', -1, 64) } - -func float64Conv(sval string) (interface{}, error) { - return strconv.ParseFloat(sval, 64) -} - -// GetFloat64 return the float64 value of a flag with the given name -func (f *FlagSet) GetFloat64(name string) (float64, error) { - val, err := f.getFlagType(name, "float64", float64Conv) - if err != nil { - return 0, err - } - return val.(float64), nil -} - -// Float64Var defines a float64 flag with specified name, default value, and usage string. -// The argument p points to a float64 variable in which to store the value of the flag. -func (f *FlagSet) Float64Var(p *float64, name string, value float64, usage string) { - f.VarP(newFloat64Value(value, p), name, "", usage) -} - -// Float64VarP is like Float64Var, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Float64VarP(p *float64, name, shorthand string, value float64, usage string) { - f.VarP(newFloat64Value(value, p), name, shorthand, usage) -} - -// Float64Var defines a float64 flag with specified name, default value, and usage string. -// The argument p points to a float64 variable in which to store the value of the flag. -func Float64Var(p *float64, name string, value float64, usage string) { - CommandLine.VarP(newFloat64Value(value, p), name, "", usage) -} - -// Float64VarP is like Float64Var, but accepts a shorthand letter that can be used after a single dash. -func Float64VarP(p *float64, name, shorthand string, value float64, usage string) { - CommandLine.VarP(newFloat64Value(value, p), name, shorthand, usage) -} - -// Float64 defines a float64 flag with specified name, default value, and usage string. -// The return value is the address of a float64 variable that stores the value of the flag. -func (f *FlagSet) Float64(name string, value float64, usage string) *float64 { - p := new(float64) - f.Float64VarP(p, name, "", value, usage) - return p -} - -// Float64P is like Float64, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Float64P(name, shorthand string, value float64, usage string) *float64 { - p := new(float64) - f.Float64VarP(p, name, shorthand, value, usage) - return p -} - -// Float64 defines a float64 flag with specified name, default value, and usage string. -// The return value is the address of a float64 variable that stores the value of the flag. -func Float64(name string, value float64, usage string) *float64 { - return CommandLine.Float64P(name, "", value, usage) -} - -// Float64P is like Float64, but accepts a shorthand letter that can be used after a single dash. -func Float64P(name, shorthand string, value float64, usage string) *float64 { - return CommandLine.Float64P(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/golangflag.go b/vendor/github.com/spf13/pflag/golangflag.go deleted file mode 100644 index d3dd72b..0000000 --- a/vendor/github.com/spf13/pflag/golangflag.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pflag - -import ( - goflag "flag" - "reflect" - "strings" -) - -// flagValueWrapper implements pflag.Value around a flag.Value. The main -// difference here is the addition of the Type method that returns a string -// name of the type. As this is generally unknown, we approximate that with -// reflection. -type flagValueWrapper struct { - inner goflag.Value - flagType string -} - -// We are just copying the boolFlag interface out of goflag as that is what -// they use to decide if a flag should get "true" when no arg is given. -type goBoolFlag interface { - goflag.Value - IsBoolFlag() bool -} - -func wrapFlagValue(v goflag.Value) Value { - // If the flag.Value happens to also be a pflag.Value, just use it directly. - if pv, ok := v.(Value); ok { - return pv - } - - pv := &flagValueWrapper{ - inner: v, - } - - t := reflect.TypeOf(v) - if t.Kind() == reflect.Interface || t.Kind() == reflect.Ptr { - t = t.Elem() - } - - pv.flagType = strings.TrimSuffix(t.Name(), "Value") - return pv -} - -func (v *flagValueWrapper) String() string { - return v.inner.String() -} - -func (v *flagValueWrapper) Set(s string) error { - return v.inner.Set(s) -} - -func (v *flagValueWrapper) Type() string { - return v.flagType -} - -// PFlagFromGoFlag will return a *pflag.Flag given a *flag.Flag -// If the *flag.Flag.Name was a single character (ex: `v`) it will be accessiblei -// with both `-v` and `--v` in flags. If the golang flag was more than a single -// character (ex: `verbose`) it will only be accessible via `--verbose` -func PFlagFromGoFlag(goflag *goflag.Flag) *Flag { - // Remember the default value as a string; it won't change. - flag := &Flag{ - Name: goflag.Name, - Usage: goflag.Usage, - Value: wrapFlagValue(goflag.Value), - // Looks like golang flags don't set DefValue correctly :-( - //DefValue: goflag.DefValue, - DefValue: goflag.Value.String(), - } - // Ex: if the golang flag was -v, allow both -v and --v to work - if len(flag.Name) == 1 { - flag.Shorthand = flag.Name - } - if fv, ok := goflag.Value.(goBoolFlag); ok && fv.IsBoolFlag() { - flag.NoOptDefVal = "true" - } - return flag -} - -// AddGoFlag will add the given *flag.Flag to the pflag.FlagSet -func (f *FlagSet) AddGoFlag(goflag *goflag.Flag) { - if f.Lookup(goflag.Name) != nil { - return - } - newflag := PFlagFromGoFlag(goflag) - f.AddFlag(newflag) -} - -// AddGoFlagSet will add the given *flag.FlagSet to the pflag.FlagSet -func (f *FlagSet) AddGoFlagSet(newSet *goflag.FlagSet) { - if newSet == nil { - return - } - newSet.VisitAll(func(goflag *goflag.Flag) { - f.AddGoFlag(goflag) - }) - if f.addedGoFlagSets == nil { - f.addedGoFlagSets = make([]*goflag.FlagSet, 0) - } - f.addedGoFlagSets = append(f.addedGoFlagSets, newSet) -} diff --git a/vendor/github.com/spf13/pflag/int.go b/vendor/github.com/spf13/pflag/int.go deleted file mode 100644 index 1474b89..0000000 --- a/vendor/github.com/spf13/pflag/int.go +++ /dev/null @@ -1,84 +0,0 @@ -package pflag - -import "strconv" - -// -- int Value -type intValue int - -func newIntValue(val int, p *int) *intValue { - *p = val - return (*intValue)(p) -} - -func (i *intValue) Set(s string) error { - v, err := strconv.ParseInt(s, 0, 64) - *i = intValue(v) - return err -} - -func (i *intValue) Type() string { - return "int" -} - -func (i *intValue) String() string { return strconv.Itoa(int(*i)) } - -func intConv(sval string) (interface{}, error) { - return strconv.Atoi(sval) -} - -// GetInt return the int value of a flag with the given name -func (f *FlagSet) GetInt(name string) (int, error) { - val, err := f.getFlagType(name, "int", intConv) - if err != nil { - return 0, err - } - return val.(int), nil -} - -// IntVar defines an int flag with specified name, default value, and usage string. -// The argument p points to an int variable in which to store the value of the flag. -func (f *FlagSet) IntVar(p *int, name string, value int, usage string) { - f.VarP(newIntValue(value, p), name, "", usage) -} - -// IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) IntVarP(p *int, name, shorthand string, value int, usage string) { - f.VarP(newIntValue(value, p), name, shorthand, usage) -} - -// IntVar defines an int flag with specified name, default value, and usage string. -// The argument p points to an int variable in which to store the value of the flag. -func IntVar(p *int, name string, value int, usage string) { - CommandLine.VarP(newIntValue(value, p), name, "", usage) -} - -// IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash. -func IntVarP(p *int, name, shorthand string, value int, usage string) { - CommandLine.VarP(newIntValue(value, p), name, shorthand, usage) -} - -// Int defines an int flag with specified name, default value, and usage string. -// The return value is the address of an int variable that stores the value of the flag. -func (f *FlagSet) Int(name string, value int, usage string) *int { - p := new(int) - f.IntVarP(p, name, "", value, usage) - return p -} - -// IntP is like Int, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) IntP(name, shorthand string, value int, usage string) *int { - p := new(int) - f.IntVarP(p, name, shorthand, value, usage) - return p -} - -// Int defines an int flag with specified name, default value, and usage string. -// The return value is the address of an int variable that stores the value of the flag. -func Int(name string, value int, usage string) *int { - return CommandLine.IntP(name, "", value, usage) -} - -// IntP is like Int, but accepts a shorthand letter that can be used after a single dash. -func IntP(name, shorthand string, value int, usage string) *int { - return CommandLine.IntP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/int16.go b/vendor/github.com/spf13/pflag/int16.go deleted file mode 100644 index f1a01d0..0000000 --- a/vendor/github.com/spf13/pflag/int16.go +++ /dev/null @@ -1,88 +0,0 @@ -package pflag - -import "strconv" - -// -- int16 Value -type int16Value int16 - -func newInt16Value(val int16, p *int16) *int16Value { - *p = val - return (*int16Value)(p) -} - -func (i *int16Value) Set(s string) error { - v, err := strconv.ParseInt(s, 0, 16) - *i = int16Value(v) - return err -} - -func (i *int16Value) Type() string { - return "int16" -} - -func (i *int16Value) String() string { return strconv.FormatInt(int64(*i), 10) } - -func int16Conv(sval string) (interface{}, error) { - v, err := strconv.ParseInt(sval, 0, 16) - if err != nil { - return 0, err - } - return int16(v), nil -} - -// GetInt16 returns the int16 value of a flag with the given name -func (f *FlagSet) GetInt16(name string) (int16, error) { - val, err := f.getFlagType(name, "int16", int16Conv) - if err != nil { - return 0, err - } - return val.(int16), nil -} - -// Int16Var defines an int16 flag with specified name, default value, and usage string. -// The argument p points to an int16 variable in which to store the value of the flag. -func (f *FlagSet) Int16Var(p *int16, name string, value int16, usage string) { - f.VarP(newInt16Value(value, p), name, "", usage) -} - -// Int16VarP is like Int16Var, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Int16VarP(p *int16, name, shorthand string, value int16, usage string) { - f.VarP(newInt16Value(value, p), name, shorthand, usage) -} - -// Int16Var defines an int16 flag with specified name, default value, and usage string. -// The argument p points to an int16 variable in which to store the value of the flag. -func Int16Var(p *int16, name string, value int16, usage string) { - CommandLine.VarP(newInt16Value(value, p), name, "", usage) -} - -// Int16VarP is like Int16Var, but accepts a shorthand letter that can be used after a single dash. -func Int16VarP(p *int16, name, shorthand string, value int16, usage string) { - CommandLine.VarP(newInt16Value(value, p), name, shorthand, usage) -} - -// Int16 defines an int16 flag with specified name, default value, and usage string. -// The return value is the address of an int16 variable that stores the value of the flag. -func (f *FlagSet) Int16(name string, value int16, usage string) *int16 { - p := new(int16) - f.Int16VarP(p, name, "", value, usage) - return p -} - -// Int16P is like Int16, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Int16P(name, shorthand string, value int16, usage string) *int16 { - p := new(int16) - f.Int16VarP(p, name, shorthand, value, usage) - return p -} - -// Int16 defines an int16 flag with specified name, default value, and usage string. -// The return value is the address of an int16 variable that stores the value of the flag. -func Int16(name string, value int16, usage string) *int16 { - return CommandLine.Int16P(name, "", value, usage) -} - -// Int16P is like Int16, but accepts a shorthand letter that can be used after a single dash. -func Int16P(name, shorthand string, value int16, usage string) *int16 { - return CommandLine.Int16P(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/int32.go b/vendor/github.com/spf13/pflag/int32.go deleted file mode 100644 index 9b95944..0000000 --- a/vendor/github.com/spf13/pflag/int32.go +++ /dev/null @@ -1,88 +0,0 @@ -package pflag - -import "strconv" - -// -- int32 Value -type int32Value int32 - -func newInt32Value(val int32, p *int32) *int32Value { - *p = val - return (*int32Value)(p) -} - -func (i *int32Value) Set(s string) error { - v, err := strconv.ParseInt(s, 0, 32) - *i = int32Value(v) - return err -} - -func (i *int32Value) Type() string { - return "int32" -} - -func (i *int32Value) String() string { return strconv.FormatInt(int64(*i), 10) } - -func int32Conv(sval string) (interface{}, error) { - v, err := strconv.ParseInt(sval, 0, 32) - if err != nil { - return 0, err - } - return int32(v), nil -} - -// GetInt32 return the int32 value of a flag with the given name -func (f *FlagSet) GetInt32(name string) (int32, error) { - val, err := f.getFlagType(name, "int32", int32Conv) - if err != nil { - return 0, err - } - return val.(int32), nil -} - -// Int32Var defines an int32 flag with specified name, default value, and usage string. -// The argument p points to an int32 variable in which to store the value of the flag. -func (f *FlagSet) Int32Var(p *int32, name string, value int32, usage string) { - f.VarP(newInt32Value(value, p), name, "", usage) -} - -// Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Int32VarP(p *int32, name, shorthand string, value int32, usage string) { - f.VarP(newInt32Value(value, p), name, shorthand, usage) -} - -// Int32Var defines an int32 flag with specified name, default value, and usage string. -// The argument p points to an int32 variable in which to store the value of the flag. -func Int32Var(p *int32, name string, value int32, usage string) { - CommandLine.VarP(newInt32Value(value, p), name, "", usage) -} - -// Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash. -func Int32VarP(p *int32, name, shorthand string, value int32, usage string) { - CommandLine.VarP(newInt32Value(value, p), name, shorthand, usage) -} - -// Int32 defines an int32 flag with specified name, default value, and usage string. -// The return value is the address of an int32 variable that stores the value of the flag. -func (f *FlagSet) Int32(name string, value int32, usage string) *int32 { - p := new(int32) - f.Int32VarP(p, name, "", value, usage) - return p -} - -// Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Int32P(name, shorthand string, value int32, usage string) *int32 { - p := new(int32) - f.Int32VarP(p, name, shorthand, value, usage) - return p -} - -// Int32 defines an int32 flag with specified name, default value, and usage string. -// The return value is the address of an int32 variable that stores the value of the flag. -func Int32(name string, value int32, usage string) *int32 { - return CommandLine.Int32P(name, "", value, usage) -} - -// Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash. -func Int32P(name, shorthand string, value int32, usage string) *int32 { - return CommandLine.Int32P(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/int64.go b/vendor/github.com/spf13/pflag/int64.go deleted file mode 100644 index 0026d78..0000000 --- a/vendor/github.com/spf13/pflag/int64.go +++ /dev/null @@ -1,84 +0,0 @@ -package pflag - -import "strconv" - -// -- int64 Value -type int64Value int64 - -func newInt64Value(val int64, p *int64) *int64Value { - *p = val - return (*int64Value)(p) -} - -func (i *int64Value) Set(s string) error { - v, err := strconv.ParseInt(s, 0, 64) - *i = int64Value(v) - return err -} - -func (i *int64Value) Type() string { - return "int64" -} - -func (i *int64Value) String() string { return strconv.FormatInt(int64(*i), 10) } - -func int64Conv(sval string) (interface{}, error) { - return strconv.ParseInt(sval, 0, 64) -} - -// GetInt64 return the int64 value of a flag with the given name -func (f *FlagSet) GetInt64(name string) (int64, error) { - val, err := f.getFlagType(name, "int64", int64Conv) - if err != nil { - return 0, err - } - return val.(int64), nil -} - -// Int64Var defines an int64 flag with specified name, default value, and usage string. -// The argument p points to an int64 variable in which to store the value of the flag. -func (f *FlagSet) Int64Var(p *int64, name string, value int64, usage string) { - f.VarP(newInt64Value(value, p), name, "", usage) -} - -// Int64VarP is like Int64Var, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Int64VarP(p *int64, name, shorthand string, value int64, usage string) { - f.VarP(newInt64Value(value, p), name, shorthand, usage) -} - -// Int64Var defines an int64 flag with specified name, default value, and usage string. -// The argument p points to an int64 variable in which to store the value of the flag. -func Int64Var(p *int64, name string, value int64, usage string) { - CommandLine.VarP(newInt64Value(value, p), name, "", usage) -} - -// Int64VarP is like Int64Var, but accepts a shorthand letter that can be used after a single dash. -func Int64VarP(p *int64, name, shorthand string, value int64, usage string) { - CommandLine.VarP(newInt64Value(value, p), name, shorthand, usage) -} - -// Int64 defines an int64 flag with specified name, default value, and usage string. -// The return value is the address of an int64 variable that stores the value of the flag. -func (f *FlagSet) Int64(name string, value int64, usage string) *int64 { - p := new(int64) - f.Int64VarP(p, name, "", value, usage) - return p -} - -// Int64P is like Int64, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Int64P(name, shorthand string, value int64, usage string) *int64 { - p := new(int64) - f.Int64VarP(p, name, shorthand, value, usage) - return p -} - -// Int64 defines an int64 flag with specified name, default value, and usage string. -// The return value is the address of an int64 variable that stores the value of the flag. -func Int64(name string, value int64, usage string) *int64 { - return CommandLine.Int64P(name, "", value, usage) -} - -// Int64P is like Int64, but accepts a shorthand letter that can be used after a single dash. -func Int64P(name, shorthand string, value int64, usage string) *int64 { - return CommandLine.Int64P(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/int8.go b/vendor/github.com/spf13/pflag/int8.go deleted file mode 100644 index 4da9222..0000000 --- a/vendor/github.com/spf13/pflag/int8.go +++ /dev/null @@ -1,88 +0,0 @@ -package pflag - -import "strconv" - -// -- int8 Value -type int8Value int8 - -func newInt8Value(val int8, p *int8) *int8Value { - *p = val - return (*int8Value)(p) -} - -func (i *int8Value) Set(s string) error { - v, err := strconv.ParseInt(s, 0, 8) - *i = int8Value(v) - return err -} - -func (i *int8Value) Type() string { - return "int8" -} - -func (i *int8Value) String() string { return strconv.FormatInt(int64(*i), 10) } - -func int8Conv(sval string) (interface{}, error) { - v, err := strconv.ParseInt(sval, 0, 8) - if err != nil { - return 0, err - } - return int8(v), nil -} - -// GetInt8 return the int8 value of a flag with the given name -func (f *FlagSet) GetInt8(name string) (int8, error) { - val, err := f.getFlagType(name, "int8", int8Conv) - if err != nil { - return 0, err - } - return val.(int8), nil -} - -// Int8Var defines an int8 flag with specified name, default value, and usage string. -// The argument p points to an int8 variable in which to store the value of the flag. -func (f *FlagSet) Int8Var(p *int8, name string, value int8, usage string) { - f.VarP(newInt8Value(value, p), name, "", usage) -} - -// Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Int8VarP(p *int8, name, shorthand string, value int8, usage string) { - f.VarP(newInt8Value(value, p), name, shorthand, usage) -} - -// Int8Var defines an int8 flag with specified name, default value, and usage string. -// The argument p points to an int8 variable in which to store the value of the flag. -func Int8Var(p *int8, name string, value int8, usage string) { - CommandLine.VarP(newInt8Value(value, p), name, "", usage) -} - -// Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash. -func Int8VarP(p *int8, name, shorthand string, value int8, usage string) { - CommandLine.VarP(newInt8Value(value, p), name, shorthand, usage) -} - -// Int8 defines an int8 flag with specified name, default value, and usage string. -// The return value is the address of an int8 variable that stores the value of the flag. -func (f *FlagSet) Int8(name string, value int8, usage string) *int8 { - p := new(int8) - f.Int8VarP(p, name, "", value, usage) - return p -} - -// Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Int8P(name, shorthand string, value int8, usage string) *int8 { - p := new(int8) - f.Int8VarP(p, name, shorthand, value, usage) - return p -} - -// Int8 defines an int8 flag with specified name, default value, and usage string. -// The return value is the address of an int8 variable that stores the value of the flag. -func Int8(name string, value int8, usage string) *int8 { - return CommandLine.Int8P(name, "", value, usage) -} - -// Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash. -func Int8P(name, shorthand string, value int8, usage string) *int8 { - return CommandLine.Int8P(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/int_slice.go b/vendor/github.com/spf13/pflag/int_slice.go deleted file mode 100644 index 1e7c9ed..0000000 --- a/vendor/github.com/spf13/pflag/int_slice.go +++ /dev/null @@ -1,128 +0,0 @@ -package pflag - -import ( - "fmt" - "strconv" - "strings" -) - -// -- intSlice Value -type intSliceValue struct { - value *[]int - changed bool -} - -func newIntSliceValue(val []int, p *[]int) *intSliceValue { - isv := new(intSliceValue) - isv.value = p - *isv.value = val - return isv -} - -func (s *intSliceValue) Set(val string) error { - ss := strings.Split(val, ",") - out := make([]int, len(ss)) - for i, d := range ss { - var err error - out[i], err = strconv.Atoi(d) - if err != nil { - return err - } - - } - if !s.changed { - *s.value = out - } else { - *s.value = append(*s.value, out...) - } - s.changed = true - return nil -} - -func (s *intSliceValue) Type() string { - return "intSlice" -} - -func (s *intSliceValue) String() string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = fmt.Sprintf("%d", d) - } - return "[" + strings.Join(out, ",") + "]" -} - -func intSliceConv(val string) (interface{}, error) { - val = strings.Trim(val, "[]") - // Empty string would cause a slice with one (empty) entry - if len(val) == 0 { - return []int{}, nil - } - ss := strings.Split(val, ",") - out := make([]int, len(ss)) - for i, d := range ss { - var err error - out[i], err = strconv.Atoi(d) - if err != nil { - return nil, err - } - - } - return out, nil -} - -// GetIntSlice return the []int value of a flag with the given name -func (f *FlagSet) GetIntSlice(name string) ([]int, error) { - val, err := f.getFlagType(name, "intSlice", intSliceConv) - if err != nil { - return []int{}, err - } - return val.([]int), nil -} - -// IntSliceVar defines a intSlice flag with specified name, default value, and usage string. -// The argument p points to a []int variable in which to store the value of the flag. -func (f *FlagSet) IntSliceVar(p *[]int, name string, value []int, usage string) { - f.VarP(newIntSliceValue(value, p), name, "", usage) -} - -// IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) { - f.VarP(newIntSliceValue(value, p), name, shorthand, usage) -} - -// IntSliceVar defines a int[] flag with specified name, default value, and usage string. -// The argument p points to a int[] variable in which to store the value of the flag. -func IntSliceVar(p *[]int, name string, value []int, usage string) { - CommandLine.VarP(newIntSliceValue(value, p), name, "", usage) -} - -// IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash. -func IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) { - CommandLine.VarP(newIntSliceValue(value, p), name, shorthand, usage) -} - -// IntSlice defines a []int flag with specified name, default value, and usage string. -// The return value is the address of a []int variable that stores the value of the flag. -func (f *FlagSet) IntSlice(name string, value []int, usage string) *[]int { - p := []int{} - f.IntSliceVarP(&p, name, "", value, usage) - return &p -} - -// IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) IntSliceP(name, shorthand string, value []int, usage string) *[]int { - p := []int{} - f.IntSliceVarP(&p, name, shorthand, value, usage) - return &p -} - -// IntSlice defines a []int flag with specified name, default value, and usage string. -// The return value is the address of a []int variable that stores the value of the flag. -func IntSlice(name string, value []int, usage string) *[]int { - return CommandLine.IntSliceP(name, "", value, usage) -} - -// IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash. -func IntSliceP(name, shorthand string, value []int, usage string) *[]int { - return CommandLine.IntSliceP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/ip.go b/vendor/github.com/spf13/pflag/ip.go deleted file mode 100644 index 3d414ba..0000000 --- a/vendor/github.com/spf13/pflag/ip.go +++ /dev/null @@ -1,94 +0,0 @@ -package pflag - -import ( - "fmt" - "net" - "strings" -) - -// -- net.IP value -type ipValue net.IP - -func newIPValue(val net.IP, p *net.IP) *ipValue { - *p = val - return (*ipValue)(p) -} - -func (i *ipValue) String() string { return net.IP(*i).String() } -func (i *ipValue) Set(s string) error { - ip := net.ParseIP(strings.TrimSpace(s)) - if ip == nil { - return fmt.Errorf("failed to parse IP: %q", s) - } - *i = ipValue(ip) - return nil -} - -func (i *ipValue) Type() string { - return "ip" -} - -func ipConv(sval string) (interface{}, error) { - ip := net.ParseIP(sval) - if ip != nil { - return ip, nil - } - return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval) -} - -// GetIP return the net.IP value of a flag with the given name -func (f *FlagSet) GetIP(name string) (net.IP, error) { - val, err := f.getFlagType(name, "ip", ipConv) - if err != nil { - return nil, err - } - return val.(net.IP), nil -} - -// IPVar defines an net.IP flag with specified name, default value, and usage string. -// The argument p points to an net.IP variable in which to store the value of the flag. -func (f *FlagSet) IPVar(p *net.IP, name string, value net.IP, usage string) { - f.VarP(newIPValue(value, p), name, "", usage) -} - -// IPVarP is like IPVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) { - f.VarP(newIPValue(value, p), name, shorthand, usage) -} - -// IPVar defines an net.IP flag with specified name, default value, and usage string. -// The argument p points to an net.IP variable in which to store the value of the flag. -func IPVar(p *net.IP, name string, value net.IP, usage string) { - CommandLine.VarP(newIPValue(value, p), name, "", usage) -} - -// IPVarP is like IPVar, but accepts a shorthand letter that can be used after a single dash. -func IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) { - CommandLine.VarP(newIPValue(value, p), name, shorthand, usage) -} - -// IP defines an net.IP flag with specified name, default value, and usage string. -// The return value is the address of an net.IP variable that stores the value of the flag. -func (f *FlagSet) IP(name string, value net.IP, usage string) *net.IP { - p := new(net.IP) - f.IPVarP(p, name, "", value, usage) - return p -} - -// IPP is like IP, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) IPP(name, shorthand string, value net.IP, usage string) *net.IP { - p := new(net.IP) - f.IPVarP(p, name, shorthand, value, usage) - return p -} - -// IP defines an net.IP flag with specified name, default value, and usage string. -// The return value is the address of an net.IP variable that stores the value of the flag. -func IP(name string, value net.IP, usage string) *net.IP { - return CommandLine.IPP(name, "", value, usage) -} - -// IPP is like IP, but accepts a shorthand letter that can be used after a single dash. -func IPP(name, shorthand string, value net.IP, usage string) *net.IP { - return CommandLine.IPP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/ip_slice.go b/vendor/github.com/spf13/pflag/ip_slice.go deleted file mode 100644 index 7dd196f..0000000 --- a/vendor/github.com/spf13/pflag/ip_slice.go +++ /dev/null @@ -1,148 +0,0 @@ -package pflag - -import ( - "fmt" - "io" - "net" - "strings" -) - -// -- ipSlice Value -type ipSliceValue struct { - value *[]net.IP - changed bool -} - -func newIPSliceValue(val []net.IP, p *[]net.IP) *ipSliceValue { - ipsv := new(ipSliceValue) - ipsv.value = p - *ipsv.value = val - return ipsv -} - -// Set converts, and assigns, the comma-separated IP argument string representation as the []net.IP value of this flag. -// If Set is called on a flag that already has a []net.IP assigned, the newly converted values will be appended. -func (s *ipSliceValue) Set(val string) error { - - // remove all quote characters - rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "") - - // read flag arguments with CSV parser - ipStrSlice, err := readAsCSV(rmQuote.Replace(val)) - if err != nil && err != io.EOF { - return err - } - - // parse ip values into slice - out := make([]net.IP, 0, len(ipStrSlice)) - for _, ipStr := range ipStrSlice { - ip := net.ParseIP(strings.TrimSpace(ipStr)) - if ip == nil { - return fmt.Errorf("invalid string being converted to IP address: %s", ipStr) - } - out = append(out, ip) - } - - if !s.changed { - *s.value = out - } else { - *s.value = append(*s.value, out...) - } - - s.changed = true - - return nil -} - -// Type returns a string that uniquely represents this flag's type. -func (s *ipSliceValue) Type() string { - return "ipSlice" -} - -// String defines a "native" format for this net.IP slice flag value. -func (s *ipSliceValue) String() string { - - ipStrSlice := make([]string, len(*s.value)) - for i, ip := range *s.value { - ipStrSlice[i] = ip.String() - } - - out, _ := writeAsCSV(ipStrSlice) - - return "[" + out + "]" -} - -func ipSliceConv(val string) (interface{}, error) { - val = strings.Trim(val, "[]") - // Emtpy string would cause a slice with one (empty) entry - if len(val) == 0 { - return []net.IP{}, nil - } - ss := strings.Split(val, ",") - out := make([]net.IP, len(ss)) - for i, sval := range ss { - ip := net.ParseIP(strings.TrimSpace(sval)) - if ip == nil { - return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval) - } - out[i] = ip - } - return out, nil -} - -// GetIPSlice returns the []net.IP value of a flag with the given name -func (f *FlagSet) GetIPSlice(name string) ([]net.IP, error) { - val, err := f.getFlagType(name, "ipSlice", ipSliceConv) - if err != nil { - return []net.IP{}, err - } - return val.([]net.IP), nil -} - -// IPSliceVar defines a ipSlice flag with specified name, default value, and usage string. -// The argument p points to a []net.IP variable in which to store the value of the flag. -func (f *FlagSet) IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) { - f.VarP(newIPSliceValue(value, p), name, "", usage) -} - -// IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) { - f.VarP(newIPSliceValue(value, p), name, shorthand, usage) -} - -// IPSliceVar defines a []net.IP flag with specified name, default value, and usage string. -// The argument p points to a []net.IP variable in which to store the value of the flag. -func IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) { - CommandLine.VarP(newIPSliceValue(value, p), name, "", usage) -} - -// IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash. -func IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) { - CommandLine.VarP(newIPSliceValue(value, p), name, shorthand, usage) -} - -// IPSlice defines a []net.IP flag with specified name, default value, and usage string. -// The return value is the address of a []net.IP variable that stores the value of that flag. -func (f *FlagSet) IPSlice(name string, value []net.IP, usage string) *[]net.IP { - p := []net.IP{} - f.IPSliceVarP(&p, name, "", value, usage) - return &p -} - -// IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP { - p := []net.IP{} - f.IPSliceVarP(&p, name, shorthand, value, usage) - return &p -} - -// IPSlice defines a []net.IP flag with specified name, default value, and usage string. -// The return value is the address of a []net.IP variable that stores the value of the flag. -func IPSlice(name string, value []net.IP, usage string) *[]net.IP { - return CommandLine.IPSliceP(name, "", value, usage) -} - -// IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash. -func IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP { - return CommandLine.IPSliceP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/ipmask.go b/vendor/github.com/spf13/pflag/ipmask.go deleted file mode 100644 index 5bd44bd..0000000 --- a/vendor/github.com/spf13/pflag/ipmask.go +++ /dev/null @@ -1,122 +0,0 @@ -package pflag - -import ( - "fmt" - "net" - "strconv" -) - -// -- net.IPMask value -type ipMaskValue net.IPMask - -func newIPMaskValue(val net.IPMask, p *net.IPMask) *ipMaskValue { - *p = val - return (*ipMaskValue)(p) -} - -func (i *ipMaskValue) String() string { return net.IPMask(*i).String() } -func (i *ipMaskValue) Set(s string) error { - ip := ParseIPv4Mask(s) - if ip == nil { - return fmt.Errorf("failed to parse IP mask: %q", s) - } - *i = ipMaskValue(ip) - return nil -} - -func (i *ipMaskValue) Type() string { - return "ipMask" -} - -// ParseIPv4Mask written in IP form (e.g. 255.255.255.0). -// This function should really belong to the net package. -func ParseIPv4Mask(s string) net.IPMask { - mask := net.ParseIP(s) - if mask == nil { - if len(s) != 8 { - return nil - } - // net.IPMask.String() actually outputs things like ffffff00 - // so write a horrible parser for that as well :-( - m := []int{} - for i := 0; i < 4; i++ { - b := "0x" + s[2*i:2*i+2] - d, err := strconv.ParseInt(b, 0, 0) - if err != nil { - return nil - } - m = append(m, int(d)) - } - s := fmt.Sprintf("%d.%d.%d.%d", m[0], m[1], m[2], m[3]) - mask = net.ParseIP(s) - if mask == nil { - return nil - } - } - return net.IPv4Mask(mask[12], mask[13], mask[14], mask[15]) -} - -func parseIPv4Mask(sval string) (interface{}, error) { - mask := ParseIPv4Mask(sval) - if mask == nil { - return nil, fmt.Errorf("unable to parse %s as net.IPMask", sval) - } - return mask, nil -} - -// GetIPv4Mask return the net.IPv4Mask value of a flag with the given name -func (f *FlagSet) GetIPv4Mask(name string) (net.IPMask, error) { - val, err := f.getFlagType(name, "ipMask", parseIPv4Mask) - if err != nil { - return nil, err - } - return val.(net.IPMask), nil -} - -// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string. -// The argument p points to an net.IPMask variable in which to store the value of the flag. -func (f *FlagSet) IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) { - f.VarP(newIPMaskValue(value, p), name, "", usage) -} - -// IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) { - f.VarP(newIPMaskValue(value, p), name, shorthand, usage) -} - -// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string. -// The argument p points to an net.IPMask variable in which to store the value of the flag. -func IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) { - CommandLine.VarP(newIPMaskValue(value, p), name, "", usage) -} - -// IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash. -func IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) { - CommandLine.VarP(newIPMaskValue(value, p), name, shorthand, usage) -} - -// IPMask defines an net.IPMask flag with specified name, default value, and usage string. -// The return value is the address of an net.IPMask variable that stores the value of the flag. -func (f *FlagSet) IPMask(name string, value net.IPMask, usage string) *net.IPMask { - p := new(net.IPMask) - f.IPMaskVarP(p, name, "", value, usage) - return p -} - -// IPMaskP is like IPMask, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask { - p := new(net.IPMask) - f.IPMaskVarP(p, name, shorthand, value, usage) - return p -} - -// IPMask defines an net.IPMask flag with specified name, default value, and usage string. -// The return value is the address of an net.IPMask variable that stores the value of the flag. -func IPMask(name string, value net.IPMask, usage string) *net.IPMask { - return CommandLine.IPMaskP(name, "", value, usage) -} - -// IPMaskP is like IP, but accepts a shorthand letter that can be used after a single dash. -func IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask { - return CommandLine.IPMaskP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/ipnet.go b/vendor/github.com/spf13/pflag/ipnet.go deleted file mode 100644 index e2c1b8b..0000000 --- a/vendor/github.com/spf13/pflag/ipnet.go +++ /dev/null @@ -1,98 +0,0 @@ -package pflag - -import ( - "fmt" - "net" - "strings" -) - -// IPNet adapts net.IPNet for use as a flag. -type ipNetValue net.IPNet - -func (ipnet ipNetValue) String() string { - n := net.IPNet(ipnet) - return n.String() -} - -func (ipnet *ipNetValue) Set(value string) error { - _, n, err := net.ParseCIDR(strings.TrimSpace(value)) - if err != nil { - return err - } - *ipnet = ipNetValue(*n) - return nil -} - -func (*ipNetValue) Type() string { - return "ipNet" -} - -func newIPNetValue(val net.IPNet, p *net.IPNet) *ipNetValue { - *p = val - return (*ipNetValue)(p) -} - -func ipNetConv(sval string) (interface{}, error) { - _, n, err := net.ParseCIDR(strings.TrimSpace(sval)) - if err == nil { - return *n, nil - } - return nil, fmt.Errorf("invalid string being converted to IPNet: %s", sval) -} - -// GetIPNet return the net.IPNet value of a flag with the given name -func (f *FlagSet) GetIPNet(name string) (net.IPNet, error) { - val, err := f.getFlagType(name, "ipNet", ipNetConv) - if err != nil { - return net.IPNet{}, err - } - return val.(net.IPNet), nil -} - -// IPNetVar defines an net.IPNet flag with specified name, default value, and usage string. -// The argument p points to an net.IPNet variable in which to store the value of the flag. -func (f *FlagSet) IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) { - f.VarP(newIPNetValue(value, p), name, "", usage) -} - -// IPNetVarP is like IPNetVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) IPNetVarP(p *net.IPNet, name, shorthand string, value net.IPNet, usage string) { - f.VarP(newIPNetValue(value, p), name, shorthand, usage) -} - -// IPNetVar defines an net.IPNet flag with specified name, default value, and usage string. -// The argument p points to an net.IPNet variable in which to store the value of the flag. -func IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) { - CommandLine.VarP(newIPNetValue(value, p), name, "", usage) -} - -// IPNetVarP is like IPNetVar, but accepts a shorthand letter that can be used after a single dash. -func IPNetVarP(p *net.IPNet, name, shorthand string, value net.IPNet, usage string) { - CommandLine.VarP(newIPNetValue(value, p), name, shorthand, usage) -} - -// IPNet defines an net.IPNet flag with specified name, default value, and usage string. -// The return value is the address of an net.IPNet variable that stores the value of the flag. -func (f *FlagSet) IPNet(name string, value net.IPNet, usage string) *net.IPNet { - p := new(net.IPNet) - f.IPNetVarP(p, name, "", value, usage) - return p -} - -// IPNetP is like IPNet, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) IPNetP(name, shorthand string, value net.IPNet, usage string) *net.IPNet { - p := new(net.IPNet) - f.IPNetVarP(p, name, shorthand, value, usage) - return p -} - -// IPNet defines an net.IPNet flag with specified name, default value, and usage string. -// The return value is the address of an net.IPNet variable that stores the value of the flag. -func IPNet(name string, value net.IPNet, usage string) *net.IPNet { - return CommandLine.IPNetP(name, "", value, usage) -} - -// IPNetP is like IPNet, but accepts a shorthand letter that can be used after a single dash. -func IPNetP(name, shorthand string, value net.IPNet, usage string) *net.IPNet { - return CommandLine.IPNetP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/string.go b/vendor/github.com/spf13/pflag/string.go deleted file mode 100644 index 04e0a26..0000000 --- a/vendor/github.com/spf13/pflag/string.go +++ /dev/null @@ -1,80 +0,0 @@ -package pflag - -// -- string Value -type stringValue string - -func newStringValue(val string, p *string) *stringValue { - *p = val - return (*stringValue)(p) -} - -func (s *stringValue) Set(val string) error { - *s = stringValue(val) - return nil -} -func (s *stringValue) Type() string { - return "string" -} - -func (s *stringValue) String() string { return string(*s) } - -func stringConv(sval string) (interface{}, error) { - return sval, nil -} - -// GetString return the string value of a flag with the given name -func (f *FlagSet) GetString(name string) (string, error) { - val, err := f.getFlagType(name, "string", stringConv) - if err != nil { - return "", err - } - return val.(string), nil -} - -// StringVar defines a string flag with specified name, default value, and usage string. -// The argument p points to a string variable in which to store the value of the flag. -func (f *FlagSet) StringVar(p *string, name string, value string, usage string) { - f.VarP(newStringValue(value, p), name, "", usage) -} - -// StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) StringVarP(p *string, name, shorthand string, value string, usage string) { - f.VarP(newStringValue(value, p), name, shorthand, usage) -} - -// StringVar defines a string flag with specified name, default value, and usage string. -// The argument p points to a string variable in which to store the value of the flag. -func StringVar(p *string, name string, value string, usage string) { - CommandLine.VarP(newStringValue(value, p), name, "", usage) -} - -// StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash. -func StringVarP(p *string, name, shorthand string, value string, usage string) { - CommandLine.VarP(newStringValue(value, p), name, shorthand, usage) -} - -// String defines a string flag with specified name, default value, and usage string. -// The return value is the address of a string variable that stores the value of the flag. -func (f *FlagSet) String(name string, value string, usage string) *string { - p := new(string) - f.StringVarP(p, name, "", value, usage) - return p -} - -// StringP is like String, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) StringP(name, shorthand string, value string, usage string) *string { - p := new(string) - f.StringVarP(p, name, shorthand, value, usage) - return p -} - -// String defines a string flag with specified name, default value, and usage string. -// The return value is the address of a string variable that stores the value of the flag. -func String(name string, value string, usage string) *string { - return CommandLine.StringP(name, "", value, usage) -} - -// StringP is like String, but accepts a shorthand letter that can be used after a single dash. -func StringP(name, shorthand string, value string, usage string) *string { - return CommandLine.StringP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/string_array.go b/vendor/github.com/spf13/pflag/string_array.go deleted file mode 100644 index fa7bc60..0000000 --- a/vendor/github.com/spf13/pflag/string_array.go +++ /dev/null @@ -1,103 +0,0 @@ -package pflag - -// -- stringArray Value -type stringArrayValue struct { - value *[]string - changed bool -} - -func newStringArrayValue(val []string, p *[]string) *stringArrayValue { - ssv := new(stringArrayValue) - ssv.value = p - *ssv.value = val - return ssv -} - -func (s *stringArrayValue) Set(val string) error { - if !s.changed { - *s.value = []string{val} - s.changed = true - } else { - *s.value = append(*s.value, val) - } - return nil -} - -func (s *stringArrayValue) Type() string { - return "stringArray" -} - -func (s *stringArrayValue) String() string { - str, _ := writeAsCSV(*s.value) - return "[" + str + "]" -} - -func stringArrayConv(sval string) (interface{}, error) { - sval = sval[1 : len(sval)-1] - // An empty string would cause a array with one (empty) string - if len(sval) == 0 { - return []string{}, nil - } - return readAsCSV(sval) -} - -// GetStringArray return the []string value of a flag with the given name -func (f *FlagSet) GetStringArray(name string) ([]string, error) { - val, err := f.getFlagType(name, "stringArray", stringArrayConv) - if err != nil { - return []string{}, err - } - return val.([]string), nil -} - -// StringArrayVar defines a string flag with specified name, default value, and usage string. -// The argument p points to a []string variable in which to store the values of the multiple flags. -// The value of each argument will not try to be separated by comma. Use a StringSlice for that. -func (f *FlagSet) StringArrayVar(p *[]string, name string, value []string, usage string) { - f.VarP(newStringArrayValue(value, p), name, "", usage) -} - -// StringArrayVarP is like StringArrayVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) StringArrayVarP(p *[]string, name, shorthand string, value []string, usage string) { - f.VarP(newStringArrayValue(value, p), name, shorthand, usage) -} - -// StringArrayVar defines a string flag with specified name, default value, and usage string. -// The argument p points to a []string variable in which to store the value of the flag. -// The value of each argument will not try to be separated by comma. Use a StringSlice for that. -func StringArrayVar(p *[]string, name string, value []string, usage string) { - CommandLine.VarP(newStringArrayValue(value, p), name, "", usage) -} - -// StringArrayVarP is like StringArrayVar, but accepts a shorthand letter that can be used after a single dash. -func StringArrayVarP(p *[]string, name, shorthand string, value []string, usage string) { - CommandLine.VarP(newStringArrayValue(value, p), name, shorthand, usage) -} - -// StringArray defines a string flag with specified name, default value, and usage string. -// The return value is the address of a []string variable that stores the value of the flag. -// The value of each argument will not try to be separated by comma. Use a StringSlice for that. -func (f *FlagSet) StringArray(name string, value []string, usage string) *[]string { - p := []string{} - f.StringArrayVarP(&p, name, "", value, usage) - return &p -} - -// StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) StringArrayP(name, shorthand string, value []string, usage string) *[]string { - p := []string{} - f.StringArrayVarP(&p, name, shorthand, value, usage) - return &p -} - -// StringArray defines a string flag with specified name, default value, and usage string. -// The return value is the address of a []string variable that stores the value of the flag. -// The value of each argument will not try to be separated by comma. Use a StringSlice for that. -func StringArray(name string, value []string, usage string) *[]string { - return CommandLine.StringArrayP(name, "", value, usage) -} - -// StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash. -func StringArrayP(name, shorthand string, value []string, usage string) *[]string { - return CommandLine.StringArrayP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/string_slice.go b/vendor/github.com/spf13/pflag/string_slice.go deleted file mode 100644 index 0cd3ccc..0000000 --- a/vendor/github.com/spf13/pflag/string_slice.go +++ /dev/null @@ -1,149 +0,0 @@ -package pflag - -import ( - "bytes" - "encoding/csv" - "strings" -) - -// -- stringSlice Value -type stringSliceValue struct { - value *[]string - changed bool -} - -func newStringSliceValue(val []string, p *[]string) *stringSliceValue { - ssv := new(stringSliceValue) - ssv.value = p - *ssv.value = val - return ssv -} - -func readAsCSV(val string) ([]string, error) { - if val == "" { - return []string{}, nil - } - stringReader := strings.NewReader(val) - csvReader := csv.NewReader(stringReader) - return csvReader.Read() -} - -func writeAsCSV(vals []string) (string, error) { - b := &bytes.Buffer{} - w := csv.NewWriter(b) - err := w.Write(vals) - if err != nil { - return "", err - } - w.Flush() - return strings.TrimSuffix(b.String(), "\n"), nil -} - -func (s *stringSliceValue) Set(val string) error { - v, err := readAsCSV(val) - if err != nil { - return err - } - if !s.changed { - *s.value = v - } else { - *s.value = append(*s.value, v...) - } - s.changed = true - return nil -} - -func (s *stringSliceValue) Type() string { - return "stringSlice" -} - -func (s *stringSliceValue) String() string { - str, _ := writeAsCSV(*s.value) - return "[" + str + "]" -} - -func stringSliceConv(sval string) (interface{}, error) { - sval = sval[1 : len(sval)-1] - // An empty string would cause a slice with one (empty) string - if len(sval) == 0 { - return []string{}, nil - } - return readAsCSV(sval) -} - -// GetStringSlice return the []string value of a flag with the given name -func (f *FlagSet) GetStringSlice(name string) ([]string, error) { - val, err := f.getFlagType(name, "stringSlice", stringSliceConv) - if err != nil { - return []string{}, err - } - return val.([]string), nil -} - -// StringSliceVar defines a string flag with specified name, default value, and usage string. -// The argument p points to a []string variable in which to store the value of the flag. -// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. -// For example: -// --ss="v1,v2" -ss="v3" -// will result in -// []string{"v1", "v2", "v3"} -func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string) { - f.VarP(newStringSliceValue(value, p), name, "", usage) -} - -// StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) { - f.VarP(newStringSliceValue(value, p), name, shorthand, usage) -} - -// StringSliceVar defines a string flag with specified name, default value, and usage string. -// The argument p points to a []string variable in which to store the value of the flag. -// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. -// For example: -// --ss="v1,v2" -ss="v3" -// will result in -// []string{"v1", "v2", "v3"} -func StringSliceVar(p *[]string, name string, value []string, usage string) { - CommandLine.VarP(newStringSliceValue(value, p), name, "", usage) -} - -// StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash. -func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) { - CommandLine.VarP(newStringSliceValue(value, p), name, shorthand, usage) -} - -// StringSlice defines a string flag with specified name, default value, and usage string. -// The return value is the address of a []string variable that stores the value of the flag. -// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. -// For example: -// --ss="v1,v2" -ss="v3" -// will result in -// []string{"v1", "v2", "v3"} -func (f *FlagSet) StringSlice(name string, value []string, usage string) *[]string { - p := []string{} - f.StringSliceVarP(&p, name, "", value, usage) - return &p -} - -// StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) StringSliceP(name, shorthand string, value []string, usage string) *[]string { - p := []string{} - f.StringSliceVarP(&p, name, shorthand, value, usage) - return &p -} - -// StringSlice defines a string flag with specified name, default value, and usage string. -// The return value is the address of a []string variable that stores the value of the flag. -// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. -// For example: -// --ss="v1,v2" -ss="v3" -// will result in -// []string{"v1", "v2", "v3"} -func StringSlice(name string, value []string, usage string) *[]string { - return CommandLine.StringSliceP(name, "", value, usage) -} - -// StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash. -func StringSliceP(name, shorthand string, value []string, usage string) *[]string { - return CommandLine.StringSliceP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/uint.go b/vendor/github.com/spf13/pflag/uint.go deleted file mode 100644 index dcbc2b7..0000000 --- a/vendor/github.com/spf13/pflag/uint.go +++ /dev/null @@ -1,88 +0,0 @@ -package pflag - -import "strconv" - -// -- uint Value -type uintValue uint - -func newUintValue(val uint, p *uint) *uintValue { - *p = val - return (*uintValue)(p) -} - -func (i *uintValue) Set(s string) error { - v, err := strconv.ParseUint(s, 0, 64) - *i = uintValue(v) - return err -} - -func (i *uintValue) Type() string { - return "uint" -} - -func (i *uintValue) String() string { return strconv.FormatUint(uint64(*i), 10) } - -func uintConv(sval string) (interface{}, error) { - v, err := strconv.ParseUint(sval, 0, 0) - if err != nil { - return 0, err - } - return uint(v), nil -} - -// GetUint return the uint value of a flag with the given name -func (f *FlagSet) GetUint(name string) (uint, error) { - val, err := f.getFlagType(name, "uint", uintConv) - if err != nil { - return 0, err - } - return val.(uint), nil -} - -// UintVar defines a uint flag with specified name, default value, and usage string. -// The argument p points to a uint variable in which to store the value of the flag. -func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string) { - f.VarP(newUintValue(value, p), name, "", usage) -} - -// UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) UintVarP(p *uint, name, shorthand string, value uint, usage string) { - f.VarP(newUintValue(value, p), name, shorthand, usage) -} - -// UintVar defines a uint flag with specified name, default value, and usage string. -// The argument p points to a uint variable in which to store the value of the flag. -func UintVar(p *uint, name string, value uint, usage string) { - CommandLine.VarP(newUintValue(value, p), name, "", usage) -} - -// UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash. -func UintVarP(p *uint, name, shorthand string, value uint, usage string) { - CommandLine.VarP(newUintValue(value, p), name, shorthand, usage) -} - -// Uint defines a uint flag with specified name, default value, and usage string. -// The return value is the address of a uint variable that stores the value of the flag. -func (f *FlagSet) Uint(name string, value uint, usage string) *uint { - p := new(uint) - f.UintVarP(p, name, "", value, usage) - return p -} - -// UintP is like Uint, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) UintP(name, shorthand string, value uint, usage string) *uint { - p := new(uint) - f.UintVarP(p, name, shorthand, value, usage) - return p -} - -// Uint defines a uint flag with specified name, default value, and usage string. -// The return value is the address of a uint variable that stores the value of the flag. -func Uint(name string, value uint, usage string) *uint { - return CommandLine.UintP(name, "", value, usage) -} - -// UintP is like Uint, but accepts a shorthand letter that can be used after a single dash. -func UintP(name, shorthand string, value uint, usage string) *uint { - return CommandLine.UintP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/uint16.go b/vendor/github.com/spf13/pflag/uint16.go deleted file mode 100644 index 7e9914e..0000000 --- a/vendor/github.com/spf13/pflag/uint16.go +++ /dev/null @@ -1,88 +0,0 @@ -package pflag - -import "strconv" - -// -- uint16 value -type uint16Value uint16 - -func newUint16Value(val uint16, p *uint16) *uint16Value { - *p = val - return (*uint16Value)(p) -} - -func (i *uint16Value) Set(s string) error { - v, err := strconv.ParseUint(s, 0, 16) - *i = uint16Value(v) - return err -} - -func (i *uint16Value) Type() string { - return "uint16" -} - -func (i *uint16Value) String() string { return strconv.FormatUint(uint64(*i), 10) } - -func uint16Conv(sval string) (interface{}, error) { - v, err := strconv.ParseUint(sval, 0, 16) - if err != nil { - return 0, err - } - return uint16(v), nil -} - -// GetUint16 return the uint16 value of a flag with the given name -func (f *FlagSet) GetUint16(name string) (uint16, error) { - val, err := f.getFlagType(name, "uint16", uint16Conv) - if err != nil { - return 0, err - } - return val.(uint16), nil -} - -// Uint16Var defines a uint flag with specified name, default value, and usage string. -// The argument p points to a uint variable in which to store the value of the flag. -func (f *FlagSet) Uint16Var(p *uint16, name string, value uint16, usage string) { - f.VarP(newUint16Value(value, p), name, "", usage) -} - -// Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) { - f.VarP(newUint16Value(value, p), name, shorthand, usage) -} - -// Uint16Var defines a uint flag with specified name, default value, and usage string. -// The argument p points to a uint variable in which to store the value of the flag. -func Uint16Var(p *uint16, name string, value uint16, usage string) { - CommandLine.VarP(newUint16Value(value, p), name, "", usage) -} - -// Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash. -func Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) { - CommandLine.VarP(newUint16Value(value, p), name, shorthand, usage) -} - -// Uint16 defines a uint flag with specified name, default value, and usage string. -// The return value is the address of a uint variable that stores the value of the flag. -func (f *FlagSet) Uint16(name string, value uint16, usage string) *uint16 { - p := new(uint16) - f.Uint16VarP(p, name, "", value, usage) - return p -} - -// Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Uint16P(name, shorthand string, value uint16, usage string) *uint16 { - p := new(uint16) - f.Uint16VarP(p, name, shorthand, value, usage) - return p -} - -// Uint16 defines a uint flag with specified name, default value, and usage string. -// The return value is the address of a uint variable that stores the value of the flag. -func Uint16(name string, value uint16, usage string) *uint16 { - return CommandLine.Uint16P(name, "", value, usage) -} - -// Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash. -func Uint16P(name, shorthand string, value uint16, usage string) *uint16 { - return CommandLine.Uint16P(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/uint32.go b/vendor/github.com/spf13/pflag/uint32.go deleted file mode 100644 index d802453..0000000 --- a/vendor/github.com/spf13/pflag/uint32.go +++ /dev/null @@ -1,88 +0,0 @@ -package pflag - -import "strconv" - -// -- uint32 value -type uint32Value uint32 - -func newUint32Value(val uint32, p *uint32) *uint32Value { - *p = val - return (*uint32Value)(p) -} - -func (i *uint32Value) Set(s string) error { - v, err := strconv.ParseUint(s, 0, 32) - *i = uint32Value(v) - return err -} - -func (i *uint32Value) Type() string { - return "uint32" -} - -func (i *uint32Value) String() string { return strconv.FormatUint(uint64(*i), 10) } - -func uint32Conv(sval string) (interface{}, error) { - v, err := strconv.ParseUint(sval, 0, 32) - if err != nil { - return 0, err - } - return uint32(v), nil -} - -// GetUint32 return the uint32 value of a flag with the given name -func (f *FlagSet) GetUint32(name string) (uint32, error) { - val, err := f.getFlagType(name, "uint32", uint32Conv) - if err != nil { - return 0, err - } - return val.(uint32), nil -} - -// Uint32Var defines a uint32 flag with specified name, default value, and usage string. -// The argument p points to a uint32 variable in which to store the value of the flag. -func (f *FlagSet) Uint32Var(p *uint32, name string, value uint32, usage string) { - f.VarP(newUint32Value(value, p), name, "", usage) -} - -// Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) { - f.VarP(newUint32Value(value, p), name, shorthand, usage) -} - -// Uint32Var defines a uint32 flag with specified name, default value, and usage string. -// The argument p points to a uint32 variable in which to store the value of the flag. -func Uint32Var(p *uint32, name string, value uint32, usage string) { - CommandLine.VarP(newUint32Value(value, p), name, "", usage) -} - -// Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash. -func Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) { - CommandLine.VarP(newUint32Value(value, p), name, shorthand, usage) -} - -// Uint32 defines a uint32 flag with specified name, default value, and usage string. -// The return value is the address of a uint32 variable that stores the value of the flag. -func (f *FlagSet) Uint32(name string, value uint32, usage string) *uint32 { - p := new(uint32) - f.Uint32VarP(p, name, "", value, usage) - return p -} - -// Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Uint32P(name, shorthand string, value uint32, usage string) *uint32 { - p := new(uint32) - f.Uint32VarP(p, name, shorthand, value, usage) - return p -} - -// Uint32 defines a uint32 flag with specified name, default value, and usage string. -// The return value is the address of a uint32 variable that stores the value of the flag. -func Uint32(name string, value uint32, usage string) *uint32 { - return CommandLine.Uint32P(name, "", value, usage) -} - -// Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash. -func Uint32P(name, shorthand string, value uint32, usage string) *uint32 { - return CommandLine.Uint32P(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/uint64.go b/vendor/github.com/spf13/pflag/uint64.go deleted file mode 100644 index f62240f..0000000 --- a/vendor/github.com/spf13/pflag/uint64.go +++ /dev/null @@ -1,88 +0,0 @@ -package pflag - -import "strconv" - -// -- uint64 Value -type uint64Value uint64 - -func newUint64Value(val uint64, p *uint64) *uint64Value { - *p = val - return (*uint64Value)(p) -} - -func (i *uint64Value) Set(s string) error { - v, err := strconv.ParseUint(s, 0, 64) - *i = uint64Value(v) - return err -} - -func (i *uint64Value) Type() string { - return "uint64" -} - -func (i *uint64Value) String() string { return strconv.FormatUint(uint64(*i), 10) } - -func uint64Conv(sval string) (interface{}, error) { - v, err := strconv.ParseUint(sval, 0, 64) - if err != nil { - return 0, err - } - return uint64(v), nil -} - -// GetUint64 return the uint64 value of a flag with the given name -func (f *FlagSet) GetUint64(name string) (uint64, error) { - val, err := f.getFlagType(name, "uint64", uint64Conv) - if err != nil { - return 0, err - } - return val.(uint64), nil -} - -// Uint64Var defines a uint64 flag with specified name, default value, and usage string. -// The argument p points to a uint64 variable in which to store the value of the flag. -func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string) { - f.VarP(newUint64Value(value, p), name, "", usage) -} - -// Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) { - f.VarP(newUint64Value(value, p), name, shorthand, usage) -} - -// Uint64Var defines a uint64 flag with specified name, default value, and usage string. -// The argument p points to a uint64 variable in which to store the value of the flag. -func Uint64Var(p *uint64, name string, value uint64, usage string) { - CommandLine.VarP(newUint64Value(value, p), name, "", usage) -} - -// Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash. -func Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) { - CommandLine.VarP(newUint64Value(value, p), name, shorthand, usage) -} - -// Uint64 defines a uint64 flag with specified name, default value, and usage string. -// The return value is the address of a uint64 variable that stores the value of the flag. -func (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64 { - p := new(uint64) - f.Uint64VarP(p, name, "", value, usage) - return p -} - -// Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Uint64P(name, shorthand string, value uint64, usage string) *uint64 { - p := new(uint64) - f.Uint64VarP(p, name, shorthand, value, usage) - return p -} - -// Uint64 defines a uint64 flag with specified name, default value, and usage string. -// The return value is the address of a uint64 variable that stores the value of the flag. -func Uint64(name string, value uint64, usage string) *uint64 { - return CommandLine.Uint64P(name, "", value, usage) -} - -// Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash. -func Uint64P(name, shorthand string, value uint64, usage string) *uint64 { - return CommandLine.Uint64P(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/uint8.go b/vendor/github.com/spf13/pflag/uint8.go deleted file mode 100644 index bb0e83c..0000000 --- a/vendor/github.com/spf13/pflag/uint8.go +++ /dev/null @@ -1,88 +0,0 @@ -package pflag - -import "strconv" - -// -- uint8 Value -type uint8Value uint8 - -func newUint8Value(val uint8, p *uint8) *uint8Value { - *p = val - return (*uint8Value)(p) -} - -func (i *uint8Value) Set(s string) error { - v, err := strconv.ParseUint(s, 0, 8) - *i = uint8Value(v) - return err -} - -func (i *uint8Value) Type() string { - return "uint8" -} - -func (i *uint8Value) String() string { return strconv.FormatUint(uint64(*i), 10) } - -func uint8Conv(sval string) (interface{}, error) { - v, err := strconv.ParseUint(sval, 0, 8) - if err != nil { - return 0, err - } - return uint8(v), nil -} - -// GetUint8 return the uint8 value of a flag with the given name -func (f *FlagSet) GetUint8(name string) (uint8, error) { - val, err := f.getFlagType(name, "uint8", uint8Conv) - if err != nil { - return 0, err - } - return val.(uint8), nil -} - -// Uint8Var defines a uint8 flag with specified name, default value, and usage string. -// The argument p points to a uint8 variable in which to store the value of the flag. -func (f *FlagSet) Uint8Var(p *uint8, name string, value uint8, usage string) { - f.VarP(newUint8Value(value, p), name, "", usage) -} - -// Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) { - f.VarP(newUint8Value(value, p), name, shorthand, usage) -} - -// Uint8Var defines a uint8 flag with specified name, default value, and usage string. -// The argument p points to a uint8 variable in which to store the value of the flag. -func Uint8Var(p *uint8, name string, value uint8, usage string) { - CommandLine.VarP(newUint8Value(value, p), name, "", usage) -} - -// Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash. -func Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) { - CommandLine.VarP(newUint8Value(value, p), name, shorthand, usage) -} - -// Uint8 defines a uint8 flag with specified name, default value, and usage string. -// The return value is the address of a uint8 variable that stores the value of the flag. -func (f *FlagSet) Uint8(name string, value uint8, usage string) *uint8 { - p := new(uint8) - f.Uint8VarP(p, name, "", value, usage) - return p -} - -// Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Uint8P(name, shorthand string, value uint8, usage string) *uint8 { - p := new(uint8) - f.Uint8VarP(p, name, shorthand, value, usage) - return p -} - -// Uint8 defines a uint8 flag with specified name, default value, and usage string. -// The return value is the address of a uint8 variable that stores the value of the flag. -func Uint8(name string, value uint8, usage string) *uint8 { - return CommandLine.Uint8P(name, "", value, usage) -} - -// Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash. -func Uint8P(name, shorthand string, value uint8, usage string) *uint8 { - return CommandLine.Uint8P(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/uint_slice.go b/vendor/github.com/spf13/pflag/uint_slice.go deleted file mode 100644 index edd94c6..0000000 --- a/vendor/github.com/spf13/pflag/uint_slice.go +++ /dev/null @@ -1,126 +0,0 @@ -package pflag - -import ( - "fmt" - "strconv" - "strings" -) - -// -- uintSlice Value -type uintSliceValue struct { - value *[]uint - changed bool -} - -func newUintSliceValue(val []uint, p *[]uint) *uintSliceValue { - uisv := new(uintSliceValue) - uisv.value = p - *uisv.value = val - return uisv -} - -func (s *uintSliceValue) Set(val string) error { - ss := strings.Split(val, ",") - out := make([]uint, len(ss)) - for i, d := range ss { - u, err := strconv.ParseUint(d, 10, 0) - if err != nil { - return err - } - out[i] = uint(u) - } - if !s.changed { - *s.value = out - } else { - *s.value = append(*s.value, out...) - } - s.changed = true - return nil -} - -func (s *uintSliceValue) Type() string { - return "uintSlice" -} - -func (s *uintSliceValue) String() string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = fmt.Sprintf("%d", d) - } - return "[" + strings.Join(out, ",") + "]" -} - -func uintSliceConv(val string) (interface{}, error) { - val = strings.Trim(val, "[]") - // Empty string would cause a slice with one (empty) entry - if len(val) == 0 { - return []uint{}, nil - } - ss := strings.Split(val, ",") - out := make([]uint, len(ss)) - for i, d := range ss { - u, err := strconv.ParseUint(d, 10, 0) - if err != nil { - return nil, err - } - out[i] = uint(u) - } - return out, nil -} - -// GetUintSlice returns the []uint value of a flag with the given name. -func (f *FlagSet) GetUintSlice(name string) ([]uint, error) { - val, err := f.getFlagType(name, "uintSlice", uintSliceConv) - if err != nil { - return []uint{}, err - } - return val.([]uint), nil -} - -// UintSliceVar defines a uintSlice flag with specified name, default value, and usage string. -// The argument p points to a []uint variable in which to store the value of the flag. -func (f *FlagSet) UintSliceVar(p *[]uint, name string, value []uint, usage string) { - f.VarP(newUintSliceValue(value, p), name, "", usage) -} - -// UintSliceVarP is like UintSliceVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) { - f.VarP(newUintSliceValue(value, p), name, shorthand, usage) -} - -// UintSliceVar defines a uint[] flag with specified name, default value, and usage string. -// The argument p points to a uint[] variable in which to store the value of the flag. -func UintSliceVar(p *[]uint, name string, value []uint, usage string) { - CommandLine.VarP(newUintSliceValue(value, p), name, "", usage) -} - -// UintSliceVarP is like the UintSliceVar, but accepts a shorthand letter that can be used after a single dash. -func UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) { - CommandLine.VarP(newUintSliceValue(value, p), name, shorthand, usage) -} - -// UintSlice defines a []uint flag with specified name, default value, and usage string. -// The return value is the address of a []uint variable that stores the value of the flag. -func (f *FlagSet) UintSlice(name string, value []uint, usage string) *[]uint { - p := []uint{} - f.UintSliceVarP(&p, name, "", value, usage) - return &p -} - -// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) UintSliceP(name, shorthand string, value []uint, usage string) *[]uint { - p := []uint{} - f.UintSliceVarP(&p, name, shorthand, value, usage) - return &p -} - -// UintSlice defines a []uint flag with specified name, default value, and usage string. -// The return value is the address of a []uint variable that stores the value of the flag. -func UintSlice(name string, value []uint, usage string) *[]uint { - return CommandLine.UintSliceP(name, "", value, usage) -} - -// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash. -func UintSliceP(name, shorthand string, value []uint, usage string) *[]uint { - return CommandLine.UintSliceP(name, shorthand, value, usage) -} diff --git a/vendor/golang.org/x/crypto/AUTHORS b/vendor/golang.org/x/crypto/AUTHORS deleted file mode 100644 index 2b00ddb..0000000 --- a/vendor/golang.org/x/crypto/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at https://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/crypto/CONTRIBUTORS b/vendor/golang.org/x/crypto/CONTRIBUTORS deleted file mode 100644 index 1fbd3e9..0000000 --- a/vendor/golang.org/x/crypto/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at https://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/crypto/LICENSE b/vendor/golang.org/x/crypto/LICENSE deleted file mode 100644 index 6a66aea..0000000 --- a/vendor/golang.org/x/crypto/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/crypto/PATENTS b/vendor/golang.org/x/crypto/PATENTS deleted file mode 100644 index 7330990..0000000 --- a/vendor/golang.org/x/crypto/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go b/vendor/golang.org/x/crypto/ssh/terminal/terminal.go deleted file mode 100644 index 9a88759..0000000 --- a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go +++ /dev/null @@ -1,951 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package terminal - -import ( - "bytes" - "io" - "sync" - "unicode/utf8" -) - -// EscapeCodes contains escape sequences that can be written to the terminal in -// order to achieve different styles of text. -type EscapeCodes struct { - // Foreground colors - Black, Red, Green, Yellow, Blue, Magenta, Cyan, White []byte - - // Reset all attributes - Reset []byte -} - -var vt100EscapeCodes = EscapeCodes{ - Black: []byte{keyEscape, '[', '3', '0', 'm'}, - Red: []byte{keyEscape, '[', '3', '1', 'm'}, - Green: []byte{keyEscape, '[', '3', '2', 'm'}, - Yellow: []byte{keyEscape, '[', '3', '3', 'm'}, - Blue: []byte{keyEscape, '[', '3', '4', 'm'}, - Magenta: []byte{keyEscape, '[', '3', '5', 'm'}, - Cyan: []byte{keyEscape, '[', '3', '6', 'm'}, - White: []byte{keyEscape, '[', '3', '7', 'm'}, - - Reset: []byte{keyEscape, '[', '0', 'm'}, -} - -// Terminal contains the state for running a VT100 terminal that is capable of -// reading lines of input. -type Terminal struct { - // AutoCompleteCallback, if non-null, is called for each keypress with - // the full input line and the current position of the cursor (in - // bytes, as an index into |line|). If it returns ok=false, the key - // press is processed normally. Otherwise it returns a replacement line - // and the new cursor position. - AutoCompleteCallback func(line string, pos int, key rune) (newLine string, newPos int, ok bool) - - // Escape contains a pointer to the escape codes for this terminal. - // It's always a valid pointer, although the escape codes themselves - // may be empty if the terminal doesn't support them. - Escape *EscapeCodes - - // lock protects the terminal and the state in this object from - // concurrent processing of a key press and a Write() call. - lock sync.Mutex - - c io.ReadWriter - prompt []rune - - // line is the current line being entered. - line []rune - // pos is the logical position of the cursor in line - pos int - // echo is true if local echo is enabled - echo bool - // pasteActive is true iff there is a bracketed paste operation in - // progress. - pasteActive bool - - // cursorX contains the current X value of the cursor where the left - // edge is 0. cursorY contains the row number where the first row of - // the current line is 0. - cursorX, cursorY int - // maxLine is the greatest value of cursorY so far. - maxLine int - - termWidth, termHeight int - - // outBuf contains the terminal data to be sent. - outBuf []byte - // remainder contains the remainder of any partial key sequences after - // a read. It aliases into inBuf. - remainder []byte - inBuf [256]byte - - // history contains previously entered commands so that they can be - // accessed with the up and down keys. - history stRingBuffer - // historyIndex stores the currently accessed history entry, where zero - // means the immediately previous entry. - historyIndex int - // When navigating up and down the history it's possible to return to - // the incomplete, initial line. That value is stored in - // historyPending. - historyPending string -} - -// NewTerminal runs a VT100 terminal on the given ReadWriter. If the ReadWriter is -// a local terminal, that terminal must first have been put into raw mode. -// prompt is a string that is written at the start of each input line (i.e. -// "> "). -func NewTerminal(c io.ReadWriter, prompt string) *Terminal { - return &Terminal{ - Escape: &vt100EscapeCodes, - c: c, - prompt: []rune(prompt), - termWidth: 80, - termHeight: 24, - echo: true, - historyIndex: -1, - } -} - -const ( - keyCtrlD = 4 - keyCtrlU = 21 - keyEnter = '\r' - keyEscape = 27 - keyBackspace = 127 - keyUnknown = 0xd800 /* UTF-16 surrogate area */ + iota - keyUp - keyDown - keyLeft - keyRight - keyAltLeft - keyAltRight - keyHome - keyEnd - keyDeleteWord - keyDeleteLine - keyClearScreen - keyPasteStart - keyPasteEnd -) - -var ( - crlf = []byte{'\r', '\n'} - pasteStart = []byte{keyEscape, '[', '2', '0', '0', '~'} - pasteEnd = []byte{keyEscape, '[', '2', '0', '1', '~'} -) - -// bytesToKey tries to parse a key sequence from b. If successful, it returns -// the key and the remainder of the input. Otherwise it returns utf8.RuneError. -func bytesToKey(b []byte, pasteActive bool) (rune, []byte) { - if len(b) == 0 { - return utf8.RuneError, nil - } - - if !pasteActive { - switch b[0] { - case 1: // ^A - return keyHome, b[1:] - case 5: // ^E - return keyEnd, b[1:] - case 8: // ^H - return keyBackspace, b[1:] - case 11: // ^K - return keyDeleteLine, b[1:] - case 12: // ^L - return keyClearScreen, b[1:] - case 23: // ^W - return keyDeleteWord, b[1:] - } - } - - if b[0] != keyEscape { - if !utf8.FullRune(b) { - return utf8.RuneError, b - } - r, l := utf8.DecodeRune(b) - return r, b[l:] - } - - if !pasteActive && len(b) >= 3 && b[0] == keyEscape && b[1] == '[' { - switch b[2] { - case 'A': - return keyUp, b[3:] - case 'B': - return keyDown, b[3:] - case 'C': - return keyRight, b[3:] - case 'D': - return keyLeft, b[3:] - case 'H': - return keyHome, b[3:] - case 'F': - return keyEnd, b[3:] - } - } - - if !pasteActive && len(b) >= 6 && b[0] == keyEscape && b[1] == '[' && b[2] == '1' && b[3] == ';' && b[4] == '3' { - switch b[5] { - case 'C': - return keyAltRight, b[6:] - case 'D': - return keyAltLeft, b[6:] - } - } - - if !pasteActive && len(b) >= 6 && bytes.Equal(b[:6], pasteStart) { - return keyPasteStart, b[6:] - } - - if pasteActive && len(b) >= 6 && bytes.Equal(b[:6], pasteEnd) { - return keyPasteEnd, b[6:] - } - - // If we get here then we have a key that we don't recognise, or a - // partial sequence. It's not clear how one should find the end of a - // sequence without knowing them all, but it seems that [a-zA-Z~] only - // appears at the end of a sequence. - for i, c := range b[0:] { - if c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '~' { - return keyUnknown, b[i+1:] - } - } - - return utf8.RuneError, b -} - -// queue appends data to the end of t.outBuf -func (t *Terminal) queue(data []rune) { - t.outBuf = append(t.outBuf, []byte(string(data))...) -} - -var eraseUnderCursor = []rune{' ', keyEscape, '[', 'D'} -var space = []rune{' '} - -func isPrintable(key rune) bool { - isInSurrogateArea := key >= 0xd800 && key <= 0xdbff - return key >= 32 && !isInSurrogateArea -} - -// moveCursorToPos appends data to t.outBuf which will move the cursor to the -// given, logical position in the text. -func (t *Terminal) moveCursorToPos(pos int) { - if !t.echo { - return - } - - x := visualLength(t.prompt) + pos - y := x / t.termWidth - x = x % t.termWidth - - up := 0 - if y < t.cursorY { - up = t.cursorY - y - } - - down := 0 - if y > t.cursorY { - down = y - t.cursorY - } - - left := 0 - if x < t.cursorX { - left = t.cursorX - x - } - - right := 0 - if x > t.cursorX { - right = x - t.cursorX - } - - t.cursorX = x - t.cursorY = y - t.move(up, down, left, right) -} - -func (t *Terminal) move(up, down, left, right int) { - movement := make([]rune, 3*(up+down+left+right)) - m := movement - for i := 0; i < up; i++ { - m[0] = keyEscape - m[1] = '[' - m[2] = 'A' - m = m[3:] - } - for i := 0; i < down; i++ { - m[0] = keyEscape - m[1] = '[' - m[2] = 'B' - m = m[3:] - } - for i := 0; i < left; i++ { - m[0] = keyEscape - m[1] = '[' - m[2] = 'D' - m = m[3:] - } - for i := 0; i < right; i++ { - m[0] = keyEscape - m[1] = '[' - m[2] = 'C' - m = m[3:] - } - - t.queue(movement) -} - -func (t *Terminal) clearLineToRight() { - op := []rune{keyEscape, '[', 'K'} - t.queue(op) -} - -const maxLineLength = 4096 - -func (t *Terminal) setLine(newLine []rune, newPos int) { - if t.echo { - t.moveCursorToPos(0) - t.writeLine(newLine) - for i := len(newLine); i < len(t.line); i++ { - t.writeLine(space) - } - t.moveCursorToPos(newPos) - } - t.line = newLine - t.pos = newPos -} - -func (t *Terminal) advanceCursor(places int) { - t.cursorX += places - t.cursorY += t.cursorX / t.termWidth - if t.cursorY > t.maxLine { - t.maxLine = t.cursorY - } - t.cursorX = t.cursorX % t.termWidth - - if places > 0 && t.cursorX == 0 { - // Normally terminals will advance the current position - // when writing a character. But that doesn't happen - // for the last character in a line. However, when - // writing a character (except a new line) that causes - // a line wrap, the position will be advanced two - // places. - // - // So, if we are stopping at the end of a line, we - // need to write a newline so that our cursor can be - // advanced to the next line. - t.outBuf = append(t.outBuf, '\r', '\n') - } -} - -func (t *Terminal) eraseNPreviousChars(n int) { - if n == 0 { - return - } - - if t.pos < n { - n = t.pos - } - t.pos -= n - t.moveCursorToPos(t.pos) - - copy(t.line[t.pos:], t.line[n+t.pos:]) - t.line = t.line[:len(t.line)-n] - if t.echo { - t.writeLine(t.line[t.pos:]) - for i := 0; i < n; i++ { - t.queue(space) - } - t.advanceCursor(n) - t.moveCursorToPos(t.pos) - } -} - -// countToLeftWord returns then number of characters from the cursor to the -// start of the previous word. -func (t *Terminal) countToLeftWord() int { - if t.pos == 0 { - return 0 - } - - pos := t.pos - 1 - for pos > 0 { - if t.line[pos] != ' ' { - break - } - pos-- - } - for pos > 0 { - if t.line[pos] == ' ' { - pos++ - break - } - pos-- - } - - return t.pos - pos -} - -// countToRightWord returns then number of characters from the cursor to the -// start of the next word. -func (t *Terminal) countToRightWord() int { - pos := t.pos - for pos < len(t.line) { - if t.line[pos] == ' ' { - break - } - pos++ - } - for pos < len(t.line) { - if t.line[pos] != ' ' { - break - } - pos++ - } - return pos - t.pos -} - -// visualLength returns the number of visible glyphs in s. -func visualLength(runes []rune) int { - inEscapeSeq := false - length := 0 - - for _, r := range runes { - switch { - case inEscapeSeq: - if (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') { - inEscapeSeq = false - } - case r == '\x1b': - inEscapeSeq = true - default: - length++ - } - } - - return length -} - -// handleKey processes the given key and, optionally, returns a line of text -// that the user has entered. -func (t *Terminal) handleKey(key rune) (line string, ok bool) { - if t.pasteActive && key != keyEnter { - t.addKeyToLine(key) - return - } - - switch key { - case keyBackspace: - if t.pos == 0 { - return - } - t.eraseNPreviousChars(1) - case keyAltLeft: - // move left by a word. - t.pos -= t.countToLeftWord() - t.moveCursorToPos(t.pos) - case keyAltRight: - // move right by a word. - t.pos += t.countToRightWord() - t.moveCursorToPos(t.pos) - case keyLeft: - if t.pos == 0 { - return - } - t.pos-- - t.moveCursorToPos(t.pos) - case keyRight: - if t.pos == len(t.line) { - return - } - t.pos++ - t.moveCursorToPos(t.pos) - case keyHome: - if t.pos == 0 { - return - } - t.pos = 0 - t.moveCursorToPos(t.pos) - case keyEnd: - if t.pos == len(t.line) { - return - } - t.pos = len(t.line) - t.moveCursorToPos(t.pos) - case keyUp: - entry, ok := t.history.NthPreviousEntry(t.historyIndex + 1) - if !ok { - return "", false - } - if t.historyIndex == -1 { - t.historyPending = string(t.line) - } - t.historyIndex++ - runes := []rune(entry) - t.setLine(runes, len(runes)) - case keyDown: - switch t.historyIndex { - case -1: - return - case 0: - runes := []rune(t.historyPending) - t.setLine(runes, len(runes)) - t.historyIndex-- - default: - entry, ok := t.history.NthPreviousEntry(t.historyIndex - 1) - if ok { - t.historyIndex-- - runes := []rune(entry) - t.setLine(runes, len(runes)) - } - } - case keyEnter: - t.moveCursorToPos(len(t.line)) - t.queue([]rune("\r\n")) - line = string(t.line) - ok = true - t.line = t.line[:0] - t.pos = 0 - t.cursorX = 0 - t.cursorY = 0 - t.maxLine = 0 - case keyDeleteWord: - // Delete zero or more spaces and then one or more characters. - t.eraseNPreviousChars(t.countToLeftWord()) - case keyDeleteLine: - // Delete everything from the current cursor position to the - // end of line. - for i := t.pos; i < len(t.line); i++ { - t.queue(space) - t.advanceCursor(1) - } - t.line = t.line[:t.pos] - t.moveCursorToPos(t.pos) - case keyCtrlD: - // Erase the character under the current position. - // The EOF case when the line is empty is handled in - // readLine(). - if t.pos < len(t.line) { - t.pos++ - t.eraseNPreviousChars(1) - } - case keyCtrlU: - t.eraseNPreviousChars(t.pos) - case keyClearScreen: - // Erases the screen and moves the cursor to the home position. - t.queue([]rune("\x1b[2J\x1b[H")) - t.queue(t.prompt) - t.cursorX, t.cursorY = 0, 0 - t.advanceCursor(visualLength(t.prompt)) - t.setLine(t.line, t.pos) - default: - if t.AutoCompleteCallback != nil { - prefix := string(t.line[:t.pos]) - suffix := string(t.line[t.pos:]) - - t.lock.Unlock() - newLine, newPos, completeOk := t.AutoCompleteCallback(prefix+suffix, len(prefix), key) - t.lock.Lock() - - if completeOk { - t.setLine([]rune(newLine), utf8.RuneCount([]byte(newLine)[:newPos])) - return - } - } - if !isPrintable(key) { - return - } - if len(t.line) == maxLineLength { - return - } - t.addKeyToLine(key) - } - return -} - -// addKeyToLine inserts the given key at the current position in the current -// line. -func (t *Terminal) addKeyToLine(key rune) { - if len(t.line) == cap(t.line) { - newLine := make([]rune, len(t.line), 2*(1+len(t.line))) - copy(newLine, t.line) - t.line = newLine - } - t.line = t.line[:len(t.line)+1] - copy(t.line[t.pos+1:], t.line[t.pos:]) - t.line[t.pos] = key - if t.echo { - t.writeLine(t.line[t.pos:]) - } - t.pos++ - t.moveCursorToPos(t.pos) -} - -func (t *Terminal) writeLine(line []rune) { - for len(line) != 0 { - remainingOnLine := t.termWidth - t.cursorX - todo := len(line) - if todo > remainingOnLine { - todo = remainingOnLine - } - t.queue(line[:todo]) - t.advanceCursor(visualLength(line[:todo])) - line = line[todo:] - } -} - -// writeWithCRLF writes buf to w but replaces all occurrences of \n with \r\n. -func writeWithCRLF(w io.Writer, buf []byte) (n int, err error) { - for len(buf) > 0 { - i := bytes.IndexByte(buf, '\n') - todo := len(buf) - if i >= 0 { - todo = i - } - - var nn int - nn, err = w.Write(buf[:todo]) - n += nn - if err != nil { - return n, err - } - buf = buf[todo:] - - if i >= 0 { - if _, err = w.Write(crlf); err != nil { - return n, err - } - n++ - buf = buf[1:] - } - } - - return n, nil -} - -func (t *Terminal) Write(buf []byte) (n int, err error) { - t.lock.Lock() - defer t.lock.Unlock() - - if t.cursorX == 0 && t.cursorY == 0 { - // This is the easy case: there's nothing on the screen that we - // have to move out of the way. - return writeWithCRLF(t.c, buf) - } - - // We have a prompt and possibly user input on the screen. We - // have to clear it first. - t.move(0 /* up */, 0 /* down */, t.cursorX /* left */, 0 /* right */) - t.cursorX = 0 - t.clearLineToRight() - - for t.cursorY > 0 { - t.move(1 /* up */, 0, 0, 0) - t.cursorY-- - t.clearLineToRight() - } - - if _, err = t.c.Write(t.outBuf); err != nil { - return - } - t.outBuf = t.outBuf[:0] - - if n, err = writeWithCRLF(t.c, buf); err != nil { - return - } - - t.writeLine(t.prompt) - if t.echo { - t.writeLine(t.line) - } - - t.moveCursorToPos(t.pos) - - if _, err = t.c.Write(t.outBuf); err != nil { - return - } - t.outBuf = t.outBuf[:0] - return -} - -// ReadPassword temporarily changes the prompt and reads a password, without -// echo, from the terminal. -func (t *Terminal) ReadPassword(prompt string) (line string, err error) { - t.lock.Lock() - defer t.lock.Unlock() - - oldPrompt := t.prompt - t.prompt = []rune(prompt) - t.echo = false - - line, err = t.readLine() - - t.prompt = oldPrompt - t.echo = true - - return -} - -// ReadLine returns a line of input from the terminal. -func (t *Terminal) ReadLine() (line string, err error) { - t.lock.Lock() - defer t.lock.Unlock() - - return t.readLine() -} - -func (t *Terminal) readLine() (line string, err error) { - // t.lock must be held at this point - - if t.cursorX == 0 && t.cursorY == 0 { - t.writeLine(t.prompt) - t.c.Write(t.outBuf) - t.outBuf = t.outBuf[:0] - } - - lineIsPasted := t.pasteActive - - for { - rest := t.remainder - lineOk := false - for !lineOk { - var key rune - key, rest = bytesToKey(rest, t.pasteActive) - if key == utf8.RuneError { - break - } - if !t.pasteActive { - if key == keyCtrlD { - if len(t.line) == 0 { - return "", io.EOF - } - } - if key == keyPasteStart { - t.pasteActive = true - if len(t.line) == 0 { - lineIsPasted = true - } - continue - } - } else if key == keyPasteEnd { - t.pasteActive = false - continue - } - if !t.pasteActive { - lineIsPasted = false - } - line, lineOk = t.handleKey(key) - } - if len(rest) > 0 { - n := copy(t.inBuf[:], rest) - t.remainder = t.inBuf[:n] - } else { - t.remainder = nil - } - t.c.Write(t.outBuf) - t.outBuf = t.outBuf[:0] - if lineOk { - if t.echo { - t.historyIndex = -1 - t.history.Add(line) - } - if lineIsPasted { - err = ErrPasteIndicator - } - return - } - - // t.remainder is a slice at the beginning of t.inBuf - // containing a partial key sequence - readBuf := t.inBuf[len(t.remainder):] - var n int - - t.lock.Unlock() - n, err = t.c.Read(readBuf) - t.lock.Lock() - - if err != nil { - return - } - - t.remainder = t.inBuf[:n+len(t.remainder)] - } -} - -// SetPrompt sets the prompt to be used when reading subsequent lines. -func (t *Terminal) SetPrompt(prompt string) { - t.lock.Lock() - defer t.lock.Unlock() - - t.prompt = []rune(prompt) -} - -func (t *Terminal) clearAndRepaintLinePlusNPrevious(numPrevLines int) { - // Move cursor to column zero at the start of the line. - t.move(t.cursorY, 0, t.cursorX, 0) - t.cursorX, t.cursorY = 0, 0 - t.clearLineToRight() - for t.cursorY < numPrevLines { - // Move down a line - t.move(0, 1, 0, 0) - t.cursorY++ - t.clearLineToRight() - } - // Move back to beginning. - t.move(t.cursorY, 0, 0, 0) - t.cursorX, t.cursorY = 0, 0 - - t.queue(t.prompt) - t.advanceCursor(visualLength(t.prompt)) - t.writeLine(t.line) - t.moveCursorToPos(t.pos) -} - -func (t *Terminal) SetSize(width, height int) error { - t.lock.Lock() - defer t.lock.Unlock() - - if width == 0 { - width = 1 - } - - oldWidth := t.termWidth - t.termWidth, t.termHeight = width, height - - switch { - case width == oldWidth: - // If the width didn't change then nothing else needs to be - // done. - return nil - case len(t.line) == 0 && t.cursorX == 0 && t.cursorY == 0: - // If there is nothing on current line and no prompt printed, - // just do nothing - return nil - case width < oldWidth: - // Some terminals (e.g. xterm) will truncate lines that were - // too long when shinking. Others, (e.g. gnome-terminal) will - // attempt to wrap them. For the former, repainting t.maxLine - // works great, but that behaviour goes badly wrong in the case - // of the latter because they have doubled every full line. - - // We assume that we are working on a terminal that wraps lines - // and adjust the cursor position based on every previous line - // wrapping and turning into two. This causes the prompt on - // xterms to move upwards, which isn't great, but it avoids a - // huge mess with gnome-terminal. - if t.cursorX >= t.termWidth { - t.cursorX = t.termWidth - 1 - } - t.cursorY *= 2 - t.clearAndRepaintLinePlusNPrevious(t.maxLine * 2) - case width > oldWidth: - // If the terminal expands then our position calculations will - // be wrong in the future because we think the cursor is - // |t.pos| chars into the string, but there will be a gap at - // the end of any wrapped line. - // - // But the position will actually be correct until we move, so - // we can move back to the beginning and repaint everything. - t.clearAndRepaintLinePlusNPrevious(t.maxLine) - } - - _, err := t.c.Write(t.outBuf) - t.outBuf = t.outBuf[:0] - return err -} - -type pasteIndicatorError struct{} - -func (pasteIndicatorError) Error() string { - return "terminal: ErrPasteIndicator not correctly handled" -} - -// ErrPasteIndicator may be returned from ReadLine as the error, in addition -// to valid line data. It indicates that bracketed paste mode is enabled and -// that the returned line consists only of pasted data. Programs may wish to -// interpret pasted data more literally than typed data. -var ErrPasteIndicator = pasteIndicatorError{} - -// SetBracketedPasteMode requests that the terminal bracket paste operations -// with markers. Not all terminals support this but, if it is supported, then -// enabling this mode will stop any autocomplete callback from running due to -// pastes. Additionally, any lines that are completely pasted will be returned -// from ReadLine with the error set to ErrPasteIndicator. -func (t *Terminal) SetBracketedPasteMode(on bool) { - if on { - io.WriteString(t.c, "\x1b[?2004h") - } else { - io.WriteString(t.c, "\x1b[?2004l") - } -} - -// stRingBuffer is a ring buffer of strings. -type stRingBuffer struct { - // entries contains max elements. - entries []string - max int - // head contains the index of the element most recently added to the ring. - head int - // size contains the number of elements in the ring. - size int -} - -func (s *stRingBuffer) Add(a string) { - if s.entries == nil { - const defaultNumEntries = 100 - s.entries = make([]string, defaultNumEntries) - s.max = defaultNumEntries - } - - s.head = (s.head + 1) % s.max - s.entries[s.head] = a - if s.size < s.max { - s.size++ - } -} - -// NthPreviousEntry returns the value passed to the nth previous call to Add. -// If n is zero then the immediately prior value is returned, if one, then the -// next most recent, and so on. If such an element doesn't exist then ok is -// false. -func (s *stRingBuffer) NthPreviousEntry(n int) (value string, ok bool) { - if n >= s.size { - return "", false - } - index := s.head - n - if index < 0 { - index += s.max - } - return s.entries[index], true -} - -// readPasswordLine reads from reader until it finds \n or io.EOF. -// The slice returned does not include the \n. -// readPasswordLine also ignores any \r it finds. -func readPasswordLine(reader io.Reader) ([]byte, error) { - var buf [1]byte - var ret []byte - - for { - n, err := reader.Read(buf[:]) - if n > 0 { - switch buf[0] { - case '\n': - return ret, nil - case '\r': - // remove \r from passwords on Windows - default: - ret = append(ret, buf[0]) - } - continue - } - if err != nil { - if err == io.EOF && len(ret) > 0 { - return ret, nil - } - return ret, err - } - } -} diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util.go b/vendor/golang.org/x/crypto/ssh/terminal/util.go deleted file mode 100644 index 731c89a..0000000 --- a/vendor/golang.org/x/crypto/ssh/terminal/util.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux,!appengine netbsd openbsd - -// Package terminal provides support functions for dealing with terminals, as -// commonly found on UNIX systems. -// -// Putting a terminal into raw mode is the most common requirement: -// -// oldState, err := terminal.MakeRaw(0) -// if err != nil { -// panic(err) -// } -// defer terminal.Restore(0, oldState) -package terminal // import "golang.org/x/crypto/ssh/terminal" - -import ( - "golang.org/x/sys/unix" -) - -// State contains the state of a terminal. -type State struct { - termios unix.Termios -} - -// IsTerminal returns true if the given file descriptor is a terminal. -func IsTerminal(fd int) bool { - _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) - return err == nil -} - -// MakeRaw put the terminal connected to the given file descriptor into raw -// mode and returns the previous state of the terminal so that it can be -// restored. -func MakeRaw(fd int) (*State, error) { - termios, err := unix.IoctlGetTermios(fd, ioctlReadTermios) - if err != nil { - return nil, err - } - - oldState := State{termios: *termios} - - // This attempts to replicate the behaviour documented for cfmakeraw in - // the termios(3) manpage. - termios.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON - termios.Oflag &^= unix.OPOST - termios.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN - termios.Cflag &^= unix.CSIZE | unix.PARENB - termios.Cflag |= unix.CS8 - termios.Cc[unix.VMIN] = 1 - termios.Cc[unix.VTIME] = 0 - if err := unix.IoctlSetTermios(fd, ioctlWriteTermios, termios); err != nil { - return nil, err - } - - return &oldState, nil -} - -// GetState returns the current state of a terminal which may be useful to -// restore the terminal after a signal. -func GetState(fd int) (*State, error) { - termios, err := unix.IoctlGetTermios(fd, ioctlReadTermios) - if err != nil { - return nil, err - } - - return &State{termios: *termios}, nil -} - -// Restore restores the terminal connected to the given file descriptor to a -// previous state. -func Restore(fd int, state *State) error { - return unix.IoctlSetTermios(fd, ioctlWriteTermios, &state.termios) -} - -// GetSize returns the dimensions of the given terminal. -func GetSize(fd int) (width, height int, err error) { - ws, err := unix.IoctlGetWinsize(fd, unix.TIOCGWINSZ) - if err != nil { - return -1, -1, err - } - return int(ws.Col), int(ws.Row), nil -} - -// passwordReader is an io.Reader that reads from a specific file descriptor. -type passwordReader int - -func (r passwordReader) Read(buf []byte) (int, error) { - return unix.Read(int(r), buf) -} - -// ReadPassword reads a line of input from a terminal without local echo. This -// is commonly used for inputting passwords and other sensitive data. The slice -// returned does not include the \n. -func ReadPassword(fd int) ([]byte, error) { - termios, err := unix.IoctlGetTermios(fd, ioctlReadTermios) - if err != nil { - return nil, err - } - - newState := *termios - newState.Lflag &^= unix.ECHO - newState.Lflag |= unix.ICANON | unix.ISIG - newState.Iflag |= unix.ICRNL - if err := unix.IoctlSetTermios(fd, ioctlWriteTermios, &newState); err != nil { - return nil, err - } - - defer unix.IoctlSetTermios(fd, ioctlWriteTermios, termios) - - return readPasswordLine(passwordReader(fd)) -} diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go b/vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go deleted file mode 100644 index cb23a59..0000000 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd netbsd openbsd - -package terminal - -import "golang.org/x/sys/unix" - -const ioctlReadTermios = unix.TIOCGETA -const ioctlWriteTermios = unix.TIOCSETA diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_linux.go b/vendor/golang.org/x/crypto/ssh/terminal/util_linux.go deleted file mode 100644 index 5fadfe8..0000000 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_linux.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package terminal - -import "golang.org/x/sys/unix" - -const ioctlReadTermios = unix.TCGETS -const ioctlWriteTermios = unix.TCSETS diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_plan9.go b/vendor/golang.org/x/crypto/ssh/terminal/util_plan9.go deleted file mode 100644 index 799f049..0000000 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_plan9.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package terminal provides support functions for dealing with terminals, as -// commonly found on UNIX systems. -// -// Putting a terminal into raw mode is the most common requirement: -// -// oldState, err := terminal.MakeRaw(0) -// if err != nil { -// panic(err) -// } -// defer terminal.Restore(0, oldState) -package terminal - -import ( - "fmt" - "runtime" -) - -type State struct{} - -// IsTerminal returns true if the given file descriptor is a terminal. -func IsTerminal(fd int) bool { - return false -} - -// MakeRaw put the terminal connected to the given file descriptor into raw -// mode and returns the previous state of the terminal so that it can be -// restored. -func MakeRaw(fd int) (*State, error) { - return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) -} - -// GetState returns the current state of a terminal which may be useful to -// restore the terminal after a signal. -func GetState(fd int) (*State, error) { - return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) -} - -// Restore restores the terminal connected to the given file descriptor to a -// previous state. -func Restore(fd int, state *State) error { - return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) -} - -// GetSize returns the dimensions of the given terminal. -func GetSize(fd int) (width, height int, err error) { - return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) -} - -// ReadPassword reads a line of input from a terminal without local echo. This -// is commonly used for inputting passwords and other sensitive data. The slice -// returned does not include the \n. -func ReadPassword(fd int) ([]byte, error) { - return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) -} diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go b/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go deleted file mode 100644 index 9e41b9f..0000000 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build solaris - -package terminal // import "golang.org/x/crypto/ssh/terminal" - -import ( - "golang.org/x/sys/unix" - "io" - "syscall" -) - -// State contains the state of a terminal. -type State struct { - termios unix.Termios -} - -// IsTerminal returns true if the given file descriptor is a terminal. -func IsTerminal(fd int) bool { - _, err := unix.IoctlGetTermio(fd, unix.TCGETA) - return err == nil -} - -// ReadPassword reads a line of input from a terminal without local echo. This -// is commonly used for inputting passwords and other sensitive data. The slice -// returned does not include the \n. -func ReadPassword(fd int) ([]byte, error) { - // see also: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libast/common/uwin/getpass.c - val, err := unix.IoctlGetTermios(fd, unix.TCGETS) - if err != nil { - return nil, err - } - oldState := *val - - newState := oldState - newState.Lflag &^= syscall.ECHO - newState.Lflag |= syscall.ICANON | syscall.ISIG - newState.Iflag |= syscall.ICRNL - err = unix.IoctlSetTermios(fd, unix.TCSETS, &newState) - if err != nil { - return nil, err - } - - defer unix.IoctlSetTermios(fd, unix.TCSETS, &oldState) - - var buf [16]byte - var ret []byte - for { - n, err := syscall.Read(fd, buf[:]) - if err != nil { - return nil, err - } - if n == 0 { - if len(ret) == 0 { - return nil, io.EOF - } - break - } - if buf[n-1] == '\n' { - n-- - } - ret = append(ret, buf[:n]...) - if n < len(buf) { - break - } - } - - return ret, nil -} - -// MakeRaw puts the terminal connected to the given file descriptor into raw -// mode and returns the previous state of the terminal so that it can be -// restored. -// see http://cr.illumos.org/~webrev/andy_js/1060/ -func MakeRaw(fd int) (*State, error) { - termios, err := unix.IoctlGetTermios(fd, unix.TCGETS) - if err != nil { - return nil, err - } - - oldState := State{termios: *termios} - - termios.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON - termios.Oflag &^= unix.OPOST - termios.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN - termios.Cflag &^= unix.CSIZE | unix.PARENB - termios.Cflag |= unix.CS8 - termios.Cc[unix.VMIN] = 1 - termios.Cc[unix.VTIME] = 0 - - if err := unix.IoctlSetTermios(fd, unix.TCSETS, termios); err != nil { - return nil, err - } - - return &oldState, nil -} - -// Restore restores the terminal connected to the given file descriptor to a -// previous state. -func Restore(fd int, oldState *State) error { - return unix.IoctlSetTermios(fd, unix.TCSETS, &oldState.termios) -} - -// GetState returns the current state of a terminal which may be useful to -// restore the terminal after a signal. -func GetState(fd int) (*State, error) { - termios, err := unix.IoctlGetTermios(fd, unix.TCGETS) - if err != nil { - return nil, err - } - - return &State{termios: *termios}, nil -} - -// GetSize returns the dimensions of the given terminal. -func GetSize(fd int) (width, height int, err error) { - ws, err := unix.IoctlGetWinsize(fd, unix.TIOCGWINSZ) - if err != nil { - return 0, 0, err - } - return int(ws.Col), int(ws.Row), nil -} diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go b/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go deleted file mode 100644 index 8618955..0000000 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -// Package terminal provides support functions for dealing with terminals, as -// commonly found on UNIX systems. -// -// Putting a terminal into raw mode is the most common requirement: -// -// oldState, err := terminal.MakeRaw(0) -// if err != nil { -// panic(err) -// } -// defer terminal.Restore(0, oldState) -package terminal - -import ( - "os" - - "golang.org/x/sys/windows" -) - -type State struct { - mode uint32 -} - -// IsTerminal returns true if the given file descriptor is a terminal. -func IsTerminal(fd int) bool { - var st uint32 - err := windows.GetConsoleMode(windows.Handle(fd), &st) - return err == nil -} - -// MakeRaw put the terminal connected to the given file descriptor into raw -// mode and returns the previous state of the terminal so that it can be -// restored. -func MakeRaw(fd int) (*State, error) { - var st uint32 - if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil { - return nil, err - } - raw := st &^ (windows.ENABLE_ECHO_INPUT | windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT) - if err := windows.SetConsoleMode(windows.Handle(fd), raw); err != nil { - return nil, err - } - return &State{st}, nil -} - -// GetState returns the current state of a terminal which may be useful to -// restore the terminal after a signal. -func GetState(fd int) (*State, error) { - var st uint32 - if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil { - return nil, err - } - return &State{st}, nil -} - -// Restore restores the terminal connected to the given file descriptor to a -// previous state. -func Restore(fd int, state *State) error { - return windows.SetConsoleMode(windows.Handle(fd), state.mode) -} - -// GetSize returns the dimensions of the given terminal. -func GetSize(fd int) (width, height int, err error) { - var info windows.ConsoleScreenBufferInfo - if err := windows.GetConsoleScreenBufferInfo(windows.Handle(fd), &info); err != nil { - return 0, 0, err - } - return int(info.Size.X), int(info.Size.Y), nil -} - -// ReadPassword reads a line of input from a terminal without local echo. This -// is commonly used for inputting passwords and other sensitive data. The slice -// returned does not include the \n. -func ReadPassword(fd int) ([]byte, error) { - var st uint32 - if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil { - return nil, err - } - old := st - - st &^= (windows.ENABLE_ECHO_INPUT) - st |= (windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT) - if err := windows.SetConsoleMode(windows.Handle(fd), st); err != nil { - return nil, err - } - - defer windows.SetConsoleMode(windows.Handle(fd), old) - - var h windows.Handle - p, _ := windows.GetCurrentProcess() - if err := windows.DuplicateHandle(p, windows.Handle(fd), p, &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil { - return nil, err - } - - f := os.NewFile(uintptr(h), "stdin") - defer f.Close() - return readPasswordLine(f) -} diff --git a/vendor/golang.org/x/net/AUTHORS b/vendor/golang.org/x/net/AUTHORS deleted file mode 100644 index 15167cd..0000000 --- a/vendor/golang.org/x/net/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/net/CONTRIBUTORS b/vendor/golang.org/x/net/CONTRIBUTORS deleted file mode 100644 index 1c4577e..0000000 --- a/vendor/golang.org/x/net/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/net/LICENSE b/vendor/golang.org/x/net/LICENSE deleted file mode 100644 index 6a66aea..0000000 --- a/vendor/golang.org/x/net/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/net/PATENTS b/vendor/golang.org/x/net/PATENTS deleted file mode 100644 index 7330990..0000000 --- a/vendor/golang.org/x/net/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/net/html/atom/atom.go b/vendor/golang.org/x/net/html/atom/atom.go deleted file mode 100644 index cd0a8ac..0000000 --- a/vendor/golang.org/x/net/html/atom/atom.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package atom provides integer codes (also known as atoms) for a fixed set of -// frequently occurring HTML strings: tag names and attribute keys such as "p" -// and "id". -// -// Sharing an atom's name between all elements with the same tag can result in -// fewer string allocations when tokenizing and parsing HTML. Integer -// comparisons are also generally faster than string comparisons. -// -// The value of an atom's particular code is not guaranteed to stay the same -// between versions of this package. Neither is any ordering guaranteed: -// whether atom.H1 < atom.H2 may also change. The codes are not guaranteed to -// be dense. The only guarantees are that e.g. looking up "div" will yield -// atom.Div, calling atom.Div.String will return "div", and atom.Div != 0. -package atom // import "golang.org/x/net/html/atom" - -// Atom is an integer code for a string. The zero value maps to "". -type Atom uint32 - -// String returns the atom's name. -func (a Atom) String() string { - start := uint32(a >> 8) - n := uint32(a & 0xff) - if start+n > uint32(len(atomText)) { - return "" - } - return atomText[start : start+n] -} - -func (a Atom) string() string { - return atomText[a>>8 : a>>8+a&0xff] -} - -// fnv computes the FNV hash with an arbitrary starting value h. -func fnv(h uint32, s []byte) uint32 { - for i := range s { - h ^= uint32(s[i]) - h *= 16777619 - } - return h -} - -func match(s string, t []byte) bool { - for i, c := range t { - if s[i] != c { - return false - } - } - return true -} - -// Lookup returns the atom whose name is s. It returns zero if there is no -// such atom. The lookup is case sensitive. -func Lookup(s []byte) Atom { - if len(s) == 0 || len(s) > maxAtomLen { - return 0 - } - h := fnv(hash0, s) - if a := table[h&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) { - return a - } - if a := table[(h>>16)&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) { - return a - } - return 0 -} - -// String returns a string whose contents are equal to s. In that sense, it is -// equivalent to string(s) but may be more efficient. -func String(s []byte) string { - if a := Lookup(s); a != 0 { - return a.String() - } - return string(s) -} diff --git a/vendor/golang.org/x/net/html/atom/gen.go b/vendor/golang.org/x/net/html/atom/gen.go deleted file mode 100644 index 5d05278..0000000 --- a/vendor/golang.org/x/net/html/atom/gen.go +++ /dev/null @@ -1,712 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -//go:generate go run gen.go -//go:generate go run gen.go -test - -package main - -import ( - "bytes" - "flag" - "fmt" - "go/format" - "io/ioutil" - "math/rand" - "os" - "sort" - "strings" -) - -// identifier converts s to a Go exported identifier. -// It converts "div" to "Div" and "accept-charset" to "AcceptCharset". -func identifier(s string) string { - b := make([]byte, 0, len(s)) - cap := true - for _, c := range s { - if c == '-' { - cap = true - continue - } - if cap && 'a' <= c && c <= 'z' { - c -= 'a' - 'A' - } - cap = false - b = append(b, byte(c)) - } - return string(b) -} - -var test = flag.Bool("test", false, "generate table_test.go") - -func genFile(name string, buf *bytes.Buffer) { - b, err := format.Source(buf.Bytes()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - if err := ioutil.WriteFile(name, b, 0644); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } -} - -func main() { - flag.Parse() - - var all []string - all = append(all, elements...) - all = append(all, attributes...) - all = append(all, eventHandlers...) - all = append(all, extra...) - sort.Strings(all) - - // uniq - lists have dups - w := 0 - for _, s := range all { - if w == 0 || all[w-1] != s { - all[w] = s - w++ - } - } - all = all[:w] - - if *test { - var buf bytes.Buffer - fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") - fmt.Fprintln(&buf, "//go:generate go run gen.go -test\n") - fmt.Fprintln(&buf, "package atom\n") - fmt.Fprintln(&buf, "var testAtomList = []string{") - for _, s := range all { - fmt.Fprintf(&buf, "\t%q,\n", s) - } - fmt.Fprintln(&buf, "}") - - genFile("table_test.go", &buf) - return - } - - // Find hash that minimizes table size. - var best *table - for i := 0; i < 1000000; i++ { - if best != nil && 1<<(best.k-1) < len(all) { - break - } - h := rand.Uint32() - for k := uint(0); k <= 16; k++ { - if best != nil && k >= best.k { - break - } - var t table - if t.init(h, k, all) { - best = &t - break - } - } - } - if best == nil { - fmt.Fprintf(os.Stderr, "failed to construct string table\n") - os.Exit(1) - } - - // Lay out strings, using overlaps when possible. - layout := append([]string{}, all...) - - // Remove strings that are substrings of other strings - for changed := true; changed; { - changed = false - for i, s := range layout { - if s == "" { - continue - } - for j, t := range layout { - if i != j && t != "" && strings.Contains(s, t) { - changed = true - layout[j] = "" - } - } - } - } - - // Join strings where one suffix matches another prefix. - for { - // Find best i, j, k such that layout[i][len-k:] == layout[j][:k], - // maximizing overlap length k. - besti := -1 - bestj := -1 - bestk := 0 - for i, s := range layout { - if s == "" { - continue - } - for j, t := range layout { - if i == j { - continue - } - for k := bestk + 1; k <= len(s) && k <= len(t); k++ { - if s[len(s)-k:] == t[:k] { - besti = i - bestj = j - bestk = k - } - } - } - } - if bestk > 0 { - layout[besti] += layout[bestj][bestk:] - layout[bestj] = "" - continue - } - break - } - - text := strings.Join(layout, "") - - atom := map[string]uint32{} - for _, s := range all { - off := strings.Index(text, s) - if off < 0 { - panic("lost string " + s) - } - atom[s] = uint32(off<<8 | len(s)) - } - - var buf bytes.Buffer - // Generate the Go code. - fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") - fmt.Fprintln(&buf, "//go:generate go run gen.go\n") - fmt.Fprintln(&buf, "package atom\n\nconst (") - - // compute max len - maxLen := 0 - for _, s := range all { - if maxLen < len(s) { - maxLen = len(s) - } - fmt.Fprintf(&buf, "\t%s Atom = %#x\n", identifier(s), atom[s]) - } - fmt.Fprintln(&buf, ")\n") - - fmt.Fprintf(&buf, "const hash0 = %#x\n\n", best.h0) - fmt.Fprintf(&buf, "const maxAtomLen = %d\n\n", maxLen) - - fmt.Fprintf(&buf, "var table = [1<<%d]Atom{\n", best.k) - for i, s := range best.tab { - if s == "" { - continue - } - fmt.Fprintf(&buf, "\t%#x: %#x, // %s\n", i, atom[s], s) - } - fmt.Fprintf(&buf, "}\n") - datasize := (1 << best.k) * 4 - - fmt.Fprintln(&buf, "const atomText =") - textsize := len(text) - for len(text) > 60 { - fmt.Fprintf(&buf, "\t%q +\n", text[:60]) - text = text[60:] - } - fmt.Fprintf(&buf, "\t%q\n\n", text) - - genFile("table.go", &buf) - - fmt.Fprintf(os.Stdout, "%d atoms; %d string bytes + %d tables = %d total data\n", len(all), textsize, datasize, textsize+datasize) -} - -type byLen []string - -func (x byLen) Less(i, j int) bool { return len(x[i]) > len(x[j]) } -func (x byLen) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x byLen) Len() int { return len(x) } - -// fnv computes the FNV hash with an arbitrary starting value h. -func fnv(h uint32, s string) uint32 { - for i := 0; i < len(s); i++ { - h ^= uint32(s[i]) - h *= 16777619 - } - return h -} - -// A table represents an attempt at constructing the lookup table. -// The lookup table uses cuckoo hashing, meaning that each string -// can be found in one of two positions. -type table struct { - h0 uint32 - k uint - mask uint32 - tab []string -} - -// hash returns the two hashes for s. -func (t *table) hash(s string) (h1, h2 uint32) { - h := fnv(t.h0, s) - h1 = h & t.mask - h2 = (h >> 16) & t.mask - return -} - -// init initializes the table with the given parameters. -// h0 is the initial hash value, -// k is the number of bits of hash value to use, and -// x is the list of strings to store in the table. -// init returns false if the table cannot be constructed. -func (t *table) init(h0 uint32, k uint, x []string) bool { - t.h0 = h0 - t.k = k - t.tab = make([]string, 1< len(t.tab) { - return false - } - s := t.tab[i] - h1, h2 := t.hash(s) - j := h1 + h2 - i - if t.tab[j] != "" && !t.push(j, depth+1) { - return false - } - t.tab[j] = s - return true -} - -// The lists of element names and attribute keys were taken from -// https://html.spec.whatwg.org/multipage/indices.html#index -// as of the "HTML Living Standard - Last Updated 16 April 2018" version. - -// "command", "keygen" and "menuitem" have been removed from the spec, -// but are kept here for backwards compatibility. -var elements = []string{ - "a", - "abbr", - "address", - "area", - "article", - "aside", - "audio", - "b", - "base", - "bdi", - "bdo", - "blockquote", - "body", - "br", - "button", - "canvas", - "caption", - "cite", - "code", - "col", - "colgroup", - "command", - "data", - "datalist", - "dd", - "del", - "details", - "dfn", - "dialog", - "div", - "dl", - "dt", - "em", - "embed", - "fieldset", - "figcaption", - "figure", - "footer", - "form", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "head", - "header", - "hgroup", - "hr", - "html", - "i", - "iframe", - "img", - "input", - "ins", - "kbd", - "keygen", - "label", - "legend", - "li", - "link", - "main", - "map", - "mark", - "menu", - "menuitem", - "meta", - "meter", - "nav", - "noscript", - "object", - "ol", - "optgroup", - "option", - "output", - "p", - "param", - "picture", - "pre", - "progress", - "q", - "rp", - "rt", - "ruby", - "s", - "samp", - "script", - "section", - "select", - "slot", - "small", - "source", - "span", - "strong", - "style", - "sub", - "summary", - "sup", - "table", - "tbody", - "td", - "template", - "textarea", - "tfoot", - "th", - "thead", - "time", - "title", - "tr", - "track", - "u", - "ul", - "var", - "video", - "wbr", -} - -// https://html.spec.whatwg.org/multipage/indices.html#attributes-3 -// -// "challenge", "command", "contextmenu", "dropzone", "icon", "keytype", "mediagroup", -// "radiogroup", "spellcheck", "scoped", "seamless", "sortable" and "sorted" have been removed from the spec, -// but are kept here for backwards compatibility. -var attributes = []string{ - "abbr", - "accept", - "accept-charset", - "accesskey", - "action", - "allowfullscreen", - "allowpaymentrequest", - "allowusermedia", - "alt", - "as", - "async", - "autocomplete", - "autofocus", - "autoplay", - "challenge", - "charset", - "checked", - "cite", - "class", - "color", - "cols", - "colspan", - "command", - "content", - "contenteditable", - "contextmenu", - "controls", - "coords", - "crossorigin", - "data", - "datetime", - "default", - "defer", - "dir", - "dirname", - "disabled", - "download", - "draggable", - "dropzone", - "enctype", - "for", - "form", - "formaction", - "formenctype", - "formmethod", - "formnovalidate", - "formtarget", - "headers", - "height", - "hidden", - "high", - "href", - "hreflang", - "http-equiv", - "icon", - "id", - "inputmode", - "integrity", - "is", - "ismap", - "itemid", - "itemprop", - "itemref", - "itemscope", - "itemtype", - "keytype", - "kind", - "label", - "lang", - "list", - "loop", - "low", - "manifest", - "max", - "maxlength", - "media", - "mediagroup", - "method", - "min", - "minlength", - "multiple", - "muted", - "name", - "nomodule", - "nonce", - "novalidate", - "open", - "optimum", - "pattern", - "ping", - "placeholder", - "playsinline", - "poster", - "preload", - "radiogroup", - "readonly", - "referrerpolicy", - "rel", - "required", - "reversed", - "rows", - "rowspan", - "sandbox", - "spellcheck", - "scope", - "scoped", - "seamless", - "selected", - "shape", - "size", - "sizes", - "sortable", - "sorted", - "slot", - "span", - "spellcheck", - "src", - "srcdoc", - "srclang", - "srcset", - "start", - "step", - "style", - "tabindex", - "target", - "title", - "translate", - "type", - "typemustmatch", - "updateviacache", - "usemap", - "value", - "width", - "workertype", - "wrap", -} - -// "onautocomplete", "onautocompleteerror", "onmousewheel", -// "onshow" and "onsort" have been removed from the spec, -// but are kept here for backwards compatibility. -var eventHandlers = []string{ - "onabort", - "onautocomplete", - "onautocompleteerror", - "onauxclick", - "onafterprint", - "onbeforeprint", - "onbeforeunload", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncopy", - "oncuechange", - "oncut", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragexit", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "onhashchange", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onlanguagechange", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadend", - "onloadstart", - "onmessage", - "onmessageerror", - "onmousedown", - "onmouseenter", - "onmouseleave", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onwheel", - "onoffline", - "ononline", - "onpagehide", - "onpageshow", - "onpaste", - "onpause", - "onplay", - "onplaying", - "onpopstate", - "onprogress", - "onratechange", - "onreset", - "onresize", - "onrejectionhandled", - "onscroll", - "onsecuritypolicyviolation", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onsort", - "onstalled", - "onstorage", - "onsubmit", - "onsuspend", - "ontimeupdate", - "ontoggle", - "onunhandledrejection", - "onunload", - "onvolumechange", - "onwaiting", -} - -// extra are ad-hoc values not covered by any of the lists above. -var extra = []string{ - "acronym", - "align", - "annotation", - "annotation-xml", - "applet", - "basefont", - "bgsound", - "big", - "blink", - "center", - "color", - "desc", - "face", - "font", - "foreignObject", // HTML is case-insensitive, but SVG-embedded-in-HTML is case-sensitive. - "foreignobject", - "frame", - "frameset", - "image", - "isindex", - "listing", - "malignmark", - "marquee", - "math", - "mglyph", - "mi", - "mn", - "mo", - "ms", - "mtext", - "nobr", - "noembed", - "noframes", - "plaintext", - "prompt", - "public", - "rb", - "rtc", - "spacer", - "strike", - "svg", - "system", - "tt", - "xmp", -} diff --git a/vendor/golang.org/x/net/html/atom/table.go b/vendor/golang.org/x/net/html/atom/table.go deleted file mode 100644 index 2a93886..0000000 --- a/vendor/golang.org/x/net/html/atom/table.go +++ /dev/null @@ -1,783 +0,0 @@ -// Code generated by go generate gen.go; DO NOT EDIT. - -//go:generate go run gen.go - -package atom - -const ( - A Atom = 0x1 - Abbr Atom = 0x4 - Accept Atom = 0x1a06 - AcceptCharset Atom = 0x1a0e - Accesskey Atom = 0x2c09 - Acronym Atom = 0xaa07 - Action Atom = 0x27206 - Address Atom = 0x6f307 - Align Atom = 0xb105 - Allowfullscreen Atom = 0x2080f - Allowpaymentrequest Atom = 0xc113 - Allowusermedia Atom = 0xdd0e - Alt Atom = 0xf303 - Annotation Atom = 0x1c90a - AnnotationXml Atom = 0x1c90e - Applet Atom = 0x31906 - Area Atom = 0x35604 - Article Atom = 0x3fc07 - As Atom = 0x3c02 - Aside Atom = 0x10705 - Async Atom = 0xff05 - Audio Atom = 0x11505 - Autocomplete Atom = 0x2780c - Autofocus Atom = 0x12109 - Autoplay Atom = 0x13c08 - B Atom = 0x101 - Base Atom = 0x3b04 - Basefont Atom = 0x3b08 - Bdi Atom = 0xba03 - Bdo Atom = 0x14b03 - Bgsound Atom = 0x15e07 - Big Atom = 0x17003 - Blink Atom = 0x17305 - Blockquote Atom = 0x1870a - Body Atom = 0x2804 - Br Atom = 0x202 - Button Atom = 0x19106 - Canvas Atom = 0x10306 - Caption Atom = 0x23107 - Center Atom = 0x22006 - Challenge Atom = 0x29b09 - Charset Atom = 0x2107 - Checked Atom = 0x47907 - Cite Atom = 0x19c04 - Class Atom = 0x56405 - Code Atom = 0x5c504 - Col Atom = 0x1ab03 - Colgroup Atom = 0x1ab08 - Color Atom = 0x1bf05 - Cols Atom = 0x1c404 - Colspan Atom = 0x1c407 - Command Atom = 0x1d707 - Content Atom = 0x58b07 - Contenteditable Atom = 0x58b0f - Contextmenu Atom = 0x3800b - Controls Atom = 0x1de08 - Coords Atom = 0x1ea06 - Crossorigin Atom = 0x1fb0b - Data Atom = 0x4a504 - Datalist Atom = 0x4a508 - Datetime Atom = 0x2b808 - Dd Atom = 0x2d702 - Default Atom = 0x10a07 - Defer Atom = 0x5c705 - Del Atom = 0x45203 - Desc Atom = 0x56104 - Details Atom = 0x7207 - Dfn Atom = 0x8703 - Dialog Atom = 0xbb06 - Dir Atom = 0x9303 - Dirname Atom = 0x9307 - Disabled Atom = 0x16408 - Div Atom = 0x16b03 - Dl Atom = 0x5e602 - Download Atom = 0x46308 - Draggable Atom = 0x17a09 - Dropzone Atom = 0x40508 - Dt Atom = 0x64b02 - Em Atom = 0x6e02 - Embed Atom = 0x6e05 - Enctype Atom = 0x28d07 - Face Atom = 0x21e04 - Fieldset Atom = 0x22608 - Figcaption Atom = 0x22e0a - Figure Atom = 0x24806 - Font Atom = 0x3f04 - Footer Atom = 0xf606 - For Atom = 0x25403 - ForeignObject Atom = 0x2540d - Foreignobject Atom = 0x2610d - Form Atom = 0x26e04 - Formaction Atom = 0x26e0a - Formenctype Atom = 0x2890b - Formmethod Atom = 0x2a40a - Formnovalidate Atom = 0x2ae0e - Formtarget Atom = 0x2c00a - Frame Atom = 0x8b05 - Frameset Atom = 0x8b08 - H1 Atom = 0x15c02 - H2 Atom = 0x2de02 - H3 Atom = 0x30d02 - H4 Atom = 0x34502 - H5 Atom = 0x34f02 - H6 Atom = 0x64d02 - Head Atom = 0x33104 - Header Atom = 0x33106 - Headers Atom = 0x33107 - Height Atom = 0x5206 - Hgroup Atom = 0x2ca06 - Hidden Atom = 0x2d506 - High Atom = 0x2db04 - Hr Atom = 0x15702 - Href Atom = 0x2e004 - Hreflang Atom = 0x2e008 - Html Atom = 0x5604 - HttpEquiv Atom = 0x2e80a - I Atom = 0x601 - Icon Atom = 0x58a04 - Id Atom = 0x10902 - Iframe Atom = 0x2fc06 - Image Atom = 0x30205 - Img Atom = 0x30703 - Input Atom = 0x44b05 - Inputmode Atom = 0x44b09 - Ins Atom = 0x20403 - Integrity Atom = 0x23f09 - Is Atom = 0x16502 - Isindex Atom = 0x30f07 - Ismap Atom = 0x31605 - Itemid Atom = 0x38b06 - Itemprop Atom = 0x19d08 - Itemref Atom = 0x3cd07 - Itemscope Atom = 0x67109 - Itemtype Atom = 0x31f08 - Kbd Atom = 0xb903 - Keygen Atom = 0x3206 - Keytype Atom = 0xd607 - Kind Atom = 0x17704 - Label Atom = 0x5905 - Lang Atom = 0x2e404 - Legend Atom = 0x18106 - Li Atom = 0xb202 - Link Atom = 0x17404 - List Atom = 0x4a904 - Listing Atom = 0x4a907 - Loop Atom = 0x5d04 - Low Atom = 0xc303 - Main Atom = 0x1004 - Malignmark Atom = 0xb00a - Manifest Atom = 0x6d708 - Map Atom = 0x31803 - Mark Atom = 0xb604 - Marquee Atom = 0x32707 - Math Atom = 0x32e04 - Max Atom = 0x33d03 - Maxlength Atom = 0x33d09 - Media Atom = 0xe605 - Mediagroup Atom = 0xe60a - Menu Atom = 0x38704 - Menuitem Atom = 0x38708 - Meta Atom = 0x4b804 - Meter Atom = 0x9805 - Method Atom = 0x2a806 - Mglyph Atom = 0x30806 - Mi Atom = 0x34702 - Min Atom = 0x34703 - Minlength Atom = 0x34709 - Mn Atom = 0x2b102 - Mo Atom = 0xa402 - Ms Atom = 0x67402 - Mtext Atom = 0x35105 - Multiple Atom = 0x35f08 - Muted Atom = 0x36705 - Name Atom = 0x9604 - Nav Atom = 0x1303 - Nobr Atom = 0x3704 - Noembed Atom = 0x6c07 - Noframes Atom = 0x8908 - Nomodule Atom = 0xa208 - Nonce Atom = 0x1a605 - Noscript Atom = 0x21608 - Novalidate Atom = 0x2b20a - Object Atom = 0x26806 - Ol Atom = 0x13702 - Onabort Atom = 0x19507 - Onafterprint Atom = 0x2360c - Onautocomplete Atom = 0x2760e - Onautocompleteerror Atom = 0x27613 - Onauxclick Atom = 0x61f0a - Onbeforeprint Atom = 0x69e0d - Onbeforeunload Atom = 0x6e70e - Onblur Atom = 0x56d06 - Oncancel Atom = 0x11908 - Oncanplay Atom = 0x14d09 - Oncanplaythrough Atom = 0x14d10 - Onchange Atom = 0x41b08 - Onclick Atom = 0x2f507 - Onclose Atom = 0x36c07 - Oncontextmenu Atom = 0x37e0d - Oncopy Atom = 0x39106 - Oncuechange Atom = 0x3970b - Oncut Atom = 0x3a205 - Ondblclick Atom = 0x3a70a - Ondrag Atom = 0x3b106 - Ondragend Atom = 0x3b109 - Ondragenter Atom = 0x3ba0b - Ondragexit Atom = 0x3c50a - Ondragleave Atom = 0x3df0b - Ondragover Atom = 0x3ea0a - Ondragstart Atom = 0x3f40b - Ondrop Atom = 0x40306 - Ondurationchange Atom = 0x41310 - Onemptied Atom = 0x40a09 - Onended Atom = 0x42307 - Onerror Atom = 0x42a07 - Onfocus Atom = 0x43107 - Onhashchange Atom = 0x43d0c - Oninput Atom = 0x44907 - Oninvalid Atom = 0x45509 - Onkeydown Atom = 0x45e09 - Onkeypress Atom = 0x46b0a - Onkeyup Atom = 0x48007 - Onlanguagechange Atom = 0x48d10 - Onload Atom = 0x49d06 - Onloadeddata Atom = 0x49d0c - Onloadedmetadata Atom = 0x4b010 - Onloadend Atom = 0x4c609 - Onloadstart Atom = 0x4cf0b - Onmessage Atom = 0x4da09 - Onmessageerror Atom = 0x4da0e - Onmousedown Atom = 0x4e80b - Onmouseenter Atom = 0x4f30c - Onmouseleave Atom = 0x4ff0c - Onmousemove Atom = 0x50b0b - Onmouseout Atom = 0x5160a - Onmouseover Atom = 0x5230b - Onmouseup Atom = 0x52e09 - Onmousewheel Atom = 0x53c0c - Onoffline Atom = 0x54809 - Ononline Atom = 0x55108 - Onpagehide Atom = 0x5590a - Onpageshow Atom = 0x5730a - Onpaste Atom = 0x57f07 - Onpause Atom = 0x59a07 - Onplay Atom = 0x5a406 - Onplaying Atom = 0x5a409 - Onpopstate Atom = 0x5ad0a - Onprogress Atom = 0x5b70a - Onratechange Atom = 0x5cc0c - Onrejectionhandled Atom = 0x5d812 - Onreset Atom = 0x5ea07 - Onresize Atom = 0x5f108 - Onscroll Atom = 0x60008 - Onsecuritypolicyviolation Atom = 0x60819 - Onseeked Atom = 0x62908 - Onseeking Atom = 0x63109 - Onselect Atom = 0x63a08 - Onshow Atom = 0x64406 - Onsort Atom = 0x64f06 - Onstalled Atom = 0x65909 - Onstorage Atom = 0x66209 - Onsubmit Atom = 0x66b08 - Onsuspend Atom = 0x67b09 - Ontimeupdate Atom = 0x400c - Ontoggle Atom = 0x68408 - Onunhandledrejection Atom = 0x68c14 - Onunload Atom = 0x6ab08 - Onvolumechange Atom = 0x6b30e - Onwaiting Atom = 0x6c109 - Onwheel Atom = 0x6ca07 - Open Atom = 0x1a304 - Optgroup Atom = 0x5f08 - Optimum Atom = 0x6d107 - Option Atom = 0x6e306 - Output Atom = 0x51d06 - P Atom = 0xc01 - Param Atom = 0xc05 - Pattern Atom = 0x6607 - Picture Atom = 0x7b07 - Ping Atom = 0xef04 - Placeholder Atom = 0x1310b - Plaintext Atom = 0x1b209 - Playsinline Atom = 0x1400b - Poster Atom = 0x2cf06 - Pre Atom = 0x47003 - Preload Atom = 0x48607 - Progress Atom = 0x5b908 - Prompt Atom = 0x53606 - Public Atom = 0x58606 - Q Atom = 0xcf01 - Radiogroup Atom = 0x30a - Rb Atom = 0x3a02 - Readonly Atom = 0x35708 - Referrerpolicy Atom = 0x3d10e - Rel Atom = 0x48703 - Required Atom = 0x24c08 - Reversed Atom = 0x8008 - Rows Atom = 0x9c04 - Rowspan Atom = 0x9c07 - Rp Atom = 0x23c02 - Rt Atom = 0x19a02 - Rtc Atom = 0x19a03 - Ruby Atom = 0xfb04 - S Atom = 0x2501 - Samp Atom = 0x7804 - Sandbox Atom = 0x12907 - Scope Atom = 0x67505 - Scoped Atom = 0x67506 - Script Atom = 0x21806 - Seamless Atom = 0x37108 - Section Atom = 0x56807 - Select Atom = 0x63c06 - Selected Atom = 0x63c08 - Shape Atom = 0x1e505 - Size Atom = 0x5f504 - Sizes Atom = 0x5f505 - Slot Atom = 0x1ef04 - Small Atom = 0x20605 - Sortable Atom = 0x65108 - Sorted Atom = 0x33706 - Source Atom = 0x37806 - Spacer Atom = 0x43706 - Span Atom = 0x9f04 - Spellcheck Atom = 0x4740a - Src Atom = 0x5c003 - Srcdoc Atom = 0x5c006 - Srclang Atom = 0x5f907 - Srcset Atom = 0x6f906 - Start Atom = 0x3fa05 - Step Atom = 0x58304 - Strike Atom = 0xd206 - Strong Atom = 0x6dd06 - Style Atom = 0x6ff05 - Sub Atom = 0x66d03 - Summary Atom = 0x70407 - Sup Atom = 0x70b03 - Svg Atom = 0x70e03 - System Atom = 0x71106 - Tabindex Atom = 0x4be08 - Table Atom = 0x59505 - Target Atom = 0x2c406 - Tbody Atom = 0x2705 - Td Atom = 0x9202 - Template Atom = 0x71408 - Textarea Atom = 0x35208 - Tfoot Atom = 0xf505 - Th Atom = 0x15602 - Thead Atom = 0x33005 - Time Atom = 0x4204 - Title Atom = 0x11005 - Tr Atom = 0xcc02 - Track Atom = 0x1ba05 - Translate Atom = 0x1f209 - Tt Atom = 0x6802 - Type Atom = 0xd904 - Typemustmatch Atom = 0x2900d - U Atom = 0xb01 - Ul Atom = 0xa702 - Updateviacache Atom = 0x460e - Usemap Atom = 0x59e06 - Value Atom = 0x1505 - Var Atom = 0x16d03 - Video Atom = 0x2f105 - Wbr Atom = 0x57c03 - Width Atom = 0x64905 - Workertype Atom = 0x71c0a - Wrap Atom = 0x72604 - Xmp Atom = 0x12f03 -) - -const hash0 = 0x81cdf10e - -const maxAtomLen = 25 - -var table = [1 << 9]Atom{ - 0x1: 0xe60a, // mediagroup - 0x2: 0x2e404, // lang - 0x4: 0x2c09, // accesskey - 0x5: 0x8b08, // frameset - 0x7: 0x63a08, // onselect - 0x8: 0x71106, // system - 0xa: 0x64905, // width - 0xc: 0x2890b, // formenctype - 0xd: 0x13702, // ol - 0xe: 0x3970b, // oncuechange - 0x10: 0x14b03, // bdo - 0x11: 0x11505, // audio - 0x12: 0x17a09, // draggable - 0x14: 0x2f105, // video - 0x15: 0x2b102, // mn - 0x16: 0x38704, // menu - 0x17: 0x2cf06, // poster - 0x19: 0xf606, // footer - 0x1a: 0x2a806, // method - 0x1b: 0x2b808, // datetime - 0x1c: 0x19507, // onabort - 0x1d: 0x460e, // updateviacache - 0x1e: 0xff05, // async - 0x1f: 0x49d06, // onload - 0x21: 0x11908, // oncancel - 0x22: 0x62908, // onseeked - 0x23: 0x30205, // image - 0x24: 0x5d812, // onrejectionhandled - 0x26: 0x17404, // link - 0x27: 0x51d06, // output - 0x28: 0x33104, // head - 0x29: 0x4ff0c, // onmouseleave - 0x2a: 0x57f07, // onpaste - 0x2b: 0x5a409, // onplaying - 0x2c: 0x1c407, // colspan - 0x2f: 0x1bf05, // color - 0x30: 0x5f504, // size - 0x31: 0x2e80a, // http-equiv - 0x33: 0x601, // i - 0x34: 0x5590a, // onpagehide - 0x35: 0x68c14, // onunhandledrejection - 0x37: 0x42a07, // onerror - 0x3a: 0x3b08, // basefont - 0x3f: 0x1303, // nav - 0x40: 0x17704, // kind - 0x41: 0x35708, // readonly - 0x42: 0x30806, // mglyph - 0x44: 0xb202, // li - 0x46: 0x2d506, // hidden - 0x47: 0x70e03, // svg - 0x48: 0x58304, // step - 0x49: 0x23f09, // integrity - 0x4a: 0x58606, // public - 0x4c: 0x1ab03, // col - 0x4d: 0x1870a, // blockquote - 0x4e: 0x34f02, // h5 - 0x50: 0x5b908, // progress - 0x51: 0x5f505, // sizes - 0x52: 0x34502, // h4 - 0x56: 0x33005, // thead - 0x57: 0xd607, // keytype - 0x58: 0x5b70a, // onprogress - 0x59: 0x44b09, // inputmode - 0x5a: 0x3b109, // ondragend - 0x5d: 0x3a205, // oncut - 0x5e: 0x43706, // spacer - 0x5f: 0x1ab08, // colgroup - 0x62: 0x16502, // is - 0x65: 0x3c02, // as - 0x66: 0x54809, // onoffline - 0x67: 0x33706, // sorted - 0x69: 0x48d10, // onlanguagechange - 0x6c: 0x43d0c, // onhashchange - 0x6d: 0x9604, // name - 0x6e: 0xf505, // tfoot - 0x6f: 0x56104, // desc - 0x70: 0x33d03, // max - 0x72: 0x1ea06, // coords - 0x73: 0x30d02, // h3 - 0x74: 0x6e70e, // onbeforeunload - 0x75: 0x9c04, // rows - 0x76: 0x63c06, // select - 0x77: 0x9805, // meter - 0x78: 0x38b06, // itemid - 0x79: 0x53c0c, // onmousewheel - 0x7a: 0x5c006, // srcdoc - 0x7d: 0x1ba05, // track - 0x7f: 0x31f08, // itemtype - 0x82: 0xa402, // mo - 0x83: 0x41b08, // onchange - 0x84: 0x33107, // headers - 0x85: 0x5cc0c, // onratechange - 0x86: 0x60819, // onsecuritypolicyviolation - 0x88: 0x4a508, // datalist - 0x89: 0x4e80b, // onmousedown - 0x8a: 0x1ef04, // slot - 0x8b: 0x4b010, // onloadedmetadata - 0x8c: 0x1a06, // accept - 0x8d: 0x26806, // object - 0x91: 0x6b30e, // onvolumechange - 0x92: 0x2107, // charset - 0x93: 0x27613, // onautocompleteerror - 0x94: 0xc113, // allowpaymentrequest - 0x95: 0x2804, // body - 0x96: 0x10a07, // default - 0x97: 0x63c08, // selected - 0x98: 0x21e04, // face - 0x99: 0x1e505, // shape - 0x9b: 0x68408, // ontoggle - 0x9e: 0x64b02, // dt - 0x9f: 0xb604, // mark - 0xa1: 0xb01, // u - 0xa4: 0x6ab08, // onunload - 0xa5: 0x5d04, // loop - 0xa6: 0x16408, // disabled - 0xaa: 0x42307, // onended - 0xab: 0xb00a, // malignmark - 0xad: 0x67b09, // onsuspend - 0xae: 0x35105, // mtext - 0xaf: 0x64f06, // onsort - 0xb0: 0x19d08, // itemprop - 0xb3: 0x67109, // itemscope - 0xb4: 0x17305, // blink - 0xb6: 0x3b106, // ondrag - 0xb7: 0xa702, // ul - 0xb8: 0x26e04, // form - 0xb9: 0x12907, // sandbox - 0xba: 0x8b05, // frame - 0xbb: 0x1505, // value - 0xbc: 0x66209, // onstorage - 0xbf: 0xaa07, // acronym - 0xc0: 0x19a02, // rt - 0xc2: 0x202, // br - 0xc3: 0x22608, // fieldset - 0xc4: 0x2900d, // typemustmatch - 0xc5: 0xa208, // nomodule - 0xc6: 0x6c07, // noembed - 0xc7: 0x69e0d, // onbeforeprint - 0xc8: 0x19106, // button - 0xc9: 0x2f507, // onclick - 0xca: 0x70407, // summary - 0xcd: 0xfb04, // ruby - 0xce: 0x56405, // class - 0xcf: 0x3f40b, // ondragstart - 0xd0: 0x23107, // caption - 0xd4: 0xdd0e, // allowusermedia - 0xd5: 0x4cf0b, // onloadstart - 0xd9: 0x16b03, // div - 0xda: 0x4a904, // list - 0xdb: 0x32e04, // math - 0xdc: 0x44b05, // input - 0xdf: 0x3ea0a, // ondragover - 0xe0: 0x2de02, // h2 - 0xe2: 0x1b209, // plaintext - 0xe4: 0x4f30c, // onmouseenter - 0xe7: 0x47907, // checked - 0xe8: 0x47003, // pre - 0xea: 0x35f08, // multiple - 0xeb: 0xba03, // bdi - 0xec: 0x33d09, // maxlength - 0xed: 0xcf01, // q - 0xee: 0x61f0a, // onauxclick - 0xf0: 0x57c03, // wbr - 0xf2: 0x3b04, // base - 0xf3: 0x6e306, // option - 0xf5: 0x41310, // ondurationchange - 0xf7: 0x8908, // noframes - 0xf9: 0x40508, // dropzone - 0xfb: 0x67505, // scope - 0xfc: 0x8008, // reversed - 0xfd: 0x3ba0b, // ondragenter - 0xfe: 0x3fa05, // start - 0xff: 0x12f03, // xmp - 0x100: 0x5f907, // srclang - 0x101: 0x30703, // img - 0x104: 0x101, // b - 0x105: 0x25403, // for - 0x106: 0x10705, // aside - 0x107: 0x44907, // oninput - 0x108: 0x35604, // area - 0x109: 0x2a40a, // formmethod - 0x10a: 0x72604, // wrap - 0x10c: 0x23c02, // rp - 0x10d: 0x46b0a, // onkeypress - 0x10e: 0x6802, // tt - 0x110: 0x34702, // mi - 0x111: 0x36705, // muted - 0x112: 0xf303, // alt - 0x113: 0x5c504, // code - 0x114: 0x6e02, // em - 0x115: 0x3c50a, // ondragexit - 0x117: 0x9f04, // span - 0x119: 0x6d708, // manifest - 0x11a: 0x38708, // menuitem - 0x11b: 0x58b07, // content - 0x11d: 0x6c109, // onwaiting - 0x11f: 0x4c609, // onloadend - 0x121: 0x37e0d, // oncontextmenu - 0x123: 0x56d06, // onblur - 0x124: 0x3fc07, // article - 0x125: 0x9303, // dir - 0x126: 0xef04, // ping - 0x127: 0x24c08, // required - 0x128: 0x45509, // oninvalid - 0x129: 0xb105, // align - 0x12b: 0x58a04, // icon - 0x12c: 0x64d02, // h6 - 0x12d: 0x1c404, // cols - 0x12e: 0x22e0a, // figcaption - 0x12f: 0x45e09, // onkeydown - 0x130: 0x66b08, // onsubmit - 0x131: 0x14d09, // oncanplay - 0x132: 0x70b03, // sup - 0x133: 0xc01, // p - 0x135: 0x40a09, // onemptied - 0x136: 0x39106, // oncopy - 0x137: 0x19c04, // cite - 0x138: 0x3a70a, // ondblclick - 0x13a: 0x50b0b, // onmousemove - 0x13c: 0x66d03, // sub - 0x13d: 0x48703, // rel - 0x13e: 0x5f08, // optgroup - 0x142: 0x9c07, // rowspan - 0x143: 0x37806, // source - 0x144: 0x21608, // noscript - 0x145: 0x1a304, // open - 0x146: 0x20403, // ins - 0x147: 0x2540d, // foreignObject - 0x148: 0x5ad0a, // onpopstate - 0x14a: 0x28d07, // enctype - 0x14b: 0x2760e, // onautocomplete - 0x14c: 0x35208, // textarea - 0x14e: 0x2780c, // autocomplete - 0x14f: 0x15702, // hr - 0x150: 0x1de08, // controls - 0x151: 0x10902, // id - 0x153: 0x2360c, // onafterprint - 0x155: 0x2610d, // foreignobject - 0x156: 0x32707, // marquee - 0x157: 0x59a07, // onpause - 0x158: 0x5e602, // dl - 0x159: 0x5206, // height - 0x15a: 0x34703, // min - 0x15b: 0x9307, // dirname - 0x15c: 0x1f209, // translate - 0x15d: 0x5604, // html - 0x15e: 0x34709, // minlength - 0x15f: 0x48607, // preload - 0x160: 0x71408, // template - 0x161: 0x3df0b, // ondragleave - 0x162: 0x3a02, // rb - 0x164: 0x5c003, // src - 0x165: 0x6dd06, // strong - 0x167: 0x7804, // samp - 0x168: 0x6f307, // address - 0x169: 0x55108, // ononline - 0x16b: 0x1310b, // placeholder - 0x16c: 0x2c406, // target - 0x16d: 0x20605, // small - 0x16e: 0x6ca07, // onwheel - 0x16f: 0x1c90a, // annotation - 0x170: 0x4740a, // spellcheck - 0x171: 0x7207, // details - 0x172: 0x10306, // canvas - 0x173: 0x12109, // autofocus - 0x174: 0xc05, // param - 0x176: 0x46308, // download - 0x177: 0x45203, // del - 0x178: 0x36c07, // onclose - 0x179: 0xb903, // kbd - 0x17a: 0x31906, // applet - 0x17b: 0x2e004, // href - 0x17c: 0x5f108, // onresize - 0x17e: 0x49d0c, // onloadeddata - 0x180: 0xcc02, // tr - 0x181: 0x2c00a, // formtarget - 0x182: 0x11005, // title - 0x183: 0x6ff05, // style - 0x184: 0xd206, // strike - 0x185: 0x59e06, // usemap - 0x186: 0x2fc06, // iframe - 0x187: 0x1004, // main - 0x189: 0x7b07, // picture - 0x18c: 0x31605, // ismap - 0x18e: 0x4a504, // data - 0x18f: 0x5905, // label - 0x191: 0x3d10e, // referrerpolicy - 0x192: 0x15602, // th - 0x194: 0x53606, // prompt - 0x195: 0x56807, // section - 0x197: 0x6d107, // optimum - 0x198: 0x2db04, // high - 0x199: 0x15c02, // h1 - 0x19a: 0x65909, // onstalled - 0x19b: 0x16d03, // var - 0x19c: 0x4204, // time - 0x19e: 0x67402, // ms - 0x19f: 0x33106, // header - 0x1a0: 0x4da09, // onmessage - 0x1a1: 0x1a605, // nonce - 0x1a2: 0x26e0a, // formaction - 0x1a3: 0x22006, // center - 0x1a4: 0x3704, // nobr - 0x1a5: 0x59505, // table - 0x1a6: 0x4a907, // listing - 0x1a7: 0x18106, // legend - 0x1a9: 0x29b09, // challenge - 0x1aa: 0x24806, // figure - 0x1ab: 0xe605, // media - 0x1ae: 0xd904, // type - 0x1af: 0x3f04, // font - 0x1b0: 0x4da0e, // onmessageerror - 0x1b1: 0x37108, // seamless - 0x1b2: 0x8703, // dfn - 0x1b3: 0x5c705, // defer - 0x1b4: 0xc303, // low - 0x1b5: 0x19a03, // rtc - 0x1b6: 0x5230b, // onmouseover - 0x1b7: 0x2b20a, // novalidate - 0x1b8: 0x71c0a, // workertype - 0x1ba: 0x3cd07, // itemref - 0x1bd: 0x1, // a - 0x1be: 0x31803, // map - 0x1bf: 0x400c, // ontimeupdate - 0x1c0: 0x15e07, // bgsound - 0x1c1: 0x3206, // keygen - 0x1c2: 0x2705, // tbody - 0x1c5: 0x64406, // onshow - 0x1c7: 0x2501, // s - 0x1c8: 0x6607, // pattern - 0x1cc: 0x14d10, // oncanplaythrough - 0x1ce: 0x2d702, // dd - 0x1cf: 0x6f906, // srcset - 0x1d0: 0x17003, // big - 0x1d2: 0x65108, // sortable - 0x1d3: 0x48007, // onkeyup - 0x1d5: 0x5a406, // onplay - 0x1d7: 0x4b804, // meta - 0x1d8: 0x40306, // ondrop - 0x1da: 0x60008, // onscroll - 0x1db: 0x1fb0b, // crossorigin - 0x1dc: 0x5730a, // onpageshow - 0x1dd: 0x4, // abbr - 0x1de: 0x9202, // td - 0x1df: 0x58b0f, // contenteditable - 0x1e0: 0x27206, // action - 0x1e1: 0x1400b, // playsinline - 0x1e2: 0x43107, // onfocus - 0x1e3: 0x2e008, // hreflang - 0x1e5: 0x5160a, // onmouseout - 0x1e6: 0x5ea07, // onreset - 0x1e7: 0x13c08, // autoplay - 0x1e8: 0x63109, // onseeking - 0x1ea: 0x67506, // scoped - 0x1ec: 0x30a, // radiogroup - 0x1ee: 0x3800b, // contextmenu - 0x1ef: 0x52e09, // onmouseup - 0x1f1: 0x2ca06, // hgroup - 0x1f2: 0x2080f, // allowfullscreen - 0x1f3: 0x4be08, // tabindex - 0x1f6: 0x30f07, // isindex - 0x1f7: 0x1a0e, // accept-charset - 0x1f8: 0x2ae0e, // formnovalidate - 0x1fb: 0x1c90e, // annotation-xml - 0x1fc: 0x6e05, // embed - 0x1fd: 0x21806, // script - 0x1fe: 0xbb06, // dialog - 0x1ff: 0x1d707, // command -} - -const atomText = "abbradiogrouparamainavalueaccept-charsetbodyaccesskeygenobrb" + - "asefontimeupdateviacacheightmlabelooptgroupatternoembedetail" + - "sampictureversedfnoframesetdirnameterowspanomoduleacronymali" + - "gnmarkbdialogallowpaymentrequestrikeytypeallowusermediagroup" + - "ingaltfooterubyasyncanvasidefaultitleaudioncancelautofocusan" + - "dboxmplaceholderautoplaysinlinebdoncanplaythrough1bgsoundisa" + - "bledivarbigblinkindraggablegendblockquotebuttonabortcitempro" + - "penoncecolgrouplaintextrackcolorcolspannotation-xmlcommandco" + - "ntrolshapecoordslotranslatecrossoriginsmallowfullscreenoscri" + - "ptfacenterfieldsetfigcaptionafterprintegrityfigurequiredfore" + - "ignObjectforeignobjectformactionautocompleteerrorformenctype" + - "mustmatchallengeformmethodformnovalidatetimeformtargethgroup" + - "osterhiddenhigh2hreflanghttp-equivideonclickiframeimageimgly" + - "ph3isindexismappletitemtypemarqueematheadersortedmaxlength4m" + - "inlength5mtextareadonlymultiplemutedoncloseamlessourceoncont" + - "extmenuitemidoncopyoncuechangeoncutondblclickondragendondrag" + - "enterondragexitemreferrerpolicyondragleaveondragoverondragst" + - "articleondropzonemptiedondurationchangeonendedonerroronfocus" + - "paceronhashchangeoninputmodeloninvalidonkeydownloadonkeypres" + - "spellcheckedonkeyupreloadonlanguagechangeonloadeddatalisting" + - "onloadedmetadatabindexonloadendonloadstartonmessageerroronmo" + - "usedownonmouseenteronmouseleaveonmousemoveonmouseoutputonmou" + - "seoveronmouseupromptonmousewheelonofflineononlineonpagehides" + - "classectionbluronpageshowbronpastepublicontenteditableonpaus" + - "emaponplayingonpopstateonprogressrcdocodeferonratechangeonre" + - "jectionhandledonresetonresizesrclangonscrollonsecuritypolicy" + - "violationauxclickonseekedonseekingonselectedonshowidth6onsor" + - "tableonstalledonstorageonsubmitemscopedonsuspendontoggleonun" + - "handledrejectionbeforeprintonunloadonvolumechangeonwaitingon" + - "wheeloptimumanifestrongoptionbeforeunloaddressrcsetstylesumm" + - "arysupsvgsystemplateworkertypewrap" diff --git a/vendor/golang.org/x/net/html/const.go b/vendor/golang.org/x/net/html/const.go deleted file mode 100644 index a3a918f..0000000 --- a/vendor/golang.org/x/net/html/const.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package html - -// Section 12.2.4.2 of the HTML5 specification says "The following elements -// have varying levels of special parsing rules". -// https://html.spec.whatwg.org/multipage/syntax.html#the-stack-of-open-elements -var isSpecialElementMap = map[string]bool{ - "address": true, - "applet": true, - "area": true, - "article": true, - "aside": true, - "base": true, - "basefont": true, - "bgsound": true, - "blockquote": true, - "body": true, - "br": true, - "button": true, - "caption": true, - "center": true, - "col": true, - "colgroup": true, - "dd": true, - "details": true, - "dir": true, - "div": true, - "dl": true, - "dt": true, - "embed": true, - "fieldset": true, - "figcaption": true, - "figure": true, - "footer": true, - "form": true, - "frame": true, - "frameset": true, - "h1": true, - "h2": true, - "h3": true, - "h4": true, - "h5": true, - "h6": true, - "head": true, - "header": true, - "hgroup": true, - "hr": true, - "html": true, - "iframe": true, - "img": true, - "input": true, - "isindex": true, // The 'isindex' element has been removed, but keep it for backwards compatibility. - "keygen": true, - "li": true, - "link": true, - "listing": true, - "main": true, - "marquee": true, - "menu": true, - "meta": true, - "nav": true, - "noembed": true, - "noframes": true, - "noscript": true, - "object": true, - "ol": true, - "p": true, - "param": true, - "plaintext": true, - "pre": true, - "script": true, - "section": true, - "select": true, - "source": true, - "style": true, - "summary": true, - "table": true, - "tbody": true, - "td": true, - "template": true, - "textarea": true, - "tfoot": true, - "th": true, - "thead": true, - "title": true, - "tr": true, - "track": true, - "ul": true, - "wbr": true, - "xmp": true, -} - -func isSpecialElement(element *Node) bool { - switch element.Namespace { - case "", "html": - return isSpecialElementMap[element.Data] - case "math": - switch element.Data { - case "mi", "mo", "mn", "ms", "mtext", "annotation-xml": - return true - } - case "svg": - switch element.Data { - case "foreignObject", "desc", "title": - return true - } - } - return false -} diff --git a/vendor/golang.org/x/net/html/doc.go b/vendor/golang.org/x/net/html/doc.go deleted file mode 100644 index 822ed42..0000000 --- a/vendor/golang.org/x/net/html/doc.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package html implements an HTML5-compliant tokenizer and parser. - -Tokenization is done by creating a Tokenizer for an io.Reader r. It is the -caller's responsibility to ensure that r provides UTF-8 encoded HTML. - - z := html.NewTokenizer(r) - -Given a Tokenizer z, the HTML is tokenized by repeatedly calling z.Next(), -which parses the next token and returns its type, or an error: - - for { - tt := z.Next() - if tt == html.ErrorToken { - // ... - return ... - } - // Process the current token. - } - -There are two APIs for retrieving the current token. The high-level API is to -call Token; the low-level API is to call Text or TagName / TagAttr. Both APIs -allow optionally calling Raw after Next but before Token, Text, TagName, or -TagAttr. In EBNF notation, the valid call sequence per token is: - - Next {Raw} [ Token | Text | TagName {TagAttr} ] - -Token returns an independent data structure that completely describes a token. -Entities (such as "<") are unescaped, tag names and attribute keys are -lower-cased, and attributes are collected into a []Attribute. For example: - - for { - if z.Next() == html.ErrorToken { - // Returning io.EOF indicates success. - return z.Err() - } - emitToken(z.Token()) - } - -The low-level API performs fewer allocations and copies, but the contents of -the []byte values returned by Text, TagName and TagAttr may change on the next -call to Next. For example, to extract an HTML page's anchor text: - - depth := 0 - for { - tt := z.Next() - switch tt { - case html.ErrorToken: - return z.Err() - case html.TextToken: - if depth > 0 { - // emitBytes should copy the []byte it receives, - // if it doesn't process it immediately. - emitBytes(z.Text()) - } - case html.StartTagToken, html.EndTagToken: - tn, _ := z.TagName() - if len(tn) == 1 && tn[0] == 'a' { - if tt == html.StartTagToken { - depth++ - } else { - depth-- - } - } - } - } - -Parsing is done by calling Parse with an io.Reader, which returns the root of -the parse tree (the document element) as a *Node. It is the caller's -responsibility to ensure that the Reader provides UTF-8 encoded HTML. For -example, to process each anchor node in depth-first order: - - doc, err := html.Parse(r) - if err != nil { - // ... - } - var f func(*html.Node) - f = func(n *html.Node) { - if n.Type == html.ElementNode && n.Data == "a" { - // Do something with n... - } - for c := n.FirstChild; c != nil; c = c.NextSibling { - f(c) - } - } - f(doc) - -The relevant specifications include: -https://html.spec.whatwg.org/multipage/syntax.html and -https://html.spec.whatwg.org/multipage/syntax.html#tokenization -*/ -package html // import "golang.org/x/net/html" - -// The tokenization algorithm implemented by this package is not a line-by-line -// transliteration of the relatively verbose state-machine in the WHATWG -// specification. A more direct approach is used instead, where the program -// counter implies the state, such as whether it is tokenizing a tag or a text -// node. Specification compliance is verified by checking expected and actual -// outputs over a test suite rather than aiming for algorithmic fidelity. - -// TODO(nigeltao): Does a DOM API belong in this package or a separate one? -// TODO(nigeltao): How does parsing interact with a JavaScript engine? diff --git a/vendor/golang.org/x/net/html/doctype.go b/vendor/golang.org/x/net/html/doctype.go deleted file mode 100644 index c484e5a..0000000 --- a/vendor/golang.org/x/net/html/doctype.go +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package html - -import ( - "strings" -) - -// parseDoctype parses the data from a DoctypeToken into a name, -// public identifier, and system identifier. It returns a Node whose Type -// is DoctypeNode, whose Data is the name, and which has attributes -// named "system" and "public" for the two identifiers if they were present. -// quirks is whether the document should be parsed in "quirks mode". -func parseDoctype(s string) (n *Node, quirks bool) { - n = &Node{Type: DoctypeNode} - - // Find the name. - space := strings.IndexAny(s, whitespace) - if space == -1 { - space = len(s) - } - n.Data = s[:space] - // The comparison to "html" is case-sensitive. - if n.Data != "html" { - quirks = true - } - n.Data = strings.ToLower(n.Data) - s = strings.TrimLeft(s[space:], whitespace) - - if len(s) < 6 { - // It can't start with "PUBLIC" or "SYSTEM". - // Ignore the rest of the string. - return n, quirks || s != "" - } - - key := strings.ToLower(s[:6]) - s = s[6:] - for key == "public" || key == "system" { - s = strings.TrimLeft(s, whitespace) - if s == "" { - break - } - quote := s[0] - if quote != '"' && quote != '\'' { - break - } - s = s[1:] - q := strings.IndexRune(s, rune(quote)) - var id string - if q == -1 { - id = s - s = "" - } else { - id = s[:q] - s = s[q+1:] - } - n.Attr = append(n.Attr, Attribute{Key: key, Val: id}) - if key == "public" { - key = "system" - } else { - key = "" - } - } - - if key != "" || s != "" { - quirks = true - } else if len(n.Attr) > 0 { - if n.Attr[0].Key == "public" { - public := strings.ToLower(n.Attr[0].Val) - switch public { - case "-//w3o//dtd w3 html strict 3.0//en//", "-/w3d/dtd html 4.0 transitional/en", "html": - quirks = true - default: - for _, q := range quirkyIDs { - if strings.HasPrefix(public, q) { - quirks = true - break - } - } - } - // The following two public IDs only cause quirks mode if there is no system ID. - if len(n.Attr) == 1 && (strings.HasPrefix(public, "-//w3c//dtd html 4.01 frameset//") || - strings.HasPrefix(public, "-//w3c//dtd html 4.01 transitional//")) { - quirks = true - } - } - if lastAttr := n.Attr[len(n.Attr)-1]; lastAttr.Key == "system" && - strings.ToLower(lastAttr.Val) == "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" { - quirks = true - } - } - - return n, quirks -} - -// quirkyIDs is a list of public doctype identifiers that cause a document -// to be interpreted in quirks mode. The identifiers should be in lower case. -var quirkyIDs = []string{ - "+//silmaril//dtd html pro v0r11 19970101//", - "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", - "-//as//dtd html 3.0 aswedit + extensions//", - "-//ietf//dtd html 2.0 level 1//", - "-//ietf//dtd html 2.0 level 2//", - "-//ietf//dtd html 2.0 strict level 1//", - "-//ietf//dtd html 2.0 strict level 2//", - "-//ietf//dtd html 2.0 strict//", - "-//ietf//dtd html 2.0//", - "-//ietf//dtd html 2.1e//", - "-//ietf//dtd html 3.0//", - "-//ietf//dtd html 3.2 final//", - "-//ietf//dtd html 3.2//", - "-//ietf//dtd html 3//", - "-//ietf//dtd html level 0//", - "-//ietf//dtd html level 1//", - "-//ietf//dtd html level 2//", - "-//ietf//dtd html level 3//", - "-//ietf//dtd html strict level 0//", - "-//ietf//dtd html strict level 1//", - "-//ietf//dtd html strict level 2//", - "-//ietf//dtd html strict level 3//", - "-//ietf//dtd html strict//", - "-//ietf//dtd html//", - "-//metrius//dtd metrius presentational//", - "-//microsoft//dtd internet explorer 2.0 html strict//", - "-//microsoft//dtd internet explorer 2.0 html//", - "-//microsoft//dtd internet explorer 2.0 tables//", - "-//microsoft//dtd internet explorer 3.0 html strict//", - "-//microsoft//dtd internet explorer 3.0 html//", - "-//microsoft//dtd internet explorer 3.0 tables//", - "-//netscape comm. corp.//dtd html//", - "-//netscape comm. corp.//dtd strict html//", - "-//o'reilly and associates//dtd html 2.0//", - "-//o'reilly and associates//dtd html extended 1.0//", - "-//o'reilly and associates//dtd html extended relaxed 1.0//", - "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", - "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", - "-//spyglass//dtd html 2.0 extended//", - "-//sq//dtd html 2.0 hotmetal + extensions//", - "-//sun microsystems corp.//dtd hotjava html//", - "-//sun microsystems corp.//dtd hotjava strict html//", - "-//w3c//dtd html 3 1995-03-24//", - "-//w3c//dtd html 3.2 draft//", - "-//w3c//dtd html 3.2 final//", - "-//w3c//dtd html 3.2//", - "-//w3c//dtd html 3.2s draft//", - "-//w3c//dtd html 4.0 frameset//", - "-//w3c//dtd html 4.0 transitional//", - "-//w3c//dtd html experimental 19960712//", - "-//w3c//dtd html experimental 970421//", - "-//w3c//dtd w3 html//", - "-//w3o//dtd w3 html 3.0//", - "-//webtechs//dtd mozilla html 2.0//", - "-//webtechs//dtd mozilla html//", -} diff --git a/vendor/golang.org/x/net/html/entity.go b/vendor/golang.org/x/net/html/entity.go deleted file mode 100644 index b628880..0000000 --- a/vendor/golang.org/x/net/html/entity.go +++ /dev/null @@ -1,2253 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package html - -// All entities that do not end with ';' are 6 or fewer bytes long. -const longestEntityWithoutSemicolon = 6 - -// entity is a map from HTML entity names to their values. The semicolon matters: -// https://html.spec.whatwg.org/multipage/syntax.html#named-character-references -// lists both "amp" and "amp;" as two separate entries. -// -// Note that the HTML5 list is larger than the HTML4 list at -// http://www.w3.org/TR/html4/sgml/entities.html -var entity = map[string]rune{ - "AElig;": '\U000000C6', - "AMP;": '\U00000026', - "Aacute;": '\U000000C1', - "Abreve;": '\U00000102', - "Acirc;": '\U000000C2', - "Acy;": '\U00000410', - "Afr;": '\U0001D504', - "Agrave;": '\U000000C0', - "Alpha;": '\U00000391', - "Amacr;": '\U00000100', - "And;": '\U00002A53', - "Aogon;": '\U00000104', - "Aopf;": '\U0001D538', - "ApplyFunction;": '\U00002061', - "Aring;": '\U000000C5', - "Ascr;": '\U0001D49C', - "Assign;": '\U00002254', - "Atilde;": '\U000000C3', - "Auml;": '\U000000C4', - "Backslash;": '\U00002216', - "Barv;": '\U00002AE7', - "Barwed;": '\U00002306', - "Bcy;": '\U00000411', - "Because;": '\U00002235', - "Bernoullis;": '\U0000212C', - "Beta;": '\U00000392', - "Bfr;": '\U0001D505', - "Bopf;": '\U0001D539', - "Breve;": '\U000002D8', - "Bscr;": '\U0000212C', - "Bumpeq;": '\U0000224E', - "CHcy;": '\U00000427', - "COPY;": '\U000000A9', - "Cacute;": '\U00000106', - "Cap;": '\U000022D2', - "CapitalDifferentialD;": '\U00002145', - "Cayleys;": '\U0000212D', - "Ccaron;": '\U0000010C', - "Ccedil;": '\U000000C7', - "Ccirc;": '\U00000108', - "Cconint;": '\U00002230', - "Cdot;": '\U0000010A', - "Cedilla;": '\U000000B8', - "CenterDot;": '\U000000B7', - "Cfr;": '\U0000212D', - "Chi;": '\U000003A7', - "CircleDot;": '\U00002299', - "CircleMinus;": '\U00002296', - "CirclePlus;": '\U00002295', - "CircleTimes;": '\U00002297', - "ClockwiseContourIntegral;": '\U00002232', - "CloseCurlyDoubleQuote;": '\U0000201D', - "CloseCurlyQuote;": '\U00002019', - "Colon;": '\U00002237', - "Colone;": '\U00002A74', - "Congruent;": '\U00002261', - "Conint;": '\U0000222F', - "ContourIntegral;": '\U0000222E', - "Copf;": '\U00002102', - "Coproduct;": '\U00002210', - "CounterClockwiseContourIntegral;": '\U00002233', - "Cross;": '\U00002A2F', - "Cscr;": '\U0001D49E', - "Cup;": '\U000022D3', - "CupCap;": '\U0000224D', - "DD;": '\U00002145', - "DDotrahd;": '\U00002911', - "DJcy;": '\U00000402', - "DScy;": '\U00000405', - "DZcy;": '\U0000040F', - "Dagger;": '\U00002021', - "Darr;": '\U000021A1', - "Dashv;": '\U00002AE4', - "Dcaron;": '\U0000010E', - "Dcy;": '\U00000414', - "Del;": '\U00002207', - "Delta;": '\U00000394', - "Dfr;": '\U0001D507', - "DiacriticalAcute;": '\U000000B4', - "DiacriticalDot;": '\U000002D9', - "DiacriticalDoubleAcute;": '\U000002DD', - "DiacriticalGrave;": '\U00000060', - "DiacriticalTilde;": '\U000002DC', - "Diamond;": '\U000022C4', - "DifferentialD;": '\U00002146', - "Dopf;": '\U0001D53B', - "Dot;": '\U000000A8', - "DotDot;": '\U000020DC', - "DotEqual;": '\U00002250', - "DoubleContourIntegral;": '\U0000222F', - "DoubleDot;": '\U000000A8', - "DoubleDownArrow;": '\U000021D3', - "DoubleLeftArrow;": '\U000021D0', - "DoubleLeftRightArrow;": '\U000021D4', - "DoubleLeftTee;": '\U00002AE4', - "DoubleLongLeftArrow;": '\U000027F8', - "DoubleLongLeftRightArrow;": '\U000027FA', - "DoubleLongRightArrow;": '\U000027F9', - "DoubleRightArrow;": '\U000021D2', - "DoubleRightTee;": '\U000022A8', - "DoubleUpArrow;": '\U000021D1', - "DoubleUpDownArrow;": '\U000021D5', - "DoubleVerticalBar;": '\U00002225', - "DownArrow;": '\U00002193', - "DownArrowBar;": '\U00002913', - "DownArrowUpArrow;": '\U000021F5', - "DownBreve;": '\U00000311', - "DownLeftRightVector;": '\U00002950', - "DownLeftTeeVector;": '\U0000295E', - "DownLeftVector;": '\U000021BD', - "DownLeftVectorBar;": '\U00002956', - "DownRightTeeVector;": '\U0000295F', - "DownRightVector;": '\U000021C1', - "DownRightVectorBar;": '\U00002957', - "DownTee;": '\U000022A4', - "DownTeeArrow;": '\U000021A7', - "Downarrow;": '\U000021D3', - "Dscr;": '\U0001D49F', - "Dstrok;": '\U00000110', - "ENG;": '\U0000014A', - "ETH;": '\U000000D0', - "Eacute;": '\U000000C9', - "Ecaron;": '\U0000011A', - "Ecirc;": '\U000000CA', - "Ecy;": '\U0000042D', - "Edot;": '\U00000116', - "Efr;": '\U0001D508', - "Egrave;": '\U000000C8', - "Element;": '\U00002208', - "Emacr;": '\U00000112', - "EmptySmallSquare;": '\U000025FB', - "EmptyVerySmallSquare;": '\U000025AB', - "Eogon;": '\U00000118', - "Eopf;": '\U0001D53C', - "Epsilon;": '\U00000395', - "Equal;": '\U00002A75', - "EqualTilde;": '\U00002242', - "Equilibrium;": '\U000021CC', - "Escr;": '\U00002130', - "Esim;": '\U00002A73', - "Eta;": '\U00000397', - "Euml;": '\U000000CB', - "Exists;": '\U00002203', - "ExponentialE;": '\U00002147', - "Fcy;": '\U00000424', - "Ffr;": '\U0001D509', - "FilledSmallSquare;": '\U000025FC', - "FilledVerySmallSquare;": '\U000025AA', - "Fopf;": '\U0001D53D', - "ForAll;": '\U00002200', - "Fouriertrf;": '\U00002131', - "Fscr;": '\U00002131', - "GJcy;": '\U00000403', - "GT;": '\U0000003E', - "Gamma;": '\U00000393', - "Gammad;": '\U000003DC', - "Gbreve;": '\U0000011E', - "Gcedil;": '\U00000122', - "Gcirc;": '\U0000011C', - "Gcy;": '\U00000413', - "Gdot;": '\U00000120', - "Gfr;": '\U0001D50A', - "Gg;": '\U000022D9', - "Gopf;": '\U0001D53E', - "GreaterEqual;": '\U00002265', - "GreaterEqualLess;": '\U000022DB', - "GreaterFullEqual;": '\U00002267', - "GreaterGreater;": '\U00002AA2', - "GreaterLess;": '\U00002277', - "GreaterSlantEqual;": '\U00002A7E', - "GreaterTilde;": '\U00002273', - "Gscr;": '\U0001D4A2', - "Gt;": '\U0000226B', - "HARDcy;": '\U0000042A', - "Hacek;": '\U000002C7', - "Hat;": '\U0000005E', - "Hcirc;": '\U00000124', - "Hfr;": '\U0000210C', - "HilbertSpace;": '\U0000210B', - "Hopf;": '\U0000210D', - "HorizontalLine;": '\U00002500', - "Hscr;": '\U0000210B', - "Hstrok;": '\U00000126', - "HumpDownHump;": '\U0000224E', - "HumpEqual;": '\U0000224F', - "IEcy;": '\U00000415', - "IJlig;": '\U00000132', - "IOcy;": '\U00000401', - "Iacute;": '\U000000CD', - "Icirc;": '\U000000CE', - "Icy;": '\U00000418', - "Idot;": '\U00000130', - "Ifr;": '\U00002111', - "Igrave;": '\U000000CC', - "Im;": '\U00002111', - "Imacr;": '\U0000012A', - "ImaginaryI;": '\U00002148', - "Implies;": '\U000021D2', - "Int;": '\U0000222C', - "Integral;": '\U0000222B', - "Intersection;": '\U000022C2', - "InvisibleComma;": '\U00002063', - "InvisibleTimes;": '\U00002062', - "Iogon;": '\U0000012E', - "Iopf;": '\U0001D540', - "Iota;": '\U00000399', - "Iscr;": '\U00002110', - "Itilde;": '\U00000128', - "Iukcy;": '\U00000406', - "Iuml;": '\U000000CF', - "Jcirc;": '\U00000134', - "Jcy;": '\U00000419', - "Jfr;": '\U0001D50D', - "Jopf;": '\U0001D541', - "Jscr;": '\U0001D4A5', - "Jsercy;": '\U00000408', - "Jukcy;": '\U00000404', - "KHcy;": '\U00000425', - "KJcy;": '\U0000040C', - "Kappa;": '\U0000039A', - "Kcedil;": '\U00000136', - "Kcy;": '\U0000041A', - "Kfr;": '\U0001D50E', - "Kopf;": '\U0001D542', - "Kscr;": '\U0001D4A6', - "LJcy;": '\U00000409', - "LT;": '\U0000003C', - "Lacute;": '\U00000139', - "Lambda;": '\U0000039B', - "Lang;": '\U000027EA', - "Laplacetrf;": '\U00002112', - "Larr;": '\U0000219E', - "Lcaron;": '\U0000013D', - "Lcedil;": '\U0000013B', - "Lcy;": '\U0000041B', - "LeftAngleBracket;": '\U000027E8', - "LeftArrow;": '\U00002190', - "LeftArrowBar;": '\U000021E4', - "LeftArrowRightArrow;": '\U000021C6', - "LeftCeiling;": '\U00002308', - "LeftDoubleBracket;": '\U000027E6', - "LeftDownTeeVector;": '\U00002961', - "LeftDownVector;": '\U000021C3', - "LeftDownVectorBar;": '\U00002959', - "LeftFloor;": '\U0000230A', - "LeftRightArrow;": '\U00002194', - "LeftRightVector;": '\U0000294E', - "LeftTee;": '\U000022A3', - "LeftTeeArrow;": '\U000021A4', - "LeftTeeVector;": '\U0000295A', - "LeftTriangle;": '\U000022B2', - "LeftTriangleBar;": '\U000029CF', - "LeftTriangleEqual;": '\U000022B4', - "LeftUpDownVector;": '\U00002951', - "LeftUpTeeVector;": '\U00002960', - "LeftUpVector;": '\U000021BF', - "LeftUpVectorBar;": '\U00002958', - "LeftVector;": '\U000021BC', - "LeftVectorBar;": '\U00002952', - "Leftarrow;": '\U000021D0', - "Leftrightarrow;": '\U000021D4', - "LessEqualGreater;": '\U000022DA', - "LessFullEqual;": '\U00002266', - "LessGreater;": '\U00002276', - "LessLess;": '\U00002AA1', - "LessSlantEqual;": '\U00002A7D', - "LessTilde;": '\U00002272', - "Lfr;": '\U0001D50F', - "Ll;": '\U000022D8', - "Lleftarrow;": '\U000021DA', - "Lmidot;": '\U0000013F', - "LongLeftArrow;": '\U000027F5', - "LongLeftRightArrow;": '\U000027F7', - "LongRightArrow;": '\U000027F6', - "Longleftarrow;": '\U000027F8', - "Longleftrightarrow;": '\U000027FA', - "Longrightarrow;": '\U000027F9', - "Lopf;": '\U0001D543', - "LowerLeftArrow;": '\U00002199', - "LowerRightArrow;": '\U00002198', - "Lscr;": '\U00002112', - "Lsh;": '\U000021B0', - "Lstrok;": '\U00000141', - "Lt;": '\U0000226A', - "Map;": '\U00002905', - "Mcy;": '\U0000041C', - "MediumSpace;": '\U0000205F', - "Mellintrf;": '\U00002133', - "Mfr;": '\U0001D510', - "MinusPlus;": '\U00002213', - "Mopf;": '\U0001D544', - "Mscr;": '\U00002133', - "Mu;": '\U0000039C', - "NJcy;": '\U0000040A', - "Nacute;": '\U00000143', - "Ncaron;": '\U00000147', - "Ncedil;": '\U00000145', - "Ncy;": '\U0000041D', - "NegativeMediumSpace;": '\U0000200B', - "NegativeThickSpace;": '\U0000200B', - "NegativeThinSpace;": '\U0000200B', - "NegativeVeryThinSpace;": '\U0000200B', - "NestedGreaterGreater;": '\U0000226B', - "NestedLessLess;": '\U0000226A', - "NewLine;": '\U0000000A', - "Nfr;": '\U0001D511', - "NoBreak;": '\U00002060', - "NonBreakingSpace;": '\U000000A0', - "Nopf;": '\U00002115', - "Not;": '\U00002AEC', - "NotCongruent;": '\U00002262', - "NotCupCap;": '\U0000226D', - "NotDoubleVerticalBar;": '\U00002226', - "NotElement;": '\U00002209', - "NotEqual;": '\U00002260', - "NotExists;": '\U00002204', - "NotGreater;": '\U0000226F', - "NotGreaterEqual;": '\U00002271', - "NotGreaterLess;": '\U00002279', - "NotGreaterTilde;": '\U00002275', - "NotLeftTriangle;": '\U000022EA', - "NotLeftTriangleEqual;": '\U000022EC', - "NotLess;": '\U0000226E', - "NotLessEqual;": '\U00002270', - "NotLessGreater;": '\U00002278', - "NotLessTilde;": '\U00002274', - "NotPrecedes;": '\U00002280', - "NotPrecedesSlantEqual;": '\U000022E0', - "NotReverseElement;": '\U0000220C', - "NotRightTriangle;": '\U000022EB', - "NotRightTriangleEqual;": '\U000022ED', - "NotSquareSubsetEqual;": '\U000022E2', - "NotSquareSupersetEqual;": '\U000022E3', - "NotSubsetEqual;": '\U00002288', - "NotSucceeds;": '\U00002281', - "NotSucceedsSlantEqual;": '\U000022E1', - "NotSupersetEqual;": '\U00002289', - "NotTilde;": '\U00002241', - "NotTildeEqual;": '\U00002244', - "NotTildeFullEqual;": '\U00002247', - "NotTildeTilde;": '\U00002249', - "NotVerticalBar;": '\U00002224', - "Nscr;": '\U0001D4A9', - "Ntilde;": '\U000000D1', - "Nu;": '\U0000039D', - "OElig;": '\U00000152', - "Oacute;": '\U000000D3', - "Ocirc;": '\U000000D4', - "Ocy;": '\U0000041E', - "Odblac;": '\U00000150', - "Ofr;": '\U0001D512', - "Ograve;": '\U000000D2', - "Omacr;": '\U0000014C', - "Omega;": '\U000003A9', - "Omicron;": '\U0000039F', - "Oopf;": '\U0001D546', - "OpenCurlyDoubleQuote;": '\U0000201C', - "OpenCurlyQuote;": '\U00002018', - "Or;": '\U00002A54', - "Oscr;": '\U0001D4AA', - "Oslash;": '\U000000D8', - "Otilde;": '\U000000D5', - "Otimes;": '\U00002A37', - "Ouml;": '\U000000D6', - "OverBar;": '\U0000203E', - "OverBrace;": '\U000023DE', - "OverBracket;": '\U000023B4', - "OverParenthesis;": '\U000023DC', - "PartialD;": '\U00002202', - "Pcy;": '\U0000041F', - "Pfr;": '\U0001D513', - "Phi;": '\U000003A6', - "Pi;": '\U000003A0', - "PlusMinus;": '\U000000B1', - "Poincareplane;": '\U0000210C', - "Popf;": '\U00002119', - "Pr;": '\U00002ABB', - "Precedes;": '\U0000227A', - "PrecedesEqual;": '\U00002AAF', - "PrecedesSlantEqual;": '\U0000227C', - "PrecedesTilde;": '\U0000227E', - "Prime;": '\U00002033', - "Product;": '\U0000220F', - "Proportion;": '\U00002237', - "Proportional;": '\U0000221D', - "Pscr;": '\U0001D4AB', - "Psi;": '\U000003A8', - "QUOT;": '\U00000022', - "Qfr;": '\U0001D514', - "Qopf;": '\U0000211A', - "Qscr;": '\U0001D4AC', - "RBarr;": '\U00002910', - "REG;": '\U000000AE', - "Racute;": '\U00000154', - "Rang;": '\U000027EB', - "Rarr;": '\U000021A0', - "Rarrtl;": '\U00002916', - "Rcaron;": '\U00000158', - "Rcedil;": '\U00000156', - "Rcy;": '\U00000420', - "Re;": '\U0000211C', - "ReverseElement;": '\U0000220B', - "ReverseEquilibrium;": '\U000021CB', - "ReverseUpEquilibrium;": '\U0000296F', - "Rfr;": '\U0000211C', - "Rho;": '\U000003A1', - "RightAngleBracket;": '\U000027E9', - "RightArrow;": '\U00002192', - "RightArrowBar;": '\U000021E5', - "RightArrowLeftArrow;": '\U000021C4', - "RightCeiling;": '\U00002309', - "RightDoubleBracket;": '\U000027E7', - "RightDownTeeVector;": '\U0000295D', - "RightDownVector;": '\U000021C2', - "RightDownVectorBar;": '\U00002955', - "RightFloor;": '\U0000230B', - "RightTee;": '\U000022A2', - "RightTeeArrow;": '\U000021A6', - "RightTeeVector;": '\U0000295B', - "RightTriangle;": '\U000022B3', - "RightTriangleBar;": '\U000029D0', - "RightTriangleEqual;": '\U000022B5', - "RightUpDownVector;": '\U0000294F', - "RightUpTeeVector;": '\U0000295C', - "RightUpVector;": '\U000021BE', - "RightUpVectorBar;": '\U00002954', - "RightVector;": '\U000021C0', - "RightVectorBar;": '\U00002953', - "Rightarrow;": '\U000021D2', - "Ropf;": '\U0000211D', - "RoundImplies;": '\U00002970', - "Rrightarrow;": '\U000021DB', - "Rscr;": '\U0000211B', - "Rsh;": '\U000021B1', - "RuleDelayed;": '\U000029F4', - "SHCHcy;": '\U00000429', - "SHcy;": '\U00000428', - "SOFTcy;": '\U0000042C', - "Sacute;": '\U0000015A', - "Sc;": '\U00002ABC', - "Scaron;": '\U00000160', - "Scedil;": '\U0000015E', - "Scirc;": '\U0000015C', - "Scy;": '\U00000421', - "Sfr;": '\U0001D516', - "ShortDownArrow;": '\U00002193', - "ShortLeftArrow;": '\U00002190', - "ShortRightArrow;": '\U00002192', - "ShortUpArrow;": '\U00002191', - "Sigma;": '\U000003A3', - "SmallCircle;": '\U00002218', - "Sopf;": '\U0001D54A', - "Sqrt;": '\U0000221A', - "Square;": '\U000025A1', - "SquareIntersection;": '\U00002293', - "SquareSubset;": '\U0000228F', - "SquareSubsetEqual;": '\U00002291', - "SquareSuperset;": '\U00002290', - "SquareSupersetEqual;": '\U00002292', - "SquareUnion;": '\U00002294', - "Sscr;": '\U0001D4AE', - "Star;": '\U000022C6', - "Sub;": '\U000022D0', - "Subset;": '\U000022D0', - "SubsetEqual;": '\U00002286', - "Succeeds;": '\U0000227B', - "SucceedsEqual;": '\U00002AB0', - "SucceedsSlantEqual;": '\U0000227D', - "SucceedsTilde;": '\U0000227F', - "SuchThat;": '\U0000220B', - "Sum;": '\U00002211', - "Sup;": '\U000022D1', - "Superset;": '\U00002283', - "SupersetEqual;": '\U00002287', - "Supset;": '\U000022D1', - "THORN;": '\U000000DE', - "TRADE;": '\U00002122', - "TSHcy;": '\U0000040B', - "TScy;": '\U00000426', - "Tab;": '\U00000009', - "Tau;": '\U000003A4', - "Tcaron;": '\U00000164', - "Tcedil;": '\U00000162', - "Tcy;": '\U00000422', - "Tfr;": '\U0001D517', - "Therefore;": '\U00002234', - "Theta;": '\U00000398', - "ThinSpace;": '\U00002009', - "Tilde;": '\U0000223C', - "TildeEqual;": '\U00002243', - "TildeFullEqual;": '\U00002245', - "TildeTilde;": '\U00002248', - "Topf;": '\U0001D54B', - "TripleDot;": '\U000020DB', - "Tscr;": '\U0001D4AF', - "Tstrok;": '\U00000166', - "Uacute;": '\U000000DA', - "Uarr;": '\U0000219F', - "Uarrocir;": '\U00002949', - "Ubrcy;": '\U0000040E', - "Ubreve;": '\U0000016C', - "Ucirc;": '\U000000DB', - "Ucy;": '\U00000423', - "Udblac;": '\U00000170', - "Ufr;": '\U0001D518', - "Ugrave;": '\U000000D9', - "Umacr;": '\U0000016A', - "UnderBar;": '\U0000005F', - "UnderBrace;": '\U000023DF', - "UnderBracket;": '\U000023B5', - "UnderParenthesis;": '\U000023DD', - "Union;": '\U000022C3', - "UnionPlus;": '\U0000228E', - "Uogon;": '\U00000172', - "Uopf;": '\U0001D54C', - "UpArrow;": '\U00002191', - "UpArrowBar;": '\U00002912', - "UpArrowDownArrow;": '\U000021C5', - "UpDownArrow;": '\U00002195', - "UpEquilibrium;": '\U0000296E', - "UpTee;": '\U000022A5', - "UpTeeArrow;": '\U000021A5', - "Uparrow;": '\U000021D1', - "Updownarrow;": '\U000021D5', - "UpperLeftArrow;": '\U00002196', - "UpperRightArrow;": '\U00002197', - "Upsi;": '\U000003D2', - "Upsilon;": '\U000003A5', - "Uring;": '\U0000016E', - "Uscr;": '\U0001D4B0', - "Utilde;": '\U00000168', - "Uuml;": '\U000000DC', - "VDash;": '\U000022AB', - "Vbar;": '\U00002AEB', - "Vcy;": '\U00000412', - "Vdash;": '\U000022A9', - "Vdashl;": '\U00002AE6', - "Vee;": '\U000022C1', - "Verbar;": '\U00002016', - "Vert;": '\U00002016', - "VerticalBar;": '\U00002223', - "VerticalLine;": '\U0000007C', - "VerticalSeparator;": '\U00002758', - "VerticalTilde;": '\U00002240', - "VeryThinSpace;": '\U0000200A', - "Vfr;": '\U0001D519', - "Vopf;": '\U0001D54D', - "Vscr;": '\U0001D4B1', - "Vvdash;": '\U000022AA', - "Wcirc;": '\U00000174', - "Wedge;": '\U000022C0', - "Wfr;": '\U0001D51A', - "Wopf;": '\U0001D54E', - "Wscr;": '\U0001D4B2', - "Xfr;": '\U0001D51B', - "Xi;": '\U0000039E', - "Xopf;": '\U0001D54F', - "Xscr;": '\U0001D4B3', - "YAcy;": '\U0000042F', - "YIcy;": '\U00000407', - "YUcy;": '\U0000042E', - "Yacute;": '\U000000DD', - "Ycirc;": '\U00000176', - "Ycy;": '\U0000042B', - "Yfr;": '\U0001D51C', - "Yopf;": '\U0001D550', - "Yscr;": '\U0001D4B4', - "Yuml;": '\U00000178', - "ZHcy;": '\U00000416', - "Zacute;": '\U00000179', - "Zcaron;": '\U0000017D', - "Zcy;": '\U00000417', - "Zdot;": '\U0000017B', - "ZeroWidthSpace;": '\U0000200B', - "Zeta;": '\U00000396', - "Zfr;": '\U00002128', - "Zopf;": '\U00002124', - "Zscr;": '\U0001D4B5', - "aacute;": '\U000000E1', - "abreve;": '\U00000103', - "ac;": '\U0000223E', - "acd;": '\U0000223F', - "acirc;": '\U000000E2', - "acute;": '\U000000B4', - "acy;": '\U00000430', - "aelig;": '\U000000E6', - "af;": '\U00002061', - "afr;": '\U0001D51E', - "agrave;": '\U000000E0', - "alefsym;": '\U00002135', - "aleph;": '\U00002135', - "alpha;": '\U000003B1', - "amacr;": '\U00000101', - "amalg;": '\U00002A3F', - "amp;": '\U00000026', - "and;": '\U00002227', - "andand;": '\U00002A55', - "andd;": '\U00002A5C', - "andslope;": '\U00002A58', - "andv;": '\U00002A5A', - "ang;": '\U00002220', - "ange;": '\U000029A4', - "angle;": '\U00002220', - "angmsd;": '\U00002221', - "angmsdaa;": '\U000029A8', - "angmsdab;": '\U000029A9', - "angmsdac;": '\U000029AA', - "angmsdad;": '\U000029AB', - "angmsdae;": '\U000029AC', - "angmsdaf;": '\U000029AD', - "angmsdag;": '\U000029AE', - "angmsdah;": '\U000029AF', - "angrt;": '\U0000221F', - "angrtvb;": '\U000022BE', - "angrtvbd;": '\U0000299D', - "angsph;": '\U00002222', - "angst;": '\U000000C5', - "angzarr;": '\U0000237C', - "aogon;": '\U00000105', - "aopf;": '\U0001D552', - "ap;": '\U00002248', - "apE;": '\U00002A70', - "apacir;": '\U00002A6F', - "ape;": '\U0000224A', - "apid;": '\U0000224B', - "apos;": '\U00000027', - "approx;": '\U00002248', - "approxeq;": '\U0000224A', - "aring;": '\U000000E5', - "ascr;": '\U0001D4B6', - "ast;": '\U0000002A', - "asymp;": '\U00002248', - "asympeq;": '\U0000224D', - "atilde;": '\U000000E3', - "auml;": '\U000000E4', - "awconint;": '\U00002233', - "awint;": '\U00002A11', - "bNot;": '\U00002AED', - "backcong;": '\U0000224C', - "backepsilon;": '\U000003F6', - "backprime;": '\U00002035', - "backsim;": '\U0000223D', - "backsimeq;": '\U000022CD', - "barvee;": '\U000022BD', - "barwed;": '\U00002305', - "barwedge;": '\U00002305', - "bbrk;": '\U000023B5', - "bbrktbrk;": '\U000023B6', - "bcong;": '\U0000224C', - "bcy;": '\U00000431', - "bdquo;": '\U0000201E', - "becaus;": '\U00002235', - "because;": '\U00002235', - "bemptyv;": '\U000029B0', - "bepsi;": '\U000003F6', - "bernou;": '\U0000212C', - "beta;": '\U000003B2', - "beth;": '\U00002136', - "between;": '\U0000226C', - "bfr;": '\U0001D51F', - "bigcap;": '\U000022C2', - "bigcirc;": '\U000025EF', - "bigcup;": '\U000022C3', - "bigodot;": '\U00002A00', - "bigoplus;": '\U00002A01', - "bigotimes;": '\U00002A02', - "bigsqcup;": '\U00002A06', - "bigstar;": '\U00002605', - "bigtriangledown;": '\U000025BD', - "bigtriangleup;": '\U000025B3', - "biguplus;": '\U00002A04', - "bigvee;": '\U000022C1', - "bigwedge;": '\U000022C0', - "bkarow;": '\U0000290D', - "blacklozenge;": '\U000029EB', - "blacksquare;": '\U000025AA', - "blacktriangle;": '\U000025B4', - "blacktriangledown;": '\U000025BE', - "blacktriangleleft;": '\U000025C2', - "blacktriangleright;": '\U000025B8', - "blank;": '\U00002423', - "blk12;": '\U00002592', - "blk14;": '\U00002591', - "blk34;": '\U00002593', - "block;": '\U00002588', - "bnot;": '\U00002310', - "bopf;": '\U0001D553', - "bot;": '\U000022A5', - "bottom;": '\U000022A5', - "bowtie;": '\U000022C8', - "boxDL;": '\U00002557', - "boxDR;": '\U00002554', - "boxDl;": '\U00002556', - "boxDr;": '\U00002553', - "boxH;": '\U00002550', - "boxHD;": '\U00002566', - "boxHU;": '\U00002569', - "boxHd;": '\U00002564', - "boxHu;": '\U00002567', - "boxUL;": '\U0000255D', - "boxUR;": '\U0000255A', - "boxUl;": '\U0000255C', - "boxUr;": '\U00002559', - "boxV;": '\U00002551', - "boxVH;": '\U0000256C', - "boxVL;": '\U00002563', - "boxVR;": '\U00002560', - "boxVh;": '\U0000256B', - "boxVl;": '\U00002562', - "boxVr;": '\U0000255F', - "boxbox;": '\U000029C9', - "boxdL;": '\U00002555', - "boxdR;": '\U00002552', - "boxdl;": '\U00002510', - "boxdr;": '\U0000250C', - "boxh;": '\U00002500', - "boxhD;": '\U00002565', - "boxhU;": '\U00002568', - "boxhd;": '\U0000252C', - "boxhu;": '\U00002534', - "boxminus;": '\U0000229F', - "boxplus;": '\U0000229E', - "boxtimes;": '\U000022A0', - "boxuL;": '\U0000255B', - "boxuR;": '\U00002558', - "boxul;": '\U00002518', - "boxur;": '\U00002514', - "boxv;": '\U00002502', - "boxvH;": '\U0000256A', - "boxvL;": '\U00002561', - "boxvR;": '\U0000255E', - "boxvh;": '\U0000253C', - "boxvl;": '\U00002524', - "boxvr;": '\U0000251C', - "bprime;": '\U00002035', - "breve;": '\U000002D8', - "brvbar;": '\U000000A6', - "bscr;": '\U0001D4B7', - "bsemi;": '\U0000204F', - "bsim;": '\U0000223D', - "bsime;": '\U000022CD', - "bsol;": '\U0000005C', - "bsolb;": '\U000029C5', - "bsolhsub;": '\U000027C8', - "bull;": '\U00002022', - "bullet;": '\U00002022', - "bump;": '\U0000224E', - "bumpE;": '\U00002AAE', - "bumpe;": '\U0000224F', - "bumpeq;": '\U0000224F', - "cacute;": '\U00000107', - "cap;": '\U00002229', - "capand;": '\U00002A44', - "capbrcup;": '\U00002A49', - "capcap;": '\U00002A4B', - "capcup;": '\U00002A47', - "capdot;": '\U00002A40', - "caret;": '\U00002041', - "caron;": '\U000002C7', - "ccaps;": '\U00002A4D', - "ccaron;": '\U0000010D', - "ccedil;": '\U000000E7', - "ccirc;": '\U00000109', - "ccups;": '\U00002A4C', - "ccupssm;": '\U00002A50', - "cdot;": '\U0000010B', - "cedil;": '\U000000B8', - "cemptyv;": '\U000029B2', - "cent;": '\U000000A2', - "centerdot;": '\U000000B7', - "cfr;": '\U0001D520', - "chcy;": '\U00000447', - "check;": '\U00002713', - "checkmark;": '\U00002713', - "chi;": '\U000003C7', - "cir;": '\U000025CB', - "cirE;": '\U000029C3', - "circ;": '\U000002C6', - "circeq;": '\U00002257', - "circlearrowleft;": '\U000021BA', - "circlearrowright;": '\U000021BB', - "circledR;": '\U000000AE', - "circledS;": '\U000024C8', - "circledast;": '\U0000229B', - "circledcirc;": '\U0000229A', - "circleddash;": '\U0000229D', - "cire;": '\U00002257', - "cirfnint;": '\U00002A10', - "cirmid;": '\U00002AEF', - "cirscir;": '\U000029C2', - "clubs;": '\U00002663', - "clubsuit;": '\U00002663', - "colon;": '\U0000003A', - "colone;": '\U00002254', - "coloneq;": '\U00002254', - "comma;": '\U0000002C', - "commat;": '\U00000040', - "comp;": '\U00002201', - "compfn;": '\U00002218', - "complement;": '\U00002201', - "complexes;": '\U00002102', - "cong;": '\U00002245', - "congdot;": '\U00002A6D', - "conint;": '\U0000222E', - "copf;": '\U0001D554', - "coprod;": '\U00002210', - "copy;": '\U000000A9', - "copysr;": '\U00002117', - "crarr;": '\U000021B5', - "cross;": '\U00002717', - "cscr;": '\U0001D4B8', - "csub;": '\U00002ACF', - "csube;": '\U00002AD1', - "csup;": '\U00002AD0', - "csupe;": '\U00002AD2', - "ctdot;": '\U000022EF', - "cudarrl;": '\U00002938', - "cudarrr;": '\U00002935', - "cuepr;": '\U000022DE', - "cuesc;": '\U000022DF', - "cularr;": '\U000021B6', - "cularrp;": '\U0000293D', - "cup;": '\U0000222A', - "cupbrcap;": '\U00002A48', - "cupcap;": '\U00002A46', - "cupcup;": '\U00002A4A', - "cupdot;": '\U0000228D', - "cupor;": '\U00002A45', - "curarr;": '\U000021B7', - "curarrm;": '\U0000293C', - "curlyeqprec;": '\U000022DE', - "curlyeqsucc;": '\U000022DF', - "curlyvee;": '\U000022CE', - "curlywedge;": '\U000022CF', - "curren;": '\U000000A4', - "curvearrowleft;": '\U000021B6', - "curvearrowright;": '\U000021B7', - "cuvee;": '\U000022CE', - "cuwed;": '\U000022CF', - "cwconint;": '\U00002232', - "cwint;": '\U00002231', - "cylcty;": '\U0000232D', - "dArr;": '\U000021D3', - "dHar;": '\U00002965', - "dagger;": '\U00002020', - "daleth;": '\U00002138', - "darr;": '\U00002193', - "dash;": '\U00002010', - "dashv;": '\U000022A3', - "dbkarow;": '\U0000290F', - "dblac;": '\U000002DD', - "dcaron;": '\U0000010F', - "dcy;": '\U00000434', - "dd;": '\U00002146', - "ddagger;": '\U00002021', - "ddarr;": '\U000021CA', - "ddotseq;": '\U00002A77', - "deg;": '\U000000B0', - "delta;": '\U000003B4', - "demptyv;": '\U000029B1', - "dfisht;": '\U0000297F', - "dfr;": '\U0001D521', - "dharl;": '\U000021C3', - "dharr;": '\U000021C2', - "diam;": '\U000022C4', - "diamond;": '\U000022C4', - "diamondsuit;": '\U00002666', - "diams;": '\U00002666', - "die;": '\U000000A8', - "digamma;": '\U000003DD', - "disin;": '\U000022F2', - "div;": '\U000000F7', - "divide;": '\U000000F7', - "divideontimes;": '\U000022C7', - "divonx;": '\U000022C7', - "djcy;": '\U00000452', - "dlcorn;": '\U0000231E', - "dlcrop;": '\U0000230D', - "dollar;": '\U00000024', - "dopf;": '\U0001D555', - "dot;": '\U000002D9', - "doteq;": '\U00002250', - "doteqdot;": '\U00002251', - "dotminus;": '\U00002238', - "dotplus;": '\U00002214', - "dotsquare;": '\U000022A1', - "doublebarwedge;": '\U00002306', - "downarrow;": '\U00002193', - "downdownarrows;": '\U000021CA', - "downharpoonleft;": '\U000021C3', - "downharpoonright;": '\U000021C2', - "drbkarow;": '\U00002910', - "drcorn;": '\U0000231F', - "drcrop;": '\U0000230C', - "dscr;": '\U0001D4B9', - "dscy;": '\U00000455', - "dsol;": '\U000029F6', - "dstrok;": '\U00000111', - "dtdot;": '\U000022F1', - "dtri;": '\U000025BF', - "dtrif;": '\U000025BE', - "duarr;": '\U000021F5', - "duhar;": '\U0000296F', - "dwangle;": '\U000029A6', - "dzcy;": '\U0000045F', - "dzigrarr;": '\U000027FF', - "eDDot;": '\U00002A77', - "eDot;": '\U00002251', - "eacute;": '\U000000E9', - "easter;": '\U00002A6E', - "ecaron;": '\U0000011B', - "ecir;": '\U00002256', - "ecirc;": '\U000000EA', - "ecolon;": '\U00002255', - "ecy;": '\U0000044D', - "edot;": '\U00000117', - "ee;": '\U00002147', - "efDot;": '\U00002252', - "efr;": '\U0001D522', - "eg;": '\U00002A9A', - "egrave;": '\U000000E8', - "egs;": '\U00002A96', - "egsdot;": '\U00002A98', - "el;": '\U00002A99', - "elinters;": '\U000023E7', - "ell;": '\U00002113', - "els;": '\U00002A95', - "elsdot;": '\U00002A97', - "emacr;": '\U00000113', - "empty;": '\U00002205', - "emptyset;": '\U00002205', - "emptyv;": '\U00002205', - "emsp;": '\U00002003', - "emsp13;": '\U00002004', - "emsp14;": '\U00002005', - "eng;": '\U0000014B', - "ensp;": '\U00002002', - "eogon;": '\U00000119', - "eopf;": '\U0001D556', - "epar;": '\U000022D5', - "eparsl;": '\U000029E3', - "eplus;": '\U00002A71', - "epsi;": '\U000003B5', - "epsilon;": '\U000003B5', - "epsiv;": '\U000003F5', - "eqcirc;": '\U00002256', - "eqcolon;": '\U00002255', - "eqsim;": '\U00002242', - "eqslantgtr;": '\U00002A96', - "eqslantless;": '\U00002A95', - "equals;": '\U0000003D', - "equest;": '\U0000225F', - "equiv;": '\U00002261', - "equivDD;": '\U00002A78', - "eqvparsl;": '\U000029E5', - "erDot;": '\U00002253', - "erarr;": '\U00002971', - "escr;": '\U0000212F', - "esdot;": '\U00002250', - "esim;": '\U00002242', - "eta;": '\U000003B7', - "eth;": '\U000000F0', - "euml;": '\U000000EB', - "euro;": '\U000020AC', - "excl;": '\U00000021', - "exist;": '\U00002203', - "expectation;": '\U00002130', - "exponentiale;": '\U00002147', - "fallingdotseq;": '\U00002252', - "fcy;": '\U00000444', - "female;": '\U00002640', - "ffilig;": '\U0000FB03', - "fflig;": '\U0000FB00', - "ffllig;": '\U0000FB04', - "ffr;": '\U0001D523', - "filig;": '\U0000FB01', - "flat;": '\U0000266D', - "fllig;": '\U0000FB02', - "fltns;": '\U000025B1', - "fnof;": '\U00000192', - "fopf;": '\U0001D557', - "forall;": '\U00002200', - "fork;": '\U000022D4', - "forkv;": '\U00002AD9', - "fpartint;": '\U00002A0D', - "frac12;": '\U000000BD', - "frac13;": '\U00002153', - "frac14;": '\U000000BC', - "frac15;": '\U00002155', - "frac16;": '\U00002159', - "frac18;": '\U0000215B', - "frac23;": '\U00002154', - "frac25;": '\U00002156', - "frac34;": '\U000000BE', - "frac35;": '\U00002157', - "frac38;": '\U0000215C', - "frac45;": '\U00002158', - "frac56;": '\U0000215A', - "frac58;": '\U0000215D', - "frac78;": '\U0000215E', - "frasl;": '\U00002044', - "frown;": '\U00002322', - "fscr;": '\U0001D4BB', - "gE;": '\U00002267', - "gEl;": '\U00002A8C', - "gacute;": '\U000001F5', - "gamma;": '\U000003B3', - "gammad;": '\U000003DD', - "gap;": '\U00002A86', - "gbreve;": '\U0000011F', - "gcirc;": '\U0000011D', - "gcy;": '\U00000433', - "gdot;": '\U00000121', - "ge;": '\U00002265', - "gel;": '\U000022DB', - "geq;": '\U00002265', - "geqq;": '\U00002267', - "geqslant;": '\U00002A7E', - "ges;": '\U00002A7E', - "gescc;": '\U00002AA9', - "gesdot;": '\U00002A80', - "gesdoto;": '\U00002A82', - "gesdotol;": '\U00002A84', - "gesles;": '\U00002A94', - "gfr;": '\U0001D524', - "gg;": '\U0000226B', - "ggg;": '\U000022D9', - "gimel;": '\U00002137', - "gjcy;": '\U00000453', - "gl;": '\U00002277', - "glE;": '\U00002A92', - "gla;": '\U00002AA5', - "glj;": '\U00002AA4', - "gnE;": '\U00002269', - "gnap;": '\U00002A8A', - "gnapprox;": '\U00002A8A', - "gne;": '\U00002A88', - "gneq;": '\U00002A88', - "gneqq;": '\U00002269', - "gnsim;": '\U000022E7', - "gopf;": '\U0001D558', - "grave;": '\U00000060', - "gscr;": '\U0000210A', - "gsim;": '\U00002273', - "gsime;": '\U00002A8E', - "gsiml;": '\U00002A90', - "gt;": '\U0000003E', - "gtcc;": '\U00002AA7', - "gtcir;": '\U00002A7A', - "gtdot;": '\U000022D7', - "gtlPar;": '\U00002995', - "gtquest;": '\U00002A7C', - "gtrapprox;": '\U00002A86', - "gtrarr;": '\U00002978', - "gtrdot;": '\U000022D7', - "gtreqless;": '\U000022DB', - "gtreqqless;": '\U00002A8C', - "gtrless;": '\U00002277', - "gtrsim;": '\U00002273', - "hArr;": '\U000021D4', - "hairsp;": '\U0000200A', - "half;": '\U000000BD', - "hamilt;": '\U0000210B', - "hardcy;": '\U0000044A', - "harr;": '\U00002194', - "harrcir;": '\U00002948', - "harrw;": '\U000021AD', - "hbar;": '\U0000210F', - "hcirc;": '\U00000125', - "hearts;": '\U00002665', - "heartsuit;": '\U00002665', - "hellip;": '\U00002026', - "hercon;": '\U000022B9', - "hfr;": '\U0001D525', - "hksearow;": '\U00002925', - "hkswarow;": '\U00002926', - "hoarr;": '\U000021FF', - "homtht;": '\U0000223B', - "hookleftarrow;": '\U000021A9', - "hookrightarrow;": '\U000021AA', - "hopf;": '\U0001D559', - "horbar;": '\U00002015', - "hscr;": '\U0001D4BD', - "hslash;": '\U0000210F', - "hstrok;": '\U00000127', - "hybull;": '\U00002043', - "hyphen;": '\U00002010', - "iacute;": '\U000000ED', - "ic;": '\U00002063', - "icirc;": '\U000000EE', - "icy;": '\U00000438', - "iecy;": '\U00000435', - "iexcl;": '\U000000A1', - "iff;": '\U000021D4', - "ifr;": '\U0001D526', - "igrave;": '\U000000EC', - "ii;": '\U00002148', - "iiiint;": '\U00002A0C', - "iiint;": '\U0000222D', - "iinfin;": '\U000029DC', - "iiota;": '\U00002129', - "ijlig;": '\U00000133', - "imacr;": '\U0000012B', - "image;": '\U00002111', - "imagline;": '\U00002110', - "imagpart;": '\U00002111', - "imath;": '\U00000131', - "imof;": '\U000022B7', - "imped;": '\U000001B5', - "in;": '\U00002208', - "incare;": '\U00002105', - "infin;": '\U0000221E', - "infintie;": '\U000029DD', - "inodot;": '\U00000131', - "int;": '\U0000222B', - "intcal;": '\U000022BA', - "integers;": '\U00002124', - "intercal;": '\U000022BA', - "intlarhk;": '\U00002A17', - "intprod;": '\U00002A3C', - "iocy;": '\U00000451', - "iogon;": '\U0000012F', - "iopf;": '\U0001D55A', - "iota;": '\U000003B9', - "iprod;": '\U00002A3C', - "iquest;": '\U000000BF', - "iscr;": '\U0001D4BE', - "isin;": '\U00002208', - "isinE;": '\U000022F9', - "isindot;": '\U000022F5', - "isins;": '\U000022F4', - "isinsv;": '\U000022F3', - "isinv;": '\U00002208', - "it;": '\U00002062', - "itilde;": '\U00000129', - "iukcy;": '\U00000456', - "iuml;": '\U000000EF', - "jcirc;": '\U00000135', - "jcy;": '\U00000439', - "jfr;": '\U0001D527', - "jmath;": '\U00000237', - "jopf;": '\U0001D55B', - "jscr;": '\U0001D4BF', - "jsercy;": '\U00000458', - "jukcy;": '\U00000454', - "kappa;": '\U000003BA', - "kappav;": '\U000003F0', - "kcedil;": '\U00000137', - "kcy;": '\U0000043A', - "kfr;": '\U0001D528', - "kgreen;": '\U00000138', - "khcy;": '\U00000445', - "kjcy;": '\U0000045C', - "kopf;": '\U0001D55C', - "kscr;": '\U0001D4C0', - "lAarr;": '\U000021DA', - "lArr;": '\U000021D0', - "lAtail;": '\U0000291B', - "lBarr;": '\U0000290E', - "lE;": '\U00002266', - "lEg;": '\U00002A8B', - "lHar;": '\U00002962', - "lacute;": '\U0000013A', - "laemptyv;": '\U000029B4', - "lagran;": '\U00002112', - "lambda;": '\U000003BB', - "lang;": '\U000027E8', - "langd;": '\U00002991', - "langle;": '\U000027E8', - "lap;": '\U00002A85', - "laquo;": '\U000000AB', - "larr;": '\U00002190', - "larrb;": '\U000021E4', - "larrbfs;": '\U0000291F', - "larrfs;": '\U0000291D', - "larrhk;": '\U000021A9', - "larrlp;": '\U000021AB', - "larrpl;": '\U00002939', - "larrsim;": '\U00002973', - "larrtl;": '\U000021A2', - "lat;": '\U00002AAB', - "latail;": '\U00002919', - "late;": '\U00002AAD', - "lbarr;": '\U0000290C', - "lbbrk;": '\U00002772', - "lbrace;": '\U0000007B', - "lbrack;": '\U0000005B', - "lbrke;": '\U0000298B', - "lbrksld;": '\U0000298F', - "lbrkslu;": '\U0000298D', - "lcaron;": '\U0000013E', - "lcedil;": '\U0000013C', - "lceil;": '\U00002308', - "lcub;": '\U0000007B', - "lcy;": '\U0000043B', - "ldca;": '\U00002936', - "ldquo;": '\U0000201C', - "ldquor;": '\U0000201E', - "ldrdhar;": '\U00002967', - "ldrushar;": '\U0000294B', - "ldsh;": '\U000021B2', - "le;": '\U00002264', - "leftarrow;": '\U00002190', - "leftarrowtail;": '\U000021A2', - "leftharpoondown;": '\U000021BD', - "leftharpoonup;": '\U000021BC', - "leftleftarrows;": '\U000021C7', - "leftrightarrow;": '\U00002194', - "leftrightarrows;": '\U000021C6', - "leftrightharpoons;": '\U000021CB', - "leftrightsquigarrow;": '\U000021AD', - "leftthreetimes;": '\U000022CB', - "leg;": '\U000022DA', - "leq;": '\U00002264', - "leqq;": '\U00002266', - "leqslant;": '\U00002A7D', - "les;": '\U00002A7D', - "lescc;": '\U00002AA8', - "lesdot;": '\U00002A7F', - "lesdoto;": '\U00002A81', - "lesdotor;": '\U00002A83', - "lesges;": '\U00002A93', - "lessapprox;": '\U00002A85', - "lessdot;": '\U000022D6', - "lesseqgtr;": '\U000022DA', - "lesseqqgtr;": '\U00002A8B', - "lessgtr;": '\U00002276', - "lesssim;": '\U00002272', - "lfisht;": '\U0000297C', - "lfloor;": '\U0000230A', - "lfr;": '\U0001D529', - "lg;": '\U00002276', - "lgE;": '\U00002A91', - "lhard;": '\U000021BD', - "lharu;": '\U000021BC', - "lharul;": '\U0000296A', - "lhblk;": '\U00002584', - "ljcy;": '\U00000459', - "ll;": '\U0000226A', - "llarr;": '\U000021C7', - "llcorner;": '\U0000231E', - "llhard;": '\U0000296B', - "lltri;": '\U000025FA', - "lmidot;": '\U00000140', - "lmoust;": '\U000023B0', - "lmoustache;": '\U000023B0', - "lnE;": '\U00002268', - "lnap;": '\U00002A89', - "lnapprox;": '\U00002A89', - "lne;": '\U00002A87', - "lneq;": '\U00002A87', - "lneqq;": '\U00002268', - "lnsim;": '\U000022E6', - "loang;": '\U000027EC', - "loarr;": '\U000021FD', - "lobrk;": '\U000027E6', - "longleftarrow;": '\U000027F5', - "longleftrightarrow;": '\U000027F7', - "longmapsto;": '\U000027FC', - "longrightarrow;": '\U000027F6', - "looparrowleft;": '\U000021AB', - "looparrowright;": '\U000021AC', - "lopar;": '\U00002985', - "lopf;": '\U0001D55D', - "loplus;": '\U00002A2D', - "lotimes;": '\U00002A34', - "lowast;": '\U00002217', - "lowbar;": '\U0000005F', - "loz;": '\U000025CA', - "lozenge;": '\U000025CA', - "lozf;": '\U000029EB', - "lpar;": '\U00000028', - "lparlt;": '\U00002993', - "lrarr;": '\U000021C6', - "lrcorner;": '\U0000231F', - "lrhar;": '\U000021CB', - "lrhard;": '\U0000296D', - "lrm;": '\U0000200E', - "lrtri;": '\U000022BF', - "lsaquo;": '\U00002039', - "lscr;": '\U0001D4C1', - "lsh;": '\U000021B0', - "lsim;": '\U00002272', - "lsime;": '\U00002A8D', - "lsimg;": '\U00002A8F', - "lsqb;": '\U0000005B', - "lsquo;": '\U00002018', - "lsquor;": '\U0000201A', - "lstrok;": '\U00000142', - "lt;": '\U0000003C', - "ltcc;": '\U00002AA6', - "ltcir;": '\U00002A79', - "ltdot;": '\U000022D6', - "lthree;": '\U000022CB', - "ltimes;": '\U000022C9', - "ltlarr;": '\U00002976', - "ltquest;": '\U00002A7B', - "ltrPar;": '\U00002996', - "ltri;": '\U000025C3', - "ltrie;": '\U000022B4', - "ltrif;": '\U000025C2', - "lurdshar;": '\U0000294A', - "luruhar;": '\U00002966', - "mDDot;": '\U0000223A', - "macr;": '\U000000AF', - "male;": '\U00002642', - "malt;": '\U00002720', - "maltese;": '\U00002720', - "map;": '\U000021A6', - "mapsto;": '\U000021A6', - "mapstodown;": '\U000021A7', - "mapstoleft;": '\U000021A4', - "mapstoup;": '\U000021A5', - "marker;": '\U000025AE', - "mcomma;": '\U00002A29', - "mcy;": '\U0000043C', - "mdash;": '\U00002014', - "measuredangle;": '\U00002221', - "mfr;": '\U0001D52A', - "mho;": '\U00002127', - "micro;": '\U000000B5', - "mid;": '\U00002223', - "midast;": '\U0000002A', - "midcir;": '\U00002AF0', - "middot;": '\U000000B7', - "minus;": '\U00002212', - "minusb;": '\U0000229F', - "minusd;": '\U00002238', - "minusdu;": '\U00002A2A', - "mlcp;": '\U00002ADB', - "mldr;": '\U00002026', - "mnplus;": '\U00002213', - "models;": '\U000022A7', - "mopf;": '\U0001D55E', - "mp;": '\U00002213', - "mscr;": '\U0001D4C2', - "mstpos;": '\U0000223E', - "mu;": '\U000003BC', - "multimap;": '\U000022B8', - "mumap;": '\U000022B8', - "nLeftarrow;": '\U000021CD', - "nLeftrightarrow;": '\U000021CE', - "nRightarrow;": '\U000021CF', - "nVDash;": '\U000022AF', - "nVdash;": '\U000022AE', - "nabla;": '\U00002207', - "nacute;": '\U00000144', - "nap;": '\U00002249', - "napos;": '\U00000149', - "napprox;": '\U00002249', - "natur;": '\U0000266E', - "natural;": '\U0000266E', - "naturals;": '\U00002115', - "nbsp;": '\U000000A0', - "ncap;": '\U00002A43', - "ncaron;": '\U00000148', - "ncedil;": '\U00000146', - "ncong;": '\U00002247', - "ncup;": '\U00002A42', - "ncy;": '\U0000043D', - "ndash;": '\U00002013', - "ne;": '\U00002260', - "neArr;": '\U000021D7', - "nearhk;": '\U00002924', - "nearr;": '\U00002197', - "nearrow;": '\U00002197', - "nequiv;": '\U00002262', - "nesear;": '\U00002928', - "nexist;": '\U00002204', - "nexists;": '\U00002204', - "nfr;": '\U0001D52B', - "nge;": '\U00002271', - "ngeq;": '\U00002271', - "ngsim;": '\U00002275', - "ngt;": '\U0000226F', - "ngtr;": '\U0000226F', - "nhArr;": '\U000021CE', - "nharr;": '\U000021AE', - "nhpar;": '\U00002AF2', - "ni;": '\U0000220B', - "nis;": '\U000022FC', - "nisd;": '\U000022FA', - "niv;": '\U0000220B', - "njcy;": '\U0000045A', - "nlArr;": '\U000021CD', - "nlarr;": '\U0000219A', - "nldr;": '\U00002025', - "nle;": '\U00002270', - "nleftarrow;": '\U0000219A', - "nleftrightarrow;": '\U000021AE', - "nleq;": '\U00002270', - "nless;": '\U0000226E', - "nlsim;": '\U00002274', - "nlt;": '\U0000226E', - "nltri;": '\U000022EA', - "nltrie;": '\U000022EC', - "nmid;": '\U00002224', - "nopf;": '\U0001D55F', - "not;": '\U000000AC', - "notin;": '\U00002209', - "notinva;": '\U00002209', - "notinvb;": '\U000022F7', - "notinvc;": '\U000022F6', - "notni;": '\U0000220C', - "notniva;": '\U0000220C', - "notnivb;": '\U000022FE', - "notnivc;": '\U000022FD', - "npar;": '\U00002226', - "nparallel;": '\U00002226', - "npolint;": '\U00002A14', - "npr;": '\U00002280', - "nprcue;": '\U000022E0', - "nprec;": '\U00002280', - "nrArr;": '\U000021CF', - "nrarr;": '\U0000219B', - "nrightarrow;": '\U0000219B', - "nrtri;": '\U000022EB', - "nrtrie;": '\U000022ED', - "nsc;": '\U00002281', - "nsccue;": '\U000022E1', - "nscr;": '\U0001D4C3', - "nshortmid;": '\U00002224', - "nshortparallel;": '\U00002226', - "nsim;": '\U00002241', - "nsime;": '\U00002244', - "nsimeq;": '\U00002244', - "nsmid;": '\U00002224', - "nspar;": '\U00002226', - "nsqsube;": '\U000022E2', - "nsqsupe;": '\U000022E3', - "nsub;": '\U00002284', - "nsube;": '\U00002288', - "nsubseteq;": '\U00002288', - "nsucc;": '\U00002281', - "nsup;": '\U00002285', - "nsupe;": '\U00002289', - "nsupseteq;": '\U00002289', - "ntgl;": '\U00002279', - "ntilde;": '\U000000F1', - "ntlg;": '\U00002278', - "ntriangleleft;": '\U000022EA', - "ntrianglelefteq;": '\U000022EC', - "ntriangleright;": '\U000022EB', - "ntrianglerighteq;": '\U000022ED', - "nu;": '\U000003BD', - "num;": '\U00000023', - "numero;": '\U00002116', - "numsp;": '\U00002007', - "nvDash;": '\U000022AD', - "nvHarr;": '\U00002904', - "nvdash;": '\U000022AC', - "nvinfin;": '\U000029DE', - "nvlArr;": '\U00002902', - "nvrArr;": '\U00002903', - "nwArr;": '\U000021D6', - "nwarhk;": '\U00002923', - "nwarr;": '\U00002196', - "nwarrow;": '\U00002196', - "nwnear;": '\U00002927', - "oS;": '\U000024C8', - "oacute;": '\U000000F3', - "oast;": '\U0000229B', - "ocir;": '\U0000229A', - "ocirc;": '\U000000F4', - "ocy;": '\U0000043E', - "odash;": '\U0000229D', - "odblac;": '\U00000151', - "odiv;": '\U00002A38', - "odot;": '\U00002299', - "odsold;": '\U000029BC', - "oelig;": '\U00000153', - "ofcir;": '\U000029BF', - "ofr;": '\U0001D52C', - "ogon;": '\U000002DB', - "ograve;": '\U000000F2', - "ogt;": '\U000029C1', - "ohbar;": '\U000029B5', - "ohm;": '\U000003A9', - "oint;": '\U0000222E', - "olarr;": '\U000021BA', - "olcir;": '\U000029BE', - "olcross;": '\U000029BB', - "oline;": '\U0000203E', - "olt;": '\U000029C0', - "omacr;": '\U0000014D', - "omega;": '\U000003C9', - "omicron;": '\U000003BF', - "omid;": '\U000029B6', - "ominus;": '\U00002296', - "oopf;": '\U0001D560', - "opar;": '\U000029B7', - "operp;": '\U000029B9', - "oplus;": '\U00002295', - "or;": '\U00002228', - "orarr;": '\U000021BB', - "ord;": '\U00002A5D', - "order;": '\U00002134', - "orderof;": '\U00002134', - "ordf;": '\U000000AA', - "ordm;": '\U000000BA', - "origof;": '\U000022B6', - "oror;": '\U00002A56', - "orslope;": '\U00002A57', - "orv;": '\U00002A5B', - "oscr;": '\U00002134', - "oslash;": '\U000000F8', - "osol;": '\U00002298', - "otilde;": '\U000000F5', - "otimes;": '\U00002297', - "otimesas;": '\U00002A36', - "ouml;": '\U000000F6', - "ovbar;": '\U0000233D', - "par;": '\U00002225', - "para;": '\U000000B6', - "parallel;": '\U00002225', - "parsim;": '\U00002AF3', - "parsl;": '\U00002AFD', - "part;": '\U00002202', - "pcy;": '\U0000043F', - "percnt;": '\U00000025', - "period;": '\U0000002E', - "permil;": '\U00002030', - "perp;": '\U000022A5', - "pertenk;": '\U00002031', - "pfr;": '\U0001D52D', - "phi;": '\U000003C6', - "phiv;": '\U000003D5', - "phmmat;": '\U00002133', - "phone;": '\U0000260E', - "pi;": '\U000003C0', - "pitchfork;": '\U000022D4', - "piv;": '\U000003D6', - "planck;": '\U0000210F', - "planckh;": '\U0000210E', - "plankv;": '\U0000210F', - "plus;": '\U0000002B', - "plusacir;": '\U00002A23', - "plusb;": '\U0000229E', - "pluscir;": '\U00002A22', - "plusdo;": '\U00002214', - "plusdu;": '\U00002A25', - "pluse;": '\U00002A72', - "plusmn;": '\U000000B1', - "plussim;": '\U00002A26', - "plustwo;": '\U00002A27', - "pm;": '\U000000B1', - "pointint;": '\U00002A15', - "popf;": '\U0001D561', - "pound;": '\U000000A3', - "pr;": '\U0000227A', - "prE;": '\U00002AB3', - "prap;": '\U00002AB7', - "prcue;": '\U0000227C', - "pre;": '\U00002AAF', - "prec;": '\U0000227A', - "precapprox;": '\U00002AB7', - "preccurlyeq;": '\U0000227C', - "preceq;": '\U00002AAF', - "precnapprox;": '\U00002AB9', - "precneqq;": '\U00002AB5', - "precnsim;": '\U000022E8', - "precsim;": '\U0000227E', - "prime;": '\U00002032', - "primes;": '\U00002119', - "prnE;": '\U00002AB5', - "prnap;": '\U00002AB9', - "prnsim;": '\U000022E8', - "prod;": '\U0000220F', - "profalar;": '\U0000232E', - "profline;": '\U00002312', - "profsurf;": '\U00002313', - "prop;": '\U0000221D', - "propto;": '\U0000221D', - "prsim;": '\U0000227E', - "prurel;": '\U000022B0', - "pscr;": '\U0001D4C5', - "psi;": '\U000003C8', - "puncsp;": '\U00002008', - "qfr;": '\U0001D52E', - "qint;": '\U00002A0C', - "qopf;": '\U0001D562', - "qprime;": '\U00002057', - "qscr;": '\U0001D4C6', - "quaternions;": '\U0000210D', - "quatint;": '\U00002A16', - "quest;": '\U0000003F', - "questeq;": '\U0000225F', - "quot;": '\U00000022', - "rAarr;": '\U000021DB', - "rArr;": '\U000021D2', - "rAtail;": '\U0000291C', - "rBarr;": '\U0000290F', - "rHar;": '\U00002964', - "racute;": '\U00000155', - "radic;": '\U0000221A', - "raemptyv;": '\U000029B3', - "rang;": '\U000027E9', - "rangd;": '\U00002992', - "range;": '\U000029A5', - "rangle;": '\U000027E9', - "raquo;": '\U000000BB', - "rarr;": '\U00002192', - "rarrap;": '\U00002975', - "rarrb;": '\U000021E5', - "rarrbfs;": '\U00002920', - "rarrc;": '\U00002933', - "rarrfs;": '\U0000291E', - "rarrhk;": '\U000021AA', - "rarrlp;": '\U000021AC', - "rarrpl;": '\U00002945', - "rarrsim;": '\U00002974', - "rarrtl;": '\U000021A3', - "rarrw;": '\U0000219D', - "ratail;": '\U0000291A', - "ratio;": '\U00002236', - "rationals;": '\U0000211A', - "rbarr;": '\U0000290D', - "rbbrk;": '\U00002773', - "rbrace;": '\U0000007D', - "rbrack;": '\U0000005D', - "rbrke;": '\U0000298C', - "rbrksld;": '\U0000298E', - "rbrkslu;": '\U00002990', - "rcaron;": '\U00000159', - "rcedil;": '\U00000157', - "rceil;": '\U00002309', - "rcub;": '\U0000007D', - "rcy;": '\U00000440', - "rdca;": '\U00002937', - "rdldhar;": '\U00002969', - "rdquo;": '\U0000201D', - "rdquor;": '\U0000201D', - "rdsh;": '\U000021B3', - "real;": '\U0000211C', - "realine;": '\U0000211B', - "realpart;": '\U0000211C', - "reals;": '\U0000211D', - "rect;": '\U000025AD', - "reg;": '\U000000AE', - "rfisht;": '\U0000297D', - "rfloor;": '\U0000230B', - "rfr;": '\U0001D52F', - "rhard;": '\U000021C1', - "rharu;": '\U000021C0', - "rharul;": '\U0000296C', - "rho;": '\U000003C1', - "rhov;": '\U000003F1', - "rightarrow;": '\U00002192', - "rightarrowtail;": '\U000021A3', - "rightharpoondown;": '\U000021C1', - "rightharpoonup;": '\U000021C0', - "rightleftarrows;": '\U000021C4', - "rightleftharpoons;": '\U000021CC', - "rightrightarrows;": '\U000021C9', - "rightsquigarrow;": '\U0000219D', - "rightthreetimes;": '\U000022CC', - "ring;": '\U000002DA', - "risingdotseq;": '\U00002253', - "rlarr;": '\U000021C4', - "rlhar;": '\U000021CC', - "rlm;": '\U0000200F', - "rmoust;": '\U000023B1', - "rmoustache;": '\U000023B1', - "rnmid;": '\U00002AEE', - "roang;": '\U000027ED', - "roarr;": '\U000021FE', - "robrk;": '\U000027E7', - "ropar;": '\U00002986', - "ropf;": '\U0001D563', - "roplus;": '\U00002A2E', - "rotimes;": '\U00002A35', - "rpar;": '\U00000029', - "rpargt;": '\U00002994', - "rppolint;": '\U00002A12', - "rrarr;": '\U000021C9', - "rsaquo;": '\U0000203A', - "rscr;": '\U0001D4C7', - "rsh;": '\U000021B1', - "rsqb;": '\U0000005D', - "rsquo;": '\U00002019', - "rsquor;": '\U00002019', - "rthree;": '\U000022CC', - "rtimes;": '\U000022CA', - "rtri;": '\U000025B9', - "rtrie;": '\U000022B5', - "rtrif;": '\U000025B8', - "rtriltri;": '\U000029CE', - "ruluhar;": '\U00002968', - "rx;": '\U0000211E', - "sacute;": '\U0000015B', - "sbquo;": '\U0000201A', - "sc;": '\U0000227B', - "scE;": '\U00002AB4', - "scap;": '\U00002AB8', - "scaron;": '\U00000161', - "sccue;": '\U0000227D', - "sce;": '\U00002AB0', - "scedil;": '\U0000015F', - "scirc;": '\U0000015D', - "scnE;": '\U00002AB6', - "scnap;": '\U00002ABA', - "scnsim;": '\U000022E9', - "scpolint;": '\U00002A13', - "scsim;": '\U0000227F', - "scy;": '\U00000441', - "sdot;": '\U000022C5', - "sdotb;": '\U000022A1', - "sdote;": '\U00002A66', - "seArr;": '\U000021D8', - "searhk;": '\U00002925', - "searr;": '\U00002198', - "searrow;": '\U00002198', - "sect;": '\U000000A7', - "semi;": '\U0000003B', - "seswar;": '\U00002929', - "setminus;": '\U00002216', - "setmn;": '\U00002216', - "sext;": '\U00002736', - "sfr;": '\U0001D530', - "sfrown;": '\U00002322', - "sharp;": '\U0000266F', - "shchcy;": '\U00000449', - "shcy;": '\U00000448', - "shortmid;": '\U00002223', - "shortparallel;": '\U00002225', - "shy;": '\U000000AD', - "sigma;": '\U000003C3', - "sigmaf;": '\U000003C2', - "sigmav;": '\U000003C2', - "sim;": '\U0000223C', - "simdot;": '\U00002A6A', - "sime;": '\U00002243', - "simeq;": '\U00002243', - "simg;": '\U00002A9E', - "simgE;": '\U00002AA0', - "siml;": '\U00002A9D', - "simlE;": '\U00002A9F', - "simne;": '\U00002246', - "simplus;": '\U00002A24', - "simrarr;": '\U00002972', - "slarr;": '\U00002190', - "smallsetminus;": '\U00002216', - "smashp;": '\U00002A33', - "smeparsl;": '\U000029E4', - "smid;": '\U00002223', - "smile;": '\U00002323', - "smt;": '\U00002AAA', - "smte;": '\U00002AAC', - "softcy;": '\U0000044C', - "sol;": '\U0000002F', - "solb;": '\U000029C4', - "solbar;": '\U0000233F', - "sopf;": '\U0001D564', - "spades;": '\U00002660', - "spadesuit;": '\U00002660', - "spar;": '\U00002225', - "sqcap;": '\U00002293', - "sqcup;": '\U00002294', - "sqsub;": '\U0000228F', - "sqsube;": '\U00002291', - "sqsubset;": '\U0000228F', - "sqsubseteq;": '\U00002291', - "sqsup;": '\U00002290', - "sqsupe;": '\U00002292', - "sqsupset;": '\U00002290', - "sqsupseteq;": '\U00002292', - "squ;": '\U000025A1', - "square;": '\U000025A1', - "squarf;": '\U000025AA', - "squf;": '\U000025AA', - "srarr;": '\U00002192', - "sscr;": '\U0001D4C8', - "ssetmn;": '\U00002216', - "ssmile;": '\U00002323', - "sstarf;": '\U000022C6', - "star;": '\U00002606', - "starf;": '\U00002605', - "straightepsilon;": '\U000003F5', - "straightphi;": '\U000003D5', - "strns;": '\U000000AF', - "sub;": '\U00002282', - "subE;": '\U00002AC5', - "subdot;": '\U00002ABD', - "sube;": '\U00002286', - "subedot;": '\U00002AC3', - "submult;": '\U00002AC1', - "subnE;": '\U00002ACB', - "subne;": '\U0000228A', - "subplus;": '\U00002ABF', - "subrarr;": '\U00002979', - "subset;": '\U00002282', - "subseteq;": '\U00002286', - "subseteqq;": '\U00002AC5', - "subsetneq;": '\U0000228A', - "subsetneqq;": '\U00002ACB', - "subsim;": '\U00002AC7', - "subsub;": '\U00002AD5', - "subsup;": '\U00002AD3', - "succ;": '\U0000227B', - "succapprox;": '\U00002AB8', - "succcurlyeq;": '\U0000227D', - "succeq;": '\U00002AB0', - "succnapprox;": '\U00002ABA', - "succneqq;": '\U00002AB6', - "succnsim;": '\U000022E9', - "succsim;": '\U0000227F', - "sum;": '\U00002211', - "sung;": '\U0000266A', - "sup;": '\U00002283', - "sup1;": '\U000000B9', - "sup2;": '\U000000B2', - "sup3;": '\U000000B3', - "supE;": '\U00002AC6', - "supdot;": '\U00002ABE', - "supdsub;": '\U00002AD8', - "supe;": '\U00002287', - "supedot;": '\U00002AC4', - "suphsol;": '\U000027C9', - "suphsub;": '\U00002AD7', - "suplarr;": '\U0000297B', - "supmult;": '\U00002AC2', - "supnE;": '\U00002ACC', - "supne;": '\U0000228B', - "supplus;": '\U00002AC0', - "supset;": '\U00002283', - "supseteq;": '\U00002287', - "supseteqq;": '\U00002AC6', - "supsetneq;": '\U0000228B', - "supsetneqq;": '\U00002ACC', - "supsim;": '\U00002AC8', - "supsub;": '\U00002AD4', - "supsup;": '\U00002AD6', - "swArr;": '\U000021D9', - "swarhk;": '\U00002926', - "swarr;": '\U00002199', - "swarrow;": '\U00002199', - "swnwar;": '\U0000292A', - "szlig;": '\U000000DF', - "target;": '\U00002316', - "tau;": '\U000003C4', - "tbrk;": '\U000023B4', - "tcaron;": '\U00000165', - "tcedil;": '\U00000163', - "tcy;": '\U00000442', - "tdot;": '\U000020DB', - "telrec;": '\U00002315', - "tfr;": '\U0001D531', - "there4;": '\U00002234', - "therefore;": '\U00002234', - "theta;": '\U000003B8', - "thetasym;": '\U000003D1', - "thetav;": '\U000003D1', - "thickapprox;": '\U00002248', - "thicksim;": '\U0000223C', - "thinsp;": '\U00002009', - "thkap;": '\U00002248', - "thksim;": '\U0000223C', - "thorn;": '\U000000FE', - "tilde;": '\U000002DC', - "times;": '\U000000D7', - "timesb;": '\U000022A0', - "timesbar;": '\U00002A31', - "timesd;": '\U00002A30', - "tint;": '\U0000222D', - "toea;": '\U00002928', - "top;": '\U000022A4', - "topbot;": '\U00002336', - "topcir;": '\U00002AF1', - "topf;": '\U0001D565', - "topfork;": '\U00002ADA', - "tosa;": '\U00002929', - "tprime;": '\U00002034', - "trade;": '\U00002122', - "triangle;": '\U000025B5', - "triangledown;": '\U000025BF', - "triangleleft;": '\U000025C3', - "trianglelefteq;": '\U000022B4', - "triangleq;": '\U0000225C', - "triangleright;": '\U000025B9', - "trianglerighteq;": '\U000022B5', - "tridot;": '\U000025EC', - "trie;": '\U0000225C', - "triminus;": '\U00002A3A', - "triplus;": '\U00002A39', - "trisb;": '\U000029CD', - "tritime;": '\U00002A3B', - "trpezium;": '\U000023E2', - "tscr;": '\U0001D4C9', - "tscy;": '\U00000446', - "tshcy;": '\U0000045B', - "tstrok;": '\U00000167', - "twixt;": '\U0000226C', - "twoheadleftarrow;": '\U0000219E', - "twoheadrightarrow;": '\U000021A0', - "uArr;": '\U000021D1', - "uHar;": '\U00002963', - "uacute;": '\U000000FA', - "uarr;": '\U00002191', - "ubrcy;": '\U0000045E', - "ubreve;": '\U0000016D', - "ucirc;": '\U000000FB', - "ucy;": '\U00000443', - "udarr;": '\U000021C5', - "udblac;": '\U00000171', - "udhar;": '\U0000296E', - "ufisht;": '\U0000297E', - "ufr;": '\U0001D532', - "ugrave;": '\U000000F9', - "uharl;": '\U000021BF', - "uharr;": '\U000021BE', - "uhblk;": '\U00002580', - "ulcorn;": '\U0000231C', - "ulcorner;": '\U0000231C', - "ulcrop;": '\U0000230F', - "ultri;": '\U000025F8', - "umacr;": '\U0000016B', - "uml;": '\U000000A8', - "uogon;": '\U00000173', - "uopf;": '\U0001D566', - "uparrow;": '\U00002191', - "updownarrow;": '\U00002195', - "upharpoonleft;": '\U000021BF', - "upharpoonright;": '\U000021BE', - "uplus;": '\U0000228E', - "upsi;": '\U000003C5', - "upsih;": '\U000003D2', - "upsilon;": '\U000003C5', - "upuparrows;": '\U000021C8', - "urcorn;": '\U0000231D', - "urcorner;": '\U0000231D', - "urcrop;": '\U0000230E', - "uring;": '\U0000016F', - "urtri;": '\U000025F9', - "uscr;": '\U0001D4CA', - "utdot;": '\U000022F0', - "utilde;": '\U00000169', - "utri;": '\U000025B5', - "utrif;": '\U000025B4', - "uuarr;": '\U000021C8', - "uuml;": '\U000000FC', - "uwangle;": '\U000029A7', - "vArr;": '\U000021D5', - "vBar;": '\U00002AE8', - "vBarv;": '\U00002AE9', - "vDash;": '\U000022A8', - "vangrt;": '\U0000299C', - "varepsilon;": '\U000003F5', - "varkappa;": '\U000003F0', - "varnothing;": '\U00002205', - "varphi;": '\U000003D5', - "varpi;": '\U000003D6', - "varpropto;": '\U0000221D', - "varr;": '\U00002195', - "varrho;": '\U000003F1', - "varsigma;": '\U000003C2', - "vartheta;": '\U000003D1', - "vartriangleleft;": '\U000022B2', - "vartriangleright;": '\U000022B3', - "vcy;": '\U00000432', - "vdash;": '\U000022A2', - "vee;": '\U00002228', - "veebar;": '\U000022BB', - "veeeq;": '\U0000225A', - "vellip;": '\U000022EE', - "verbar;": '\U0000007C', - "vert;": '\U0000007C', - "vfr;": '\U0001D533', - "vltri;": '\U000022B2', - "vopf;": '\U0001D567', - "vprop;": '\U0000221D', - "vrtri;": '\U000022B3', - "vscr;": '\U0001D4CB', - "vzigzag;": '\U0000299A', - "wcirc;": '\U00000175', - "wedbar;": '\U00002A5F', - "wedge;": '\U00002227', - "wedgeq;": '\U00002259', - "weierp;": '\U00002118', - "wfr;": '\U0001D534', - "wopf;": '\U0001D568', - "wp;": '\U00002118', - "wr;": '\U00002240', - "wreath;": '\U00002240', - "wscr;": '\U0001D4CC', - "xcap;": '\U000022C2', - "xcirc;": '\U000025EF', - "xcup;": '\U000022C3', - "xdtri;": '\U000025BD', - "xfr;": '\U0001D535', - "xhArr;": '\U000027FA', - "xharr;": '\U000027F7', - "xi;": '\U000003BE', - "xlArr;": '\U000027F8', - "xlarr;": '\U000027F5', - "xmap;": '\U000027FC', - "xnis;": '\U000022FB', - "xodot;": '\U00002A00', - "xopf;": '\U0001D569', - "xoplus;": '\U00002A01', - "xotime;": '\U00002A02', - "xrArr;": '\U000027F9', - "xrarr;": '\U000027F6', - "xscr;": '\U0001D4CD', - "xsqcup;": '\U00002A06', - "xuplus;": '\U00002A04', - "xutri;": '\U000025B3', - "xvee;": '\U000022C1', - "xwedge;": '\U000022C0', - "yacute;": '\U000000FD', - "yacy;": '\U0000044F', - "ycirc;": '\U00000177', - "ycy;": '\U0000044B', - "yen;": '\U000000A5', - "yfr;": '\U0001D536', - "yicy;": '\U00000457', - "yopf;": '\U0001D56A', - "yscr;": '\U0001D4CE', - "yucy;": '\U0000044E', - "yuml;": '\U000000FF', - "zacute;": '\U0000017A', - "zcaron;": '\U0000017E', - "zcy;": '\U00000437', - "zdot;": '\U0000017C', - "zeetrf;": '\U00002128', - "zeta;": '\U000003B6', - "zfr;": '\U0001D537', - "zhcy;": '\U00000436', - "zigrarr;": '\U000021DD', - "zopf;": '\U0001D56B', - "zscr;": '\U0001D4CF', - "zwj;": '\U0000200D', - "zwnj;": '\U0000200C', - "AElig": '\U000000C6', - "AMP": '\U00000026', - "Aacute": '\U000000C1', - "Acirc": '\U000000C2', - "Agrave": '\U000000C0', - "Aring": '\U000000C5', - "Atilde": '\U000000C3', - "Auml": '\U000000C4', - "COPY": '\U000000A9', - "Ccedil": '\U000000C7', - "ETH": '\U000000D0', - "Eacute": '\U000000C9', - "Ecirc": '\U000000CA', - "Egrave": '\U000000C8', - "Euml": '\U000000CB', - "GT": '\U0000003E', - "Iacute": '\U000000CD', - "Icirc": '\U000000CE', - "Igrave": '\U000000CC', - "Iuml": '\U000000CF', - "LT": '\U0000003C', - "Ntilde": '\U000000D1', - "Oacute": '\U000000D3', - "Ocirc": '\U000000D4', - "Ograve": '\U000000D2', - "Oslash": '\U000000D8', - "Otilde": '\U000000D5', - "Ouml": '\U000000D6', - "QUOT": '\U00000022', - "REG": '\U000000AE', - "THORN": '\U000000DE', - "Uacute": '\U000000DA', - "Ucirc": '\U000000DB', - "Ugrave": '\U000000D9', - "Uuml": '\U000000DC', - "Yacute": '\U000000DD', - "aacute": '\U000000E1', - "acirc": '\U000000E2', - "acute": '\U000000B4', - "aelig": '\U000000E6', - "agrave": '\U000000E0', - "amp": '\U00000026', - "aring": '\U000000E5', - "atilde": '\U000000E3', - "auml": '\U000000E4', - "brvbar": '\U000000A6', - "ccedil": '\U000000E7', - "cedil": '\U000000B8', - "cent": '\U000000A2', - "copy": '\U000000A9', - "curren": '\U000000A4', - "deg": '\U000000B0', - "divide": '\U000000F7', - "eacute": '\U000000E9', - "ecirc": '\U000000EA', - "egrave": '\U000000E8', - "eth": '\U000000F0', - "euml": '\U000000EB', - "frac12": '\U000000BD', - "frac14": '\U000000BC', - "frac34": '\U000000BE', - "gt": '\U0000003E', - "iacute": '\U000000ED', - "icirc": '\U000000EE', - "iexcl": '\U000000A1', - "igrave": '\U000000EC', - "iquest": '\U000000BF', - "iuml": '\U000000EF', - "laquo": '\U000000AB', - "lt": '\U0000003C', - "macr": '\U000000AF', - "micro": '\U000000B5', - "middot": '\U000000B7', - "nbsp": '\U000000A0', - "not": '\U000000AC', - "ntilde": '\U000000F1', - "oacute": '\U000000F3', - "ocirc": '\U000000F4', - "ograve": '\U000000F2', - "ordf": '\U000000AA', - "ordm": '\U000000BA', - "oslash": '\U000000F8', - "otilde": '\U000000F5', - "ouml": '\U000000F6', - "para": '\U000000B6', - "plusmn": '\U000000B1', - "pound": '\U000000A3', - "quot": '\U00000022', - "raquo": '\U000000BB', - "reg": '\U000000AE', - "sect": '\U000000A7', - "shy": '\U000000AD', - "sup1": '\U000000B9', - "sup2": '\U000000B2', - "sup3": '\U000000B3', - "szlig": '\U000000DF', - "thorn": '\U000000FE', - "times": '\U000000D7', - "uacute": '\U000000FA', - "ucirc": '\U000000FB', - "ugrave": '\U000000F9', - "uml": '\U000000A8', - "uuml": '\U000000FC', - "yacute": '\U000000FD', - "yen": '\U000000A5', - "yuml": '\U000000FF', -} - -// HTML entities that are two unicode codepoints. -var entity2 = map[string][2]rune{ - // TODO(nigeltao): Handle replacements that are wider than their names. - // "nLt;": {'\u226A', '\u20D2'}, - // "nGt;": {'\u226B', '\u20D2'}, - "NotEqualTilde;": {'\u2242', '\u0338'}, - "NotGreaterFullEqual;": {'\u2267', '\u0338'}, - "NotGreaterGreater;": {'\u226B', '\u0338'}, - "NotGreaterSlantEqual;": {'\u2A7E', '\u0338'}, - "NotHumpDownHump;": {'\u224E', '\u0338'}, - "NotHumpEqual;": {'\u224F', '\u0338'}, - "NotLeftTriangleBar;": {'\u29CF', '\u0338'}, - "NotLessLess;": {'\u226A', '\u0338'}, - "NotLessSlantEqual;": {'\u2A7D', '\u0338'}, - "NotNestedGreaterGreater;": {'\u2AA2', '\u0338'}, - "NotNestedLessLess;": {'\u2AA1', '\u0338'}, - "NotPrecedesEqual;": {'\u2AAF', '\u0338'}, - "NotRightTriangleBar;": {'\u29D0', '\u0338'}, - "NotSquareSubset;": {'\u228F', '\u0338'}, - "NotSquareSuperset;": {'\u2290', '\u0338'}, - "NotSubset;": {'\u2282', '\u20D2'}, - "NotSucceedsEqual;": {'\u2AB0', '\u0338'}, - "NotSucceedsTilde;": {'\u227F', '\u0338'}, - "NotSuperset;": {'\u2283', '\u20D2'}, - "ThickSpace;": {'\u205F', '\u200A'}, - "acE;": {'\u223E', '\u0333'}, - "bne;": {'\u003D', '\u20E5'}, - "bnequiv;": {'\u2261', '\u20E5'}, - "caps;": {'\u2229', '\uFE00'}, - "cups;": {'\u222A', '\uFE00'}, - "fjlig;": {'\u0066', '\u006A'}, - "gesl;": {'\u22DB', '\uFE00'}, - "gvertneqq;": {'\u2269', '\uFE00'}, - "gvnE;": {'\u2269', '\uFE00'}, - "lates;": {'\u2AAD', '\uFE00'}, - "lesg;": {'\u22DA', '\uFE00'}, - "lvertneqq;": {'\u2268', '\uFE00'}, - "lvnE;": {'\u2268', '\uFE00'}, - "nGg;": {'\u22D9', '\u0338'}, - "nGtv;": {'\u226B', '\u0338'}, - "nLl;": {'\u22D8', '\u0338'}, - "nLtv;": {'\u226A', '\u0338'}, - "nang;": {'\u2220', '\u20D2'}, - "napE;": {'\u2A70', '\u0338'}, - "napid;": {'\u224B', '\u0338'}, - "nbump;": {'\u224E', '\u0338'}, - "nbumpe;": {'\u224F', '\u0338'}, - "ncongdot;": {'\u2A6D', '\u0338'}, - "nedot;": {'\u2250', '\u0338'}, - "nesim;": {'\u2242', '\u0338'}, - "ngE;": {'\u2267', '\u0338'}, - "ngeqq;": {'\u2267', '\u0338'}, - "ngeqslant;": {'\u2A7E', '\u0338'}, - "nges;": {'\u2A7E', '\u0338'}, - "nlE;": {'\u2266', '\u0338'}, - "nleqq;": {'\u2266', '\u0338'}, - "nleqslant;": {'\u2A7D', '\u0338'}, - "nles;": {'\u2A7D', '\u0338'}, - "notinE;": {'\u22F9', '\u0338'}, - "notindot;": {'\u22F5', '\u0338'}, - "nparsl;": {'\u2AFD', '\u20E5'}, - "npart;": {'\u2202', '\u0338'}, - "npre;": {'\u2AAF', '\u0338'}, - "npreceq;": {'\u2AAF', '\u0338'}, - "nrarrc;": {'\u2933', '\u0338'}, - "nrarrw;": {'\u219D', '\u0338'}, - "nsce;": {'\u2AB0', '\u0338'}, - "nsubE;": {'\u2AC5', '\u0338'}, - "nsubset;": {'\u2282', '\u20D2'}, - "nsubseteqq;": {'\u2AC5', '\u0338'}, - "nsucceq;": {'\u2AB0', '\u0338'}, - "nsupE;": {'\u2AC6', '\u0338'}, - "nsupset;": {'\u2283', '\u20D2'}, - "nsupseteqq;": {'\u2AC6', '\u0338'}, - "nvap;": {'\u224D', '\u20D2'}, - "nvge;": {'\u2265', '\u20D2'}, - "nvgt;": {'\u003E', '\u20D2'}, - "nvle;": {'\u2264', '\u20D2'}, - "nvlt;": {'\u003C', '\u20D2'}, - "nvltrie;": {'\u22B4', '\u20D2'}, - "nvrtrie;": {'\u22B5', '\u20D2'}, - "nvsim;": {'\u223C', '\u20D2'}, - "race;": {'\u223D', '\u0331'}, - "smtes;": {'\u2AAC', '\uFE00'}, - "sqcaps;": {'\u2293', '\uFE00'}, - "sqcups;": {'\u2294', '\uFE00'}, - "varsubsetneq;": {'\u228A', '\uFE00'}, - "varsubsetneqq;": {'\u2ACB', '\uFE00'}, - "varsupsetneq;": {'\u228B', '\uFE00'}, - "varsupsetneqq;": {'\u2ACC', '\uFE00'}, - "vnsub;": {'\u2282', '\u20D2'}, - "vnsup;": {'\u2283', '\u20D2'}, - "vsubnE;": {'\u2ACB', '\uFE00'}, - "vsubne;": {'\u228A', '\uFE00'}, - "vsupnE;": {'\u2ACC', '\uFE00'}, - "vsupne;": {'\u228B', '\uFE00'}, -} diff --git a/vendor/golang.org/x/net/html/escape.go b/vendor/golang.org/x/net/html/escape.go deleted file mode 100644 index d856139..0000000 --- a/vendor/golang.org/x/net/html/escape.go +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package html - -import ( - "bytes" - "strings" - "unicode/utf8" -) - -// These replacements permit compatibility with old numeric entities that -// assumed Windows-1252 encoding. -// https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference -var replacementTable = [...]rune{ - '\u20AC', // First entry is what 0x80 should be replaced with. - '\u0081', - '\u201A', - '\u0192', - '\u201E', - '\u2026', - '\u2020', - '\u2021', - '\u02C6', - '\u2030', - '\u0160', - '\u2039', - '\u0152', - '\u008D', - '\u017D', - '\u008F', - '\u0090', - '\u2018', - '\u2019', - '\u201C', - '\u201D', - '\u2022', - '\u2013', - '\u2014', - '\u02DC', - '\u2122', - '\u0161', - '\u203A', - '\u0153', - '\u009D', - '\u017E', - '\u0178', // Last entry is 0x9F. - // 0x00->'\uFFFD' is handled programmatically. - // 0x0D->'\u000D' is a no-op. -} - -// unescapeEntity reads an entity like "<" from b[src:] and writes the -// corresponding "<" to b[dst:], returning the incremented dst and src cursors. -// Precondition: b[src] == '&' && dst <= src. -// attribute should be true if parsing an attribute value. -func unescapeEntity(b []byte, dst, src int, attribute bool) (dst1, src1 int) { - // https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference - - // i starts at 1 because we already know that s[0] == '&'. - i, s := 1, b[src:] - - if len(s) <= 1 { - b[dst] = b[src] - return dst + 1, src + 1 - } - - if s[i] == '#' { - if len(s) <= 3 { // We need to have at least "&#.". - b[dst] = b[src] - return dst + 1, src + 1 - } - i++ - c := s[i] - hex := false - if c == 'x' || c == 'X' { - hex = true - i++ - } - - x := '\x00' - for i < len(s) { - c = s[i] - i++ - if hex { - if '0' <= c && c <= '9' { - x = 16*x + rune(c) - '0' - continue - } else if 'a' <= c && c <= 'f' { - x = 16*x + rune(c) - 'a' + 10 - continue - } else if 'A' <= c && c <= 'F' { - x = 16*x + rune(c) - 'A' + 10 - continue - } - } else if '0' <= c && c <= '9' { - x = 10*x + rune(c) - '0' - continue - } - if c != ';' { - i-- - } - break - } - - if i <= 3 { // No characters matched. - b[dst] = b[src] - return dst + 1, src + 1 - } - - if 0x80 <= x && x <= 0x9F { - // Replace characters from Windows-1252 with UTF-8 equivalents. - x = replacementTable[x-0x80] - } else if x == 0 || (0xD800 <= x && x <= 0xDFFF) || x > 0x10FFFF { - // Replace invalid characters with the replacement character. - x = '\uFFFD' - } - - return dst + utf8.EncodeRune(b[dst:], x), src + i - } - - // Consume the maximum number of characters possible, with the - // consumed characters matching one of the named references. - - for i < len(s) { - c := s[i] - i++ - // Lower-cased characters are more common in entities, so we check for them first. - if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' { - continue - } - if c != ';' { - i-- - } - break - } - - entityName := string(s[1:i]) - if entityName == "" { - // No-op. - } else if attribute && entityName[len(entityName)-1] != ';' && len(s) > i && s[i] == '=' { - // No-op. - } else if x := entity[entityName]; x != 0 { - return dst + utf8.EncodeRune(b[dst:], x), src + i - } else if x := entity2[entityName]; x[0] != 0 { - dst1 := dst + utf8.EncodeRune(b[dst:], x[0]) - return dst1 + utf8.EncodeRune(b[dst1:], x[1]), src + i - } else if !attribute { - maxLen := len(entityName) - 1 - if maxLen > longestEntityWithoutSemicolon { - maxLen = longestEntityWithoutSemicolon - } - for j := maxLen; j > 1; j-- { - if x := entity[entityName[:j]]; x != 0 { - return dst + utf8.EncodeRune(b[dst:], x), src + j + 1 - } - } - } - - dst1, src1 = dst+i, src+i - copy(b[dst:dst1], b[src:src1]) - return dst1, src1 -} - -// unescape unescapes b's entities in-place, so that "a<b" becomes "a': - esc = ">" - case '"': - // """ is shorter than """. - esc = """ - case '\r': - esc = " " - default: - panic("unrecognized escape character") - } - s = s[i+1:] - if _, err := w.WriteString(esc); err != nil { - return err - } - i = strings.IndexAny(s, escapedChars) - } - _, err := w.WriteString(s) - return err -} - -// EscapeString escapes special characters like "<" to become "<". It -// escapes only five such characters: <, >, &, ' and ". -// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't -// always true. -func EscapeString(s string) string { - if strings.IndexAny(s, escapedChars) == -1 { - return s - } - var buf bytes.Buffer - escape(&buf, s) - return buf.String() -} - -// UnescapeString unescapes entities like "<" to become "<". It unescapes a -// larger range of entities than EscapeString escapes. For example, "á" -// unescapes to "á", as does "á" and "&xE1;". -// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't -// always true. -func UnescapeString(s string) string { - for _, c := range s { - if c == '&' { - return string(unescape([]byte(s), false)) - } - } - return s -} diff --git a/vendor/golang.org/x/net/html/foreign.go b/vendor/golang.org/x/net/html/foreign.go deleted file mode 100644 index 01477a9..0000000 --- a/vendor/golang.org/x/net/html/foreign.go +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package html - -import ( - "strings" -) - -func adjustAttributeNames(aa []Attribute, nameMap map[string]string) { - for i := range aa { - if newName, ok := nameMap[aa[i].Key]; ok { - aa[i].Key = newName - } - } -} - -func adjustForeignAttributes(aa []Attribute) { - for i, a := range aa { - if a.Key == "" || a.Key[0] != 'x' { - continue - } - switch a.Key { - case "xlink:actuate", "xlink:arcrole", "xlink:href", "xlink:role", "xlink:show", - "xlink:title", "xlink:type", "xml:base", "xml:lang", "xml:space", "xmlns:xlink": - j := strings.Index(a.Key, ":") - aa[i].Namespace = a.Key[:j] - aa[i].Key = a.Key[j+1:] - } - } -} - -func htmlIntegrationPoint(n *Node) bool { - if n.Type != ElementNode { - return false - } - switch n.Namespace { - case "math": - if n.Data == "annotation-xml" { - for _, a := range n.Attr { - if a.Key == "encoding" { - val := strings.ToLower(a.Val) - if val == "text/html" || val == "application/xhtml+xml" { - return true - } - } - } - } - case "svg": - switch n.Data { - case "desc", "foreignObject", "title": - return true - } - } - return false -} - -func mathMLTextIntegrationPoint(n *Node) bool { - if n.Namespace != "math" { - return false - } - switch n.Data { - case "mi", "mo", "mn", "ms", "mtext": - return true - } - return false -} - -// Section 12.2.6.5. -var breakout = map[string]bool{ - "b": true, - "big": true, - "blockquote": true, - "body": true, - "br": true, - "center": true, - "code": true, - "dd": true, - "div": true, - "dl": true, - "dt": true, - "em": true, - "embed": true, - "h1": true, - "h2": true, - "h3": true, - "h4": true, - "h5": true, - "h6": true, - "head": true, - "hr": true, - "i": true, - "img": true, - "li": true, - "listing": true, - "menu": true, - "meta": true, - "nobr": true, - "ol": true, - "p": true, - "pre": true, - "ruby": true, - "s": true, - "small": true, - "span": true, - "strong": true, - "strike": true, - "sub": true, - "sup": true, - "table": true, - "tt": true, - "u": true, - "ul": true, - "var": true, -} - -// Section 12.2.6.5. -var svgTagNameAdjustments = map[string]string{ - "altglyph": "altGlyph", - "altglyphdef": "altGlyphDef", - "altglyphitem": "altGlyphItem", - "animatecolor": "animateColor", - "animatemotion": "animateMotion", - "animatetransform": "animateTransform", - "clippath": "clipPath", - "feblend": "feBlend", - "fecolormatrix": "feColorMatrix", - "fecomponenttransfer": "feComponentTransfer", - "fecomposite": "feComposite", - "feconvolvematrix": "feConvolveMatrix", - "fediffuselighting": "feDiffuseLighting", - "fedisplacementmap": "feDisplacementMap", - "fedistantlight": "feDistantLight", - "feflood": "feFlood", - "fefunca": "feFuncA", - "fefuncb": "feFuncB", - "fefuncg": "feFuncG", - "fefuncr": "feFuncR", - "fegaussianblur": "feGaussianBlur", - "feimage": "feImage", - "femerge": "feMerge", - "femergenode": "feMergeNode", - "femorphology": "feMorphology", - "feoffset": "feOffset", - "fepointlight": "fePointLight", - "fespecularlighting": "feSpecularLighting", - "fespotlight": "feSpotLight", - "fetile": "feTile", - "feturbulence": "feTurbulence", - "foreignobject": "foreignObject", - "glyphref": "glyphRef", - "lineargradient": "linearGradient", - "radialgradient": "radialGradient", - "textpath": "textPath", -} - -// Section 12.2.6.1 -var mathMLAttributeAdjustments = map[string]string{ - "definitionurl": "definitionURL", -} - -var svgAttributeAdjustments = map[string]string{ - "attributename": "attributeName", - "attributetype": "attributeType", - "basefrequency": "baseFrequency", - "baseprofile": "baseProfile", - "calcmode": "calcMode", - "clippathunits": "clipPathUnits", - "contentscripttype": "contentScriptType", - "contentstyletype": "contentStyleType", - "diffuseconstant": "diffuseConstant", - "edgemode": "edgeMode", - "externalresourcesrequired": "externalResourcesRequired", - "filterres": "filterRes", - "filterunits": "filterUnits", - "glyphref": "glyphRef", - "gradienttransform": "gradientTransform", - "gradientunits": "gradientUnits", - "kernelmatrix": "kernelMatrix", - "kernelunitlength": "kernelUnitLength", - "keypoints": "keyPoints", - "keysplines": "keySplines", - "keytimes": "keyTimes", - "lengthadjust": "lengthAdjust", - "limitingconeangle": "limitingConeAngle", - "markerheight": "markerHeight", - "markerunits": "markerUnits", - "markerwidth": "markerWidth", - "maskcontentunits": "maskContentUnits", - "maskunits": "maskUnits", - "numoctaves": "numOctaves", - "pathlength": "pathLength", - "patterncontentunits": "patternContentUnits", - "patterntransform": "patternTransform", - "patternunits": "patternUnits", - "pointsatx": "pointsAtX", - "pointsaty": "pointsAtY", - "pointsatz": "pointsAtZ", - "preservealpha": "preserveAlpha", - "preserveaspectratio": "preserveAspectRatio", - "primitiveunits": "primitiveUnits", - "refx": "refX", - "refy": "refY", - "repeatcount": "repeatCount", - "repeatdur": "repeatDur", - "requiredextensions": "requiredExtensions", - "requiredfeatures": "requiredFeatures", - "specularconstant": "specularConstant", - "specularexponent": "specularExponent", - "spreadmethod": "spreadMethod", - "startoffset": "startOffset", - "stddeviation": "stdDeviation", - "stitchtiles": "stitchTiles", - "surfacescale": "surfaceScale", - "systemlanguage": "systemLanguage", - "tablevalues": "tableValues", - "targetx": "targetX", - "targety": "targetY", - "textlength": "textLength", - "viewbox": "viewBox", - "viewtarget": "viewTarget", - "xchannelselector": "xChannelSelector", - "ychannelselector": "yChannelSelector", - "zoomandpan": "zoomAndPan", -} diff --git a/vendor/golang.org/x/net/html/node.go b/vendor/golang.org/x/net/html/node.go deleted file mode 100644 index 2c1cade..0000000 --- a/vendor/golang.org/x/net/html/node.go +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package html - -import ( - "golang.org/x/net/html/atom" -) - -// A NodeType is the type of a Node. -type NodeType uint32 - -const ( - ErrorNode NodeType = iota - TextNode - DocumentNode - ElementNode - CommentNode - DoctypeNode - scopeMarkerNode -) - -// Section 12.2.4.3 says "The markers are inserted when entering applet, -// object, marquee, template, td, th, and caption elements, and are used -// to prevent formatting from "leaking" into applet, object, marquee, -// template, td, th, and caption elements". -var scopeMarker = Node{Type: scopeMarkerNode} - -// A Node consists of a NodeType and some Data (tag name for element nodes, -// content for text) and are part of a tree of Nodes. Element nodes may also -// have a Namespace and contain a slice of Attributes. Data is unescaped, so -// that it looks like "a 0 { - return (*s)[i-1] - } - return nil -} - -// index returns the index of the top-most occurrence of n in the stack, or -1 -// if n is not present. -func (s *nodeStack) index(n *Node) int { - for i := len(*s) - 1; i >= 0; i-- { - if (*s)[i] == n { - return i - } - } - return -1 -} - -// contains returns whether a is within s. -func (s *nodeStack) contains(a atom.Atom) bool { - for _, n := range *s { - if n.DataAtom == a { - return true - } - } - return false -} - -// insert inserts a node at the given index. -func (s *nodeStack) insert(i int, n *Node) { - (*s) = append(*s, nil) - copy((*s)[i+1:], (*s)[i:]) - (*s)[i] = n -} - -// remove removes a node from the stack. It is a no-op if n is not present. -func (s *nodeStack) remove(n *Node) { - i := s.index(n) - if i == -1 { - return - } - copy((*s)[i:], (*s)[i+1:]) - j := len(*s) - 1 - (*s)[j] = nil - *s = (*s)[:j] -} - -type insertionModeStack []insertionMode - -func (s *insertionModeStack) pop() (im insertionMode) { - i := len(*s) - im = (*s)[i-1] - *s = (*s)[:i-1] - return im -} - -func (s *insertionModeStack) top() insertionMode { - if i := len(*s); i > 0 { - return (*s)[i-1] - } - return nil -} diff --git a/vendor/golang.org/x/net/html/parse.go b/vendor/golang.org/x/net/html/parse.go deleted file mode 100644 index 9889c09..0000000 --- a/vendor/golang.org/x/net/html/parse.go +++ /dev/null @@ -1,2317 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package html - -import ( - "errors" - "fmt" - "io" - "strings" - - a "golang.org/x/net/html/atom" -) - -// A parser implements the HTML5 parsing algorithm: -// https://html.spec.whatwg.org/multipage/syntax.html#tree-construction -type parser struct { - // tokenizer provides the tokens for the parser. - tokenizer *Tokenizer - // tok is the most recently read token. - tok Token - // Self-closing tags like
    are treated as start tags, except that - // hasSelfClosingToken is set while they are being processed. - hasSelfClosingToken bool - // doc is the document root element. - doc *Node - // The stack of open elements (section 12.2.4.2) and active formatting - // elements (section 12.2.4.3). - oe, afe nodeStack - // Element pointers (section 12.2.4.4). - head, form *Node - // Other parsing state flags (section 12.2.4.5). - scripting, framesetOK bool - // The stack of template insertion modes - templateStack insertionModeStack - // im is the current insertion mode. - im insertionMode - // originalIM is the insertion mode to go back to after completing a text - // or inTableText insertion mode. - originalIM insertionMode - // fosterParenting is whether new elements should be inserted according to - // the foster parenting rules (section 12.2.6.1). - fosterParenting bool - // quirks is whether the parser is operating in "quirks mode." - quirks bool - // fragment is whether the parser is parsing an HTML fragment. - fragment bool - // context is the context element when parsing an HTML fragment - // (section 12.4). - context *Node -} - -func (p *parser) top() *Node { - if n := p.oe.top(); n != nil { - return n - } - return p.doc -} - -// Stop tags for use in popUntil. These come from section 12.2.4.2. -var ( - defaultScopeStopTags = map[string][]a.Atom{ - "": {a.Applet, a.Caption, a.Html, a.Table, a.Td, a.Th, a.Marquee, a.Object, a.Template}, - "math": {a.AnnotationXml, a.Mi, a.Mn, a.Mo, a.Ms, a.Mtext}, - "svg": {a.Desc, a.ForeignObject, a.Title}, - } -) - -type scope int - -const ( - defaultScope scope = iota - listItemScope - buttonScope - tableScope - tableRowScope - tableBodyScope - selectScope -) - -// popUntil pops the stack of open elements at the highest element whose tag -// is in matchTags, provided there is no higher element in the scope's stop -// tags (as defined in section 12.2.4.2). It returns whether or not there was -// such an element. If there was not, popUntil leaves the stack unchanged. -// -// For example, the set of stop tags for table scope is: "html", "table". If -// the stack was: -// ["html", "body", "font", "table", "b", "i", "u"] -// then popUntil(tableScope, "font") would return false, but -// popUntil(tableScope, "i") would return true and the stack would become: -// ["html", "body", "font", "table", "b"] -// -// If an element's tag is in both the stop tags and matchTags, then the stack -// will be popped and the function returns true (provided, of course, there was -// no higher element in the stack that was also in the stop tags). For example, -// popUntil(tableScope, "table") returns true and leaves: -// ["html", "body", "font"] -func (p *parser) popUntil(s scope, matchTags ...a.Atom) bool { - if i := p.indexOfElementInScope(s, matchTags...); i != -1 { - p.oe = p.oe[:i] - return true - } - return false -} - -// indexOfElementInScope returns the index in p.oe of the highest element whose -// tag is in matchTags that is in scope. If no matching element is in scope, it -// returns -1. -func (p *parser) indexOfElementInScope(s scope, matchTags ...a.Atom) int { - for i := len(p.oe) - 1; i >= 0; i-- { - tagAtom := p.oe[i].DataAtom - if p.oe[i].Namespace == "" { - for _, t := range matchTags { - if t == tagAtom { - return i - } - } - switch s { - case defaultScope: - // No-op. - case listItemScope: - if tagAtom == a.Ol || tagAtom == a.Ul { - return -1 - } - case buttonScope: - if tagAtom == a.Button { - return -1 - } - case tableScope: - if tagAtom == a.Html || tagAtom == a.Table || tagAtom == a.Template { - return -1 - } - case selectScope: - if tagAtom != a.Optgroup && tagAtom != a.Option { - return -1 - } - default: - panic("unreachable") - } - } - switch s { - case defaultScope, listItemScope, buttonScope: - for _, t := range defaultScopeStopTags[p.oe[i].Namespace] { - if t == tagAtom { - return -1 - } - } - } - } - return -1 -} - -// elementInScope is like popUntil, except that it doesn't modify the stack of -// open elements. -func (p *parser) elementInScope(s scope, matchTags ...a.Atom) bool { - return p.indexOfElementInScope(s, matchTags...) != -1 -} - -// clearStackToContext pops elements off the stack of open elements until a -// scope-defined element is found. -func (p *parser) clearStackToContext(s scope) { - for i := len(p.oe) - 1; i >= 0; i-- { - tagAtom := p.oe[i].DataAtom - switch s { - case tableScope: - if tagAtom == a.Html || tagAtom == a.Table || tagAtom == a.Template { - p.oe = p.oe[:i+1] - return - } - case tableRowScope: - if tagAtom == a.Html || tagAtom == a.Tr || tagAtom == a.Template { - p.oe = p.oe[:i+1] - return - } - case tableBodyScope: - if tagAtom == a.Html || tagAtom == a.Tbody || tagAtom == a.Tfoot || tagAtom == a.Thead || tagAtom == a.Template { - p.oe = p.oe[:i+1] - return - } - default: - panic("unreachable") - } - } -} - -// generateImpliedEndTags pops nodes off the stack of open elements as long as -// the top node has a tag name of dd, dt, li, optgroup, option, p, rb, rp, rt or rtc. -// If exceptions are specified, nodes with that name will not be popped off. -func (p *parser) generateImpliedEndTags(exceptions ...string) { - var i int -loop: - for i = len(p.oe) - 1; i >= 0; i-- { - n := p.oe[i] - if n.Type == ElementNode { - switch n.DataAtom { - case a.Dd, a.Dt, a.Li, a.Optgroup, a.Option, a.P, a.Rb, a.Rp, a.Rt, a.Rtc: - for _, except := range exceptions { - if n.Data == except { - break loop - } - } - continue - } - } - break - } - - p.oe = p.oe[:i+1] -} - -// addChild adds a child node n to the top element, and pushes n onto the stack -// of open elements if it is an element node. -func (p *parser) addChild(n *Node) { - if p.shouldFosterParent() { - p.fosterParent(n) - } else { - p.top().AppendChild(n) - } - - if n.Type == ElementNode { - p.oe = append(p.oe, n) - } -} - -// shouldFosterParent returns whether the next node to be added should be -// foster parented. -func (p *parser) shouldFosterParent() bool { - if p.fosterParenting { - switch p.top().DataAtom { - case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr: - return true - } - } - return false -} - -// fosterParent adds a child node according to the foster parenting rules. -// Section 12.2.6.1, "foster parenting". -func (p *parser) fosterParent(n *Node) { - var table, parent, prev, template *Node - var i int - for i = len(p.oe) - 1; i >= 0; i-- { - if p.oe[i].DataAtom == a.Table { - table = p.oe[i] - break - } - } - - var j int - for j = len(p.oe) - 1; j >= 0; j-- { - if p.oe[j].DataAtom == a.Template { - template = p.oe[j] - break - } - } - - if template != nil && (table == nil || j > i) { - template.AppendChild(n) - return - } - - if table == nil { - // The foster parent is the html element. - parent = p.oe[0] - } else { - parent = table.Parent - } - if parent == nil { - parent = p.oe[i-1] - } - - if table != nil { - prev = table.PrevSibling - } else { - prev = parent.LastChild - } - if prev != nil && prev.Type == TextNode && n.Type == TextNode { - prev.Data += n.Data - return - } - - parent.InsertBefore(n, table) -} - -// addText adds text to the preceding node if it is a text node, or else it -// calls addChild with a new text node. -func (p *parser) addText(text string) { - if text == "" { - return - } - - if p.shouldFosterParent() { - p.fosterParent(&Node{ - Type: TextNode, - Data: text, - }) - return - } - - t := p.top() - if n := t.LastChild; n != nil && n.Type == TextNode { - n.Data += text - return - } - p.addChild(&Node{ - Type: TextNode, - Data: text, - }) -} - -// addElement adds a child element based on the current token. -func (p *parser) addElement() { - p.addChild(&Node{ - Type: ElementNode, - DataAtom: p.tok.DataAtom, - Data: p.tok.Data, - Attr: p.tok.Attr, - }) -} - -// Section 12.2.4.3. -func (p *parser) addFormattingElement() { - tagAtom, attr := p.tok.DataAtom, p.tok.Attr - p.addElement() - - // Implement the Noah's Ark clause, but with three per family instead of two. - identicalElements := 0 -findIdenticalElements: - for i := len(p.afe) - 1; i >= 0; i-- { - n := p.afe[i] - if n.Type == scopeMarkerNode { - break - } - if n.Type != ElementNode { - continue - } - if n.Namespace != "" { - continue - } - if n.DataAtom != tagAtom { - continue - } - if len(n.Attr) != len(attr) { - continue - } - compareAttributes: - for _, t0 := range n.Attr { - for _, t1 := range attr { - if t0.Key == t1.Key && t0.Namespace == t1.Namespace && t0.Val == t1.Val { - // Found a match for this attribute, continue with the next attribute. - continue compareAttributes - } - } - // If we get here, there is no attribute that matches a. - // Therefore the element is not identical to the new one. - continue findIdenticalElements - } - - identicalElements++ - if identicalElements >= 3 { - p.afe.remove(n) - } - } - - p.afe = append(p.afe, p.top()) -} - -// Section 12.2.4.3. -func (p *parser) clearActiveFormattingElements() { - for { - n := p.afe.pop() - if len(p.afe) == 0 || n.Type == scopeMarkerNode { - return - } - } -} - -// Section 12.2.4.3. -func (p *parser) reconstructActiveFormattingElements() { - n := p.afe.top() - if n == nil { - return - } - if n.Type == scopeMarkerNode || p.oe.index(n) != -1 { - return - } - i := len(p.afe) - 1 - for n.Type != scopeMarkerNode && p.oe.index(n) == -1 { - if i == 0 { - i = -1 - break - } - i-- - n = p.afe[i] - } - for { - i++ - clone := p.afe[i].clone() - p.addChild(clone) - p.afe[i] = clone - if i == len(p.afe)-1 { - break - } - } -} - -// Section 12.2.5. -func (p *parser) acknowledgeSelfClosingTag() { - p.hasSelfClosingToken = false -} - -// An insertion mode (section 12.2.4.1) is the state transition function from -// a particular state in the HTML5 parser's state machine. It updates the -// parser's fields depending on parser.tok (where ErrorToken means EOF). -// It returns whether the token was consumed. -type insertionMode func(*parser) bool - -// setOriginalIM sets the insertion mode to return to after completing a text or -// inTableText insertion mode. -// Section 12.2.4.1, "using the rules for". -func (p *parser) setOriginalIM() { - if p.originalIM != nil { - panic("html: bad parser state: originalIM was set twice") - } - p.originalIM = p.im -} - -// Section 12.2.4.1, "reset the insertion mode". -func (p *parser) resetInsertionMode() { - for i := len(p.oe) - 1; i >= 0; i-- { - n := p.oe[i] - last := i == 0 - if last && p.context != nil { - n = p.context - } - - switch n.DataAtom { - case a.Select: - if !last { - for ancestor, first := n, p.oe[0]; ancestor != first; { - if ancestor == first { - break - } - ancestor = p.oe[p.oe.index(ancestor)-1] - switch ancestor.DataAtom { - case a.Template: - p.im = inSelectIM - return - case a.Table: - p.im = inSelectInTableIM - return - } - } - } - p.im = inSelectIM - case a.Td, a.Th: - // TODO: remove this divergence from the HTML5 spec. - // - // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 - p.im = inCellIM - case a.Tr: - p.im = inRowIM - case a.Tbody, a.Thead, a.Tfoot: - p.im = inTableBodyIM - case a.Caption: - p.im = inCaptionIM - case a.Colgroup: - p.im = inColumnGroupIM - case a.Table: - p.im = inTableIM - case a.Template: - // TODO: remove this divergence from the HTML5 spec. - if n.Namespace != "" { - continue - } - p.im = p.templateStack.top() - case a.Head: - // TODO: remove this divergence from the HTML5 spec. - // - // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 - p.im = inHeadIM - case a.Body: - p.im = inBodyIM - case a.Frameset: - p.im = inFramesetIM - case a.Html: - if p.head == nil { - p.im = beforeHeadIM - } else { - p.im = afterHeadIM - } - default: - if last { - p.im = inBodyIM - return - } - continue - } - return - } -} - -const whitespace = " \t\r\n\f" - -// Section 12.2.6.4.1. -func initialIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) - if len(p.tok.Data) == 0 { - // It was all whitespace, so ignore it. - return true - } - case CommentToken: - p.doc.AppendChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - n, quirks := parseDoctype(p.tok.Data) - p.doc.AppendChild(n) - p.quirks = quirks - p.im = beforeHTMLIM - return true - } - p.quirks = true - p.im = beforeHTMLIM - return false -} - -// Section 12.2.6.4.2. -func beforeHTMLIM(p *parser) bool { - switch p.tok.Type { - case DoctypeToken: - // Ignore the token. - return true - case TextToken: - p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) - if len(p.tok.Data) == 0 { - // It was all whitespace, so ignore it. - return true - } - case StartTagToken: - if p.tok.DataAtom == a.Html { - p.addElement() - p.im = beforeHeadIM - return true - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Head, a.Body, a.Html, a.Br: - p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) - return false - default: - // Ignore the token. - return true - } - case CommentToken: - p.doc.AppendChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - } - p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) - return false -} - -// Section 12.2.6.4.3. -func beforeHeadIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) - if len(p.tok.Data) == 0 { - // It was all whitespace, so ignore it. - return true - } - case StartTagToken: - switch p.tok.DataAtom { - case a.Head: - p.addElement() - p.head = p.top() - p.im = inHeadIM - return true - case a.Html: - return inBodyIM(p) - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Head, a.Body, a.Html, a.Br: - p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) - return false - default: - // Ignore the token. - return true - } - case CommentToken: - p.addChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - // Ignore the token. - return true - } - - p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) - return false -} - -// Section 12.2.6.4.4. -func inHeadIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - s := strings.TrimLeft(p.tok.Data, whitespace) - if len(s) < len(p.tok.Data) { - // Add the initial whitespace to the current node. - p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) - if s == "" { - return true - } - p.tok.Data = s - } - case StartTagToken: - switch p.tok.DataAtom { - case a.Html: - return inBodyIM(p) - case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta: - p.addElement() - p.oe.pop() - p.acknowledgeSelfClosingTag() - return true - case a.Script, a.Title, a.Noscript, a.Noframes, a.Style: - p.addElement() - p.setOriginalIM() - p.im = textIM - return true - case a.Head: - // Ignore the token. - return true - case a.Template: - p.addElement() - p.afe = append(p.afe, &scopeMarker) - p.framesetOK = false - p.im = inTemplateIM - p.templateStack = append(p.templateStack, inTemplateIM) - return true - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Head: - p.oe.pop() - p.im = afterHeadIM - return true - case a.Body, a.Html, a.Br: - p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) - return false - case a.Template: - if !p.oe.contains(a.Template) { - return true - } - // TODO: remove this divergence from the HTML5 spec. - // - // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 - p.generateImpliedEndTags() - for i := len(p.oe) - 1; i >= 0; i-- { - if n := p.oe[i]; n.Namespace == "" && n.DataAtom == a.Template { - p.oe = p.oe[:i] - break - } - } - p.clearActiveFormattingElements() - p.templateStack.pop() - p.resetInsertionMode() - return true - default: - // Ignore the token. - return true - } - case CommentToken: - p.addChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - // Ignore the token. - return true - } - - p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) - return false -} - -// Section 12.2.6.4.6. -func afterHeadIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - s := strings.TrimLeft(p.tok.Data, whitespace) - if len(s) < len(p.tok.Data) { - // Add the initial whitespace to the current node. - p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) - if s == "" { - return true - } - p.tok.Data = s - } - case StartTagToken: - switch p.tok.DataAtom { - case a.Html: - return inBodyIM(p) - case a.Body: - p.addElement() - p.framesetOK = false - p.im = inBodyIM - return true - case a.Frameset: - p.addElement() - p.im = inFramesetIM - return true - case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Template, a.Title: - p.oe = append(p.oe, p.head) - defer p.oe.remove(p.head) - return inHeadIM(p) - case a.Head: - // Ignore the token. - return true - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Body, a.Html, a.Br: - // Drop down to creating an implied tag. - case a.Template: - return inHeadIM(p) - default: - // Ignore the token. - return true - } - case CommentToken: - p.addChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - // Ignore the token. - return true - } - - p.parseImpliedToken(StartTagToken, a.Body, a.Body.String()) - p.framesetOK = true - return false -} - -// copyAttributes copies attributes of src not found on dst to dst. -func copyAttributes(dst *Node, src Token) { - if len(src.Attr) == 0 { - return - } - attr := map[string]string{} - for _, t := range dst.Attr { - attr[t.Key] = t.Val - } - for _, t := range src.Attr { - if _, ok := attr[t.Key]; !ok { - dst.Attr = append(dst.Attr, t) - attr[t.Key] = t.Val - } - } -} - -// Section 12.2.6.4.7. -func inBodyIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - d := p.tok.Data - switch n := p.oe.top(); n.DataAtom { - case a.Pre, a.Listing: - if n.FirstChild == nil { - // Ignore a newline at the start of a
     block.
    -				if d != "" && d[0] == '\r' {
    -					d = d[1:]
    -				}
    -				if d != "" && d[0] == '\n' {
    -					d = d[1:]
    -				}
    -			}
    -		}
    -		d = strings.Replace(d, "\x00", "", -1)
    -		if d == "" {
    -			return true
    -		}
    -		p.reconstructActiveFormattingElements()
    -		p.addText(d)
    -		if p.framesetOK && strings.TrimLeft(d, whitespace) != "" {
    -			// There were non-whitespace characters inserted.
    -			p.framesetOK = false
    -		}
    -	case StartTagToken:
    -		switch p.tok.DataAtom {
    -		case a.Html:
    -			if p.oe.contains(a.Template) {
    -				return true
    -			}
    -			copyAttributes(p.oe[0], p.tok)
    -		case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Template, a.Title:
    -			return inHeadIM(p)
    -		case a.Body:
    -			if p.oe.contains(a.Template) {
    -				return true
    -			}
    -			if len(p.oe) >= 2 {
    -				body := p.oe[1]
    -				if body.Type == ElementNode && body.DataAtom == a.Body {
    -					p.framesetOK = false
    -					copyAttributes(body, p.tok)
    -				}
    -			}
    -		case a.Frameset:
    -			if !p.framesetOK || len(p.oe) < 2 || p.oe[1].DataAtom != a.Body {
    -				// Ignore the token.
    -				return true
    -			}
    -			body := p.oe[1]
    -			if body.Parent != nil {
    -				body.Parent.RemoveChild(body)
    -			}
    -			p.oe = p.oe[:1]
    -			p.addElement()
    -			p.im = inFramesetIM
    -			return true
    -		case a.Address, a.Article, a.Aside, a.Blockquote, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Menu, a.Nav, a.Ol, a.P, a.Section, a.Summary, a.Ul:
    -			p.popUntil(buttonScope, a.P)
    -			p.addElement()
    -		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
    -			p.popUntil(buttonScope, a.P)
    -			switch n := p.top(); n.DataAtom {
    -			case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
    -				p.oe.pop()
    -			}
    -			p.addElement()
    -		case a.Pre, a.Listing:
    -			p.popUntil(buttonScope, a.P)
    -			p.addElement()
    -			// The newline, if any, will be dealt with by the TextToken case.
    -			p.framesetOK = false
    -		case a.Form:
    -			if p.form != nil && !p.oe.contains(a.Template) {
    -				// Ignore the token
    -				return true
    -			}
    -			p.popUntil(buttonScope, a.P)
    -			p.addElement()
    -			if !p.oe.contains(a.Template) {
    -				p.form = p.top()
    -			}
    -		case a.Li:
    -			p.framesetOK = false
    -			for i := len(p.oe) - 1; i >= 0; i-- {
    -				node := p.oe[i]
    -				switch node.DataAtom {
    -				case a.Li:
    -					p.oe = p.oe[:i]
    -				case a.Address, a.Div, a.P:
    -					continue
    -				default:
    -					if !isSpecialElement(node) {
    -						continue
    -					}
    -				}
    -				break
    -			}
    -			p.popUntil(buttonScope, a.P)
    -			p.addElement()
    -		case a.Dd, a.Dt:
    -			p.framesetOK = false
    -			for i := len(p.oe) - 1; i >= 0; i-- {
    -				node := p.oe[i]
    -				switch node.DataAtom {
    -				case a.Dd, a.Dt:
    -					p.oe = p.oe[:i]
    -				case a.Address, a.Div, a.P:
    -					continue
    -				default:
    -					if !isSpecialElement(node) {
    -						continue
    -					}
    -				}
    -				break
    -			}
    -			p.popUntil(buttonScope, a.P)
    -			p.addElement()
    -		case a.Plaintext:
    -			p.popUntil(buttonScope, a.P)
    -			p.addElement()
    -		case a.Button:
    -			p.popUntil(defaultScope, a.Button)
    -			p.reconstructActiveFormattingElements()
    -			p.addElement()
    -			p.framesetOK = false
    -		case a.A:
    -			for i := len(p.afe) - 1; i >= 0 && p.afe[i].Type != scopeMarkerNode; i-- {
    -				if n := p.afe[i]; n.Type == ElementNode && n.DataAtom == a.A {
    -					p.inBodyEndTagFormatting(a.A)
    -					p.oe.remove(n)
    -					p.afe.remove(n)
    -					break
    -				}
    -			}
    -			p.reconstructActiveFormattingElements()
    -			p.addFormattingElement()
    -		case a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
    -			p.reconstructActiveFormattingElements()
    -			p.addFormattingElement()
    -		case a.Nobr:
    -			p.reconstructActiveFormattingElements()
    -			if p.elementInScope(defaultScope, a.Nobr) {
    -				p.inBodyEndTagFormatting(a.Nobr)
    -				p.reconstructActiveFormattingElements()
    -			}
    -			p.addFormattingElement()
    -		case a.Applet, a.Marquee, a.Object:
    -			p.reconstructActiveFormattingElements()
    -			p.addElement()
    -			p.afe = append(p.afe, &scopeMarker)
    -			p.framesetOK = false
    -		case a.Table:
    -			if !p.quirks {
    -				p.popUntil(buttonScope, a.P)
    -			}
    -			p.addElement()
    -			p.framesetOK = false
    -			p.im = inTableIM
    -			return true
    -		case a.Area, a.Br, a.Embed, a.Img, a.Input, a.Keygen, a.Wbr:
    -			p.reconstructActiveFormattingElements()
    -			p.addElement()
    -			p.oe.pop()
    -			p.acknowledgeSelfClosingTag()
    -			if p.tok.DataAtom == a.Input {
    -				for _, t := range p.tok.Attr {
    -					if t.Key == "type" {
    -						if strings.ToLower(t.Val) == "hidden" {
    -							// Skip setting framesetOK = false
    -							return true
    -						}
    -					}
    -				}
    -			}
    -			p.framesetOK = false
    -		case a.Param, a.Source, a.Track:
    -			p.addElement()
    -			p.oe.pop()
    -			p.acknowledgeSelfClosingTag()
    -		case a.Hr:
    -			p.popUntil(buttonScope, a.P)
    -			p.addElement()
    -			p.oe.pop()
    -			p.acknowledgeSelfClosingTag()
    -			p.framesetOK = false
    -		case a.Image:
    -			p.tok.DataAtom = a.Img
    -			p.tok.Data = a.Img.String()
    -			return false
    -		case a.Isindex:
    -			if p.form != nil {
    -				// Ignore the token.
    -				return true
    -			}
    -			action := ""
    -			prompt := "This is a searchable index. Enter search keywords: "
    -			attr := []Attribute{{Key: "name", Val: "isindex"}}
    -			for _, t := range p.tok.Attr {
    -				switch t.Key {
    -				case "action":
    -					action = t.Val
    -				case "name":
    -					// Ignore the attribute.
    -				case "prompt":
    -					prompt = t.Val
    -				default:
    -					attr = append(attr, t)
    -				}
    -			}
    -			p.acknowledgeSelfClosingTag()
    -			p.popUntil(buttonScope, a.P)
    -			p.parseImpliedToken(StartTagToken, a.Form, a.Form.String())
    -			if p.form == nil {
    -				// NOTE: The 'isindex' element has been removed,
    -				// and the 'template' element has not been designed to be
    -				// collaborative with the index element.
    -				//
    -				// Ignore the token.
    -				return true
    -			}
    -			if action != "" {
    -				p.form.Attr = []Attribute{{Key: "action", Val: action}}
    -			}
    -			p.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())
    -			p.parseImpliedToken(StartTagToken, a.Label, a.Label.String())
    -			p.addText(prompt)
    -			p.addChild(&Node{
    -				Type:     ElementNode,
    -				DataAtom: a.Input,
    -				Data:     a.Input.String(),
    -				Attr:     attr,
    -			})
    -			p.oe.pop()
    -			p.parseImpliedToken(EndTagToken, a.Label, a.Label.String())
    -			p.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())
    -			p.parseImpliedToken(EndTagToken, a.Form, a.Form.String())
    -		case a.Textarea:
    -			p.addElement()
    -			p.setOriginalIM()
    -			p.framesetOK = false
    -			p.im = textIM
    -		case a.Xmp:
    -			p.popUntil(buttonScope, a.P)
    -			p.reconstructActiveFormattingElements()
    -			p.framesetOK = false
    -			p.addElement()
    -			p.setOriginalIM()
    -			p.im = textIM
    -		case a.Iframe:
    -			p.framesetOK = false
    -			p.addElement()
    -			p.setOriginalIM()
    -			p.im = textIM
    -		case a.Noembed, a.Noscript:
    -			p.addElement()
    -			p.setOriginalIM()
    -			p.im = textIM
    -		case a.Select:
    -			p.reconstructActiveFormattingElements()
    -			p.addElement()
    -			p.framesetOK = false
    -			p.im = inSelectIM
    -			return true
    -		case a.Optgroup, a.Option:
    -			if p.top().DataAtom == a.Option {
    -				p.oe.pop()
    -			}
    -			p.reconstructActiveFormattingElements()
    -			p.addElement()
    -		case a.Rb, a.Rtc:
    -			if p.elementInScope(defaultScope, a.Ruby) {
    -				p.generateImpliedEndTags()
    -			}
    -			p.addElement()
    -		case a.Rp, a.Rt:
    -			if p.elementInScope(defaultScope, a.Ruby) {
    -				p.generateImpliedEndTags("rtc")
    -			}
    -			p.addElement()
    -		case a.Math, a.Svg:
    -			p.reconstructActiveFormattingElements()
    -			if p.tok.DataAtom == a.Math {
    -				adjustAttributeNames(p.tok.Attr, mathMLAttributeAdjustments)
    -			} else {
    -				adjustAttributeNames(p.tok.Attr, svgAttributeAdjustments)
    -			}
    -			adjustForeignAttributes(p.tok.Attr)
    -			p.addElement()
    -			p.top().Namespace = p.tok.Data
    -			if p.hasSelfClosingToken {
    -				p.oe.pop()
    -				p.acknowledgeSelfClosingTag()
    -			}
    -			return true
    -		case a.Caption, a.Col, a.Colgroup, a.Frame, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr:
    -			// Ignore the token.
    -		default:
    -			p.reconstructActiveFormattingElements()
    -			p.addElement()
    -		}
    -	case EndTagToken:
    -		switch p.tok.DataAtom {
    -		case a.Body:
    -			if p.elementInScope(defaultScope, a.Body) {
    -				p.im = afterBodyIM
    -			}
    -		case a.Html:
    -			if p.elementInScope(defaultScope, a.Body) {
    -				p.parseImpliedToken(EndTagToken, a.Body, a.Body.String())
    -				return false
    -			}
    -			return true
    -		case a.Address, a.Article, a.Aside, a.Blockquote, a.Button, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Listing, a.Menu, a.Nav, a.Ol, a.Pre, a.Section, a.Summary, a.Ul:
    -			p.popUntil(defaultScope, p.tok.DataAtom)
    -		case a.Form:
    -			if p.oe.contains(a.Template) {
    -				i := p.indexOfElementInScope(defaultScope, a.Form)
    -				if i == -1 {
    -					// Ignore the token.
    -					return true
    -				}
    -				p.generateImpliedEndTags()
    -				if p.oe[i].DataAtom != a.Form {
    -					// Ignore the token.
    -					return true
    -				}
    -				p.popUntil(defaultScope, a.Form)
    -			} else {
    -				node := p.form
    -				p.form = nil
    -				i := p.indexOfElementInScope(defaultScope, a.Form)
    -				if node == nil || i == -1 || p.oe[i] != node {
    -					// Ignore the token.
    -					return true
    -				}
    -				p.generateImpliedEndTags()
    -				p.oe.remove(node)
    -			}
    -		case a.P:
    -			if !p.elementInScope(buttonScope, a.P) {
    -				p.parseImpliedToken(StartTagToken, a.P, a.P.String())
    -			}
    -			p.popUntil(buttonScope, a.P)
    -		case a.Li:
    -			p.popUntil(listItemScope, a.Li)
    -		case a.Dd, a.Dt:
    -			p.popUntil(defaultScope, p.tok.DataAtom)
    -		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
    -			p.popUntil(defaultScope, a.H1, a.H2, a.H3, a.H4, a.H5, a.H6)
    -		case a.A, a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.Nobr, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
    -			p.inBodyEndTagFormatting(p.tok.DataAtom)
    -		case a.Applet, a.Marquee, a.Object:
    -			if p.popUntil(defaultScope, p.tok.DataAtom) {
    -				p.clearActiveFormattingElements()
    -			}
    -		case a.Br:
    -			p.tok.Type = StartTagToken
    -			return false
    -		case a.Template:
    -			return inHeadIM(p)
    -		default:
    -			p.inBodyEndTagOther(p.tok.DataAtom)
    -		}
    -	case CommentToken:
    -		p.addChild(&Node{
    -			Type: CommentNode,
    -			Data: p.tok.Data,
    -		})
    -	case ErrorToken:
    -		// TODO: remove this divergence from the HTML5 spec.
    -		if len(p.templateStack) > 0 {
    -			p.im = inTemplateIM
    -			return false
    -		} else {
    -			for _, e := range p.oe {
    -				switch e.DataAtom {
    -				case a.Dd, a.Dt, a.Li, a.Optgroup, a.Option, a.P, a.Rb, a.Rp, a.Rt, a.Rtc, a.Tbody, a.Td, a.Tfoot, a.Th,
    -					a.Thead, a.Tr, a.Body, a.Html:
    -				default:
    -					return true
    -				}
    -			}
    -		}
    -	}
    -
    -	return true
    -}
    -
    -func (p *parser) inBodyEndTagFormatting(tagAtom a.Atom) {
    -	// This is the "adoption agency" algorithm, described at
    -	// https://html.spec.whatwg.org/multipage/syntax.html#adoptionAgency
    -
    -	// TODO: this is a fairly literal line-by-line translation of that algorithm.
    -	// Once the code successfully parses the comprehensive test suite, we should
    -	// refactor this code to be more idiomatic.
    -
    -	// Steps 1-4. The outer loop.
    -	for i := 0; i < 8; i++ {
    -		// Step 5. Find the formatting element.
    -		var formattingElement *Node
    -		for j := len(p.afe) - 1; j >= 0; j-- {
    -			if p.afe[j].Type == scopeMarkerNode {
    -				break
    -			}
    -			if p.afe[j].DataAtom == tagAtom {
    -				formattingElement = p.afe[j]
    -				break
    -			}
    -		}
    -		if formattingElement == nil {
    -			p.inBodyEndTagOther(tagAtom)
    -			return
    -		}
    -		feIndex := p.oe.index(formattingElement)
    -		if feIndex == -1 {
    -			p.afe.remove(formattingElement)
    -			return
    -		}
    -		if !p.elementInScope(defaultScope, tagAtom) {
    -			// Ignore the tag.
    -			return
    -		}
    -
    -		// Steps 9-10. Find the furthest block.
    -		var furthestBlock *Node
    -		for _, e := range p.oe[feIndex:] {
    -			if isSpecialElement(e) {
    -				furthestBlock = e
    -				break
    -			}
    -		}
    -		if furthestBlock == nil {
    -			e := p.oe.pop()
    -			for e != formattingElement {
    -				e = p.oe.pop()
    -			}
    -			p.afe.remove(e)
    -			return
    -		}
    -
    -		// Steps 11-12. Find the common ancestor and bookmark node.
    -		commonAncestor := p.oe[feIndex-1]
    -		bookmark := p.afe.index(formattingElement)
    -
    -		// Step 13. The inner loop. Find the lastNode to reparent.
    -		lastNode := furthestBlock
    -		node := furthestBlock
    -		x := p.oe.index(node)
    -		// Steps 13.1-13.2
    -		for j := 0; j < 3; j++ {
    -			// Step 13.3.
    -			x--
    -			node = p.oe[x]
    -			// Step 13.4 - 13.5.
    -			if p.afe.index(node) == -1 {
    -				p.oe.remove(node)
    -				continue
    -			}
    -			// Step 13.6.
    -			if node == formattingElement {
    -				break
    -			}
    -			// Step 13.7.
    -			clone := node.clone()
    -			p.afe[p.afe.index(node)] = clone
    -			p.oe[p.oe.index(node)] = clone
    -			node = clone
    -			// Step 13.8.
    -			if lastNode == furthestBlock {
    -				bookmark = p.afe.index(node) + 1
    -			}
    -			// Step 13.9.
    -			if lastNode.Parent != nil {
    -				lastNode.Parent.RemoveChild(lastNode)
    -			}
    -			node.AppendChild(lastNode)
    -			// Step 13.10.
    -			lastNode = node
    -		}
    -
    -		// Step 14. Reparent lastNode to the common ancestor,
    -		// or for misnested table nodes, to the foster parent.
    -		if lastNode.Parent != nil {
    -			lastNode.Parent.RemoveChild(lastNode)
    -		}
    -		switch commonAncestor.DataAtom {
    -		case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr:
    -			p.fosterParent(lastNode)
    -		case a.Template:
    -			// TODO: remove namespace checking
    -			if commonAncestor.Namespace == "html" {
    -				commonAncestor = commonAncestor.LastChild
    -			}
    -			fallthrough
    -		default:
    -			commonAncestor.AppendChild(lastNode)
    -		}
    -
    -		// Steps 15-17. Reparent nodes from the furthest block's children
    -		// to a clone of the formatting element.
    -		clone := formattingElement.clone()
    -		reparentChildren(clone, furthestBlock)
    -		furthestBlock.AppendChild(clone)
    -
    -		// Step 18. Fix up the list of active formatting elements.
    -		if oldLoc := p.afe.index(formattingElement); oldLoc != -1 && oldLoc < bookmark {
    -			// Move the bookmark with the rest of the list.
    -			bookmark--
    -		}
    -		p.afe.remove(formattingElement)
    -		p.afe.insert(bookmark, clone)
    -
    -		// Step 19. Fix up the stack of open elements.
    -		p.oe.remove(formattingElement)
    -		p.oe.insert(p.oe.index(furthestBlock)+1, clone)
    -	}
    -}
    -
    -// inBodyEndTagOther performs the "any other end tag" algorithm for inBodyIM.
    -// "Any other end tag" handling from 12.2.6.5 The rules for parsing tokens in foreign content
    -// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inforeign
    -func (p *parser) inBodyEndTagOther(tagAtom a.Atom) {
    -	for i := len(p.oe) - 1; i >= 0; i-- {
    -		if p.oe[i].DataAtom == tagAtom {
    -			p.oe = p.oe[:i]
    -			break
    -		}
    -		if isSpecialElement(p.oe[i]) {
    -			break
    -		}
    -	}
    -}
    -
    -// Section 12.2.6.4.8.
    -func textIM(p *parser) bool {
    -	switch p.tok.Type {
    -	case ErrorToken:
    -		p.oe.pop()
    -	case TextToken:
    -		d := p.tok.Data
    -		if n := p.oe.top(); n.DataAtom == a.Textarea && n.FirstChild == nil {
    -			// Ignore a newline at the start of a