[
  {
    "path": ".gitignore",
    "content": "dist/\nbuild/\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: go\ninstall: true\nsudo: required\n\nbefore_install:\n  - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -\n  - echo \"deb https://dl.yarnpkg.com/debian/ stable main\" | sudo tee /etc/apt/sources.list.d/yarn.list\n  - sudo apt-get update\n  - sudo apt-get install apt-transport-https -y\n  - curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -\n  - sudo apt-get install yarn -y -qq\n\ncache:\n  yarn: true\n\ngo: \"1.10\"\n\nscript:\n  - go get -u -v github.com/jteeuwen/go-bindata/...\n  - cd ui\n  - yarn install\n  - cd ..\n  - make dist\n"
  },
  {
    "path": "Dockerfile",
    "content": "FROM debian:latest\n\nCOPY ./dist/gocho /usr/local/bin/gocho\n\nRUN chmod +x /usr/local/bin/gocho \\\n    && mkdir -p /root/public \\\n    && echo 'file1' > /root/public/file1 \\\n    && echo 'file2' > /root/public/file2 \\\n    && echo 'file3' > /root/public/file3 \\\n    && echo 'file4' > /root/public/file4 \\\n    && echo 'file5' > /root/public/file5 \\\n    && echo 'NodeId: root' > /root/.gocho.conf \\\n    && echo 'WebPort: \"5555\"' >> /root/.gocho.conf \\\n    && echo 'LocalPort: \"1337\"' >> /root/.gocho.conf \\\n    && echo 'ShareDirectory: \"/root/public\"' >> /root/.gocho.conf\n\nCMD [\"/usr/local/bin/gocho\", \"start\"]\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2018 Sergio Guillen Mantilla<serguimant@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "Makefile",
    "content": "VERSION = 0.2.0\nGOPATH := $(PWD)/build:$(GOPATH)\n\nbuild-dev:\n\t@echo \"Building gocho\"\n\trm -rf build && mkdir -p build/src/github.com/donkeysharp\n\tln -s $(PWD) $(PWD)/build/src/github.com/donkeysharp/gocho\n\tgo install -i github.com/donkeysharp/gocho/cmd/gocho\n\nclean:\n\trm -rf dist/*\n\trm -rf build\n\ndist: clean ui generate\n\t@echo \"Building gocho for Linux x86_64...\"\n\tmkdir -p dist/linux64\n\tgo build -o dist/linux64/gocho cmd/gocho/gocho.go\n\t@zip -j dist/gocho_${VERSION}_linux64.zip dist/linux64/gocho\n\ngenerate:\n\tgo generate cmd/gocho/gocho.go\n\ndist-linux32:\n\t@echo \"Building gocho for Linux 32bits...\"\n\tmkdir -p dist/linux386\n\tGOOS=linux GOARCH=386 go build -o dist/linux386/gocho cmd/gocho/gocho.go\n\t@zip -j dist/gocho_${VERSION}_linux386.zip dist/linux386/gocho\n\ndist-win32:\n\t@echo \"Building gocho for Windows 32bits...\"\n\tmkdir -p dist/win32\n\tGOOS=windows GOARCH=386 go build -o dist/win32/gocho.exe cmd/gocho/gocho.go\n\t@zip -j dist/gocho_${VERSION}_win32.zip dist/win32/gocho.exe\n\ndist-win64:\n\t@echo \"Building gocho for Windows 64bits...\"\n\tmkdir -p dist/win64\n\tGOOS=windows GOARCH=amd64 go build -o dist/win64/gocho.exe cmd/gocho/gocho.go\n\t@zip -j dist/gocho_${VERSION}_win64.zip dist/win64/gocho.exe\n\ndist-darwin:\n\t@echo \"Building gocho for Darwin 64bits...\"\n\tmkdir -p dist/darwin\n\tGOOS=darwin GOARCH=amd64 go build -o dist/darwin/gocho cmd/gocho/gocho.go\n\t@zip -j dist/gocho_${VERSION}_darwin.zip dist/darwin/gocho\n\ndocker: dist\n\tdocker build . -t donkeysharp/gocho\n\nstart:\n\tdocker run -it -p \"1337:1337\" --rm donkeysharp/gocho gocho start --debug || true\n\ntest:\n\tdocker run -it --rm donkeysharp/gocho || true\n\nclean-dashboard:\n\trm -rf assets/assets_gen.go\n\nui: clean-dashboard\n\tcd ui \\\n\t&& yarn build\n"
  },
  {
    "path": "README.md",
    "content": "Gocho - Local Network File Sharing [![Build Status](https://travis-ci.org/donkeysharp/gocho.svg?branch=master)](https://travis-ci.org/donkeysharp/gocho)\n==================================\n\nGocho allows you to share a chosen directory with others on the same local network, without the need to setup Samba or OS-oriented settings. It provides a local dashboard which you can access through your browser, to discover what others are sharing without knowing other's IP addresses.\n\nRun Gocho, browse to [localhost:1337](http://localhost:1337) and see what others are sharing!\n\n<!-- Image of dashboard -->\n![alt Gocho dashboard](docs/gocho-dashboard.gif)\n\n> **Building The Project:**\n>\n> If you want to help and contribute don't forget to check the [Building document](docs/building.md) in order to have your environment ready.\n\n## Install\n[Download the latest release](https://github.com/donkeysharp/gocho/releases) for your operating system. Currently the following operating systems are being supported:\n\n* GNU/Linux 32 bits\n* GNU/Linux 64 bits\n* OSX\n* Windows 32 bits\n* Windows 64 bits\n\nDownload, unzip the file and add it to your path or a directory that is already in your system's path.\n\n**Example unix-like**\n\n    $ unzip gocho_0.1.0_darwin.zip\n    $ mv gocho /usr/bin\n    $ gocho --help\n\n## Instructions\nGocho needs to be executed using the command line in order to initiate the sharing.\n\nThere are two ways to start sharing:\n1. Specify the settings on a config file\n2. Specify the settings using command line flags.\n\n### Specify a settings file\nGocho reads a settings file that is located at `$USER_HOME/.gocho.conf`. The format of the file is as follows:\n\n```\nNodeId: my-computer\nWebPort: \"5555\"\nLocalPort: \"1337\"\nShareDirectory: /home/user/some/directory\n```\n\nIf you want Gocho to create this file for you, it's possible to run the configuration wizard by running:\n\n    $ gocho configure\n\nWhich will ask for the different settings and create a `.gocho.conf` file.\n\nOnce settings file is created, run the next to start sharing:\n\n    $ gocho start\n\n![alt Gocho wizard](docs/gocho-configure.gif)\n\n### Use command line flags\nIf you don't want to specify a configuration file, or want to share a directory which is not specified on the `.gocho.conf` file, run:\n\n    $ gocho start --dir /some/directory --id my-computer-tmp\n\nThis is the list of available flags\n\nFlag | Description\n--- | ---\n--id {value} | Node ID that will be shared to other peers (**Required**)\n--dir {value} | Directory to share (**Required**)\n--share-port {value} |  Port that will be exposed for file sharing (default: \"5555\")\n--local-port {value} | Port for local dashboard (default: \"1337\")\n\n<!-- gocho using flags -->\n![alt Gocho flags](docs/gocho-start.gif)\n\n## License\nLicensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n"
  },
  {
    "path": "assets/.gitignore",
    "content": "assets_gen.go\n"
  },
  {
    "path": "assets/assets.go",
    "content": "package assets\n\nimport (\n\t\"github.com/elazarl/go-bindata-assetfs\"\n)\n\nfunc AssetFS() *assetfs.AssetFS {\n\treturn &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, AssetInfo: AssetInfo, Prefix: \"../../ui/build\"}\n}\n"
  },
  {
    "path": "cmd/gocho/gocho.go",
    "content": "package main\n\n//go:generate go-bindata -o ../../assets/assets_gen.go -pkg assets ../../ui/build/...\n\nimport (\n\t\"github.com/donkeysharp/gocho/pkg/cmds\"\n\t\"os\"\n)\n\nfunc main() {\n\tcmds.New().Run(os.Args)\n}\n"
  },
  {
    "path": "docs/building.md",
    "content": "Building Instructions\n=====================\n\n## Requirements\nYou need these tools installed in order to develop Gocho:\n\n* Yarn (ui)\n* NodeJS (ui)\n* GNU Make (for general process building)\n* Go (for main code compilation)\n* go-bindata (for embedding UI inside final binary). \n\n\n> *Installing go-bindata creates a binary, don't forget to add $GOPATH/bin to your path* It's important that go-bindata is in the path becuase `make generate` &mdash;the command that embeds ui code into binary&mdash; needs it.\n\n## Service Development\nIn order to run Gocho service and start development on it there are some things to consider: the next steps need to be run only the first time if you don't want to modify the UI.\n\nThis steps need to be executed in the root directory of the project.\n\n#### Step 1\nBuild the UI files e.g. html, javascript and css.\n\n    $ make ui\n\nIt will create a `ui/build` directory with the resulting files for the UI\n\n#### Step 2\nAs UI files are embedded inside the final binary, we use [go-binddata](https://github.com/jteeuwen/go-bindata) to achieve this. The `generate` command in the Makefile creates an `assets/assets_gen.go` file with the embedded UI code.\n\n    $ make generate\n\nSo far the previous steps need to be run only the first time unless you are modifying UI, in that case check the `UI Development` section.\n\nTo build `gocho` binary and test it while you do changes run:\n\n    $ make build-dev\n\nWhich will create the `gocho` binary at `$GOPATH/bin/gocho` as that command runs `go install github.com/donkeysharp/gocho/cmd/gocho`\n\n## UI Development\nGocho UI uses React and was intialized using [Create React App](https://github.com/facebook/create-react-app).\n\nAll React code for the dashboard is located in the `ui` directory. This directory has the package.json and the yarn.lock file, in order to develop and test the UI you need to run the next\n\n    $ cd ui\n    # Install UI dependencies\n    $ yarn install\n    # Start development server\n    $ yarn start\n\nThat will bring up a development server at http://localhost:3000 with the UI so it can be developed. The development server for UI is configured to use a proxy to `http://localhost:1337` (see `package.json`) so it's important to have a backend running, check `Service Development` section.\n"
  },
  {
    "path": "pkg/cmds/cmds.go",
    "content": "package cmds\n\nimport (\n\t\"fmt\"\n\t\"github.com/donkeysharp/gocho/pkg/config\"\n\t\"github.com/donkeysharp/gocho/pkg/info\"\n\t\"github.com/donkeysharp/gocho/pkg/node\"\n\t\"github.com/urfave/cli\"\n)\n\nfunc ConfigureAction(c *cli.Context) error {\n\terr := config.ConfigureWizard()\n\tif err != nil {\n\t\treturn cli.NewExitError(err, 1)\n\t}\n\treturn nil\n}\n\nfunc StartAction(c *cli.Context) error {\n\tfmt.Println(\"Starting Gocho Node...\")\n\tconf := &config.Config{}\n\tconf.Debug = c.Bool(\"debug\")\n\tconf.LocalPort = c.String(\"local-port\")\n\tconf.WebPort = c.String(\"share-port\")\n\tconf.ShareDirectory = c.String(\"dir\")\n\tconf.NodeId = c.String(\"id\")\n\n\tif conf.NodeId == \"\" || conf.ShareDirectory == \"\" {\n\t\tfmt.Println(\"Both --dir and --id should be set.\")\n\t\tfmt.Println(\"Checking config file.\")\n\t\tvar err error\n\t\tconf, err = config.LoadConfig()\n\t\tif err != nil {\n\t\t\treturn cli.NewExitError(err, 1)\n\t\t}\n\t}\n\n\tfmt.Println(\"Configuration loaded\")\n\tfmt.Println(\"---\")\n\tfmt.Println(conf)\n\tfmt.Println(\"---\")\n\n\tnode.Serve(conf)\n\n\treturn nil\n}\n\nfunc New() *cli.App {\n\tapp := cli.NewApp()\n\tapp.Name = info.APP_NAME\n\tapp.Usage = \"Auto-discovery local area network file sharing\"\n\tapp.Version = info.VERSION\n\tapp.Authors = []cli.Author{\n\t\tcli.Author{\n\t\t\tName:  \"Sergio Guillen Mantilla\",\n\t\t\tEmail: \"serguimant@gmail.com\",\n\t\t},\n\t}\n\n\tapp.Commands = []cli.Command{\n\t\t{\n\t\t\tName:  \"start\",\n\t\t\tUsage: \"Start Gocho node\",\n\t\t\tFlags: []cli.Flag{\n\t\t\t\tcli.BoolFlag{\n\t\t\t\t\tName:  \"debug\",\n\t\t\t\t\tUsage: \"Start gocho in debug mode\",\n\t\t\t\t},\n\t\t\t\tcli.StringFlag{\n\t\t\t\t\tName:   \"id\",\n\t\t\t\t\tUsage:  \"Node ID that will be shared to other peers\",\n\t\t\t\t\tEnvVar: \"GOCHO_ID\",\n\t\t\t\t},\n\t\t\t\tcli.StringFlag{\n\t\t\t\t\tName:   \"dir\",\n\t\t\t\t\tUsage:  \"Directory to share\",\n\t\t\t\t\tEnvVar: \"GOCHO_DIR\",\n\t\t\t\t},\n\t\t\t\tcli.StringFlag{\n\t\t\t\t\tName:   \"share-port\",\n\t\t\t\t\tUsage:  \"Port that will be exposed for file sharing\",\n\t\t\t\t\tEnvVar: \"GOCHO_SHARE_PORT\",\n\t\t\t\t\tValue:  \"5555\",\n\t\t\t\t},\n\t\t\t\tcli.StringFlag{\n\t\t\t\t\tName:   \"local-port\",\n\t\t\t\t\tUsage:  \"Port for local dashboard\",\n\t\t\t\t\tEnvVar: \"GOCHO_LOCAL_PORT\",\n\t\t\t\t\tValue:  \"1337\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tAction: StartAction,\n\t\t},\n\t\t{\n\t\t\tName:   \"configure\",\n\t\t\tUsage:  \"Create a configuration file for Gocho node\",\n\t\t\tAction: ConfigureAction,\n\t\t},\n\t}\n\n\treturn app\n}\n"
  },
  {
    "path": "pkg/config/config.go",
    "content": "package config\n\nimport (\n\t\"fmt\"\n\tyaml \"gopkg.in/yaml.v2\"\n\t\"io/ioutil\"\n)\n\ntype Config struct {\n\tNodeId         string `yaml:\"NodeId\" json:\"nodeId\"`\n\tWebPort        string `yaml:\"WebPort\" json:\"webPort\"`\n\tLocalPort      string `yaml:\"LocalPort\" json:\"localPort\"`\n\tShareDirectory string `yaml:\"ShareDirectory\" json:\"sharedDirectory\"`\n\tConfigFile     string `yaml:\"-\" json:\"-\"`\n\tDebug          bool   `yaml:\"-\" json:\"-\"`\n}\n\nfunc (c *Config) String() string {\n\tdata, err := yaml.Marshal(c)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\treturn string(data)\n}\n\nfunc ConfigureWizard() error {\n\treturn configureWizard()\n}\n\nfunc LoadConfig() (*Config, error) {\n\tconfigFile, err := getConfigFileName()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !fileExists(configFile) {\n\t\treturn nil, fmt.Errorf(\"Error: Config file does not exist\\nUse:\\n\\t$ gocho configure\")\n\t}\n\n\tdata, err := ioutil.ReadFile(configFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconfig := &Config{}\n\n\terr = yaml.Unmarshal(data, config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconfig.ShareDirectory = CleanPath(config.ShareDirectory)\n\treturn config, nil\n}\n"
  },
  {
    "path": "pkg/config/utils.go",
    "content": "package config\n\nimport (\n\t\"fmt\"\n\t\"github.com/Pallinder/go-randomdata\"\n\thomedir \"github.com/mitchellh/go-homedir\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/user\"\n\t\"strings\"\n)\n\nfunc fileExists(file string) bool {\n\t_, err := os.Stat(file)\n\treturn err == nil\n}\n\nfunc CleanPath(str string) string {\n\treturn strings.TrimRight(str, string(os.PathSeparator))\n}\n\nfunc writeConfigToFile(c *Config, fileName string) error {\n\tdata := []byte(c.String())\n\treturn ioutil.WriteFile(fileName, data, 0644)\n}\n\nfunc getConfigFileName() (string, error) {\n\tuserHome, err := homedir.Dir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tconfigFile := fmt.Sprintf(\"%s%c%s\", userHome, os.PathSeparator, \".gocho.conf\")\n\treturn configFile, nil\n}\n\nfunc getDefaultConfig() (*Config, error) {\n\tconfigFile, err := getConfigFileName()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefaultWebPort := \"5555\"\n\tdefaultLocalPort := \"1337\"\n\tdefaultNodeId := randomdata.SillyName()\n\tcurrentUser, err := user.Current()\n\tif err == nil {\n\t\tdefaultNodeId = currentUser.Username\n\t}\n\n\tconfig := &Config{\n\t\tShareDirectory: \"\",\n\t\tWebPort:        defaultWebPort,\n\t\tLocalPort:      defaultLocalPort,\n\t\tNodeId:         defaultNodeId,\n\t\tConfigFile:     configFile,\n\t}\n\treturn config, nil\n}\n"
  },
  {
    "path": "pkg/config/wizard.go",
    "content": "package config\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc configureWizard() error {\n\treader := bufio.NewReader(os.Stdin)\n\n\tconfig, err := getDefaultConfig()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Println(\"Gocho Configure Wizard\")\n\tfmt.Println(\"It will reset previous \\\"Gocho\\\" configure file\")\n\tvar (\n\t\tshareDirectory string\n\t\twebPort        string\n\t\tlocalPort      string\n\t\tnodeId         string\n\t)\n\n\tfmt.Printf(\"Node Id: (%s) \", config.NodeId)\n\tfmt.Scanf(\"%s\", &nodeId)\n\tfmt.Printf(\"Share Directory: \")\n\t// In windows it fails using fmt.Scanf\n\tlineRaw, _, err := reader.ReadLine()\n\tfmt.Println(string(lineRaw))\n\tif err != nil || strings.Trim(string(lineRaw), \" \\t\") == \"\" {\n\t\tfmt.Println(\"Invalid value for \\\"Share Directory\\\"\")\n\t\tos.Exit(1)\n\t}\n\tshareDirectory = string(lineRaw)\n\tfmt.Printf(\"Share Port: (%s) \", config.WebPort)\n\tfmt.Scanf(\"%s\", &webPort)\n\tfmt.Printf(\"Dashboard Port: (%s) \", config.LocalPort)\n\tfmt.Scanf(\"%s\", &localPort)\n\n\tif nodeId != \"\" {\n\t\tconfig.NodeId = nodeId\n\t}\n\tif shareDirectory != \"\" {\n\t\tconfig.ShareDirectory = CleanPath(shareDirectory)\n\t}\n\tif webPort != \"\" {\n\t\tconfig.WebPort = webPort\n\t}\n\tif localPort != \"\" {\n\t\tconfig.LocalPort = localPort\n\t}\n\n\tif fileExists(config.ConfigFile) {\n\t\terr := os.Remove(config.ConfigFile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn writeConfigToFile(config, config.ConfigFile)\n}\n"
  },
  {
    "path": "pkg/info/info.go",
    "content": "package info\n\nconst (\n\tAPP_NAME = \"gocho\"\n\tVERSION  = \"0.2.0-alfa\"\n)\n"
  },
  {
    "path": "pkg/node/dashboard.go",
    "content": "package node\n\nimport (\n\t\"container/list\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"github.com/donkeysharp/gocho/assets\"\n\t\"github.com/donkeysharp/gocho/pkg/config\"\n\t\"net/http\"\n\t\"log\"\n)\n\nfunc configHandler(conf *config.Config) func(w http.ResponseWriter, r *http.Request) {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tdata, err := json.Marshal(conf)\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\tw.Header().Add(\"Content-Type\", \"application/json\")\n\t\tw.Write(data)\n\t}\n}\n\nfunc nodesHandler(nodeList *list.List) func(http.ResponseWriter, *http.Request) {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tnodes := make([]*NodeInfo, 0)\n\t\tfor el := nodeList.Front(); el != nil; el = el.Next() {\n\t\t\ttmp := el.Value.(*NodeInfo)\n\t\t\tnodes = append(nodes, tmp)\n\t\t}\n\n\t\tdata, err := json.Marshal(nodes)\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\tw.Header().Add(\"Content-Type\", \"application/json\")\n\t\tw.Write(data)\n\t}\n}\n\nfunc dashboardServe(conf *config.Config, nodeList *list.List) {\n\tdashboardMux := http.NewServeMux()\n\tdashboardMux.Handle(\"/\", http.FileServer(assets.AssetFS()))\n\tdashboardMux.HandleFunc(\"/api/config\", configHandler(conf))\n\tdashboardMux.HandleFunc(\"/api/nodes\", nodesHandler(nodeList))\n\n\t// We don't want the dashboard to be public\n\taddress := \"localhost\"\n\tif conf.Debug {\n\t\taddress = \"0.0.0.0\"\n\t}\n\n\tfmt.Printf(\"Starting dashboard at %s:%s\\n\", address, conf.LocalPort)\n\terr := http.ListenAndServe(fmt.Sprintf(\"%s:%s\", address, conf.LocalPort), dashboardMux)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"
  },
  {
    "path": "pkg/node/index.go",
    "content": "package node\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"github.com/donkeysharp/gocho/pkg/config\"\n\t\"net/http\"\n\t\"regexp\"\n)\n\nconst (\n\tHTML_BODY = `<html>\n<head>\n    <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css\" type=\"text/css\">\n    <style>\n        * {\n            font-family: sans-serif;\n        }\n        a {\n            text-decoration: none;\n            color: #1552A8;\n            display: block;\n            padding-bottom: 3px;\n        }\n        a.directory:before {\n            color: #FFCF30;\n            font-family: FontAwesome;\n            content: \"\\f07b\\00a0\";\n        }\n        a.file:before {\n            font-family: FontAwesome;\n            content: \"\\f016\\00a0\";\n        }\n    </style>\n    <script>\n        function goBack() {\n            var path = window.location.pathname.split('/');\n            if (path.length <= 3) {\n                window.location = '/';\n                return;\n            }\n            window.location = path.slice(0, path.length - 2).join('/');\n        }\n    </script>\n</head>\n<body>\n<a class=\"directory\" onClick=\"javascript:goBack()\" href=\"#\">..</a>`\n\tHTML_END = `<script type=\"text/javascript\">\n    document.addEventListener('DOMContentLoaded', () => {\n        document.querySelectorAll(\".file\").forEach((el) => {\n            document.body.appendChild(el);\n        })\n    })\n</script>\n</body>\n</html>`\n)\n\ntype FileServerResponseInterceptor struct {\n\tOriginalWriter http.ResponseWriter\n\tIndexBuffer    *bytes.Buffer\n}\n\nfunc (f *FileServerResponseInterceptor) WriteHeader(status int) {\n\tf.OriginalWriter.WriteHeader(status)\n}\n\nfunc (f *FileServerResponseInterceptor) Header() http.Header {\n\treturn f.OriginalWriter.Header()\n}\n\nfunc (f *FileServerResponseInterceptor) Write(content []byte) (int, error) {\n\t// if it's not an html tag why bother evaluating with regex?\n\tif content[0] != byte('<') {\n\t\treturn f.OriginalWriter.Write(content)\n\t}\n\tre := regexp.MustCompile(\"^<a.+href=\\\"(.+)\\\".*>(.+)</a>$|^</{0,1}pre>$\")\n\tif !re.Match(bytes.Trim(content, \"\\n\\r\")) {\n\t\treturn f.OriginalWriter.Write(content)\n\t}\n\tcontent = bytes.Trim(content, \"\\n\\r\")\n\tdirectoryRegex := regexp.MustCompile(\"^<a.+href=\\\"(.+/)\\\".*>(.+)</a>$\")\n\tif directoryRegex.Match(content) {\n\t\tdirectoryLink := \"<a class=\\\"directory\\\" href=\\\"$1\\\">$2</a>\\n\"\n\t\tcontent = directoryRegex.ReplaceAll(content, []byte(directoryLink))\n\t\treturn f.IndexBuffer.Write(content)\n\t}\n\tfileRegex := regexp.MustCompile(\"^<a.+href=\\\"(.+)\\\".*>(.+)</a>$\")\n\tif fileRegex.Match(content) {\n\t\tfileLink := \"<a class=\\\"file\\\" href=\\\"$1\\\">$2</a>\\n\"\n\t\tcontent = fileRegex.ReplaceAll(content, []byte(fileLink))\n\t\treturn f.IndexBuffer.Write(content)\n\t}\n\treturn 0, nil\n}\n\nfunc interceptorHandler(next http.Handler) http.Handler {\n\tfn := func(w http.ResponseWriter, r *http.Request) {\n\t\tinterceptor := &FileServerResponseInterceptor{\n\t\t\tOriginalWriter: w,\n\t\t\tIndexBuffer:    bytes.NewBuffer(nil),\n\t\t}\n\t\tr.Header.Del(\"If-Modified-Since\")\n\t\tnext.ServeHTTP(interceptor, r)\n\n\t\tif interceptor.IndexBuffer.Len() > 0 {\n\t\t\tw.Write([]byte(HTML_BODY))\n\t\t\tw.Write(interceptor.IndexBuffer.Bytes())\n\t\t\tw.Write([]byte(HTML_END))\n\t\t}\n\t}\n\treturn http.HandlerFunc(fn)\n}\n\nfunc fileServe(conf *config.Config) {\n\tfileMux := http.NewServeMux()\n\tfileMux.Handle(\"/\", interceptorHandler(http.FileServer(http.Dir(conf.ShareDirectory))))\n\thttp.ListenAndServe(fmt.Sprintf(\"0.0.0.0:%s\", conf.WebPort), fileMux)\n}\n"
  },
  {
    "path": "pkg/node/net.go",
    "content": "package node\n\nimport (\n\t\"container/list\"\n\t\"fmt\"\n\t\"net\"\n\t\"sync\"\n\t\"time\"\n)\n\nvar (\n\tnodeMutex sync.Mutex\n)\n\nfunc announceNode(nodeInfo *NodeInfo) {\n\taddress, err := net.ResolveUDPAddr(\"udp\", MULTICAST_ADDRESS)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tconn, err := net.DialUDP(\"udp\", nil, address)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfor {\n\t\tfmt.Println(\"sending multicast info\")\n\n\t\tmessage, err := NewAnnouncePacket(nodeInfo)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Could not get announce package\")\n\t\t\tfmt.Println(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tconn.Write([]byte(message))\n\t\ttime.Sleep(ANNOUNCE_INTERVAL_SEC * time.Second)\n\t}\n}\n\nfunc listenForNodes(nodeList *list.List) {\n\taddress, err := net.ResolveUDPAddr(\"udp\", MULTICAST_ADDRESS)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tconn, err := net.ListenMulticastUDP(\"udp\", nil, address)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tconn.SetReadBuffer(MULTICAST_BUFFER_SIZE)\n\n\tfor {\n\t\tpacket := make([]byte, MULTICAST_BUFFER_SIZE)\n\t\tsize, udpAddr, err := conn.ReadFromUDP(packet)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tcontinue\n\t\t}\n\n\t\tnodeInfo, err := ParseAnnouncePacket(size, udpAddr, packet)\n\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Printf(\"Received multicast packet from %s Id: %s\\n\", udpAddr.String(), nodeInfo.Id)\n\n\t\tgo announcedNodeHandler(nodeInfo, nodeList)\n\t}\n}\n\nfunc announcedNodeHandler(nodeInfo *NodeInfo, nodeList *list.List) {\n\tnodeMutex.Lock()\n\tupdateNodeList(nodeInfo, nodeList)\n\tnodeMutex.Unlock()\n\n\tfmt.Println(\"Printing nodes\")\n\n\tfmt.Print(\"[\")\n\tfor el := nodeList.Front(); el != nil; el = el.Next() {\n\t\tfmt.Print(el.Value.(*NodeInfo).Id, \" \")\n\t}\n\tfmt.Print(\"]\\n\\n\")\n}\n\nfunc updateNodeList(nodeInfo *NodeInfo, nodeList *list.List) {\n\tnodeExists := false\n\tfor el := nodeList.Front(); el != nil; el = el.Next() {\n\t\ttmp := el.Value.(*NodeInfo)\n\n\t\t// Already in list\n\t\tif tmp.Id == nodeInfo.Id {\n\t\t\ttmp.LastMulticast = time.Now().Unix()\n\t\t\tfmt.Printf(\"Updating node %s multicast\\n\", nodeInfo.Id)\n\t\t\tnodeExists = true\n\t\t\tbreak\n\t\t}\n\n\t}\n\n\tfor el := nodeList.Front(); el != nil; el = el.Next() {\n\t\ttmp := el.Value.(*NodeInfo)\n\t\tif isNodeExpired(tmp, EXPIRE_TIMEOUT_SEC) {\n\t\t\tfmt.Println(\"Node expired, removing: \", tmp.Id)\n\t\t\tnodeList.Remove(el)\n\t\t}\n\t}\n\n\tif !nodeExists {\n\t\tfmt.Printf(\"Adding new node! %p %s\\n\", nodeInfo, nodeInfo.Id)\n\t\tnodeInfo.LastMulticast = time.Now().Unix()\n\t\tnodeList.PushBack(nodeInfo)\n\t}\n}\n\nfunc isNodeExpired(nodeInfo *NodeInfo, timeout int) bool {\n\tdiff := time.Now().Unix() - nodeInfo.LastMulticast\n\treturn diff > int64(timeout)\n}\n"
  },
  {
    "path": "pkg/node/node.go",
    "content": "package node\n\nimport (\n\t\"container/list\"\n\t\"github.com/donkeysharp/gocho/pkg/config\"\n)\n\nconst (\n\tMULTICAST_ADDRESS     = \"239.6.6.6:1337\"\n\tMULTICAST_BUFFER_SIZE = 4096\n\n\tNODE_ANNOUNCE_COMMAND = \"\\x01\"\n\tHEADER                = \"\\x60\\x0D\\xF0\\x0D\"\n\tMIN_PACKET_SIZE       = 6\n\n\tEXPIRE_TIMEOUT_SEC    = 50\n\tANNOUNCE_INTERVAL_SEC = 10\n)\n\ntype NodeInfo struct {\n\tId            string `json:\"nodeId\"`\n\tAddress       string `json:\"ipAddress\"`\n\tWebPort       string `json:\"webPort\"`\n\tLastMulticast int64  `json:\"-\"`\n}\n\ntype Announcer struct {\n\tconfig *config.Config\n}\n\nfunc (a *Announcer) Start(nodeList *list.List) {\n\tnodeInfo := &NodeInfo{\n\t\tId:            a.config.NodeId,\n\t\tAddress:       \"\",\n\t\tWebPort:       a.config.WebPort,\n\t\tLastMulticast: 0,\n\t}\n\n\tgo announceNode(nodeInfo)\n\tgo listenForNodes(nodeList)\n\n}\n"
  },
  {
    "path": "pkg/node/packet.go",
    "content": "package node\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net\"\n\t\"strings\"\n)\n\nfunc NewAnnouncePacket(n *NodeInfo) (string, error) {\n\tjsonMessage, err := json.Marshal(n)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tmessage := fmt.Sprintf(\"%s%s%s\", HEADER, NODE_ANNOUNCE_COMMAND, jsonMessage)\n\n\treturn message, nil\n}\n\nfunc ParseAnnouncePacket(size int, addr *net.UDPAddr, packet []byte) (*NodeInfo, error) {\n\tif size <= MIN_PACKET_SIZE {\n\t\treturn nil, fmt.Errorf(\"Invalid packet size\")\n\t}\n\tif strings.Compare(string(packet[0:len(HEADER)]), HEADER) != 0 {\n\t\treturn nil, fmt.Errorf(\"Invalid packet header\")\n\t}\n\n\tif string(packet[len(HEADER):len(HEADER)+1]) != NODE_ANNOUNCE_COMMAND[0:] {\n\t\treturn nil, fmt.Errorf(\"Command different than NODE_ANNOUNCE_COMMAND\")\n\t}\n\tfmt.Println(\"Packet command is NODE_ANNOUNCE_COMMAND\")\n\n\tpayload := string(packet[len(HEADER)+1:])\n\tpayload = strings.Trim(payload, \"\\x00\")\n\n\tnodeInfo := &NodeInfo{}\n\n\terr := json.Unmarshal([]byte(payload), nodeInfo)\n\tnodeInfo.Address = addr.IP.String()\n\tnodeInfo.Id = fmt.Sprintf(\"%s-%s\", nodeInfo.Id, nodeInfo.Address)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn nodeInfo, nil\n}\n"
  },
  {
    "path": "pkg/node/serve.go",
    "content": "package node\n\nimport (\n\t\"container/list\"\n\t\"github.com/donkeysharp/gocho/pkg/config\"\n\t\"time\"\n)\n\nfunc startAnnouncer(conf *config.Config, nodeList *list.List) {\n\tannouncer := &Announcer{\n\t\tconfig: conf,\n\t}\n\tannouncer.Start(nodeList)\n}\n\nfunc Serve(conf *config.Config) {\n\tnodeList := list.New()\n\n\tgo startAnnouncer(conf, nodeList)\n\tgo fileServe(conf)\n\tgo dashboardServe(conf, nodeList)\n\n\t// Enhancement. Open the UI app in a browser\n\topenUrl(\"http://localhost:\" + conf.LocalPort)\n\n\tfor {\n\t\ttime.Sleep(time.Minute * 15)\n\t}\n}\n"
  },
  {
    "path": "pkg/node/utils.go",
    "content": "package node\n\nimport (\n\t\"os/exec\"\n\t\"runtime\"\n)\n\n// https://stackoverflow.com/a/39324149/916063\n// open opens the specified URL in the default browser of the user.\nfunc openUrl(url string) error {\n\tvar cmd string\n\tvar args []string\n\n\tswitch runtime.GOOS {\n\tcase \"windows\":\n\t\tcmd = \"cmd\"\n\t\targs = []string{\"/c\", \"start\"}\n\tcase \"darwin\":\n\t\tcmd = \"open\"\n\tdefault: // \"linux\", \"freebsd\", \"openbsd\", \"netbsd\"\n\t\tcmd = \"xdg-open\"\n\t}\n\targs = append(args, url)\n\treturn exec.Command(cmd, args...).Start()\n}\n"
  },
  {
    "path": "ui/.gitignore",
    "content": "# See https://help.github.com/ignore-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "ui/package.json",
    "content": "{\n  \"name\": \"ui\",\n  \"version\": \"0.1.0\",\n  \"private\": false,\n  \"proxy\": \"http://localhost:1337\",\n  \"dependencies\": {\n    \"react\": \"^16.10.0\",\n    \"react-dom\": \"^16.10.0\",\n    \"react-scripts\": \"3.2.0\",\n    \"react-i18next\": \"^10.13.1\",\n    \"i18next\": \"^17.2.0\",\n    \"i18next-browser-languagedetector\": \"^4.0.0\",\n    \"i18next-xhr-backend\": \"^3.2.0\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build && rm build/static/js/*.map && rm build/static/css/*.map && rm build/service-worker.js && rm build/asset-manifest.json\",\n    \"test\": \"react-scripts test --env=jsdom\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"browserslist\": {}\n}\n"
  },
  {
    "path": "ui/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n    <meta name=\"theme-color\" content=\"#000000\">\n    <!--\n      manifest.json provides metadata used when your web app is added to the\n      homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/\n    -->\n    <link rel=\"shortcut icon\" href=\"%PUBLIC_URL%/favicon.ico\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"%PUBLIC_URL%/bootstrap.min.css\">\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>Gocho - Local Network File Sharing</title>\n  </head>\n  <body>\n    <noscript>\n      You need to enable JavaScript to run this app.\n    </noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "ui/public/lang/en.json",
    "content": "{\n    \"menus\": [\n        {\n            \"node_information\": \"Node Information\"\n        },\n        {\n            \"discover\": \"Discover\"\n        }\n    ],\n    \"sections\": {\n        \"node_information\": {\n            \"title\": \"Node Information\",\n            \"node_settings\": \"Node Settings\",\n            \"node_id\": \"Node ID\",\n            \"web_port\": \"Web Port\",\n            \"dashboard_port\": \"Dashboard Port\",\n            \"shared_directory\": \"Shared Directory\"\n        },\n        \"discover\": {\n            \"title\": \"Discover\",\n            \"auto_discovery\": \"Auto-Discovery\",\n            \"node_details\": \"Node Details\",\n            \"no_node_selected\": \"No node selected\",\n            \"no_nodes_available\": \"No nodes available\",\n            \"node_id\": \"Node ID\",\n            \"web_port\": \"Web Port\",\n            \"URL\": \"URL\",\n            \"view_files\": \"View Files\",\n            \"hide_files\": \"Hide Files\",\n            \"open_in_tab\": \"Open in tab\"\n        }\n    }\n}\n"
  },
  {
    "path": "ui/public/lang/es.json",
    "content": "{\n    \"menus\": [\n        {\n            \"node_information\": \"Información del Nodo\"\n        },\n        {\n            \"discover\": \"Descubrir\"\n        }\n    ],\n    \"sections\": {\n        \"node_information\": {\n            \"title\": \"Información del Nodo\",\n            \"node_settings\": \"Ajustes del Nodo\",\n            \"node_id\": \"ID Nodo\",\n            \"web_port\": \"Puerto Web\",\n            \"dashboard_port\": \"Puerto Panel de Control\",\n            \"shared_directory\": \"Directorio Compartido\"\n        },\n        \"discover\": {\n            \"title\": \"Descubrir\",\n            \"auto_discovery\": \"Auto-Descubrir\",\n            \"node_details\": \"Detalles del nodo\",\n            \"no_node_selected\": \"Ningún nodo seleccionado\",\n            \"no_nodes_available\": \"No hay nodos disponibles\",\n            \"node_id\": \"ID Nodo\",\n            \"web_port\": \"Puerto Web\",\n            \"URL\": \"URL\",\n            \"view_files\": \"Ver Archivos\",\n            \"hide_files\": \"Ocultar Archivos\",\n            \"open_in_tab\": \"Abrir en otra pestaña\"\n        }\n    }\n}\n"
  },
  {
    "path": "ui/src/App.css",
    "content": "@import \"https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700\";\n\nbody {\n  font-family: 'Poppins', sans-serif;\n  background-color: #f4f3ef;\n}\n\n.wrapper {\n  display: flex;\n}\n\n.content-wrapper {\n  position: relative;\n  margin-left: 250px;\n  width: 100%;\n}\n\n.content {\n  padding: 10px 80px;\n}\n\n.content-wrapper .nav {\n  border-bottom: 1px #d5d5d5 solid;\n  color: #747474;\n  padding: 23px 50px;\n}\n\n.content-wrapper .nav .navbar-btn {\n  display: none;\n  top: 15px;\n  right: 8px;\n}\n\n.panel {\n  background-color: #fff;\n  border-radius: 5px;\n  border: 1px #d5d5d5 solid;\n  box-shadow: 0 2px 2px rgba(204, 197, 185, 0.5);\n}\n\n.panel header {\n  color: #53BD82;\n  font-weight: bold;\n  font-size: 20px;\n  padding: 10px 15px;\n  border-bottom: 1px #d5d5d5 solid;\n}\n\n.panel .panel-body {\n  padding: 20px;\n}\n\n.sidebar {\n  position: fixed;\n  min-width: 250px;\n  max-width: 250px;\n  min-height: 100vh;\n  background: #fff;\n  transition: all 0.3s;\n  z-index: 99999;\n  border-right: 1px #d5d5d5 solid;\n}\n.sidebar a, a:hover, a:focus {\n  color: inherit;\n  text-decoration: none;\n  transition: all 0.3s;\n}\n\n.navbar-btn {\n  position: absolute;\n  right: 0;\n}\n\n.sidebar .sidebar-header {\n  padding: 20px;\n  margin-left: 15px;\n  margin-right: 20px;\n  border-bottom: 1px solid #d5d5d5;\n  font-size: 20px;\n  text-align: center;\n}\n\n.sidebar ul.components {\n  padding: 20px 0;\n}\n\n.sidebar ul li a {\n  padding: 10px 10px 10px 20px;\n  font-size: 1.1em;\n  display: block;\n  color: #959595;\n  width: 100%;\n}\n\n.sidebar ul li a:hover {\n  color: #313131;\n}\n\n.sidebar ul li.active > a {\n  color: #53BD82;\n}\n\n@media (max-width: 768px) {\n  .sidebar {\n    margin-left: -250px;\n  }\n  .sidebar.active {\n    margin-left: 0;\n  }\n  .content-wrapper {\n    margin-left: 0;\n  }\n\n  .content-wrapper .nav .navbar-btn {\n    display: inline-block;\n  }\n\n  .content {\n    padding: 10px 10px;\n  }\n}\n\nul.node-list {\n  padding: 0;\n  list-style-type: none;\n  width: 100%;\n  max-height: 350px;\n  min-height: 0px;\n  overflow: auto;\n}\n\n.node-list li {\n  list-style-type: none;\n  display: block;\n  background-color: #53BD82;\n  color: #fff;\n  margin-bottom: 5px;\n}\n\n.node-list li a {\n  color: #fff;\n  display: block;\n  width: 100%;\n  padding: 8px;\n  border: 1px transparent solid;\n  border-left: 8px #149D51 solid;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n\n.node-list li a.active {\n  background-color: #fff;\n  color: #000;\n  border: 1px #149D51 solid;\n  border-left: 8px #149D51 solid;\n}\n\n.node-list li a.active:hover {\n  background-color: #fff;\n}\n\n.node-list li a:hover {\n  background-color: #73CD9A;\n}\n\n.node-details {\n  border-left: 1px #d5d5d5 solid;\n  padding-left: 20px;\n}\n\n.node-details a {\n  color: #149D51;\n}\n\n.node-details a:hover {\n  color: #000;\n}\n\n.files {\n  width: 100%;\n  height: 500px;\n  border: 1px #d5d5d5 solid;\n}\n"
  },
  {
    "path": "ui/src/App.js",
    "content": "import React, { Component } from 'react';\nimport { withTranslation } from 'react-i18next';\nimport SideBar from './components/SideBar';\nimport Discover from './containers/Discover';\nimport NodeInfo from './containers/NodeInfo';\nimport './App.css';\n\nclass App extends Component {\n  constructor(props) {\n    super(props);\n    this.menu = [\n      {\n        name: 'menus.0.node_information',\n        component: <NodeInfo />\n      },\n      {\n        name: 'menus.1.discover',\n        component: <Discover />\n      }\n    ];\n    this.state = {\n      title: this.menu[0].name,\n      selectedItem: 0,\n      toggle: false,\n    }\n  }\n  collapse(e) {\n    this.setState({\n      toggle: !this.state.toggle,\n    })\n  }\n  menuSelectedHandler(index) {\n    this.setState({\n      title: this.menu[index].name,\n      selectedItem: index,\n    })\n  }\n  render() {\n    const { t } = this.props;\n    return (\n      <div className=\"wrapper\">\n        <span>{t(\"node_information\")}</span>\n        <SideBar\n          toggle={this.state.toggle}\n          title=\"Gocho\"\n          menu={this.menu}\n          onMenuSelected={this.menuSelectedHandler.bind(this)} />\n        <div className=\"content-wrapper\">\n          <nav className=\"nav\">\n            <b>{t(this.state.title)}</b>\n            <button\n              type=\"button\"\n              className=\"btn btn-info navbar-btn\"\n              onClick={this.collapse.bind(this)}\n            >\n              &lt;\n            </button>\n          </nav>\n          <div className=\"content\">\n            {this.menu[this.state.selectedItem].component}\n          </div>\n        </div>\n      </div>\n    );\n  }\n}\n\nexport default withTranslation()(App);\n"
  },
  {
    "path": "ui/src/components/FormField.js",
    "content": "import React, {Component} from 'react';\n\nclass FormField extends Component {\n  render() {\n    let disabled = 'false';\n    if (this.props.isDisabled) {\n      disabled = 'true';\n    }\n    let leftCol = this.props.leftCol ? this.props.leftCol : 'col-md-3';\n    let rightCol = this.props.rightCol ? this.props.rightCol : 'col-md-9';\n    return <div className=\"form-group row\">\n      <label className={leftCol + ' col-form-label'}>{this.props.label}</label>\n      <div className={rightCol}>\n        <input className=\"form-control\" disabled={disabled} value={this.props.value} />\n      </div>\n    </div>;\n  }\n}\n\nexport default FormField;\n"
  },
  {
    "path": "ui/src/components/NodeDetails.js",
    "content": "import React, {Component} from 'react';\nimport { withTranslation } from 'react-i18next';\nimport FormField from './FormField';\n\n\nconst IframeViewer = ((props) => {\n  return <div className=\"row\">\n    <div className=\"col-md-12\">\n      <iframe frameBorder=\"0\" className=\"files\" src={props.url} title=\"shared-files\" />\n    </div>\n  </div>\n})\n\nclass NodeDetails extends Component {\n  constructor(props) {\n    super(props)\n    this.state = {\n      displayIframe: false,\n    }\n  }\n  componentWillReceiveProps(nextProps) {\n    if (this.props.node.nodeId !== nextProps.node.nodeId) {\n      this.setState({\n        displayIframe: false,\n      })\n    }\n  }\n  onClickHandler() {\n    this.setState({\n      displayIframe: !this.state.displayIframe,\n    })\n  }\n  render() {\n    const { t } = this.props;\n    let nodeUrl = `http://${this.props.node.ipAddress}:${this.props.node.webPort}`;\n    let iframeViewer = '';\n    if (this.state.displayIframe) {\n      iframeViewer = <IframeViewer url={nodeUrl} />\n    }\n    return <div className=\"node-details\">\n      <h4>{t('sections.discover.node_details')}</h4>\n      <div className=\"form\">\n        <FormField label={t('sections.discover.node_id')} \n          value={this.props.node.nodeId}\n          leftCol=\"col-md-2\" rightCol=\"col-md-5\" />\n        <FormField label={t('sections.discover.web_port')} \n          value={this.props.node.webPort}\n          leftCol=\"col-md-2\" rightCol=\"col-md-5\" />\n        <FormField label={t('sections.discover.URL')} \n          value={nodeUrl}\n          leftCol=\"col-md-2\" rightCol=\"col-md-5\" />\n      </div>\n      <div className=\"row\">\n        <div className=\"col-md-12\">\n          &nbsp;|&nbsp;\n          <a\n            href=\"#/\"\n            onClick={this.onClickHandler.bind(this)} >\n            {\n              this.state.displayIframe ? \n              t('sections.discover.hide_files') : \n              t('sections.discover.view_files')\n            }\n          </a>\n          &nbsp;|&nbsp;\n          <a href={nodeUrl} target=\"_\">\n            { t('sections.discover.open_in_tab') }\n          </a>\n          &nbsp;|&nbsp;\n        </div>\n      </div>\n      { iframeViewer }\n    </div>\n  }\n}\n\nexport default withTranslation()(NodeDetails);\n"
  },
  {
    "path": "ui/src/components/NodeList.js",
    "content": "import React, {Component} from 'react';\n\nclass NodeList extends Component {\n  constructor(props) {\n    super(props)\n    this.state = {\n      currentItem: -1\n    }\n  }\n  onClickHandler(e) {\n    let index = parseInt(e.currentTarget.dataset.index, 10);\n    if (index === this.state.currentItem) {\n      return;\n    }\n    this.setState({\n      currentItem: index,\n    })\n    if (this.props.onNodeSelected) {\n      this.props.onNodeSelected(index);\n    }\n  }\n  render() {\n    if (this.props.nodes && this.props.nodes.length === 0) {\n      return <span>No nodes available</span>\n    }\n    return <ul className=\"node-list\">\n      {this.props.nodes.map((item, index) => {\n        let className = ''\n        if (index === this.state.currentItem) {\n          className = 'active'\n        }\n        return <li key={index}>\n          <a\n            data-index={index}\n            className={className}\n            href=\"#/\"\n            onClick={this.onClickHandler.bind(this)}>\n            {item.nodeId}\n          </a>\n        </li>\n      })}\n    </ul>\n  }\n}\n\nexport default NodeList;\n"
  },
  {
    "path": "ui/src/components/Panel.js",
    "content": "import React, {Component} from 'react';\n\nclass Panel extends Component {\n  render() {\n    return  <div className=\"panel\">\n      <header>\n        {this.props.title}\n      </header>\n      <div className=\"panel-body\">\n        {this.props.children}\n      </div>\n    </div>\n  }\n}\n\nexport default Panel;\n"
  },
  {
    "path": "ui/src/components/SideBar.js",
    "content": "import React, {Component} from 'react';\nimport { withTranslation } from 'react-i18next';\n\nclass SideBar extends Component {\n  constructor(props) {\n    super(props)\n    this.state = {\n      currentItem: 0\n    }\n  }\n  itemClickHandler(e) {\n    let index = parseInt(e.currentTarget.dataset.index, 10)\n    if (index === this.state.currentItem) {\n      return\n    }\n    this.setState({\n      currentItem: index,\n    })\n\n    if (this.props.onMenuSelected) {\n      this.props.onMenuSelected(index)\n    }\n  }\n  render() {\n    const { t } = this.props;\n    let className = 'sidebar';\n    if (this.props.toggle) {\n      className += ' active';\n    }\n    return <nav className={className}>\n      <div className=\"sidebar-header\">\n        {this.props.title}\n      </div>\n      <ul className=\"list-unstyled components\">\n        {this.props.menu.map((item, index) => {\n          let className = (index === this.state.currentItem ? 'active' : '');\n          return <li className={className} key={index}>\n            <a data-index={index}\n              href=\"#/\"\n              onClick={this.itemClickHandler.bind(this)}>\n              {t(item.name)}\n            </a>\n          </li>\n        })}\n      </ul>\n    </nav>\n  }\n}\n\nexport default withTranslation()(SideBar);\n"
  },
  {
    "path": "ui/src/containers/Discover.js",
    "content": "import React, {Component} from 'react';\nimport { withTranslation } from 'react-i18next';\nimport Panel from '../components/Panel';\nimport NodeList from '../components/NodeList';\nimport NodeDetails from '../components/NodeDetails';\n\n\nclass Discover extends Component {\n  constructor(props) {\n    super(props)\n    this.state = {\n      nodes: [],\n      currentNode: -1,\n    }\n  }\n  retrieveData() {\n    fetch('/api/nodes').then((resp) => {\n      return resp.json()\n    }).then((data) => {\n      this.setState({\n        nodes: data\n      })\n    })\n  }\n  componentDidMount() {\n    this.retrieveData()\n  }\n  nodeSelectedHandler(index) {\n    this.setState({\n      currentNode: index,\n    });\n  }\n  render() {\n    const { t } = this.props;\n    let detailsBody = <span>{t('sections.discover.no_node_selected')}</span>\n    if (this.state.currentNode !== -1) {\n      detailsBody = <NodeDetails\n        node={this.state.nodes[this.state.currentNode]}\n      />\n    }\n    return <Panel title={t(\"sections.discover.auto_discovery\")}>\n      <div className=\"row\">\n        <div className=\"col-md-3\">\n          <NodeList\n            nodes={this.state.nodes}\n            onNodeSelected={this.nodeSelectedHandler.bind(this)} />\n        </div>\n        <div className=\"col-md-9\">\n          {detailsBody}\n        </div>\n      </div>\n    </Panel>\n  }\n}\n\nexport default withTranslation()(Discover);\n"
  },
  {
    "path": "ui/src/containers/NodeInfo.js",
    "content": "import React, {Component} from 'react';\nimport { withTranslation } from 'react-i18next';\nimport Panel from '../components/Panel'\nimport FormField from '../components/FormField'\n\nclass NodeInfo extends Component {\n  constructor(props) {\n    super(props)\n    this.state = {\n      nodeInfo: null\n    }\n  }\n  componentDidMount() {\n    fetch('/api/config').then((resp) => {\n      return resp.json()\n    }).then((data) => {\n      this.setState({\n        nodeInfo: data\n      })\n    })\n  }\n  render() {\n    const { t } = this.props;\n    if (!this.state.nodeInfo) {\n      return <span>Loading...</span>\n    }\n    return <Panel title={t(\"sections.node_information.node_settings\")}>\n      <div className=\"form\">\n        <FormField\n          label={t(\"sections.node_information.node_id\")} \n          value={this.state.nodeInfo.nodeId}\n          leftCol=\"col-md-3\" rightCol=\"col-md-5\" />\n        <FormField label={t(\"sections.node_information.web_port\")} \n          value={this.state.nodeInfo.webPort}\n          leftCol=\"col-md-3\" rightCol=\"col-md-5\" />\n        <FormField label={t(\"sections.node_information.dashboard_port\")} \n          value={this.state.nodeInfo.localPort}\n          leftCol=\"col-md-3\" rightCol=\"col-md-5\" />\n        <FormField label={t(\"sections.node_information.shared_directory\")} \n          value={this.state.nodeInfo.sharedDirectory}\n          leftCol=\"col-md-3\" rightCol=\"col-md-5\" />\n      </div>\n    </Panel>\n  }\n}\n\nexport default withTranslation()(NodeInfo);\n"
  },
  {
    "path": "ui/src/i18n.js",
    "content": "import i18n from \"i18next\";\nimport Backend from 'i18next-xhr-backend';\nimport LanguageDetector from 'i18next-browser-languagedetector';\nimport { initReactI18next } from \"react-i18next\";\n\ni18n\n  .use(initReactI18next)\n  .use(Backend)\n  .use(LanguageDetector)\n  .init({\n    keySeparator: '.',\n    interpolation: {\n      escapeValue: false\n    },\n    backend: {\n      loadPath: 'lang/{{lng}}.json'\n    },\n    fallbackLng: 'en'\n  });\n\nexport default i18n;"
  },
  {
    "path": "ui/src/index.css",
    "content": "body {\n  margin: 0;\n  padding: 0;\n  font-family: sans-serif;\n}\n"
  },
  {
    "path": "ui/src/index.js",
    "content": "import React, { Suspense } from 'react';\nimport ReactDOM from 'react-dom';\nimport './i18n';\nimport './index.css';\nimport App from './App';\n\nReactDOM.render(\n  <Suspense fallback=\"loading\">\n    <App />\n  </Suspense>,\n  document.getElementById('root')\n);\n"
  },
  {
    "path": "vendor/github.com/Pallinder/go-randomdata/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2013 David Pallinder\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/Pallinder/go-randomdata/README.md",
    "content": "# go-randomdata\n\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/Pallinder/go-randomdata/issues)\n[![GoDoc](https://godoc.org/github.com/Pallinder/go-randomdata?status.svg)](https://godoc.org/github.com/Pallinder/go-randomdata)\n[![Build Status](https://travis-ci.org/Pallinder/go-randomdata.png)](https://travis-ci.org/Pallinder/go-randomdata)\n[![Go Report Card](https://goreportcard.com/badge/github.com/Pallinder/go-randomdata)](https://goreportcard.com/report/github.com/Pallinder/go-randomdata)\n\nrandomdata is a tiny help suite for generating random data such as\n\n* first names (male or female)\n* last names\n* full names (male or female)\n* country names (full name or iso 3166.1 alpha-2 or alpha-3)\n* random email address\n* city names\n* American state names (two chars or full)\n* random numbers (in an interval)\n* random paragraphs\n* random bool values\n* postal- or zip-codes formatted for a range of different countries.\n* american sounding addresses / street names\n* silly names - suitable for names of things\n* random days\n* random months\n* random full date\n* random full profile\n* random date inside range\n\n## Installation\n\n```go get github.com/Pallinder/go-randomdata```\n\n## Usage\n\n```go\n\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/Pallinder/go-randomdata\"\n)\n\nfunc main() {\n    // Print a random silly name\n    fmt.Println(randomdata.SillyName())\n\n    // Print a male title\n    fmt.Println(randomdata.Title(randomdata.Male))\n\n    // Print a female title\n    fmt.Println(randomdata.Title(randomdata.Female))\n\n    // Print a title with random gender\n    fmt.Println(randomdata.Title(randomdata.RandomGender))\n\n    // Print a male first name\n    fmt.Println(randomdata.FirstName(randomdata.Male))\n\n    // Print a female first name\n    fmt.Println(randomdata.FirstName(randomdata.Female))\n\n    // Print a last name\n    fmt.Println(randomdata.LastName())\n\n    // Print a male name\n    fmt.Println(randomdata.FullName(randomdata.Male))\n\n    // Print a female name\n    fmt.Println(randomdata.FullName(randomdata.Female))\n\n    // Print a name with random gender\n    fmt.Println(randomdata.FullName(randomdata.RandomGender))\n\n    // Print an email\n    fmt.Println(randomdata.Email())\n\n    // Print a country with full text representation\n    fmt.Println(randomdata.Country(randomdata.FullCountry))\n\n    // Print a country using ISO 3166-1 alpha-2\n    fmt.Println(randomdata.Country(randomdata.TwoCharCountry))\n\n    // Print a country using ISO 3166-1 alpha-3\n    fmt.Println(randomdata.Country(randomdata.ThreeCharCountry))\n\n    // Print a currency using ISO 4217\n    fmt.Println(randomdata.Currency())\n\n    // Print the name of a random city\n    fmt.Println(randomdata.City())\n\n    // Print the name of a random american state\n    fmt.Println(randomdata.State(randomdata.Large))\n\n    // Print the name of a random american state using two chars\n    fmt.Println(randomdata.State(randomdata.Small))\n\n    // Print an american sounding street name\n    fmt.Println(randomdata.Street())\n\n    // Print an american sounding address\n    fmt.Println(randomdata.Address())\n\n    // Print a random number >= 10 and <= 20\n    fmt.Println(randomdata.Number(10, 20))\n\n    // Print a number >= 0 and <= 20\n    fmt.Println(randomdata.Number(20))\n\n    // Print a random float >= 0 and <= 20 with decimal point 3\n    fmt.Println(randomdata.Decimal(0, 20, 3))\n\n    // Print a random float >= 10 and <= 20\n    fmt.Println(randomdata.Decimal(10, 20))\n\n    // Print a random float >= 0 and <= 20\n    fmt.Println(randomdata.Decimal(20))\n\n    // Print a bool\n    fmt.Println(randomdata.Boolean())\n\n    // Print a paragraph\n    fmt.Println(randomdata.Paragraph())\n\n    // Print a postal code\n    fmt.Println(randomdata.PostalCode(\"SE\"))\n\n    // Print a set of 2 random numbers as a string\n    fmt.Println(randomdata.StringNumber(2, \"-\"))\n\n    // Print a set of 2 random 3-Digits numbers as a string\n    fmt.Println(randomdata.StringNumberExt(2, \"-\", 3))\n\n    // Print a random string sampled from a list of strings\n    fmt.Println(randomdata.StringSample(\"my string 1\", \"my string 2\", \"my string 3\"))\n\n    // Print a valid random IPv4 address\n    fmt.Println(randomdata.IpV4Address())\n\n    // Print a valid random IPv6 address\n    fmt.Println(randomdata.IpV6Address())\n\n    // Print a browser's user agent string\n    fmt.Println(randomdata.UserAgentString())\n\n    // Print a day\n    fmt.Println(randomdata.Day())\n\n    // Print a month\n    fmt.Println(randomdata.Month())\n\n    // Print full date like Monday 22 Aug 2016\n    fmt.Println(randomdata.FullDate())\n\n    // Print full date <= Monday 22 Aug 2016\n    fmt.Println(randomdata.FullDateInRange(\"2016-08-22\"))\n\n    // Print full date >= Monday 01 Aug 2016 and <= Monday 22 Aug 2016\n    fmt.Println(randomdata.FullDateInRange(\"2016-08-01\", \"2016-08-22\"))\n\n    // Get a complete and randomised profile of data generally used for users\n    // There are many fields in the profile to use check the Profile struct definition in fullprofile.go\n    profile := randomdata.GenerateProfile(randomdata.Male | randomdata.Female | randomdata.RandomGender)\n    fmt.Printf(\"The new profile's username is: %s and password (md5): %s\\n\", profile.Login.Username, profile.Login.Md5)\n}\n\n```\n\n## Contributors\n\n* [jteeuwen](https://github.com/jteeuwen)\n* [n1try](https://github.com/n1try)\n\nAll the other contributors are listed [here](https://github.com/Pallinder/go-randomdata/graphs/contributors)."
  },
  {
    "path": "vendor/github.com/Pallinder/go-randomdata/fullprofile.go",
    "content": "package randomdata\n\nimport (\n\t\"crypto/md5\"\n\t\"crypto/sha1\"\n\t\"crypto/sha256\"\n\t\"encoding/base64\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"math/rand\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\nvar letterRunes = []rune(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\")\nvar portraitDirs = []string{\"men\", \"women\"}\n\ntype Profile struct {\n\tGender string `json:\"gender\"`\n\tName   struct {\n\t\tFirst string `json:\"first\"`\n\t\tLast  string `json:\"last\"`\n\t\tTitle string `json:\"title\"`\n\t} `json:\"name\"`\n\tLocation struct {\n\t\tStreet   string `json:\"street\"`\n\t\tCity     string `json:\"city\"`\n\t\tState    string `json:\"state\"`\n\t\tPostcode int    `json:\"postcode\"`\n\t} `json:\"location\"`\n\n\tEmail string `json:\"email\"`\n\tLogin struct {\n\t\tUsername string `json:\"username\"`\n\t\tPassword string `json:\"password\"`\n\t\tSalt     string `json:\"salt\"`\n\t\tMd5      string `json:\"md5\"`\n\t\tSha1     string `json:\"sha1\"`\n\t\tSha256   string `json:\"sha256\"`\n\t} `json:\"login\"`\n\n\tDob        string `json:\"dob\"`\n\tRegistered string `json:\"registered\"`\n\tPhone      string `json:\"phone\"`\n\tCell       string `json:\"cell\"`\n\n\tID struct {\n\t\tName  string      `json:\"name\"`\n\t\tValue interface{} `json:\"value\"`\n\t} `json:\"id\"`\n\n\tPicture struct {\n\t\tLarge     string `json:\"large\"`\n\t\tMedium    string `json:\"medium\"`\n\t\tThumbnail string `json:\"thumbnail\"`\n\t} `json:\"picture\"`\n\tNat string `json:\"nat\"`\n}\n\nfunc RandStringRunes(n int) string {\n\tb := make([]rune, n)\n\tfor i := range b {\n\t\tb[i] = letterRunes[rand.Intn(len(letterRunes))]\n\t}\n\treturn string(b)\n}\n\nfunc getMD5Hash(text string) string {\n\thasher := md5.New()\n\thasher.Write([]byte(text))\n\treturn hex.EncodeToString(hasher.Sum(nil))\n}\n\nfunc getSha1(text string) string {\n\thasher := sha1.New()\n\thasher.Write([]byte(text))\n\tsha := base64.URLEncoding.EncodeToString(hasher.Sum(nil))\n\treturn sha\n}\n\nfunc getSha256(text string) string {\n\thasher := sha256.New()\n\thasher.Write([]byte(text))\n\tsha := base64.URLEncoding.EncodeToString(hasher.Sum(nil))\n\treturn sha\n}\n\nfunc GenerateProfile(gender int) *Profile {\n\trand.Seed(time.Now().UnixNano())\n\tprofile := &Profile{}\n\tif gender == Male {\n\t\tprofile.Gender = \"male\"\n\t} else if gender == Female {\n\t\tprofile.Gender = \"female\"\n\t} else {\n\t\tgender = rand.Intn(2)\n\t\tif gender == Male {\n\t\t\tprofile.Gender = \"male\"\n\t\t} else {\n\t\t\tprofile.Gender = \"female\"\n\t\t}\n\t}\n\tprofile.Name.Title = Title(gender)\n\tprofile.Name.First = FirstName(gender)\n\tprofile.Name.Last = LastName()\n\tprofile.ID.Name = \"SSN\"\n\tprofile.ID.Value = fmt.Sprintf(\"%d-%d-%d\",\n\t\tNumber(101, 999),\n\t\tNumber(01, 99),\n\t\tNumber(100, 9999),\n\t)\n\n\tprofile.Email = strings.ToLower(profile.Name.First) + \".\" + strings.ToLower(profile.Name.Last) + \"@example.com\"\n\tprofile.Cell = fmt.Sprintf(\"%d-%d-%d\",\n\t\tNumber(201, 999),\n\t\tNumber(201, 999),\n\t\tNumber(1000, 9999),\n\t)\n\tprofile.Phone = fmt.Sprintf(\"%d-%d-%d\",\n\t\tNumber(201, 999),\n\t\tNumber(201, 999),\n\t\tNumber(1000, 9999),\n\t)\n\tprofile.Dob = FullDate()\n\tprofile.Registered = FullDate()\n\tprofile.Nat = \"US\"\n\n\tprofile.Location.City = City()\n\ti, _ := strconv.Atoi(PostalCode(\"US\"))\n\tprofile.Location.Postcode = i\n\tprofile.Location.State = State(2)\n\tprofile.Location.Street = StringNumber(1, \"\") + \" \" + Street()\n\n\tprofile.Login.Username = SillyName()\n\tpass := SillyName()\n\tsalt := RandStringRunes(16)\n\tprofile.Login.Password = pass\n\tprofile.Login.Salt = salt\n\tprofile.Login.Md5 = getMD5Hash(pass + salt)\n\tprofile.Login.Sha1 = getSha1(pass + salt)\n\tprofile.Login.Sha256 = getSha256(pass + salt)\n\n\tpic := rand.Intn(35)\n\tprofile.Picture.Large = fmt.Sprintf(\"https://randomuser.me/api/portraits/%s/%d.jpg\", portraitDirs[gender], pic)\n\tprofile.Picture.Medium = fmt.Sprintf(\"https://randomuser.me/api/portraits/med/%s/%d.jpg\", portraitDirs[gender], pic)\n\tprofile.Picture.Thumbnail = fmt.Sprintf(\"https://randomuser.me/api/portraits/thumb/%s/%d.jpg\", portraitDirs[gender], pic)\n\n\treturn profile\n}\n"
  },
  {
    "path": "vendor/github.com/Pallinder/go-randomdata/jsondata.go",
    "content": "package randomdata\n\nvar data = []byte(`{\n    \"adjectives\": [\n        \"black\",\n        \"white\",\n        \"gray\",\n        \"brown\",\n        \"red\",\n        \"pink\",\n        \"crimson\",\n        \"carnelian\",\n        \"orange\",\n        \"yellow\",\n        \"ivory\",\n        \"cream\",\n        \"green\",\n        \"viridian\",\n        \"aquamarine\",\n        \"cyan\",\n        \"blue\",\n        \"cerulean\",\n        \"azure\",\n        \"indigo\",\n        \"navy\",\n        \"violet\",\n        \"purple\",\n        \"lavender\",\n        \"magenta\",\n        \"rainbow\",\n        \"iridescent\",\n        \"spectrum\",\n        \"prism\",\n        \"bold\",\n        \"vivid\",\n        \"pale\",\n        \"clear\",\n        \"glass\",\n        \"translucent\",\n        \"misty\",\n        \"dark\",\n        \"light\",\n        \"gold\",\n        \"silver\",\n        \"copper\",\n        \"bronze\",\n        \"steel\",\n        \"iron\",\n        \"brass\",\n        \"mercury\",\n        \"zinc\",\n        \"chrome\",\n        \"platinum\",\n        \"titanium\",\n        \"nickel\",\n        \"lead\",\n        \"pewter\",\n        \"rust\",\n        \"metal\",\n        \"stone\",\n        \"quartz\",\n        \"granite\",\n        \"marble\",\n        \"alabaster\",\n        \"agate\",\n        \"jasper\",\n        \"pebble\",\n        \"pyrite\",\n        \"crystal\",\n        \"geode\",\n        \"obsidian\",\n        \"mica\",\n        \"flint\",\n        \"sand\",\n        \"gravel\",\n        \"boulder\",\n        \"basalt\",\n        \"ruby\",\n        \"beryl\",\n        \"scarlet\",\n        \"citrine\",\n        \"sulpher\",\n        \"topaz\",\n        \"amber\",\n        \"emerald\",\n        \"malachite\",\n        \"jade\",\n        \"abalone\",\n        \"lapis\",\n        \"sapphire\",\n        \"diamond\",\n        \"peridot\",\n        \"gem\",\n        \"jewel\",\n        \"bevel\",\n        \"coral\",\n        \"jet\",\n        \"ebony\",\n        \"wood\",\n        \"tree\",\n        \"cherry\",\n        \"maple\",\n        \"cedar\",\n        \"branch\",\n        \"bramble\",\n        \"rowan\",\n        \"ash\",\n        \"fir\",\n        \"pine\",\n        \"cactus\",\n        \"alder\",\n        \"grove\",\n        \"forest\",\n        \"jungle\",\n        \"palm\",\n        \"bush\",\n        \"mulberry\",\n        \"juniper\",\n        \"vine\",\n        \"ivy\",\n        \"rose\",\n        \"lily\",\n        \"tulip\",\n        \"daffodil\",\n        \"honeysuckle\",\n        \"fuschia\",\n        \"hazel\",\n        \"walnut\",\n        \"almond\",\n        \"lime\",\n        \"lemon\",\n        \"apple\",\n        \"blossom\",\n        \"bloom\",\n        \"crocus\",\n        \"rose\",\n        \"buttercup\",\n        \"dandelion\",\n        \"iris\",\n        \"carnation\",\n        \"fern\",\n        \"root\",\n        \"branch\",\n        \"leaf\",\n        \"seed\",\n        \"flower\",\n        \"petal\",\n        \"pollen\",\n        \"orchid\",\n        \"mangrove\",\n        \"cypress\",\n        \"sequoia\",\n        \"sage\",\n        \"heather\",\n        \"snapdragon\",\n        \"daisy\",\n        \"mountain\",\n        \"hill\",\n        \"alpine\",\n        \"chestnut\",\n        \"valley\",\n        \"glacier\",\n        \"forest\",\n        \"grove\",\n        \"glen\",\n        \"tree\",\n        \"thorn\",\n        \"stump\",\n        \"desert\",\n        \"canyon\",\n        \"dune\",\n        \"oasis\",\n        \"mirage\",\n        \"well\",\n        \"spring\",\n        \"meadow\",\n        \"field\",\n        \"prairie\",\n        \"grass\",\n        \"tundra\",\n        \"island\",\n        \"shore\",\n        \"sand\",\n        \"shell\",\n        \"surf\",\n        \"wave\",\n        \"foam\",\n        \"tide\",\n        \"lake\",\n        \"river\",\n        \"brook\",\n        \"stream\",\n        \"pool\",\n        \"pond\",\n        \"sun\",\n        \"sprinkle\",\n        \"shade\",\n        \"shadow\",\n        \"rain\",\n        \"cloud\",\n        \"storm\",\n        \"hail\",\n        \"snow\",\n        \"sleet\",\n        \"thunder\",\n        \"lightning\",\n        \"wind\",\n        \"hurricane\",\n        \"typhoon\",\n        \"dawn\",\n        \"sunrise\",\n        \"morning\",\n        \"noon\",\n        \"twilight\",\n        \"evening\",\n        \"sunset\",\n        \"midnight\",\n        \"night\",\n        \"sky\",\n        \"star\",\n        \"stellar\",\n        \"comet\",\n        \"nebula\",\n        \"quasar\",\n        \"solar\",\n        \"lunar\",\n        \"planet\",\n        \"meteor\",\n        \"sprout\",\n        \"pear\",\n        \"plum\",\n        \"kiwi\",\n        \"berry\",\n        \"apricot\",\n        \"peach\",\n        \"mango\",\n        \"pineapple\",\n        \"coconut\",\n        \"olive\",\n        \"ginger\",\n        \"root\",\n        \"plain\",\n        \"fancy\",\n        \"stripe\",\n        \"spot\",\n        \"speckle\",\n        \"spangle\",\n        \"ring\",\n        \"band\",\n        \"blaze\",\n        \"paint\",\n        \"pinto\",\n        \"shade\",\n        \"tabby\",\n        \"brindle\",\n        \"patch\",\n        \"calico\",\n        \"checker\",\n        \"dot\",\n        \"pattern\",\n        \"glitter\",\n        \"glimmer\",\n        \"shimmer\",\n        \"dull\",\n        \"dust\",\n        \"dirt\",\n        \"glaze\",\n        \"scratch\",\n        \"quick\",\n        \"swift\",\n        \"fast\",\n        \"slow\",\n        \"clever\",\n        \"fire\",\n        \"flicker\",\n        \"flash\",\n        \"spark\",\n        \"ember\",\n        \"coal\",\n        \"flame\",\n        \"chocolate\",\n        \"vanilla\",\n        \"sugar\",\n        \"spice\",\n        \"cake\",\n        \"pie\",\n        \"cookie\",\n        \"candy\",\n        \"caramel\",\n        \"spiral\",\n        \"round\",\n        \"jelly\",\n        \"square\",\n        \"narrow\",\n        \"long\",\n        \"short\",\n        \"small\",\n        \"tiny\",\n        \"big\",\n        \"giant\",\n        \"great\",\n        \"atom\",\n        \"peppermint\",\n        \"mint\",\n        \"butter\",\n        \"fringe\",\n        \"rag\",\n        \"quilt\",\n        \"truth\",\n        \"lie\",\n        \"holy\",\n        \"curse\",\n        \"noble\",\n        \"sly\",\n        \"brave\",\n        \"shy\",\n        \"lava\",\n        \"foul\",\n        \"leather\",\n        \"fantasy\",\n        \"keen\",\n        \"luminous\",\n        \"feather\",\n        \"sticky\",\n        \"gossamer\",\n        \"cotton\",\n        \"rattle\",\n        \"silk\",\n        \"satin\",\n        \"cord\",\n        \"denim\",\n        \"flannel\",\n        \"plaid\",\n        \"wool\",\n        \"linen\",\n        \"silent\",\n        \"flax\",\n        \"weak\",\n        \"valiant\",\n        \"fierce\",\n        \"gentle\",\n        \"rhinestone\",\n        \"splash\",\n        \"north\",\n        \"south\",\n        \"east\",\n        \"west\",\n        \"summer\",\n        \"winter\",\n        \"autumn\",\n        \"spring\",\n        \"season\",\n        \"equinox\",\n        \"solstice\",\n        \"paper\",\n        \"motley\",\n        \"torch\",\n        \"ballistic\",\n        \"rampant\",\n        \"shag\",\n        \"freckle\",\n        \"wild\",\n        \"free\",\n        \"chain\",\n        \"sheer\",\n        \"crazy\",\n        \"mad\",\n        \"candle\",\n        \"ribbon\",\n        \"lace\",\n        \"notch\",\n        \"wax\",\n        \"shine\",\n        \"shallow\",\n        \"deep\",\n        \"bubble\",\n        \"harvest\",\n        \"fluff\",\n        \"venom\",\n        \"boom\",\n        \"slash\",\n        \"rune\",\n        \"cold\",\n        \"quill\",\n        \"love\",\n        \"hate\",\n        \"garnet\",\n        \"zircon\",\n        \"power\",\n        \"bone\",\n        \"void\",\n        \"horn\",\n        \"glory\",\n        \"cyber\",\n        \"nova\",\n        \"hot\",\n        \"helix\",\n        \"cosmic\",\n        \"quark\",\n        \"quiver\",\n        \"holly\",\n        \"clover\",\n        \"polar\",\n        \"regal\",\n        \"ripple\",\n        \"ebony\",\n        \"wheat\",\n        \"phantom\",\n        \"dew\",\n        \"chisel\",\n        \"crack\",\n        \"chatter\",\n        \"laser\",\n        \"foil\",\n        \"tin\",\n        \"clever\",\n        \"treasure\",\n        \"maze\",\n        \"twisty\",\n        \"curly\",\n        \"fortune\",\n        \"fate\",\n        \"destiny\",\n        \"cute\",\n        \"slime\",\n        \"ink\",\n        \"disco\",\n        \"plume\",\n        \"time\",\n        \"psychadelic\",\n        \"relic\",\n        \"fossil\",\n        \"water\",\n        \"savage\",\n        \"ancient\",\n        \"rapid\",\n        \"road\",\n        \"trail\",\n        \"stitch\",\n        \"button\",\n        \"bow\",\n        \"nimble\",\n        \"zest\",\n        \"sour\",\n        \"bitter\",\n        \"phase\",\n        \"fan\",\n        \"frill\",\n        \"plump\",\n        \"pickle\",\n        \"mud\",\n        \"puddle\",\n        \"pond\",\n        \"river\",\n        \"spring\",\n        \"stream\",\n        \"battle\",\n        \"arrow\",\n        \"plume\",\n        \"roan\",\n        \"pitch\",\n        \"tar\",\n        \"cat\",\n        \"dog\",\n        \"horse\",\n        \"lizard\",\n        \"bird\",\n        \"fish\",\n        \"saber\",\n        \"scythe\",\n        \"sharp\",\n        \"soft\",\n        \"razor\",\n        \"neon\",\n        \"dandy\",\n        \"weed\",\n        \"swamp\",\n        \"marsh\",\n        \"bog\",\n        \"peat\",\n        \"moor\",\n        \"muck\",\n        \"mire\",\n        \"grave\",\n        \"fair\",\n        \"just\",\n        \"brick\",\n        \"puzzle\",\n        \"skitter\",\n        \"prong\",\n        \"fork\",\n        \"dent\",\n        \"dour\",\n        \"warp\",\n        \"luck\",\n        \"coffee\",\n        \"split\",\n        \"chip\",\n        \"hollow\",\n        \"heavy\",\n        \"legend\",\n        \"hickory\",\n        \"mesquite\",\n        \"nettle\",\n        \"rogue\",\n        \"charm\",\n        \"prickle\",\n        \"bead\",\n        \"sponge\",\n        \"whip\",\n        \"bald\",\n        \"frost\",\n        \"fog\",\n        \"oil\",\n        \"veil\",\n        \"cliff\",\n        \"volcano\",\n        \"rift\",\n        \"maze\",\n        \"proud\",\n        \"dew\",\n        \"mirror\",\n        \"shard\",\n        \"salt\",\n        \"pepper\",\n        \"honey\",\n        \"thread\",\n        \"bristle\",\n        \"ripple\",\n        \"glow\",\n        \"zenith\"\n    ],\n    \"nouns\": [\n        \"head\",\n        \"crest\",\n        \"crown\",\n        \"tooth\",\n        \"fang\",\n        \"horn\",\n        \"frill\",\n        \"skull\",\n        \"bone\",\n        \"tongue\",\n        \"throat\",\n        \"voice\",\n        \"nose\",\n        \"snout\",\n        \"chin\",\n        \"eye\",\n        \"sight\",\n        \"seer\",\n        \"speaker\",\n        \"singer\",\n        \"song\",\n        \"chanter\",\n        \"howler\",\n        \"chatter\",\n        \"shrieker\",\n        \"shriek\",\n        \"jaw\",\n        \"bite\",\n        \"biter\",\n        \"neck\",\n        \"shoulder\",\n        \"fin\",\n        \"wing\",\n        \"arm\",\n        \"lifter\",\n        \"grasp\",\n        \"grabber\",\n        \"hand\",\n        \"paw\",\n        \"foot\",\n        \"finger\",\n        \"toe\",\n        \"thumb\",\n        \"talon\",\n        \"palm\",\n        \"touch\",\n        \"racer\",\n        \"runner\",\n        \"hoof\",\n        \"fly\",\n        \"flier\",\n        \"swoop\",\n        \"roar\",\n        \"hiss\",\n        \"hisser\",\n        \"snarl\",\n        \"dive\",\n        \"diver\",\n        \"rib\",\n        \"chest\",\n        \"back\",\n        \"ridge\",\n        \"leg\",\n        \"legs\",\n        \"tail\",\n        \"beak\",\n        \"walker\",\n        \"lasher\",\n        \"swisher\",\n        \"carver\",\n        \"kicker\",\n        \"roarer\",\n        \"crusher\",\n        \"spike\",\n        \"shaker\",\n        \"charger\",\n        \"hunter\",\n        \"weaver\",\n        \"crafter\",\n        \"binder\",\n        \"scribe\",\n        \"muse\",\n        \"snap\",\n        \"snapper\",\n        \"slayer\",\n        \"stalker\",\n        \"track\",\n        \"tracker\",\n        \"scar\",\n        \"scarer\",\n        \"fright\",\n        \"killer\",\n        \"death\",\n        \"doom\",\n        \"healer\",\n        \"saver\",\n        \"friend\",\n        \"foe\",\n        \"guardian\",\n        \"thunder\",\n        \"lightning\",\n        \"cloud\",\n        \"storm\",\n        \"forger\",\n        \"scale\",\n        \"hair\",\n        \"braid\",\n        \"nape\",\n        \"belly\",\n        \"thief\",\n        \"stealer\",\n        \"reaper\",\n        \"giver\",\n        \"taker\",\n        \"dancer\",\n        \"player\",\n        \"gambler\",\n        \"twister\",\n        \"turner\",\n        \"painter\",\n        \"dart\",\n        \"drifter\",\n        \"sting\",\n        \"stinger\",\n        \"venom\",\n        \"spur\",\n        \"ripper\",\n        \"swallow\",\n        \"devourer\",\n        \"knight\",\n        \"lady\",\n        \"lord\",\n        \"queen\",\n        \"king\",\n        \"master\",\n        \"mistress\",\n        \"prince\",\n        \"princess\",\n        \"duke\",\n        \"dutchess\",\n        \"samurai\",\n        \"ninja\",\n        \"knave\",\n        \"slave\",\n        \"servant\",\n        \"sage\",\n        \"wizard\",\n        \"witch\",\n        \"warlock\",\n        \"warrior\",\n        \"jester\",\n        \"paladin\",\n        \"bard\",\n        \"trader\",\n        \"sword\",\n        \"shield\",\n        \"knife\",\n        \"dagger\",\n        \"arrow\",\n        \"bow\",\n        \"fighter\",\n        \"bane\",\n        \"follower\",\n        \"leader\",\n        \"scourge\",\n        \"watcher\",\n        \"cat\",\n        \"panther\",\n        \"tiger\",\n        \"cougar\",\n        \"puma\",\n        \"jaguar\",\n        \"ocelot\",\n        \"lynx\",\n        \"lion\",\n        \"leopard\",\n        \"ferret\",\n        \"weasel\",\n        \"wolverine\",\n        \"bear\",\n        \"raccoon\",\n        \"dog\",\n        \"wolf\",\n        \"kitten\",\n        \"puppy\",\n        \"cub\",\n        \"fox\",\n        \"hound\",\n        \"terrier\",\n        \"coyote\",\n        \"hyena\",\n        \"jackal\",\n        \"pig\",\n        \"horse\",\n        \"donkey\",\n        \"stallion\",\n        \"mare\",\n        \"zebra\",\n        \"antelope\",\n        \"gazelle\",\n        \"deer\",\n        \"buffalo\",\n        \"bison\",\n        \"boar\",\n        \"elk\",\n        \"whale\",\n        \"dolphin\",\n        \"shark\",\n        \"fish\",\n        \"minnow\",\n        \"salmon\",\n        \"ray\",\n        \"fisher\",\n        \"otter\",\n        \"gull\",\n        \"duck\",\n        \"goose\",\n        \"crow\",\n        \"raven\",\n        \"bird\",\n        \"eagle\",\n        \"raptor\",\n        \"hawk\",\n        \"falcon\",\n        \"moose\",\n        \"heron\",\n        \"owl\",\n        \"stork\",\n        \"crane\",\n        \"sparrow\",\n        \"robin\",\n        \"parrot\",\n        \"cockatoo\",\n        \"carp\",\n        \"lizard\",\n        \"gecko\",\n        \"iguana\",\n        \"snake\",\n        \"python\",\n        \"viper\",\n        \"boa\",\n        \"condor\",\n        \"vulture\",\n        \"spider\",\n        \"fly\",\n        \"scorpion\",\n        \"heron\",\n        \"oriole\",\n        \"toucan\",\n        \"bee\",\n        \"wasp\",\n        \"hornet\",\n        \"rabbit\",\n        \"bunny\",\n        \"hare\",\n        \"brow\",\n        \"mustang\",\n        \"ox\",\n        \"piper\",\n        \"soarer\",\n        \"flasher\",\n        \"moth\",\n        \"mask\",\n        \"hide\",\n        \"hero\",\n        \"antler\",\n        \"chill\",\n        \"chiller\",\n        \"gem\",\n        \"ogre\",\n        \"myth\",\n        \"elf\",\n        \"fairy\",\n        \"pixie\",\n        \"dragon\",\n        \"griffin\",\n        \"unicorn\",\n        \"pegasus\",\n        \"sprite\",\n        \"fancier\",\n        \"chopper\",\n        \"slicer\",\n        \"skinner\",\n        \"butterfly\",\n        \"legend\",\n        \"wanderer\",\n        \"rover\",\n        \"raver\",\n        \"loon\",\n        \"lancer\",\n        \"glass\",\n        \"glazer\",\n        \"flame\",\n        \"crystal\",\n        \"lantern\",\n        \"lighter\",\n        \"cloak\",\n        \"bell\",\n        \"ringer\",\n        \"keeper\",\n        \"centaur\",\n        \"bolt\",\n        \"catcher\",\n        \"whimsey\",\n        \"quester\",\n        \"rat\",\n        \"mouse\",\n        \"serpent\",\n        \"wyrm\",\n        \"gargoyle\",\n        \"thorn\",\n        \"whip\",\n        \"rider\",\n        \"spirit\",\n        \"sentry\",\n        \"bat\",\n        \"beetle\",\n        \"burn\",\n        \"cowl\",\n        \"stone\",\n        \"gem\",\n        \"collar\",\n        \"mark\",\n        \"grin\",\n        \"scowl\",\n        \"spear\",\n        \"razor\",\n        \"edge\",\n        \"seeker\",\n        \"jay\",\n        \"ape\",\n        \"monkey\",\n        \"gorilla\",\n        \"koala\",\n        \"kangaroo\",\n        \"yak\",\n        \"sloth\",\n        \"ant\",\n        \"roach\",\n        \"weed\",\n        \"seed\",\n        \"eater\",\n        \"razor\",\n        \"shirt\",\n        \"face\",\n        \"goat\",\n        \"mind\",\n        \"shift\",\n        \"rider\",\n        \"face\",\n        \"mole\",\n        \"vole\",\n        \"pirate\",\n        \"llama\",\n        \"stag\",\n        \"bug\",\n        \"cap\",\n        \"boot\",\n        \"drop\",\n        \"hugger\",\n        \"sargent\",\n        \"snagglefoot\",\n        \"carpet\",\n        \"curtain\"\n    ],\n    \"firstNamesMale\": [\n        \"Jacob\",\n        \"Mason\",\n        \"Ethan\",\n        \"Noah\",\n        \"William\",\n        \"Liam\",\n        \"Jayden\",\n        \"Michael\",\n        \"Alexander\",\n        \"Aiden\",\n        \"Daniel\",\n        \"Matthew\",\n        \"Elijah\",\n        \"James\",\n        \"Anthony\",\n        \"Benjamin\",\n        \"Joshua\",\n        \"Andrew\",\n        \"David\",\n        \"Joseph\"\n    ],\n    \"firstNamesFemale\": [\n        \"Sophia\",\n        \"Emma\",\n        \"Isabella\",\n        \"Olivia\",\n        \"Ava\",\n        \"Emily\",\n        \"Abigail\",\n        \"Mia\",\n        \"Madison\",\n        \"Elizabeth\",\n        \"Chloe\",\n        \"Ella\",\n        \"Avery\",\n        \"Addison\",\n        \"Aubrey\",\n        \"Lily\",\n        \"Natalie\",\n        \"Sofia\",\n        \"Charlotte\",\n        \"Zoey\"\n    ],\n    \"lastNames\": [\n        \"Smith\",\n        \"Johnson\",\n        \"Williams\",\n        \"Jones\",\n        \"Brown\",\n        \"Davis\",\n        \"Miller\",\n        \"Wilson\",\n        \"Moore\",\n        \"Taylor\",\n        \"Anderson\",\n        \"Thomas\",\n        \"Jackson\",\n        \"White\",\n        \"Harris\",\n        \"Martin\",\n        \"Thompson\",\n        \"Garcia\",\n        \"Martinez\",\n        \"Robinson\"\n    ],\n    \"domains\": [\n        \"test.com\",\n        \"test.net\",\n        \"test.org\",\n        \"example.com\",\n        \"example.net\",\n        \"example.org\"\n    ],\n    \"people\": [\n        \"Adams\",\n        \"Franklin\",\n        \"Jackson\",\n        \"Jefferson\",\n        \"Lincoln\",\n        \"Madison\",\n        \"Washington\",\n        \"Wilson\"\n    ],\n    \"streetTypes\": [\n        \"St\",\n        \"Ave\",\n        \"Rd\",\n        \"Blvd\",\n        \"Trl\",\n        \"Ter\",\n        \"Rdg\",\n        \"Pl\",\n        \"Pkwy\",\n        \"Ct\",\n        \"Circle\"\n    ],\n    \"paragraphs\": [\n        \"The Nellie, a cruising yawl, swung to her anchor without a flutter of the sails, and was at rest.\",\n        \"The sun set; the dusk fell on the stream, and lights began to appear along the shore. The Chapman light–house, a three–legged thing erect on a mud–flat, shone strongly.\",\n        \"He spoke of the happiness that was now certainly theirs, of the folly of not breaking sooner out of that magnificent prison of latter-day life, of the old romantic days that had passed from the world for ever.\",\n        \"One dog rolled before him, well-nigh slashed in half; but a second had him by the thigh, a third gripped his collar be- hind, and a fourth had the blade of the sword between its teeth, tasting its own blood.\",\n        \"She stared at him in astonishment, and as she read something of the significant hieroglyphic of his battered face, her lips whitened.\",\n        \"He completely abandoned the child of his marriage with Adelaida Ivanovna, not from malice, nor because of his matrimoni- al grievances, but simply because he forgot him.\",\n        \"It was at this time that the meeting, or, rather gathering of the mem- bers of this inharmonious family took place in the cell of the elder who had such an extraordinary influence on Alyosha.\",\n        \"The secular cooling that must someday overtake our planet has already gone far indeed with our neighbour.\",\n        \"Near it in the field, I remember, were three faint points of light, three telescopic stars infinitely remote, and all around it was the unfathomable darkness of empty space.\"\n    ],\n    \"countries\": [\n        \"Afghanistan\",\n        \"Albania\",\n        \"Algeria\",\n        \"American Samoa\",\n        \"Andorra\",\n        \"Angola\",\n        \"Antigua and Barbuda\",\n        \"Argentina\",\n        \"Armenia\",\n        \"Aruba\",\n        \"Australia\",\n        \"Austria\",\n        \"Azerbaijan\",\n        \"Bahamas, The\",\n        \"Bahrain\",\n        \"Bangladesh\",\n        \"Barbados\",\n        \"Belarus\",\n        \"Belgium\",\n        \"Belize\",\n        \"Benin\",\n        \"Bermuda\",\n        \"Bhutan\",\n        \"Bolivia\",\n        \"Bosnia and Herzegovina\",\n        \"Botswana\",\n        \"Brazil\",\n        \"Brunei Darussalam\",\n        \"Bulgaria\",\n        \"Burkina Faso\",\n        \"Burundi\",\n        \"Cambodia\",\n        \"Cameroon\",\n        \"Canada\",\n        \"Cape Verde\",\n        \"Cayman Islands\",\n        \"Central African Republic\",\n        \"Chad\",\n        \"Channel Islands\",\n        \"Chile\",\n        \"China\",\n        \"Colombia\",\n        \"Comoros\",\n        \"Congo, Dem. Rep.\",\n        \"Congo, Rep.\",\n        \"Costa Rica\",\n        \"Côte dIvoire\",\n        \"Croatia\",\n        \"Cuba\",\n        \"Cyprus\",\n        \"Czech Republic\",\n        \"Denmark\",\n        \"Djibouti\",\n        \"Dominica\",\n        \"Dominican Republic\",\n        \"Ecuador\",\n        \"Egypt, Arab Rep.\",\n        \"El Salvador\",\n        \"Equatorial Guinea\",\n        \"Eritrea\",\n        \"Estonia\",\n        \"Ethiopia\",\n        \"Faeroe Islands\",\n        \"Fiji\",\n        \"Finland\",\n        \"France\",\n        \"French Polynesia\",\n        \"Gabon\",\n        \"Gambia, The\",\n        \"Georgia\",\n        \"Germany\",\n        \"Ghana\",\n        \"Greece\",\n        \"Greenland\",\n        \"Grenada\",\n        \"Guam\",\n        \"Guatemala\",\n        \"Guinea\",\n        \"Guinea-Bissau\",\n        \"Guyana\",\n        \"Haiti\",\n        \"Honduras\",\n        \"Hong Kong, China\",\n        \"Hungary\",\n        \"Iceland\",\n        \"India\",\n        \"Indonesia\",\n        \"Iran, Islamic Rep.\",\n        \"Iraq\",\n        \"Ireland\",\n        \"Isle of Man\",\n        \"Israel\",\n        \"Italy\",\n        \"Jamaica\",\n        \"Japan\",\n        \"Jordan\",\n        \"Kazakhstan\",\n        \"Kenya\",\n        \"Kiribati\",\n        \"Korea, Dem. Rep.\",\n        \"Korea, Rep.\",\n        \"Kuwait\",\n        \"Kyrgyz Republic\",\n        \"Lao PDR\",\n        \"Latvia\",\n        \"Lebanon\",\n        \"Lesotho\",\n        \"Liberia\",\n        \"Libya\",\n        \"Liechtenstein\",\n        \"Lithuania\",\n        \"Luxembourg\",\n        \"Macao, China\",\n        \"Macedonia, FYR\",\n        \"Madagascar\",\n        \"Malawi\",\n        \"Malaysia\",\n        \"Maldives\",\n        \"Mali\",\n        \"Malta\",\n        \"Marshall Islands\",\n        \"Mauritania\",\n        \"Mauritius\",\n        \"Mayotte\",\n        \"Mexico\",\n        \"Micronesia, Fed. Sts.\",\n        \"Moldova\",\n        \"Monaco\",\n        \"Mongolia\",\n        \"Montenegro\",\n        \"Morocco\",\n        \"Mozambique\",\n        \"Myanmar\",\n        \"Namibia\",\n        \"Nepal\",\n        \"Netherlands\",\n        \"Netherlands Antilles\",\n        \"New Caledonia\",\n        \"New Zealand\",\n        \"Nicaragua\",\n        \"Niger\",\n        \"Nigeria\",\n        \"Northern Mariana Islands\",\n        \"Norway\",\n        \"Oman\",\n        \"Pakistan\",\n        \"Palau\",\n        \"Panama\",\n        \"Papua New Guinea\",\n        \"Paraguay\",\n        \"Peru\",\n        \"Philippines\",\n        \"Poland\",\n        \"Portugal\",\n        \"Puerto Rico\",\n        \"Qatar\",\n        \"Romania\",\n        \"Russian Federation\",\n        \"Rwanda\",\n        \"Samoa\",\n        \"San Marino\",\n        \"São Tomé and Principe\",\n        \"Saudi Arabia\",\n        \"Senegal\",\n        \"Serbia\",\n        \"Seychelles\",\n        \"Sierra Leone\",\n        \"Singapore\",\n        \"Slovak Republic\",\n        \"Slovenia\",\n        \"Solomon Islands\",\n        \"Somalia\",\n        \"South Africa\",\n        \"Spain\",\n        \"Sri Lanka\",\n        \"St. Kitts and Nevis\",\n        \"St. Lucia\",\n        \"St. Vincent and the Grenadines\",\n        \"Sudan\",\n        \"Suriname\",\n        \"Swaziland\",\n        \"Sweden\",\n        \"Switzerland\",\n        \"Syrian Arab Republic\",\n        \"Tajikistan\",\n        \"Tanzania\",\n        \"Thailand\",\n        \"Timor-Leste\",\n        \"Togo\",\n        \"Tonga\",\n        \"Trinidad and Tobago\",\n        \"Tunisia\",\n        \"Turkey\",\n        \"Turkmenistan\",\n        \"Uganda\",\n        \"Ukraine\",\n        \"United Arab Emirates\",\n        \"United Kingdom\",\n        \"United States\",\n        \"Uruguay\",\n        \"Uzbekistan\",\n        \"Vanuatu\",\n        \"Venezuela, RB\",\n        \"Vietnam\",\n        \"Virgin Islands (U.S.)\",\n        \"West Bank and Gaza\",\n        \"Yemen, Rep.\",\n        \"Zambia\",\n        \"Zimbabwe\"\n    ],\n    \"countriesThreeChars\": [\n        \"AFG\",\n        \"ALB\",\n        \"DZA\",\n        \"ASM\",\n        \"ADO\",\n        \"AGO\",\n        \"ATG\",\n        \"ARG\",\n        \"ARM\",\n        \"ABW\",\n        \"AUS\",\n        \"AUT\",\n        \"AZE\",\n        \"BHS\",\n        \"BHR\",\n        \"BGD\",\n        \"BRB\",\n        \"BLR\",\n        \"BEL\",\n        \"BLZ\",\n        \"BEN\",\n        \"BMU\",\n        \"BTN\",\n        \"BOL\",\n        \"BIH\",\n        \"BWA\",\n        \"BRA\",\n        \"BRN\",\n        \"BGR\",\n        \"BFA\",\n        \"BDI\",\n        \"KHM\",\n        \"CMR\",\n        \"CAN\",\n        \"CPV\",\n        \"CYM\",\n        \"CAF\",\n        \"TCD\",\n        \"CHI\",\n        \"CHL\",\n        \"CHN\",\n        \"COL\",\n        \"COM\",\n        \"ZAR\",\n        \"COG\",\n        \"CRI\",\n        \"CIV\",\n        \"HRV\",\n        \"CUB\",\n        \"CUW\",\n        \"CYP\",\n        \"CZE\",\n        \"DNK\",\n        \"DJI\",\n        \"DMA\",\n        \"DOM\",\n        \"ECU\",\n        \"EGY\",\n        \"SLV\",\n        \"GNQ\",\n        \"ERI\",\n        \"EST\",\n        \"ETH\",\n        \"FRO\",\n        \"FJI\",\n        \"FIN\",\n        \"FRA\",\n        \"PYF\",\n        \"GAB\",\n        \"GMB\",\n        \"GEO\",\n        \"DEU\",\n        \"GHA\",\n        \"GRC\",\n        \"GRL\",\n        \"GRD\",\n        \"GUM\",\n        \"GTM\",\n        \"GIN\",\n        \"GNB\",\n        \"GUY\",\n        \"HTI\",\n        \"HND\",\n        \"HKG\",\n        \"HUN\",\n        \"ISL\",\n        \"IND\",\n        \"IDN\",\n        \"IRN\",\n        \"IRQ\",\n        \"IRL\",\n        \"IMY\",\n        \"ISR\",\n        \"ITA\",\n        \"JAM\",\n        \"JPN\",\n        \"JOR\",\n        \"KAZ\",\n        \"KEN\",\n        \"KIR\",\n        \"PRK\",\n        \"KOR\",\n        \"KSV\",\n        \"KWT\",\n        \"KGZ\",\n        \"LAO\",\n        \"LVA\",\n        \"LBN\",\n        \"LSO\",\n        \"LBR\",\n        \"LBY\",\n        \"LIE\",\n        \"LTU\",\n        \"LUX\",\n        \"MAC\",\n        \"MKD\",\n        \"MDG\",\n        \"MWI\",\n        \"MYS\",\n        \"MDV\",\n        \"MLI\",\n        \"MLT\",\n        \"MHL\",\n        \"MRT\",\n        \"MUS\",\n        \"MEX\",\n        \"FSM\",\n        \"MDA\",\n        \"MCO\",\n        \"MNG\",\n        \"MNE\",\n        \"MAR\",\n        \"MOZ\",\n        \"MMR\",\n        \"NAM\",\n        \"NPL\",\n        \"NLD\",\n        \"NCL\",\n        \"NZL\",\n        \"NIC\",\n        \"NER\",\n        \"NGA\",\n        \"MNP\",\n        \"NOR\",\n        \"OMN\",\n        \"PAK\",\n        \"PLW\",\n        \"PAN\",\n        \"PNG\",\n        \"PRY\",\n        \"PER\",\n        \"PHL\",\n        \"POL\",\n        \"PRT\",\n        \"PRI\",\n        \"QAT\",\n        \"ROM\",\n        \"RUS\",\n        \"RWA\",\n        \"WSM\",\n        \"SMR\",\n        \"STP\",\n        \"SAU\",\n        \"SEN\",\n        \"SRB\",\n        \"SYC\",\n        \"SLE\",\n        \"SGP\",\n        \"SXM\",\n        \"SVK\",\n        \"SVN\",\n        \"SLB\",\n        \"SOM\",\n        \"ZAF\",\n        \"SSD\",\n        \"ESP\",\n        \"LKA\",\n        \"KNA\",\n        \"LCA\",\n        \"MAF\",\n        \"VCT\",\n        \"SDN\",\n        \"SUR\",\n        \"SWZ\",\n        \"SWE\",\n        \"CHE\",\n        \"SYR\",\n        \"TJK\",\n        \"TZA\",\n        \"THA\",\n        \"TMP\",\n        \"TGO\",\n        \"TON\",\n        \"TTO\",\n        \"TUN\",\n        \"TUR\",\n        \"TKM\",\n        \"TCA\",\n        \"TUV\",\n        \"UGA\",\n        \"UKR\",\n        \"ARE\",\n        \"GBR\",\n        \"USA\",\n        \"URY\",\n        \"UZB\",\n        \"VUT\",\n        \"VEN\",\n        \"VNM\",\n        \"VIR\",\n        \"WBG\",\n        \"YEM\",\n        \"ZMB\",\n        \"ZWE\"\n    ],\n    \"countriesTwoChars\": [\n        \"AF\",\n        \"AX\",\n        \"AL\",\n        \"DZ\",\n        \"AS\",\n        \"AD\",\n        \"AO\",\n        \"AI\",\n        \"AQ\",\n        \"AG\",\n        \"AR\",\n        \"AM\",\n        \"AW\",\n        \"AU\",\n        \"AT\",\n        \"AZ\",\n        \"BS\",\n        \"BH\",\n        \"BD\",\n        \"BB\",\n        \"BY\",\n        \"BE\",\n        \"BZ\",\n        \"BJ\",\n        \"BM\",\n        \"BT\",\n        \"BO\",\n        \"BQ\",\n        \"BA\",\n        \"BW\",\n        \"BV\",\n        \"BR\",\n        \"IO\",\n        \"BN\",\n        \"BG\",\n        \"BF\",\n        \"BI\",\n        \"KH\",\n        \"CM\",\n        \"CA\",\n        \"CV\",\n        \"KY\",\n        \"CF\",\n        \"TD\",\n        \"CL\",\n        \"CN\",\n        \"CX\",\n        \"CC\",\n        \"CO\",\n        \"KM\",\n        \"CG\",\n        \"CD\",\n        \"CK\",\n        \"CR\",\n        \"CI\",\n        \"HR\",\n        \"CU\",\n        \"CW\",\n        \"CY\",\n        \"CZ\",\n        \"DK\",\n        \"DJ\",\n        \"DM\",\n        \"DO\",\n        \"EC\",\n        \"EG\",\n        \"SV\",\n        \"GQ\",\n        \"ER\",\n        \"EE\",\n        \"ET\",\n        \"FK\",\n        \"FO\",\n        \"FJ\",\n        \"FI\",\n        \"FR\",\n        \"GF\",\n        \"PF\",\n        \"TF\",\n        \"GA\",\n        \"GM\",\n        \"GE\",\n        \"DE\",\n        \"GH\",\n        \"GI\",\n        \"GR\",\n        \"GL\",\n        \"GD\",\n        \"GP\",\n        \"GU\",\n        \"GT\",\n        \"GG\",\n        \"GN\",\n        \"GW\",\n        \"GY\",\n        \"HT\",\n        \"HM\",\n        \"VA\",\n        \"HN\",\n        \"HK\",\n        \"HU\",\n        \"IS\",\n        \"IN\",\n        \"ID\",\n        \"IR\",\n        \"IQ\",\n        \"IE\",\n        \"IM\",\n        \"IL\",\n        \"IT\",\n        \"JM\",\n        \"JP\",\n        \"JE\",\n        \"JO\",\n        \"KZ\",\n        \"KE\",\n        \"KI\",\n        \"KP\",\n        \"KR\",\n        \"KW\",\n        \"KG\",\n        \"LA\",\n        \"LV\",\n        \"LB\",\n        \"LS\",\n        \"LR\",\n        \"LY\",\n        \"LI\",\n        \"LT\",\n        \"LU\",\n        \"MO\",\n        \"MK\",\n        \"MG\",\n        \"MW\",\n        \"MY\",\n        \"MV\",\n        \"ML\",\n        \"MT\",\n        \"MH\",\n        \"MQ\",\n        \"MR\",\n        \"MU\",\n        \"YT\",\n        \"MX\",\n        \"FM\",\n        \"MD\",\n        \"MC\",\n        \"MN\",\n        \"ME\",\n        \"MS\",\n        \"MA\",\n        \"MZ\",\n        \"MM\",\n        \"NA\",\n        \"NR\",\n        \"NP\",\n        \"NL\",\n        \"NC\",\n        \"NZ\",\n        \"NI\",\n        \"NE\",\n        \"NG\",\n        \"NU\",\n        \"NF\",\n        \"MP\",\n        \"NO\",\n        \"OM\",\n        \"PK\",\n        \"PW\",\n        \"PS\",\n        \"PA\",\n        \"PG\",\n        \"PY\",\n        \"PE\",\n        \"PH\",\n        \"PN\",\n        \"PL\",\n        \"PT\",\n        \"PR\",\n        \"QA\",\n        \"RE\",\n        \"RO\",\n        \"RU\",\n        \"RW\",\n        \"BL\",\n        \"SH\",\n        \"KN\",\n        \"LC\",\n        \"MF\",\n        \"PM\",\n        \"VC\",\n        \"WS\",\n        \"SM\",\n        \"ST\",\n        \"SA\",\n        \"SN\",\n        \"RS\",\n        \"SC\",\n        \"SL\",\n        \"SG\",\n        \"SX\",\n        \"SK\",\n        \"SI\",\n        \"SB\",\n        \"SO\",\n        \"ZA\",\n        \"GS\",\n        \"SS\",\n        \"ES\",\n        \"LK\",\n        \"SD\",\n        \"SR\",\n        \"SJ\",\n        \"SZ\",\n        \"SE\",\n        \"CH\",\n        \"SY\",\n        \"TW\",\n        \"TJ\",\n        \"TZ\",\n        \"TH\",\n        \"TL\",\n        \"TG\",\n        \"TK\",\n        \"TO\",\n        \"TT\",\n        \"TN\",\n        \"TR\",\n        \"TM\",\n        \"TC\",\n        \"TV\",\n        \"UG\",\n        \"UA\",\n        \"AE\",\n        \"GB\",\n        \"US\",\n        \"UM\",\n        \"UY\",\n        \"UZ\",\n        \"VU\",\n        \"VE\",\n        \"VN\",\n        \"VG\",\n        \"VI\",\n        \"WF\",\n        \"EH\",\n        \"YE\",\n        \"ZM\",\n        \"ZW\"\n    ],\n    \"currencies\": [\n        \"AED\",\n        \"AFN\",\n        \"ALL\",\n        \"AMD\",\n        \"ANG\",\n        \"AOA\",\n        \"ARS\",\n        \"AUD\",\n        \"AWG\",\n        \"AZN\",\n        \"BAM\",\n        \"BBD\",\n        \"BDT\",\n        \"BGN\",\n        \"BHD\",\n        \"BIF\",\n        \"BMD\",\n        \"BND\",\n        \"BOB\",\n        \"BOV\",\n        \"BRL\",\n        \"BSD\",\n        \"BTN\",\n        \"BWP\",\n        \"BYR\",\n        \"BZD\",\n        \"CAD\",\n        \"CDF\",\n        \"CHE\",\n        \"CHF\",\n        \"CHW\",\n        \"CLF\",\n        \"CLP\",\n        \"CNY\",\n        \"COP\",\n        \"COU\",\n        \"CRC\",\n        \"CUC\",\n        \"CUP\",\n        \"CVE\",\n        \"CZK\",\n        \"DJF\",\n        \"DKK\",\n        \"DOP\",\n        \"DZD\",\n        \"EGP\",\n        \"ERN\",\n        \"ETB\",\n        \"EUR\",\n        \"FJD\",\n        \"FKP\",\n        \"GBP\",\n        \"GEL\",\n        \"GHS\",\n        \"GIP\",\n        \"GMD\",\n        \"GNF\",\n        \"GTQ\",\n        \"GYD\",\n        \"HKD\",\n        \"HNL\",\n        \"HRK\",\n        \"HTG\",\n        \"HUF\",\n        \"IDR\",\n        \"ILS\",\n        \"INR\",\n        \"IQD\",\n        \"IRR\",\n        \"ISK\",\n        \"JMD\",\n        \"JOD\",\n        \"JPY\",\n        \"KES\",\n        \"KGS\",\n        \"KHR\",\n        \"KMF\",\n        \"KPW\",\n        \"KRW\",\n        \"KWD\",\n        \"KYD\",\n        \"KZT\",\n        \"LAK\",\n        \"LBP\",\n        \"LKR\",\n        \"LRD\",\n        \"LSL\",\n        \"LTL\",\n        \"LVL\",\n        \"LYD\",\n        \"MAD\",\n        \"MDL\",\n        \"MGA\",\n        \"MKD\",\n        \"MMK\",\n        \"MNT\",\n        \"MOP\",\n        \"MRO\",\n        \"MUR\",\n        \"MVR\",\n        \"MWK\",\n        \"MXN\",\n        \"MXV\",\n        \"MYR\",\n        \"MZN\",\n        \"NAD\",\n        \"NGN\",\n        \"NIO\",\n        \"NOK\",\n        \"NPR\",\n        \"NZD\",\n        \"OMR\",\n        \"PAB\",\n        \"PEN\",\n        \"PGK\",\n        \"PHP\",\n        \"PKR\",\n        \"PLN\",\n        \"PYG\",\n        \"QAR\",\n        \"RON\",\n        \"RSD\",\n        \"RUB\",\n        \"RWF\",\n        \"SAR\",\n        \"SBD\",\n        \"SCR\",\n        \"SDG\",\n        \"SEK\",\n        \"SGD\",\n        \"SHP\",\n        \"SLL\",\n        \"SOS\",\n        \"SRD\",\n        \"SSP\",\n        \"STD\",\n        \"SYP\",\n        \"SZL\",\n        \"THB\",\n        \"TJS\",\n        \"TMT\",\n        \"TND\",\n        \"TOP\",\n        \"TRY\",\n        \"TTD\",\n        \"TWD\",\n        \"TZS\",\n        \"UAH\",\n        \"UGX\",\n        \"USD\",\n        \"USN\",\n        \"USS\",\n        \"UYI\",\n        \"UYU\",\n        \"UZS\",\n        \"VEF\",\n        \"VND\",\n        \"VUV\",\n        \"WST\",\n        \"XAF\",\n        \"XCD\",\n        \"XDR\",\n        \"XFU\",\n        \"XOF\",\n        \"XPF\",\n        \"YER\",\n        \"ZAR\",\n        \"ZMW\"\n    ],\n    \"cities\": [\n        \"Derby Center\",\n        \"New Deal\",\n        \"Cienega Springs\",\n        \"Ransom Canyon\",\n        \"Burrton\",\n        \"Hoonah\",\n        \"Lucien\",\n        \"San Martin\",\n        \"Buffalo City\",\n        \"Skidaway Island\",\n        \"Kingsbridge\",\n        \"Berkhamsted\",\n        \"Bury\",\n        \"Brandwell\",\n        \"Campden\",\n        \"Plympton\",\n        \"Baldock\",\n        \"Northleach\",\n        \"Newstead\"\n    ],\n    \"states\": [\n        \"Alabama\",\n        \"Alaska\",\n        \"Arizona\",\n        \"Arkansas\",\n        \"California\",\n        \"Colorado\",\n        \"Connecticut\",\n        \"Delaware\",\n        \"Florida\",\n        \"Georgia\",\n        \"Hawaii\",\n        \"Idaho\",\n        \"Illinois\",\n        \"Indiana\",\n        \"Iowa\",\n        \"Kansas\",\n        \"Kentucky\",\n        \"Louisiana\",\n        \"Maine\",\n        \"Maryland\",\n        \"Massachusetts\",\n        \"Michigan\",\n        \"Minnesota\",\n        \"Mississippi\",\n        \"Missouri\",\n        \"Montana\",\n        \"Nebraska\",\n        \"Nevada\",\n        \"New Hampshire\",\n        \"New Jersey\",\n        \"New Mexico\",\n        \"New York\",\n        \"North Carolina\",\n        \"North Dakota\",\n        \"Ohio\",\n        \"Oklahoma\",\n        \"Oregon\",\n        \"Pennsylvania\",\n        \"Rhode Island\",\n        \"South Carolina\",\n        \"South Dakota\",\n        \"Tennessee\",\n        \"Texas\",\n        \"Utah\",\n        \"Vermont\",\n        \"Virginia\",\n        \"Washington\",\n        \"West Virginia\",\n        \"Wisconsin\",\n        \"Wyoming\"\n    ],\n    \"statesSmall\": [\n        \"AL\",\n        \"AK\",\n        \"AS\",\n        \"AZ\",\n        \"AR\",\n        \"CA\",\n        \"CO\",\n        \"CT\",\n        \"DE\",\n        \"DC\",\n        \"FM\",\n        \"FL\",\n        \"GA\",\n        \"GU\",\n        \"HI\",\n        \"ID\",\n        \"IL\",\n        \"IN\",\n        \"IA\",\n        \"KS\",\n        \"KY\",\n        \"LA\",\n        \"ME\",\n        \"MH\",\n        \"MD\",\n        \"MA\",\n        \"MI\",\n        \"MN\",\n        \"MS\",\n        \"MO\",\n        \"MT\",\n        \"NE\",\n        \"NV\",\n        \"NH\",\n        \"NJ\",\n        \"NM\",\n        \"NY\",\n        \"NC\",\n        \"ND\",\n        \"MP\",\n        \"OH\",\n        \"OK\",\n        \"OR\",\n        \"PW\",\n        \"PA\",\n        \"PR\",\n        \"RI\",\n        \"SC\",\n        \"SD\",\n        \"TN\",\n        \"TX\",\n        \"UT\",\n        \"VT\",\n        \"VA\",\n        \"VI\",\n        \"WA\",\n        \"DC\",\n        \"WV\",\n        \"WI\",\n        \"WY\"\n    ],\n    \"days\" : [\n        \"Sunday\",\n        \"Monday\",\n        \"Tuesday\",\n        \"Wednesday\",\n        \"Thursday\",\n        \"Friday\",\n        \"Saturday\"\n    ],\n    \"months\": [\n        \"January\",\n        \"February\",\n        \"March\",\n        \"April\",\n        \"May\",\n        \"June\",\n        \"July\",\n        \"August\",\n        \"September\",\n        \"October\",\n        \"November\",\n        \"December\"\n    ],\n    \"femaleTitles\": [\n        \"Ms\",\n        \"Miss\",\n        \"Mrs\"\n    ],\n    \"maleTitles\": [\n        \"Mr\"\n    ],\n    \"timezones\": [\n        \"Africa/Abidjan\",\n        \"Africa/Accra\",\n        \"Africa/Addis_Ababa\",\n        \"Africa/Algiers\",\n        \"Africa/Asmara\",\n        \"Africa/Asmera\",\n        \"Africa/Bamako\",\n        \"Africa/Bangui\",\n        \"Africa/Banjul\",\n        \"Africa/Bissau\",\n        \"Africa/Blantyre\",\n        \"Africa/Brazzaville\",\n        \"Africa/Bujumbura\",\n        \"Africa/Cairo\",\n        \"Africa/Casablanca\",\n        \"Africa/Ceuta\",\n        \"Africa/Conakry\",\n        \"Africa/Dakar\",\n        \"Africa/Dar_es_Salaam\",\n        \"Africa/Djibouti\",\n        \"Africa/Douala\",\n        \"Africa/El_Aaiun\",\n        \"Africa/Freetown\",\n        \"Africa/Gaborone\",\n        \"Africa/Harare\",\n        \"Africa/Johannesburg\",\n        \"Africa/Juba\",\n        \"Africa/Kampala\",\n        \"Africa/Khartoum\",\n        \"Africa/Kigali\",\n        \"Africa/Kinshasa\",\n        \"Africa/Lagos\",\n        \"Africa/Libreville\",\n        \"Africa/Lome\",\n        \"Africa/Luanda\",\n        \"Africa/Lubumbashi\",\n        \"Africa/Lusaka\",\n        \"Africa/Malabo\",\n        \"Africa/Maputo\",\n        \"Africa/Maseru\",\n        \"Africa/Mbabane\",\n        \"Africa/Mogadishu\",\n        \"Africa/Monrovia\",\n        \"Africa/Nairobi\",\n        \"Africa/Ndjamena\",\n        \"Africa/Niamey\",\n        \"Africa/Nouakchott\",\n        \"Africa/Ouagadougou\",\n        \"Africa/Porto-Novo\",\n        \"Africa/Sao_Tome\",\n        \"Africa/Timbuktu\",\n        \"Africa/Tripoli\",\n        \"Africa/Tunis\",\n        \"Africa/Windhoek\",\n        \"America/Argentina/Buenos_Aires\",\n        \"America/Argentina/Catamarca\",\n        \"America/Argentina/ComodRivadavia\",\n        \"America/Argentina/Cordoba\",\n        \"America/Argentina/Jujuy\",\n        \"America/Argentina/La_Rioja\",\n        \"America/Argentina/Mendoza\",\n        \"America/Argentina/Rio_Gallegos\",\n        \"America/Argentina/Salta\",\n        \"America/Argentina/San_Juan\",\n        \"America/Argentina/San_Luis\",\n        \"America/Argentina/Tucuman\",\n        \"America/Argentina/Ushuaia\",\n        \"America/Indiana/Indianapolis\",\n        \"America/Indiana/Knox\",\n        \"America/Indiana/Marengo\",\n        \"America/Indiana/Petersburg\",\n        \"America/Indiana/Tell_City\",\n        \"America/Indiana/Vevay\",\n        \"America/Indiana/Vincennes\",\n        \"America/Indiana/Winamac\",\n        \"America/Kentucky/Louisville\",\n        \"America/Kentucky/Monticello\",\n        \"America/North_Dakota/Beulah\",\n        \"America/North_Dakota/Center\",\n        \"America/North_Dakota/New_Salem\",\n        \"America/Adak\",\n        \"America/Anchorage\",\n        \"America/Anguilla\",\n        \"America/Antigua\",\n        \"America/Araguaina\",\n        \"America/Aruba\",\n        \"America/Asuncion\",\n        \"America/Atikokan\",\n        \"America/Atka\",\n        \"America/Bahia\",\n        \"America/Bahia_Banderas\",\n        \"America/Barbados\",\n        \"America/Belem\",\n        \"America/Belize\",\n        \"America/Blanc-Sablon\",\n        \"America/Boa_Vista\",\n        \"America/Bogota\",\n        \"America/Boise\",\n        \"America/Buenos_Aires\",\n        \"America/Cambridge_Bay\",\n        \"America/Campo_Grande\",\n        \"America/Cancun\",\n        \"America/Caracas\",\n        \"America/Catamarca\",\n        \"America/Cayenne\",\n        \"America/Cayman\",\n        \"America/Chicago\",\n        \"America/Chihuahua\",\n        \"America/Coral_Harbour\",\n        \"America/Cordoba\",\n        \"America/Costa_Rica\",\n        \"America/Creston\",\n        \"America/Cuiaba\",\n        \"America/Curacao\",\n        \"America/Danmarkshavn\",\n        \"America/Dawson\",\n        \"America/Dawson_Creek\",\n        \"America/Denver\",\n        \"America/Detroit\",\n        \"America/Dominica\",\n        \"America/Edmonton\",\n        \"America/Eirunepe\",\n        \"America/El_Salvador\",\n        \"America/Ensenada\",\n        \"America/Fortaleza\",\n        \"America/Fort_Nelson\",\n        \"America/Fort_Wayne\",\n        \"America/Glace_Bay\",\n        \"America/Godthab\",\n        \"America/Goose_Bay\",\n        \"America/Grand_Turk\",\n        \"America/Grenada\",\n        \"America/Guadeloupe\",\n        \"America/Guatemala\",\n        \"America/Guayaquil\",\n        \"America/Guyana\",\n        \"America/Halifax\",\n        \"America/Havana\",\n        \"America/Hermosillo\",\n        \"America/Indianapolis\",\n        \"America/Inuvik\",\n        \"America/Iqaluit\",\n        \"America/Jamaica\",\n        \"America/Jujuy\",\n        \"America/Juneau\",\n        \"America/Knox_IN\",\n        \"America/Kralendijk\",\n        \"America/La_Paz\",\n        \"America/Lima\",\n        \"America/Los_Angeles\",\n        \"America/Louisville\",\n        \"America/Lower_Princes\",\n        \"America/Maceio\",\n        \"America/Managua\",\n        \"America/Manaus\",\n        \"America/Marigot\",\n        \"America/Martinique\",\n        \"America/Matamoros\",\n        \"America/Mazatlan\",\n        \"America/Mendoza\",\n        \"America/Menominee\",\n        \"America/Merida\",\n        \"America/Metlakatla\",\n        \"America/Mexico_City\",\n        \"America/Miquelon\",\n        \"America/Moncton\",\n        \"America/Monterrey\",\n        \"America/Montevideo\",\n        \"America/Montreal\",\n        \"America/Montserrat\",\n        \"America/Nassau\",\n        \"America/New_York\",\n        \"America/Nipigon\",\n        \"America/Nome\",\n        \"America/Noronha\",\n        \"America/Ojinaga\",\n        \"America/Panama\",\n        \"America/Pangnirtung\",\n        \"America/Paramaribo\",\n        \"America/Phoenix\",\n        \"America/Port-au-Prince\",\n        \"America/Porto_Acre\",\n        \"America/Port_of_Spain\",\n        \"America/Porto_Velho\",\n        \"America/Puerto_Rico\",\n        \"America/Rainy_River\",\n        \"America/Rankin_Inlet\",\n        \"America/Recife\",\n        \"America/Regina\",\n        \"America/Resolute\",\n        \"America/Rio_Branco\",\n        \"America/Rosario\",\n        \"America/Santa_Isabel\",\n        \"America/Santarem\",\n        \"America/Santiago\",\n        \"America/Santo_Domingo\",\n        \"America/Sao_Paulo\",\n        \"America/Scoresbysund\",\n        \"America/Shiprock\",\n        \"America/Sitka\",\n        \"America/St_Barthelemy\",\n        \"America/St_Johns\",\n        \"America/St_Kitts\",\n        \"America/St_Lucia\",\n        \"America/St_Thomas\",\n        \"America/St_Vincent\",\n        \"America/Swift_Current\",\n        \"America/Tegucigalpa\",\n        \"America/Thule\",\n        \"America/Thunder_Bay\",\n        \"America/Tijuana\",\n        \"America/Toronto\",\n        \"America/Tortola\",\n        \"America/Vancouver\",\n        \"America/Virgin\",\n        \"America/Whitehorse\",\n        \"America/Winnipeg\",\n        \"America/Yakutat\",\n        \"America/Yellowknife\",\n        \"Antarctica/Casey\",\n        \"Antarctica/Davis\",\n        \"Antarctica/DumontDUrville\",\n        \"Antarctica/Macquarie\",\n        \"Antarctica/Mawson\",\n        \"Antarctica/McMurdo\",\n        \"Antarctica/Palmer\",\n        \"Antarctica/Rothera\",\n        \"Antarctica/South_Pole\",\n        \"Antarctica/Syowa\",\n        \"Antarctica/Troll\",\n        \"Antarctica/Vostok\",\n        \"Arctic/Longyearbyen\",\n        \"Asia/Aden\",\n        \"Asia/Almaty\",\n        \"Asia/Amman\",\n        \"Asia/Anadyr\",\n        \"Asia/Aqtau\",\n        \"Asia/Aqtobe\",\n        \"Asia/Ashgabat\",\n        \"Asia/Ashkhabad\",\n        \"Asia/Atyrau\",\n        \"Asia/Baghdad\",\n        \"Asia/Bahrain\",\n        \"Asia/Baku\",\n        \"Asia/Bangkok\",\n        \"Asia/Barnaul\",\n        \"Asia/Beirut\",\n        \"Asia/Bishkek\",\n        \"Asia/Brunei\",\n        \"Asia/Calcutta\",\n        \"Asia/Chita\",\n        \"Asia/Choibalsan\",\n        \"Asia/Chongqing\",\n        \"Asia/Chungking\",\n        \"Asia/Colombo\",\n        \"Asia/Dacca\",\n        \"Asia/Damascus\",\n        \"Asia/Dhaka\",\n        \"Asia/Dili\",\n        \"Asia/Dubai\",\n        \"Asia/Dushanbe\",\n        \"Asia/Famagusta\",\n        \"Asia/Gaza\",\n        \"Asia/Harbin\",\n        \"Asia/Hebron\",\n        \"Asia/Ho_Chi_Minh\",\n        \"Asia/Hong_Kong\",\n        \"Asia/Hovd\",\n        \"Asia/Irkutsk\",\n        \"Asia/Istanbul\",\n        \"Asia/Jakarta\",\n        \"Asia/Jayapura\",\n        \"Asia/Jerusalem\",\n        \"Asia/Kabul\",\n        \"Asia/Kamchatka\",\n        \"Asia/Karachi\",\n        \"Asia/Kashgar\",\n        \"Asia/Kathmandu\",\n        \"Asia/Katmandu\",\n        \"Asia/Khandyga\",\n        \"Asia/Kolkata\",\n        \"Asia/Krasnoyarsk\",\n        \"Asia/Kuala_Lumpur\",\n        \"Asia/Kuching\",\n        \"Asia/Kuwait\",\n        \"Asia/Macao\",\n        \"Asia/Macau\",\n        \"Asia/Magadan\",\n        \"Asia/Makassar\",\n        \"Asia/Manila\",\n        \"Asia/Muscat\",\n        \"Asia/Nicosia\",\n        \"Asia/Novokuznetsk\",\n        \"Asia/Novosibirsk\",\n        \"Asia/Omsk\",\n        \"Asia/Oral\",\n        \"Asia/Phnom_Penh\",\n        \"Asia/Pontianak\",\n        \"Asia/Pyongyang\",\n        \"Asia/Qatar\",\n        \"Asia/Qyzylorda\",\n        \"Asia/Rangoon\",\n        \"Asia/Riyadh\",\n        \"Asia/Saigon\",\n        \"Asia/Sakhalin\",\n        \"Asia/Samarkand\",\n        \"Asia/Seoul\",\n        \"Asia/Shanghai\",\n        \"Asia/Singapore\",\n        \"Asia/Srednekolymsk\",\n        \"Asia/Taipei\",\n        \"Asia/Tashkent\",\n        \"Asia/Tbilisi\",\n        \"Asia/Tehran\",\n        \"Asia/Tel_Aviv\",\n        \"Asia/Thimbu\",\n        \"Asia/Thimphu\",\n        \"Asia/Tokyo\",\n        \"Asia/Tomsk\",\n        \"Asia/Ujung_Pandang\",\n        \"Asia/Ulaanbaatar\",\n        \"Asia/Ulan_Bator\",\n        \"Asia/Urumqi\",\n        \"Asia/Ust-Nera\",\n        \"Asia/Vientiane\",\n        \"Asia/Vladivostok\",\n        \"Asia/Yakutsk\",\n        \"Asia/Yangon\",\n        \"Asia/Yekaterinburg\",\n        \"Asia/Yerevan\",\n        \"Atlantic/Azores\",\n        \"Atlantic/Bermuda\",\n        \"Atlantic/Canary\",\n        \"Atlantic/Cape_Verde\",\n        \"Atlantic/Faeroe\",\n        \"Atlantic/Faroe\",\n        \"Atlantic/Jan_Mayen\",\n        \"Atlantic/Madeira\",\n        \"Atlantic/Reykjavik\",\n        \"Atlantic/South_Georgia\",\n        \"Atlantic/Stanley\",\n        \"Atlantic/St_Helena\",\n        \"Australia/ACT\",\n        \"Australia/Adelaide\",\n        \"Australia/Brisbane\",\n        \"Australia/Broken_Hill\",\n        \"Australia/Canberra\",\n        \"Australia/Currie\",\n        \"Australia/Darwin\",\n        \"Australia/Eucla\",\n        \"Australia/Hobart\",\n        \"Australia/LHI\",\n        \"Australia/Lindeman\",\n        \"Australia/Lord_Howe\",\n        \"Australia/Melbourne\",\n        \"Australia/North\",\n        \"Australia/NSW\",\n        \"Australia/Perth\",\n        \"Australia/Queensland\",\n        \"Australia/South\",\n        \"Australia/Sydney\",\n        \"Australia/Tasmania\",\n        \"Australia/Victoria\",\n        \"Australia/West\",\n        \"Australia/Yancowinna\",\n        \"Brazil/Acre\",\n        \"Brazil/DeNoronha\",\n        \"Brazil/East\",\n        \"Brazil/West\",\n        \"Canada/Atlantic\",\n        \"Canada/Central\",\n        \"Canada/Eastern\",\n        \"Canada/East-Saskatchewan\",\n        \"Canada/Mountain\",\n        \"Canada/Newfoundland\",\n        \"Canada/Pacific\",\n        \"Canada/Saskatchewan\",\n        \"Canada/Yukon\",\n        \"Chile/Continental\",\n        \"Chile/EasterIsland\",\n        \"Etc/GMT\",\n        \"Etc/GMT0\",\n        \"Etc/GMT-0\",\n        \"Etc/GMT+0\",\n        \"Etc/GMT-1\",\n        \"Etc/GMT+1\",\n        \"Etc/GMT-10\",\n        \"Etc/GMT+10\",\n        \"Etc/GMT-11\",\n        \"Etc/GMT+11\",\n        \"Etc/GMT-12\",\n        \"Etc/GMT+12\",\n        \"Etc/GMT-13\",\n        \"Etc/GMT-14\",\n        \"Etc/GMT-2\",\n        \"Etc/GMT+2\",\n        \"Etc/GMT-3\",\n        \"Etc/GMT+3\",\n        \"Etc/GMT-4\",\n        \"Etc/GMT+4\",\n        \"Etc/GMT-5\",\n        \"Etc/GMT+5\",\n        \"Etc/GMT-6\",\n        \"Etc/GMT+6\",\n        \"Etc/GMT-7\",\n        \"Etc/GMT+7\",\n        \"Etc/GMT-8\",\n        \"Etc/GMT+8\",\n        \"Etc/GMT-9\",\n        \"Etc/GMT+9\",\n        \"Etc/Greenwich\",\n        \"Etc/UCT\",\n        \"Etc/Universal\",\n        \"Etc/UTC\",\n        \"Etc/Zulu\",\n        \"Europe/Amsterdam\",\n        \"Europe/Andorra\",\n        \"Europe/Astrakhan\",\n        \"Europe/Athens\",\n        \"Europe/Belfast\",\n        \"Europe/Belgrade\",\n        \"Europe/Berlin\",\n        \"Europe/Bratislava\",\n        \"Europe/Brussels\",\n        \"Europe/Bucharest\",\n        \"Europe/Budapest\",\n        \"Europe/Busingen\",\n        \"Europe/Chisinau\",\n        \"Europe/Copenhagen\",\n        \"Europe/Dublin\",\n        \"Europe/Gibraltar\",\n        \"Europe/Guernsey\",\n        \"Europe/Helsinki\",\n        \"Europe/Isle_of_Man\",\n        \"Europe/Istanbul\",\n        \"Europe/Jersey\",\n        \"Europe/Kaliningrad\",\n        \"Europe/Kiev\",\n        \"Europe/Kirov\",\n        \"Europe/Lisbon\",\n        \"Europe/Ljubljana\",\n        \"Europe/London\",\n        \"Europe/Luxembourg\",\n        \"Europe/Madrid\",\n        \"Europe/Malta\",\n        \"Europe/Mariehamn\",\n        \"Europe/Minsk\",\n        \"Europe/Monaco\",\n        \"Europe/Moscow\",\n        \"Europe/Nicosia\",\n        \"Europe/Oslo\",\n        \"Europe/Paris\",\n        \"Europe/Podgorica\",\n        \"Europe/Prague\",\n        \"Europe/Riga\",\n        \"Europe/Rome\",\n        \"Europe/Samara\",\n        \"Europe/San_Marino\",\n        \"Europe/Sarajevo\",\n        \"Europe/Saratov\",\n        \"Europe/Simferopol\",\n        \"Europe/Skopje\",\n        \"Europe/Sofia\",\n        \"Europe/Stockholm\",\n        \"Europe/Tallinn\",\n        \"Europe/Tirane\",\n        \"Europe/Tiraspol\",\n        \"Europe/Ulyanovsk\",\n        \"Europe/Uzhgorod\",\n        \"Europe/Vaduz\",\n        \"Europe/Vatican\",\n        \"Europe/Vienna\",\n        \"Europe/Vilnius\",\n        \"Europe/Volgograd\",\n        \"Europe/Warsaw\",\n        \"Europe/Zagreb\",\n        \"Europe/Zaporozhye\",\n        \"Europe/Zurich\",\n        \"Indian/Antananarivo\",\n        \"Indian/Chagos\",\n        \"Indian/Christmas\",\n        \"Indian/Cocos\",\n        \"Indian/Comoro\",\n        \"Indian/Kerguelen\",\n        \"Indian/Mahe\",\n        \"Indian/Maldives\",\n        \"Indian/Mauritius\",\n        \"Indian/Mayotte\",\n        \"Indian/Reunion\",\n        \"Mexico/BajaNorte\",\n        \"Mexico/BajaSur\",\n        \"Mexico/General\",\n        \"Pacific/Apia\",\n        \"Pacific/Auckland\",\n        \"Pacific/Bougainville\",\n        \"Pacific/Chatham\",\n        \"Pacific/Chuuk\",\n        \"Pacific/Easter\",\n        \"Pacific/Efate\",\n        \"Pacific/Enderbury\",\n        \"Pacific/Fakaofo\",\n        \"Pacific/Fiji\",\n        \"Pacific/Funafuti\",\n        \"Pacific/Galapagos\",\n        \"Pacific/Gambier\",\n        \"Pacific/Guadalcanal\",\n        \"Pacific/Guam\",\n        \"Pacific/Honolulu\",\n        \"Pacific/Johnston\",\n        \"Pacific/Kiritimati\",\n        \"Pacific/Kosrae\",\n        \"Pacific/Kwajalein\",\n        \"Pacific/Majuro\",\n        \"Pacific/Marquesas\",\n        \"Pacific/Midway\",\n        \"Pacific/Nauru\",\n        \"Pacific/Niue\",\n        \"Pacific/Norfolk\",\n        \"Pacific/Noumea\",\n        \"Pacific/Pago_Pago\",\n        \"Pacific/Palau\",\n        \"Pacific/Pitcairn\",\n        \"Pacific/Pohnpei\",\n        \"Pacific/Ponape\",\n        \"Pacific/Port_Moresby\",\n        \"Pacific/Rarotonga\",\n        \"Pacific/Saipan\",\n        \"Pacific/Samoa\",\n        \"Pacific/Tahiti\",\n        \"Pacific/Tarawa\",\n        \"Pacific/Tongatapu\",\n        \"Pacific/Truk\",\n        \"Pacific/Wake\",\n        \"Pacific/Wallis\",\n        \"Pacific/Yap\",\n        \"US/Alaska\",\n        \"US/Aleutian\",\n        \"US/Arizona\",\n        \"US/Central\",\n        \"US/Eastern\",\n        \"US/East-Indiana\",\n        \"US/Hawaii\",\n        \"US/Indiana-Starke\",\n        \"US/Michigan\",\n        \"US/Mountain\",\n        \"US/Pacific\",\n        \"US/Pacific-New\",\n        \"US/Samoa\",\n        \"CET\",\n        \"CST6CDT\",\n        \"Cuba\",\n        \"EET\",\n        \"Egypt\",\n        \"Eire\",\n        \"EST\",\n        \"EST5EDT\",\n        \"Factory\",\n        \"GB\",\n        \"GB-Eire\",\n        \"GMT\",\n        \"GMT0\",\n        \"GMT-0\",\n        \"GMT+0\",\n        \"Greenwich\",\n        \"Hongkong\",\n        \"HST\",\n        \"Iceland\",\n        \"Iran\",\n        \"Israel\",\n        \"Jamaica\",\n        \"Japan\",\n        \"Kwajalein\",\n        \"Libya\",\n        \"MET\",\n        \"MST\",\n        \"MST7MDT\",\n        \"Navajo\",\n        \"NZ\",\n        \"NZ-CHAT\",\n        \"Poland\",\n        \"Portugal\",\n        \"PRC\",\n        \"PST8PDT\",\n        \"ROC\",\n        \"ROK\",\n        \"Singapore\",\n        \"Turkey\",\n        \"UCT\",\n        \"Universal\",\n        \"UTC\",\n        \"WET\",\n        \"W-SU\",\n        \"Zulu\"\n    ],\n    \"userAgents\": [\n        \"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/28.0.1469.0 Safari/537.36\",\n        \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2869.0 Safari/537.36\",\n        \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3191.0 Safari/537.36\",\n        \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0\",\n        \"Mozilla/5.0 (Windows NT 6.2; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0\",\n        \"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0\",\n        \"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.2; WOW64; Trident/5.0)\",\n        \"Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko\",\n        \"Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; MALNJS; rv:11.0) like Gecko\",\n        \"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36 OPR/47.0.2631.55\",\n        \"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.91 Safari/537.36 Vivaldi/1.92.917.39\",\n        \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36\",\n        \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.49 Safari/537.36\",\n        \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:25.0) Gecko/20100101 Firefox/25.0\",\n        \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11) AppleWebKit/601.1.56 (KHTML, like Gecko) Version/9.0 Safari/601.1.56\",\n        \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50\",\n        \"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10\",\n        \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML like Gecko) Chrome/22.0.1229.56 Safari/537.4\",\n        \"Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36\",\n        \"Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/60.0.3112.78 Chrome/60.0.3112.78 Safari/537.36\",\n        \"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0\",\n        \"Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.2.1\",\n        \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.166 Safari/537.36 OPR/20.0.1396.73172\",\n        \"Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36 OPR/40.0.2308.62\",\n        \"Mozilla/5.0 (Linux; Android 8.0.0; Pixel XL Build/OPR6.170623.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.107 Mobile Safari/537.36\",\n        \"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch)\",\n        \"Opera/10.61 (J2ME/MIDP; Opera Mini/5.1.21219/19.999; en-US; rv:1.9.3a5) WebKit/534.5 Presto/2.6.30\",\n        \"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1\",\n        \"Mozilla/5.0 (Linux; Android 8.0.0; Pixel XL Build/OPR6.170623.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.107 Mobile Safari/537.36\",\n        \"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; DEVICE INFO) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Mobile Safari/537.36 Edge/12.0\",\n        \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36\",\n        \"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36\",\n        \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36\",\n        \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0.1 Safari/602.2.14\",\n        \"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36\",\n        \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36\",\n        \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36\",\n        \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36\",\n        \"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36\",\n        \"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0\",\n        \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36\"\n    ]\n}`)\n"
  },
  {
    "path": "vendor/github.com/Pallinder/go-randomdata/postalcodes.go",
    "content": "package randomdata\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"math/rand\"\n\t\"strings\"\n)\n\n// Supported formats obtained from:\n// * http://www.geopostcodes.com/GeoPC_Postal_codes_formats\n\n// PostalCode yields a random postal/zip code for the given 2-letter country code.\n//\n// These codes are not guaranteed to refer to actually locations.\n// They merely follow the correct format as far as letters and digits goes.\n// Where possible, the function enforces valid ranges of letters and digits.\nfunc PostalCode(countrycode string) string {\n\tswitch strings.ToUpper(countrycode) {\n\tcase \"LS\", \"MG\", \"IS\", \"OM\", \"PG\":\n\t\treturn Digits(3)\n\n\tcase \"AM\", \"GE\", \"NZ\", \"NE\", \"NO\", \"PY\", \"ZA\", \"MZ\", \"SJ\", \"LI\", \"AL\",\n\t\t\"BD\", \"CV\", \"GL\":\n\t\treturn Digits(4)\n\n\tcase \"DZ\", \"BA\", \"KH\", \"DO\", \"EG\", \"EE\", \"GP\", \"GT\", \"ID\", \"IL\", \"JO\",\n\t\t\"KW\", \"MQ\", \"MX\", \"LK\", \"SD\", \"TR\", \"UA\", \"US\", \"CR\", \"IQ\", \"KV\", \"MY\",\n\t\t\"MN\", \"ME\", \"PK\", \"SM\", \"MA\", \"UY\", \"EH\", \"ZM\":\n\t\treturn Digits(5)\n\n\tcase \"BY\", \"CN\", \"IN\", \"KZ\", \"KG\", \"NG\", \"RO\", \"RU\", \"SG\", \"TJ\", \"TM\", \"UZ\", \"VN\":\n\t\treturn Digits(6)\n\n\tcase \"CL\":\n\t\treturn Digits(7)\n\n\tcase \"IR\":\n\t\treturn Digits(10)\n\n\tcase \"FO\":\n\t\treturn \"FO \" + Digits(3)\n\n\tcase \"AF\":\n\t\treturn BoundedDigits(2, 10, 43) + BoundedDigits(2, 1, 99)\n\n\tcase \"AU\", \"AT\", \"BE\", \"BG\", \"CY\", \"DK\", \"ET\", \"GW\", \"HU\", \"LR\", \"MK\", \"PH\",\n\t\t\"CH\", \"TN\", \"VE\":\n\t\treturn BoundedDigits(4, 1000, 9999)\n\n\tcase \"SV\":\n\t\treturn \"CP \" + BoundedDigits(4, 1000, 9999)\n\n\tcase \"HT\":\n\t\treturn \"HT\" + Digits(4)\n\n\tcase \"LB\":\n\t\treturn Digits(4) + \" \" + Digits(4)\n\n\tcase \"LU\":\n\t\treturn BoundedDigits(4, 6600, 6999)\n\n\tcase \"MD\":\n\t\treturn \"MD-\" + BoundedDigits(4, 1000, 9999)\n\n\tcase \"HR\":\n\t\treturn \"HR-\" + Digits(5)\n\n\tcase \"CU\":\n\t\treturn \"CP \" + BoundedDigits(5, 10000, 99999)\n\n\tcase \"FI\":\n\t\t// Last digit is usually 0 but can, in some cases, be 1 or 5.\n\t\tswitch rand.Intn(2) {\n\t\tcase 0:\n\t\t\treturn Digits(4) + \"0\"\n\t\tcase 1:\n\t\t\treturn Digits(4) + \"1\"\n\t\t}\n\n\t\treturn Digits(4) + \"5\"\n\n\tcase \"FR\", \"GF\", \"PF\", \"YT\", \"MC\", \"RE\", \"BL\", \"MF\", \"PM\", \"RS\", \"TH\":\n\t\treturn BoundedDigits(5, 10000, 99999)\n\n\tcase \"DE\":\n\t\treturn BoundedDigits(5, 1000, 99999)\n\n\tcase \"GR\":\n\t\treturn BoundedDigits(3, 100, 999) + \" \" + Digits(2)\n\n\tcase \"HN\":\n\t\treturn \"CM\" + Digits(4)\n\n\tcase \"IT\", \"VA\":\n\t\treturn BoundedDigits(5, 10, 99999)\n\n\tcase \"KE\":\n\t\treturn BoundedDigits(5, 100, 99999)\n\n\tcase \"LA\":\n\t\treturn BoundedDigits(5, 1000, 99999)\n\n\tcase \"MH\":\n\t\treturn BoundedDigits(5, 96960, 96970)\n\n\tcase \"FM\":\n\t\treturn \"FM\" + BoundedDigits(5, 96941, 96944)\n\n\tcase \"MM\":\n\t\treturn BoundedDigits(2, 1, 14) + Digits(3)\n\n\tcase \"NP\":\n\t\treturn BoundedDigits(5, 10700, 56311)\n\n\tcase \"NC\":\n\t\treturn \"98\" + Digits(3)\n\n\tcase \"PW\":\n\t\treturn \"PW96940\"\n\n\tcase \"PR\":\n\t\treturn \"PR \" + Digits(5)\n\n\tcase \"SA\":\n\t\treturn BoundedDigits(5, 10000, 99999) + \"-\" + BoundedDigits(4, 1000, 9999)\n\n\tcase \"ES\":\n\t\treturn BoundedDigits(2, 1, 52) + BoundedDigits(3, 100, 999)\n\n\tcase \"WF\":\n\t\treturn \"986\" + Digits(2)\n\n\tcase \"SZ\":\n\t\treturn Letters(1) + Digits(3)\n\n\tcase \"BM\":\n\t\treturn Letters(2) + Digits(2)\n\n\tcase \"AD\":\n\t\treturn Letters(2) + Digits(3)\n\n\tcase \"BN\", \"AZ\", \"VG\", \"PE\":\n\t\treturn Letters(2) + Digits(4)\n\n\tcase \"BB\":\n\t\treturn Letters(2) + Digits(5)\n\n\tcase \"EC\":\n\t\treturn Letters(2) + Digits(6)\n\n\tcase \"MT\":\n\t\treturn Letters(3) + Digits(4)\n\n\tcase \"JM\":\n\t\treturn \"JM\" + Letters(3) + Digits(2)\n\n\tcase \"AR\":\n\t\treturn Letters(1) + Digits(4) + Letters(3)\n\n\tcase \"CA\":\n\t\treturn Letters(1) + Digits(1) + Letters(1) + Digits(1) + Letters(1) + Digits(1)\n\n\tcase \"FK\", \"TC\":\n\t\treturn Letters(4) + Digits(1) + Letters(2)\n\n\tcase \"GG\", \"IM\", \"JE\", \"GB\":\n\t\treturn Letters(2) + Digits(2) + Letters(2)\n\n\tcase \"KY\":\n\t\treturn Letters(2) + Digits(1) + \"-\" + Digits(4)\n\n\tcase \"JP\":\n\t\treturn Digits(3) + \"-\" + Digits(4)\n\n\tcase \"LV\", \"SI\":\n\t\treturn Letters(2) + \"-\" + Digits(4)\n\n\tcase \"LT\":\n\t\treturn Letters(2) + \"-\" + Digits(5)\n\n\tcase \"SE\", \"TW\":\n\t\treturn Digits(5)\n\n\tcase \"MV\":\n\t\treturn Digits(2) + \"-\" + Digits(2)\n\n\tcase \"PL\":\n\t\treturn Digits(2) + \"-\" + Digits(3)\n\n\tcase \"NI\":\n\t\treturn Digits(3) + \"-\" + Digits(3) + \"-\" + Digits(1)\n\n\tcase \"KR\":\n\t\treturn Digits(3) + \"-\" + Digits(3)\n\n\tcase \"PT\":\n\t\treturn Digits(4) + \"-\" + Digits(3)\n\n\tcase \"NL\":\n\t\treturn Digits(4) + Letters(2)\n\n\tcase \"BR\":\n\t\treturn Digits(5) + \"-\" + Digits(3)\n\t}\n\n\treturn \"\"\n}\n\n// Letters generates a string of N random leters (A-Z).\nfunc Letters(letters int) string {\n\tlist := make([]byte, letters)\n\n\tfor i := range list {\n\t\tlist[i] = byte(rand.Intn('Z'-'A') + 'A')\n\t}\n\n\treturn string(list)\n}\n\n// Digits generates a string of N random digits, padded with zeros if necessary.\nfunc Digits(digits int) string {\n\tmax := int(math.Pow10(digits)) - 1\n\tnum := rand.Intn(max)\n\tformat := fmt.Sprintf(\"%%0%dd\", digits)\n\treturn fmt.Sprintf(format, num)\n}\n\n// BoundedDigits generates a string of N random digits, padded with zeros if necessary.\n// The output is restricted to the given range.\nfunc BoundedDigits(digits, low, high int) string {\n\tif low > high {\n\t\tlow, high = high, low\n\t}\n\n\tmax := int(math.Pow10(digits)) - 1\n\tif high > max {\n\t\thigh = max\n\t}\n\n\tnum := rand.Intn(high-low+1) + low\n\tformat := fmt.Sprintf(\"%%0%dd\", digits)\n\treturn fmt.Sprintf(format, num)\n}\n"
  },
  {
    "path": "vendor/github.com/Pallinder/go-randomdata/random_data.go",
    "content": "// Package randomdata implements a bunch of simple ways to generate (pseudo) random data\npackage randomdata\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"math/rand\"\n\t\"net\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\t\"unicode\"\n)\n\nconst (\n\tMale         int = 0\n\tFemale       int = 1\n\tRandomGender int = 2\n)\n\nconst (\n\tSmall int = 0\n\tLarge int = 1\n)\n\nconst (\n\tFullCountry      = 0\n\tTwoCharCountry   = 1\n\tThreeCharCountry = 2\n)\n\nconst (\n\tDateInputLayout  = \"2006-01-02\"\n\tDateOutputLayout = \"Monday 2 Jan 2006\"\n)\n\ntype jsonContent struct {\n\tAdjectives          []string `json:\"adjectives\"`\n\tNouns               []string `json:\"nouns\"`\n\tFirstNamesFemale    []string `json:\"firstNamesFemale\"`\n\tFirstNamesMale      []string `json:\"firstNamesMale\"`\n\tLastNames           []string `json:\"lastNames\"`\n\tDomains             []string `json:\"domains\"`\n\tPeople              []string `json:\"people\"`\n\tStreetTypes         []string `json:\"streetTypes\"` // Taken from https://github.com/tomharris/random_data/blob/master/lib/random_data/locations.rb\n\tParagraphs          []string `json:\"paragraphs\"`  // Taken from feedbooks.com\n\tCountries           []string `json:\"countries\"`   // Fetched from the world bank at http://siteresources.worldbank.org/DATASTATISTICS/Resources/CLASS.XLS\n\tCountriesThreeChars []string `json:\"countriesThreeChars\"`\n\tCountriesTwoChars   []string `json:\"countriesTwoChars\"`\n\tCurrencies          []string `json:\"currencies\"` //https://github.com/OpenBookPrices/country-data\n\tCities              []string `json:\"cities\"`\n\tStates              []string `json:\"states\"`\n\tStatesSmall         []string `json:\"statesSmall\"`\n\tDays                []string `json:\"days\"`\n\tMonths              []string `json:\"months\"`\n\tFemaleTitles        []string `json:\"femaleTitles\"`\n\tMaleTitles          []string `json:\"maleTitles\"`\n\tTimezones           []string `json:\"timezones\"`  // https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n\tUserAgents          []string `json:\"userAgents\"` // http://techpatterns.com/downloads/firefox/useragentswitcher.xml\n}\n\nvar jsonData = jsonContent{}\n\nfunc init() {\n\tjsonData = jsonContent{}\n\n\terr := json.Unmarshal(data, &jsonData)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\nfunc seedAndReturnRandom(n int) int {\n\trand.Seed(time.Now().UnixNano())\n\treturn rand.Intn(n)\n}\n\nfunc seedAndReturnRandomFloat() float64 {\n\trand.Seed(time.Now().UnixNano())\n\treturn rand.Float64()\n}\n\n// Returns a random part of a slice\nfunc randomFrom(source []string) string {\n\treturn source[seedAndReturnRandom(len(source))]\n}\n\n// Title returns a random title, gender decides the gender of the name\nfunc Title(gender int) string {\n\tvar title = \"\"\n\tswitch gender {\n\tcase Male:\n\t\ttitle = randomFrom(jsonData.MaleTitles)\n\t\tbreak\n\tcase Female:\n\t\ttitle = randomFrom(jsonData.FemaleTitles)\n\t\tbreak\n\tdefault:\n\t\trand.Seed(time.Now().UnixNano())\n\t\ttitle = FirstName(rand.Intn(2))\n\t\tbreak\n\t}\n\treturn title\n}\n\n// FirstName returns a random first name, gender decides the gender of the name\nfunc FirstName(gender int) string {\n\tvar name = \"\"\n\tswitch gender {\n\tcase Male:\n\t\tname = randomFrom(jsonData.FirstNamesMale)\n\t\tbreak\n\tcase Female:\n\t\tname = randomFrom(jsonData.FirstNamesFemale)\n\t\tbreak\n\tdefault:\n\t\trand.Seed(time.Now().UnixNano())\n\t\tname = FirstName(rand.Intn(2))\n\t\tbreak\n\t}\n\treturn name\n}\n\n// LastName returns a random last name\nfunc LastName() string {\n\treturn randomFrom(jsonData.LastNames)\n}\n\n// FullName returns a combination of FirstName LastName randomized, gender decides the gender of the name\nfunc FullName(gender int) string {\n\treturn FirstName(gender) + \" \" + LastName()\n}\n\n// Email returns a random email\nfunc Email() string {\n\treturn strings.ToLower(FirstName(RandomGender)+LastName()) + StringNumberExt(1, \"\", 3) + \"@\" + randomFrom(jsonData.Domains)\n}\n\n// Country returns a random country, countryStyle decides what kind of format the returned country will have\nfunc Country(countryStyle int64) string {\n\tcountry := \"\"\n\tswitch countryStyle {\n\n\tdefault:\n\n\tcase FullCountry:\n\t\tcountry = randomFrom(jsonData.Countries)\n\t\tbreak\n\n\tcase TwoCharCountry:\n\t\tcountry = randomFrom(jsonData.CountriesTwoChars)\n\t\tbreak\n\n\tcase ThreeCharCountry:\n\t\tcountry = randomFrom(jsonData.CountriesThreeChars)\n\t\tbreak\n\t}\n\treturn country\n}\n\n// Currency returns a random currency under ISO 4217 format\nfunc Currency() string {\n\treturn randomFrom(jsonData.Currencies)\n}\n\n// City returns a random city\nfunc City() string {\n\treturn randomFrom(jsonData.Cities)\n}\n\n// State returns a random american state\nfunc State(typeOfState int) string {\n\tif typeOfState == Small {\n\t\treturn randomFrom(jsonData.StatesSmall)\n\t}\n\treturn randomFrom(jsonData.States)\n}\n\n// Street returns a random fake street name\nfunc Street() string {\n\treturn fmt.Sprintf(\"%s %s\", randomFrom(jsonData.People), randomFrom(jsonData.StreetTypes))\n}\n\n// Address returns an american style address\nfunc Address() string {\n\treturn fmt.Sprintf(\"%d %s,\\n%s, %s, %s\", Number(100), Street(), City(), State(Small), PostalCode(\"US\"))\n}\n\n// Paragraph returns a random paragraph\nfunc Paragraph() string {\n\treturn randomFrom(jsonData.Paragraphs)\n}\n\n// Number returns a random number, if only one integer is supplied it is treated as the max value to return\n// if a second argument is supplied it returns a number between (and including) the two numbers\nfunc Number(numberRange ...int) int {\n\tnr := 0\n\trand.Seed(time.Now().UnixNano())\n\tif len(numberRange) > 1 {\n\t\tnr = 1\n\t\tnr = seedAndReturnRandom(numberRange[1]-numberRange[0]) + numberRange[0]\n\t} else {\n\t\tnr = seedAndReturnRandom(numberRange[0])\n\t}\n\treturn nr\n}\n\nfunc Decimal(numberRange ...int) float64 {\n\tnr := 0.0\n\trand.Seed(time.Now().UnixNano())\n\tif len(numberRange) > 1 {\n\t\tnr = 1.0\n\t\tnr = seedAndReturnRandomFloat()*(float64(numberRange[1])-float64(numberRange[0])) + float64(numberRange[0])\n\t} else {\n\t\tnr = seedAndReturnRandomFloat() * float64(numberRange[0])\n\t}\n\n\tif len(numberRange) > 2 {\n\t\tsf := strconv.FormatFloat(nr, 'f', numberRange[2], 64)\n\t\tnr, _ = strconv.ParseFloat(sf, 64)\n\t}\n\treturn nr\n}\n\nfunc StringNumberExt(numberPairs int, separator string, numberOfDigits int) string {\n\tnumberString := \"\"\n\n\tfor i := 0; i < numberPairs; i++ {\n\t\tfor d := 0; d < numberOfDigits; d++ {\n\t\t\tnumberString += fmt.Sprintf(\"%d\", Number(0, 9))\n\t\t}\n\n\t\tif i+1 != numberPairs {\n\t\t\tnumberString += separator\n\t\t}\n\t}\n\n\treturn numberString\n}\n\n// StringNumber returns a random number as a string\nfunc StringNumber(numberPairs int, separator string) string {\n\treturn StringNumberExt(numberPairs, separator, 2)\n}\n\n// StringSample returns a random string from a list of strings\nfunc StringSample(stringList ...string) string {\n\tstr := \"\"\n\tif len(stringList) > 0 {\n\t\tstr = stringList[Number(0, len(stringList))]\n\t}\n\treturn str\n}\n\nfunc Boolean() bool {\n\tnr := seedAndReturnRandom(2)\n\treturn nr != 0\n}\n\n// Noun returns a random noun\nfunc Noun() string {\n\treturn randomFrom(jsonData.Nouns)\n}\n\n// Adjective returns a random adjective\nfunc Adjective() string {\n\treturn randomFrom(jsonData.Adjectives)\n}\n\nfunc uppercaseFirstLetter(word string) string {\n\ta := []rune(word)\n\ta[0] = unicode.ToUpper(a[0])\n\treturn string(a)\n}\n\nfunc lowercaseFirstLetter(word string) string {\n\ta := []rune(word)\n\ta[0] = unicode.ToLower(a[0])\n\treturn string(a)\n}\n\n// SillyName returns a silly name, useful for randomizing naming of things\nfunc SillyName() string {\n\treturn uppercaseFirstLetter(Noun()) + Adjective()\n}\n\n// IpV4Address returns a valid IPv4 address as string\nfunc IpV4Address() string {\n\tblocks := []string{}\n\tfor i := 0; i < 4; i++ {\n\t\tnumber := seedAndReturnRandom(255)\n\t\tblocks = append(blocks, strconv.Itoa(number))\n\t}\n\n\treturn strings.Join(blocks, \".\")\n}\n\n// IpV6Address returns a valid IPv6 address as net.IP\nfunc IpV6Address() string {\n\tvar ip net.IP\n\tfor i := 0; i < net.IPv6len; i++ {\n\t\tnumber := uint8(seedAndReturnRandom(255))\n\t\tip = append(ip, number)\n\t}\n\treturn ip.String()\n}\n\n// MacAddress returns an mac address string\nfunc MacAddress() string {\n\tblocks := []string{}\n\tfor i := 0; i < 6; i++ {\n\t\tnumber := fmt.Sprintf(\"%02x\", seedAndReturnRandom(255))\n\t\tblocks = append(blocks, number)\n\t}\n\n\treturn strings.Join(blocks, \":\")\n}\n\n// Day returns random day\nfunc Day() string {\n\treturn randomFrom(jsonData.Days)\n}\n\n// Month returns random month\nfunc Month() string {\n\treturn randomFrom(jsonData.Months)\n}\n\n// FullDate returns full date\nfunc FullDate() string {\n\ttimestamp := time.Now()\n\tday := Day()\n\tmonth := Month()\n\tyear := timestamp.Year()\n\tfullDate := day + \" \" + strconv.Itoa(Number(1, 30)) + \" \" + month[0:3] + \" \" + strconv.Itoa(year)\n\treturn fullDate\n}\n\n// FullDateInRange returns a date string within a given range, given in the format \"2006-01-02\".\n// If no argument is supplied it will return the result of randomdata.FullDate().\n// If only one argument is supplied it is treated as the max date to return.\n// If a second argument is supplied it returns a date between (and including) the two dates.\n// Returned date is in format \"Monday 2 Jan 2006\".\nfunc FullDateInRange(dateRange ...string) string {\n\tvar (\n\t\tmin        time.Time\n\t\tmax        time.Time\n\t\tduration   int\n\t\tdateString string\n\t)\n\tif len(dateRange) == 1 {\n\t\tmax, _ = time.Parse(DateInputLayout, dateRange[0])\n\t} else if len(dateRange) == 2 {\n\t\tmin, _ = time.Parse(DateInputLayout, dateRange[0])\n\t\tmax, _ = time.Parse(DateInputLayout, dateRange[1])\n\t}\n\tif !max.IsZero() && max.After(min) {\n\t\tduration = Number(int(max.Sub(min))) * -1\n\t\tdateString = max.Add(time.Duration(duration)).Format(DateOutputLayout)\n\t} else if !max.IsZero() && !max.After(min) {\n\t\tdateString = max.Format(DateOutputLayout)\n\t} else {\n\t\tdateString = FullDate()\n\t}\n\treturn dateString\n}\n\nfunc Timezone() string {\n\treturn randomFrom(jsonData.Timezones)\n}\n\nfunc UserAgentString() string {\n\treturn randomFrom(jsonData.UserAgents)\n}\n"
  },
  {
    "path": "vendor/github.com/elazarl/go-bindata-assetfs/LICENSE",
    "content": "Copyright (c) 2014, Elazar Leibovich\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "vendor/github.com/elazarl/go-bindata-assetfs/README.md",
    "content": "# go-bindata-assetfs\n\nServe embedded files from [jteeuwen/go-bindata](https://github.com/jteeuwen/go-bindata) with `net/http`.\n\n[GoDoc](http://godoc.org/github.com/elazarl/go-bindata-assetfs)\n\n### Installation\n\nInstall with\n\n    $ go get github.com/jteeuwen/go-bindata/...\n    $ go get github.com/elazarl/go-bindata-assetfs/...\n\n### Creating embedded data\n\nUsage is identical to [jteeuwen/go-bindata](https://github.com/jteeuwen/go-bindata) usage,\ninstead of running `go-bindata` run `go-bindata-assetfs`.\n\nThe tool will create a `bindata_assetfs.go` file, which contains the embedded data.\n\nA typical use case is\n\n    $ go-bindata-assetfs data/...\n\n### Using assetFS in your code\n\nThe generated file provides an `assetFS()` function that returns a `http.Filesystem`\nwrapping the embedded files. What you usually want to do is:\n\n    http.Handle(\"/\", http.FileServer(assetFS()))\n\nThis would run an HTTP server serving the embedded files.\n\n## Without running binary tool\n\nYou can always just run the `go-bindata` tool, and then\n\nuse\n\n     import \"github.com/elazarl/go-bindata-assetfs\"\n     ...\n     http.Handle(\"/\",\n        http.FileServer(\n        &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, AssetInfo: AssetInfo, Prefix: \"data\"}))\n\nto serve files embedded from the `data` directory.\n"
  },
  {
    "path": "vendor/github.com/elazarl/go-bindata-assetfs/assetfs.go",
    "content": "package assetfs\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n)\n\nvar (\n\tdefaultFileTimestamp = time.Now()\n)\n\n// FakeFile implements os.FileInfo interface for a given path and size\ntype FakeFile struct {\n\t// Path is the path of this file\n\tPath string\n\t// Dir marks of the path is a directory\n\tDir bool\n\t// Len is the length of the fake file, zero if it is a directory\n\tLen int64\n\t// Timestamp is the ModTime of this file\n\tTimestamp time.Time\n}\n\nfunc (f *FakeFile) Name() string {\n\t_, name := filepath.Split(f.Path)\n\treturn name\n}\n\nfunc (f *FakeFile) Mode() os.FileMode {\n\tmode := os.FileMode(0644)\n\tif f.Dir {\n\t\treturn mode | os.ModeDir\n\t}\n\treturn mode\n}\n\nfunc (f *FakeFile) ModTime() time.Time {\n\treturn f.Timestamp\n}\n\nfunc (f *FakeFile) Size() int64 {\n\treturn f.Len\n}\n\nfunc (f *FakeFile) IsDir() bool {\n\treturn f.Mode().IsDir()\n}\n\nfunc (f *FakeFile) Sys() interface{} {\n\treturn nil\n}\n\n// AssetFile implements http.File interface for a no-directory file with content\ntype AssetFile struct {\n\t*bytes.Reader\n\tio.Closer\n\tFakeFile\n}\n\nfunc NewAssetFile(name string, content []byte, timestamp time.Time) *AssetFile {\n\tif timestamp.IsZero() {\n\t\ttimestamp = defaultFileTimestamp\n\t}\n\treturn &AssetFile{\n\t\tbytes.NewReader(content),\n\t\tioutil.NopCloser(nil),\n\t\tFakeFile{name, false, int64(len(content)), timestamp}}\n}\n\nfunc (f *AssetFile) Readdir(count int) ([]os.FileInfo, error) {\n\treturn nil, errors.New(\"not a directory\")\n}\n\nfunc (f *AssetFile) Size() int64 {\n\treturn f.FakeFile.Size()\n}\n\nfunc (f *AssetFile) Stat() (os.FileInfo, error) {\n\treturn f, nil\n}\n\n// AssetDirectory implements http.File interface for a directory\ntype AssetDirectory struct {\n\tAssetFile\n\tChildrenRead int\n\tChildren     []os.FileInfo\n}\n\nfunc NewAssetDirectory(name string, children []string, fs *AssetFS) *AssetDirectory {\n\tfileinfos := make([]os.FileInfo, 0, len(children))\n\tfor _, child := range children {\n\t\t_, err := fs.AssetDir(filepath.Join(name, child))\n\t\tfileinfos = append(fileinfos, &FakeFile{child, err == nil, 0, time.Time{}})\n\t}\n\treturn &AssetDirectory{\n\t\tAssetFile{\n\t\t\tbytes.NewReader(nil),\n\t\t\tioutil.NopCloser(nil),\n\t\t\tFakeFile{name, true, 0, time.Time{}},\n\t\t},\n\t\t0,\n\t\tfileinfos}\n}\n\nfunc (f *AssetDirectory) Readdir(count int) ([]os.FileInfo, error) {\n\tif count <= 0 {\n\t\treturn f.Children, nil\n\t}\n\tif f.ChildrenRead+count > len(f.Children) {\n\t\tcount = len(f.Children) - f.ChildrenRead\n\t}\n\trv := f.Children[f.ChildrenRead : f.ChildrenRead+count]\n\tf.ChildrenRead += count\n\treturn rv, nil\n}\n\nfunc (f *AssetDirectory) Stat() (os.FileInfo, error) {\n\treturn f, nil\n}\n\n// AssetFS implements http.FileSystem, allowing\n// embedded files to be served from net/http package.\ntype AssetFS struct {\n\t// Asset should return content of file in path if exists\n\tAsset func(path string) ([]byte, error)\n\t// AssetDir should return list of files in the path\n\tAssetDir func(path string) ([]string, error)\n\t// AssetInfo should return the info of file in path if exists\n\tAssetInfo func(path string) (os.FileInfo, error)\n\t// Prefix would be prepended to http requests\n\tPrefix string\n}\n\nfunc (fs *AssetFS) Open(name string) (http.File, error) {\n\tname = path.Join(fs.Prefix, name)\n\tif len(name) > 0 && name[0] == '/' {\n\t\tname = name[1:]\n\t}\n\tif b, err := fs.Asset(name); err == nil {\n\t\ttimestamp := defaultFileTimestamp\n\t\tif fs.AssetInfo != nil {\n\t\t\tif info, err := fs.AssetInfo(name); err == nil {\n\t\t\t\ttimestamp = info.ModTime()\n\t\t\t}\n\t\t}\n\t\treturn NewAssetFile(name, b, timestamp), nil\n\t}\n\tif children, err := fs.AssetDir(name); err == nil {\n\t\treturn NewAssetDirectory(name, children, fs), nil\n\t} else {\n\t\t// If the error is not found, return an error that will\n\t\t// result in a 404 error. Otherwise the server returns\n\t\t// a 500 error for files not found.\n\t\tif strings.Contains(err.Error(), \"not found\") {\n\t\t\treturn nil, os.ErrNotExist\n\t\t}\n\t\treturn nil, err\n\t}\n}\n"
  },
  {
    "path": "vendor/github.com/elazarl/go-bindata-assetfs/doc.go",
    "content": "// assetfs allows packages to serve static content embedded\n// with the go-bindata tool with the standard net/http package.\n//\n// See https://github.com/jteeuwen/go-bindata for more information\n// about embedding binary data with go-bindata.\n//\n// Usage example, after running\n//    $ go-bindata data/...\n// use:\n//     http.Handle(\"/\",\n//        http.FileServer(\n//        &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: \"data\"}))\npackage assetfs\n"
  },
  {
    "path": "vendor/github.com/mitchellh/go-homedir/LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2013 Mitchell Hashimoto\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/mitchellh/go-homedir/README.md",
    "content": "# go-homedir\n\nThis is a Go library for detecting the user's home directory without\nthe use of cgo, so the library can be used in cross-compilation environments.\n\nUsage is incredibly simple, just call `homedir.Dir()` to get the home directory\nfor a user, and `homedir.Expand()` to expand the `~` in a path to the home\ndirectory.\n\n**Why not just use `os/user`?** The built-in `os/user` package requires\ncgo on Darwin systems. This means that any Go code that uses that package\ncannot cross compile. But 99% of the time the use for `os/user` is just to\nretrieve the home directory, which we can do for the current user without\ncgo. This library does that, enabling cross-compilation.\n"
  },
  {
    "path": "vendor/github.com/mitchellh/go-homedir/homedir.go",
    "content": "package homedir\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n)\n\n// DisableCache will disable caching of the home directory. Caching is enabled\n// by default.\nvar DisableCache bool\n\nvar homedirCache string\nvar cacheLock sync.RWMutex\n\n// Dir returns the home directory for the executing user.\n//\n// This uses an OS-specific method for discovering the home directory.\n// An error is returned if a home directory cannot be detected.\nfunc Dir() (string, error) {\n\tif !DisableCache {\n\t\tcacheLock.RLock()\n\t\tcached := homedirCache\n\t\tcacheLock.RUnlock()\n\t\tif cached != \"\" {\n\t\t\treturn cached, nil\n\t\t}\n\t}\n\n\tcacheLock.Lock()\n\tdefer cacheLock.Unlock()\n\n\tvar result string\n\tvar err error\n\tif runtime.GOOS == \"windows\" {\n\t\tresult, err = dirWindows()\n\t} else {\n\t\t// Unix-like system, so just assume Unix\n\t\tresult, err = dirUnix()\n\t}\n\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\thomedirCache = result\n\treturn result, nil\n}\n\n// Expand expands the path to include the home directory if the path\n// is prefixed with `~`. If it isn't prefixed with `~`, the path is\n// returned as-is.\nfunc Expand(path string) (string, error) {\n\tif len(path) == 0 {\n\t\treturn path, nil\n\t}\n\n\tif path[0] != '~' {\n\t\treturn path, nil\n\t}\n\n\tif len(path) > 1 && path[1] != '/' && path[1] != '\\\\' {\n\t\treturn \"\", errors.New(\"cannot expand user-specific home dir\")\n\t}\n\n\tdir, err := Dir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filepath.Join(dir, path[1:]), nil\n}\n\nfunc dirUnix() (string, error) {\n\t// First prefer the HOME environmental variable\n\tif home := os.Getenv(\"HOME\"); home != \"\" {\n\t\treturn home, nil\n\t}\n\n\t// If that fails, try getent\n\tvar stdout bytes.Buffer\n\tcmd := exec.Command(\"getent\", \"passwd\", strconv.Itoa(os.Getuid()))\n\tcmd.Stdout = &stdout\n\tif err := cmd.Run(); err != nil {\n\t\t// If the error is ErrNotFound, we ignore it. Otherwise, return it.\n\t\tif err != exec.ErrNotFound {\n\t\t\treturn \"\", err\n\t\t}\n\t} else {\n\t\tif passwd := strings.TrimSpace(stdout.String()); passwd != \"\" {\n\t\t\t// username:password:uid:gid:gecos:home:shell\n\t\t\tpasswdParts := strings.SplitN(passwd, \":\", 7)\n\t\t\tif len(passwdParts) > 5 {\n\t\t\t\treturn passwdParts[5], nil\n\t\t\t}\n\t\t}\n\t}\n\n\t// If all else fails, try the shell\n\tstdout.Reset()\n\tcmd = exec.Command(\"sh\", \"-c\", \"cd && pwd\")\n\tcmd.Stdout = &stdout\n\tif err := cmd.Run(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tresult := strings.TrimSpace(stdout.String())\n\tif result == \"\" {\n\t\treturn \"\", errors.New(\"blank output when reading home directory\")\n\t}\n\n\treturn result, nil\n}\n\nfunc dirWindows() (string, error) {\n\t// First prefer the HOME environmental variable\n\tif home := os.Getenv(\"HOME\"); home != \"\" {\n\t\treturn home, nil\n\t}\n\n\tdrive := os.Getenv(\"HOMEDRIVE\")\n\tpath := os.Getenv(\"HOMEPATH\")\n\thome := drive + path\n\tif drive == \"\" || path == \"\" {\n\t\thome = os.Getenv(\"USERPROFILE\")\n\t}\n\tif home == \"\" {\n\t\treturn \"\", errors.New(\"HOMEDRIVE, HOMEPATH, and USERPROFILE are blank\")\n\t}\n\n\treturn home, nil\n}\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/CHANGELOG.md",
    "content": "# Change Log\n\n**ATTN**: This project uses [semantic versioning](http://semver.org/).\n\n## [Unreleased]\n\n## 1.20.0 - 2017-08-10\n\n### Fixed\n\n* `HandleExitCoder` is now correctly iterates over all errors in\n  a `MultiError`. The exit code is the exit code of the last error or `1` if\n  there are no `ExitCoder`s in the `MultiError`.\n* Fixed YAML file loading on Windows (previously would fail validate the file path)\n* Subcommand `Usage`, `Description`, `ArgsUsage`, `OnUsageError` correctly\n  propogated\n* `ErrWriter` is now passed downwards through command structure to avoid the\n  need to redefine it\n* Pass `Command` context into `OnUsageError` rather than parent context so that\n  all fields are avaiable\n* Errors occuring in `Before` funcs are no longer double printed\n* Use `UsageText` in the help templates for commands and subcommands if\n  defined; otherwise build the usage as before (was previously ignoring this\n  field)\n* `IsSet` and `GlobalIsSet` now correctly return whether a flag is set if\n  a program calls `Set` or `GlobalSet` directly after flag parsing (would\n  previously only return `true` if the flag was set during parsing)\n\n### Changed\n\n* No longer exit the program on command/subcommand error if the error raised is\n  not an `OsExiter`. This exiting behavior was introduced in 1.19.0, but was\n  determined to be a regression in functionality. See [the\n  PR](https://github.com/urfave/cli/pull/595) for discussion.\n\n### Added\n\n* `CommandsByName` type was added to make it easy to sort `Command`s by name,\n  alphabetically\n* `altsrc` now handles loading of string and int arrays from TOML\n* Support for definition of custom help templates for `App` via\n  `CustomAppHelpTemplate`\n* Support for arbitrary key/value fields on `App` to be used with\n  `CustomAppHelpTemplate` via `ExtraInfo`\n* `HelpFlag`, `VersionFlag`, and `BashCompletionFlag` changed to explictly be\n  `cli.Flag`s allowing for the use of custom flags satisfying the `cli.Flag`\n  interface to be used.\n\n\n## [1.19.1] - 2016-11-21\n\n### Fixed\n\n- Fixes regression introduced in 1.19.0 where using an `ActionFunc` as\n  the `Action` for a command would cause it to error rather than calling the\n  function. Should not have a affected declarative cases using `func(c\n  *cli.Context) err)`.\n- Shell completion now handles the case where the user specifies\n  `--generate-bash-completion` immediately after a flag that takes an argument.\n  Previously it call the application with `--generate-bash-completion` as the\n  flag value.\n\n## [1.19.0] - 2016-11-19\n### Added\n- `FlagsByName` was added to make it easy to sort flags (e.g. `sort.Sort(cli.FlagsByName(app.Flags))`)\n- A `Description` field was added to `App` for a more detailed description of\n  the application (similar to the existing `Description` field on `Command`)\n- Flag type code generation via `go generate`\n- Write to stderr and exit 1 if action returns non-nil error\n- Added support for TOML to the `altsrc` loader\n- `SkipArgReorder` was added to allow users to skip the argument reordering.\n  This is useful if you want to consider all \"flags\" after an argument as\n  arguments rather than flags (the default behavior of the stdlib `flag`\n  library). This is backported functionality from the [removal of the flag\n  reordering](https://github.com/urfave/cli/pull/398) in the unreleased version\n  2\n- For formatted errors (those implementing `ErrorFormatter`), the errors will\n  be formatted during output. Compatible with `pkg/errors`.\n\n### Changed\n- Raise minimum tested/supported Go version to 1.2+\n\n### Fixed\n- Consider empty environment variables as set (previously environment variables\n  with the equivalent of `\"\"` would be skipped rather than their value used).\n- Return an error if the value in a given environment variable cannot be parsed\n  as the flag type. Previously these errors were silently swallowed.\n- Print full error when an invalid flag is specified (which includes the invalid flag)\n- `App.Writer` defaults to `stdout` when `nil`\n- If no action is specified on a command or app, the help is now printed instead of `panic`ing\n- `App.Metadata` is initialized automatically now (previously was `nil` unless initialized)\n- Correctly show help message if `-h` is provided to a subcommand\n- `context.(Global)IsSet` now respects environment variables. Previously it\n  would return `false` if a flag was specified in the environment rather than\n  as an argument\n- Removed deprecation warnings to STDERR to avoid them leaking to the end-user\n- `altsrc`s import paths were updated to use `gopkg.in/urfave/cli.v1`. This\n  fixes issues that occurred when `gopkg.in/urfave/cli.v1` was imported as well\n  as `altsrc` where Go would complain that the types didn't match\n\n## [1.18.1] - 2016-08-28\n### Fixed\n- Removed deprecation warnings to STDERR to avoid them leaking to the end-user (backported)\n\n## [1.18.0] - 2016-06-27\n### Added\n- `./runtests` test runner with coverage tracking by default\n- testing on OS X\n- testing on Windows\n- `UintFlag`, `Uint64Flag`, and `Int64Flag` types and supporting code\n\n### Changed\n- Use spaces for alignment in help/usage output instead of tabs, making the\n  output alignment consistent regardless of tab width\n\n### Fixed\n- Printing of command aliases in help text\n- Printing of visible flags for both struct and struct pointer flags\n- Display the `help` subcommand when using `CommandCategories`\n- No longer swallows `panic`s that occur within the `Action`s themselves when\n  detecting the signature of the `Action` field\n\n## [1.17.1] - 2016-08-28\n### Fixed\n- Removed deprecation warnings to STDERR to avoid them leaking to the end-user\n\n## [1.17.0] - 2016-05-09\n### Added\n- Pluggable flag-level help text rendering via `cli.DefaultFlagStringFunc`\n- `context.GlobalBoolT` was added as an analogue to `context.GlobalBool`\n- Support for hiding commands by setting `Hidden: true` -- this will hide the\n  commands in help output\n\n### Changed\n- `Float64Flag`, `IntFlag`, and `DurationFlag` default values are no longer\n  quoted in help text output.\n- All flag types now include `(default: {value})` strings following usage when a\n  default value can be (reasonably) detected.\n- `IntSliceFlag` and `StringSliceFlag` usage strings are now more consistent\n  with non-slice flag types\n- Apps now exit with a code of 3 if an unknown subcommand is specified\n  (previously they printed \"No help topic for...\", but still exited 0. This\n  makes it easier to script around apps built using `cli` since they can trust\n  that a 0 exit code indicated a successful execution.\n- cleanups based on [Go Report Card\n  feedback](https://goreportcard.com/report/github.com/urfave/cli)\n\n## [1.16.1] - 2016-08-28\n### Fixed\n- Removed deprecation warnings to STDERR to avoid them leaking to the end-user\n\n## [1.16.0] - 2016-05-02\n### Added\n- `Hidden` field on all flag struct types to omit from generated help text\n\n### Changed\n- `BashCompletionFlag` (`--enable-bash-completion`) is now omitted from\ngenerated help text via the `Hidden` field\n\n### Fixed\n- handling of error values in `HandleAction` and `HandleExitCoder`\n\n## [1.15.0] - 2016-04-30\n### Added\n- This file!\n- Support for placeholders in flag usage strings\n- `App.Metadata` map for arbitrary data/state management\n- `Set` and `GlobalSet` methods on `*cli.Context` for altering values after\nparsing.\n- Support for nested lookup of dot-delimited keys in structures loaded from\nYAML.\n\n### Changed\n- The `App.Action` and `Command.Action` now prefer a return signature of\n`func(*cli.Context) error`, as defined by `cli.ActionFunc`.  If a non-nil\n`error` is returned, there may be two outcomes:\n    - If the error fulfills `cli.ExitCoder`, then `os.Exit` will be called\n    automatically\n    - Else the error is bubbled up and returned from `App.Run`\n- Specifying an `Action` with the legacy return signature of\n`func(*cli.Context)` will produce a deprecation message to stderr\n- Specifying an `Action` that is not a `func` type will produce a non-zero exit\nfrom `App.Run`\n- Specifying an `Action` func that has an invalid (input) signature will\nproduce a non-zero exit from `App.Run`\n\n### Deprecated\n- <a name=\"deprecated-cli-app-runandexitonerror\"></a>\n`cli.App.RunAndExitOnError`, which should now be done by returning an error\nthat fulfills `cli.ExitCoder` to `cli.App.Run`.\n- <a name=\"deprecated-cli-app-action-signature\"></a> the legacy signature for\n`cli.App.Action` of `func(*cli.Context)`, which should now have a return\nsignature of `func(*cli.Context) error`, as defined by `cli.ActionFunc`.\n\n### Fixed\n- Added missing `*cli.Context.GlobalFloat64` method\n\n## [1.14.0] - 2016-04-03 (backfilled 2016-04-25)\n### Added\n- Codebeat badge\n- Support for categorization via `CategorizedHelp` and `Categories` on app.\n\n### Changed\n- Use `filepath.Base` instead of `path.Base` in `Name` and `HelpName`.\n\n### Fixed\n- Ensure version is not shown in help text when `HideVersion` set.\n\n## [1.13.0] - 2016-03-06 (backfilled 2016-04-25)\n### Added\n- YAML file input support.\n- `NArg` method on context.\n\n## [1.12.0] - 2016-02-17 (backfilled 2016-04-25)\n### Added\n- Custom usage error handling.\n- Custom text support in `USAGE` section of help output.\n- Improved help messages for empty strings.\n- AppVeyor CI configuration.\n\n### Changed\n- Removed `panic` from default help printer func.\n- De-duping and optimizations.\n\n### Fixed\n- Correctly handle `Before`/`After` at command level when no subcommands.\n- Case of literal `-` argument causing flag reordering.\n- Environment variable hints on Windows.\n- Docs updates.\n\n## [1.11.1] - 2015-12-21 (backfilled 2016-04-25)\n### Changed\n- Use `path.Base` in `Name` and `HelpName`\n- Export `GetName` on flag types.\n\n### Fixed\n- Flag parsing when skipping is enabled.\n- Test output cleanup.\n- Move completion check to account for empty input case.\n\n## [1.11.0] - 2015-11-15 (backfilled 2016-04-25)\n### Added\n- Destination scan support for flags.\n- Testing against `tip` in Travis CI config.\n\n### Changed\n- Go version in Travis CI config.\n\n### Fixed\n- Removed redundant tests.\n- Use correct example naming in tests.\n\n## [1.10.2] - 2015-10-29 (backfilled 2016-04-25)\n### Fixed\n- Remove unused var in bash completion.\n\n## [1.10.1] - 2015-10-21 (backfilled 2016-04-25)\n### Added\n- Coverage and reference logos in README.\n\n### Fixed\n- Use specified values in help and version parsing.\n- Only display app version and help message once.\n\n## [1.10.0] - 2015-10-06 (backfilled 2016-04-25)\n### Added\n- More tests for existing functionality.\n- `ArgsUsage` at app and command level for help text flexibility.\n\n### Fixed\n- Honor `HideHelp` and `HideVersion` in `App.Run`.\n- Remove juvenile word from README.\n\n## [1.9.0] - 2015-09-08 (backfilled 2016-04-25)\n### Added\n- `FullName` on command with accompanying help output update.\n- Set default `$PROG` in bash completion.\n\n### Changed\n- Docs formatting.\n\n### Fixed\n- Removed self-referential imports in tests.\n\n## [1.8.0] - 2015-06-30 (backfilled 2016-04-25)\n### Added\n- Support for `Copyright` at app level.\n- `Parent` func at context level to walk up context lineage.\n\n### Fixed\n- Global flag processing at top level.\n\n## [1.7.1] - 2015-06-11 (backfilled 2016-04-25)\n### Added\n- Aggregate errors from `Before`/`After` funcs.\n- Doc comments on flag structs.\n- Include non-global flags when checking version and help.\n- Travis CI config updates.\n\n### Fixed\n- Ensure slice type flags have non-nil values.\n- Collect global flags from the full command hierarchy.\n- Docs prose.\n\n## [1.7.0] - 2015-05-03 (backfilled 2016-04-25)\n### Changed\n- `HelpPrinter` signature includes output writer.\n\n### Fixed\n- Specify go 1.1+ in docs.\n- Set `Writer` when running command as app.\n\n## [1.6.0] - 2015-03-23 (backfilled 2016-04-25)\n### Added\n- Multiple author support.\n- `NumFlags` at context level.\n- `Aliases` at command level.\n\n### Deprecated\n- `ShortName` at command level.\n\n### Fixed\n- Subcommand help output.\n- Backward compatible support for deprecated `Author` and `Email` fields.\n- Docs regarding `Names`/`Aliases`.\n\n## [1.5.0] - 2015-02-20 (backfilled 2016-04-25)\n### Added\n- `After` hook func support at app and command level.\n\n### Fixed\n- Use parsed context when running command as subcommand.\n- Docs prose.\n\n## [1.4.1] - 2015-01-09 (backfilled 2016-04-25)\n### Added\n- Support for hiding `-h / --help` flags, but not `help` subcommand.\n- Stop flag parsing after `--`.\n\n### Fixed\n- Help text for generic flags to specify single value.\n- Use double quotes in output for defaults.\n- Use `ParseInt` instead of `ParseUint` for int environment var values.\n- Use `0` as base when parsing int environment var values.\n\n## [1.4.0] - 2014-12-12 (backfilled 2016-04-25)\n### Added\n- Support for environment variable lookup \"cascade\".\n- Support for `Stdout` on app for output redirection.\n\n### Fixed\n- Print command help instead of app help in `ShowCommandHelp`.\n\n## [1.3.1] - 2014-11-13 (backfilled 2016-04-25)\n### Added\n- Docs and example code updates.\n\n### Changed\n- Default `-v / --version` flag made optional.\n\n## [1.3.0] - 2014-08-10 (backfilled 2016-04-25)\n### Added\n- `FlagNames` at context level.\n- Exposed `VersionPrinter` var for more control over version output.\n- Zsh completion hook.\n- `AUTHOR` section in default app help template.\n- Contribution guidelines.\n- `DurationFlag` type.\n\n## [1.2.0] - 2014-08-02\n### Added\n- Support for environment variable defaults on flags plus tests.\n\n## [1.1.0] - 2014-07-15\n### Added\n- Bash completion.\n- Optional hiding of built-in help command.\n- Optional skipping of flag parsing at command level.\n- `Author`, `Email`, and `Compiled` metadata on app.\n- `Before` hook func support at app and command level.\n- `CommandNotFound` func support at app level.\n- Command reference available on context.\n- `GenericFlag` type.\n- `Float64Flag` type.\n- `BoolTFlag` type.\n- `IsSet` flag helper on context.\n- More flag lookup funcs at context level.\n- More tests &amp; docs.\n\n### Changed\n- Help template updates to account for presence/absence of flags.\n- Separated subcommand help template.\n- Exposed `HelpPrinter` var for more control over help output.\n\n## [1.0.0] - 2013-11-01\n### Added\n- `help` flag in default app flag set and each command flag set.\n- Custom handling of argument parsing errors.\n- Command lookup by name at app level.\n- `StringSliceFlag` type and supporting `StringSlice` type.\n- `IntSliceFlag` type and supporting `IntSlice` type.\n- Slice type flag lookups by name at context level.\n- Export of app and command help functions.\n- More tests &amp; docs.\n\n## 0.1.0 - 2013-07-22\n### Added\n- Initial implementation.\n\n[Unreleased]: https://github.com/urfave/cli/compare/v1.18.0...HEAD\n[1.18.0]: https://github.com/urfave/cli/compare/v1.17.0...v1.18.0\n[1.17.0]: https://github.com/urfave/cli/compare/v1.16.0...v1.17.0\n[1.16.0]: https://github.com/urfave/cli/compare/v1.15.0...v1.16.0\n[1.15.0]: https://github.com/urfave/cli/compare/v1.14.0...v1.15.0\n[1.14.0]: https://github.com/urfave/cli/compare/v1.13.0...v1.14.0\n[1.13.0]: https://github.com/urfave/cli/compare/v1.12.0...v1.13.0\n[1.12.0]: https://github.com/urfave/cli/compare/v1.11.1...v1.12.0\n[1.11.1]: https://github.com/urfave/cli/compare/v1.11.0...v1.11.1\n[1.11.0]: https://github.com/urfave/cli/compare/v1.10.2...v1.11.0\n[1.10.2]: https://github.com/urfave/cli/compare/v1.10.1...v1.10.2\n[1.10.1]: https://github.com/urfave/cli/compare/v1.10.0...v1.10.1\n[1.10.0]: https://github.com/urfave/cli/compare/v1.9.0...v1.10.0\n[1.9.0]: https://github.com/urfave/cli/compare/v1.8.0...v1.9.0\n[1.8.0]: https://github.com/urfave/cli/compare/v1.7.1...v1.8.0\n[1.7.1]: https://github.com/urfave/cli/compare/v1.7.0...v1.7.1\n[1.7.0]: https://github.com/urfave/cli/compare/v1.6.0...v1.7.0\n[1.6.0]: https://github.com/urfave/cli/compare/v1.5.0...v1.6.0\n[1.5.0]: https://github.com/urfave/cli/compare/v1.4.1...v1.5.0\n[1.4.1]: https://github.com/urfave/cli/compare/v1.4.0...v1.4.1\n[1.4.0]: https://github.com/urfave/cli/compare/v1.3.1...v1.4.0\n[1.3.1]: https://github.com/urfave/cli/compare/v1.3.0...v1.3.1\n[1.3.0]: https://github.com/urfave/cli/compare/v1.2.0...v1.3.0\n[1.2.0]: https://github.com/urfave/cli/compare/v1.1.0...v1.2.0\n[1.1.0]: https://github.com/urfave/cli/compare/v1.0.0...v1.1.0\n[1.0.0]: https://github.com/urfave/cli/compare/v0.1.0...v1.0.0\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2016 Jeremy Saenz & Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/README.md",
    "content": "cli\n===\n\n[![Build Status](https://travis-ci.org/urfave/cli.svg?branch=master)](https://travis-ci.org/urfave/cli)\n[![Windows Build Status](https://ci.appveyor.com/api/projects/status/rtgk5xufi932pb2v?svg=true)](https://ci.appveyor.com/project/urfave/cli)\n[![GoDoc](https://godoc.org/github.com/urfave/cli?status.svg)](https://godoc.org/github.com/urfave/cli)\n[![codebeat](https://codebeat.co/badges/0a8f30aa-f975-404b-b878-5fab3ae1cc5f)](https://codebeat.co/projects/github-com-urfave-cli)\n[![Go Report Card](https://goreportcard.com/badge/urfave/cli)](https://goreportcard.com/report/urfave/cli)\n[![top level coverage](https://gocover.io/_badge/github.com/urfave/cli?0 \"top level coverage\")](http://gocover.io/github.com/urfave/cli) /\n[![altsrc coverage](https://gocover.io/_badge/github.com/urfave/cli/altsrc?0 \"altsrc coverage\")](http://gocover.io/github.com/urfave/cli/altsrc)\n\n**Notice:** This is the library formerly known as\n`github.com/codegangsta/cli` -- Github will automatically redirect requests\nto this repository, but we recommend updating your references for clarity.\n\ncli is a simple, fast, and fun package for building command line apps in Go. The\ngoal is to enable developers to write fast and distributable command line\napplications in an expressive way.\n\n<!-- toc -->\n\n- [Overview](#overview)\n- [Installation](#installation)\n  * [Supported platforms](#supported-platforms)\n  * [Using the `v2` branch](#using-the-v2-branch)\n  * [Pinning to the `v1` releases](#pinning-to-the-v1-releases)\n- [Getting Started](#getting-started)\n- [Examples](#examples)\n  * [Arguments](#arguments)\n  * [Flags](#flags)\n    + [Placeholder Values](#placeholder-values)\n    + [Alternate Names](#alternate-names)\n    + [Ordering](#ordering)\n    + [Values from the Environment](#values-from-the-environment)\n    + [Values from files](#values-from-files)\n    + [Values from alternate input sources (YAML, TOML, and others)](#values-from-alternate-input-sources-yaml-toml-and-others)\n    + [Precedence](#precedence)\n  * [Subcommands](#subcommands)\n  * [Subcommands categories](#subcommands-categories)\n  * [Exit code](#exit-code)\n  * [Bash Completion](#bash-completion)\n    + [Enabling](#enabling)\n    + [Distribution](#distribution)\n    + [Customization](#customization)\n  * [Generated Help Text](#generated-help-text)\n    + [Customization](#customization-1)\n  * [Version Flag](#version-flag)\n    + [Customization](#customization-2)\n    + [Full API Example](#full-api-example)\n  * [Combining short Bool options](#combining-short-bool-options)\n- [Contribution Guidelines](#contribution-guidelines)\n\n<!-- tocstop -->\n\n## Overview\n\nCommand line apps are usually so tiny that there is absolutely no reason why\nyour code should *not* be self-documenting. Things like generating help text and\nparsing command flags/options should not hinder productivity when writing a\ncommand line app.\n\n**This is where cli comes into play.** cli makes command line programming fun,\norganized, and expressive!\n\n## Installation\n\nMake sure you have a working Go environment.  Go version 1.2+ is supported.  [See\nthe install instructions for Go](http://golang.org/doc/install.html).\n\nTo install cli, simply run:\n```\n$ go get github.com/urfave/cli\n```\n\nMake sure your `PATH` includes the `$GOPATH/bin` directory so your commands can\nbe easily used:\n```\nexport PATH=$PATH:$GOPATH/bin\n```\n\n### Supported platforms\n\ncli is tested against multiple versions of Go on Linux, and against the latest\nreleased version of Go on OS X and Windows.  For full details, see\n[`./.travis.yml`](./.travis.yml) and [`./appveyor.yml`](./appveyor.yml).\n\n### Using the `v2` branch\n\n**Warning**: The `v2` branch is currently unreleased and considered unstable.\n\nThere is currently a long-lived branch named `v2` that is intended to land as\nthe new `master` branch once development there has settled down.  The current\n`master` branch (mirrored as `v1`) is being manually merged into `v2` on\nan irregular human-based schedule, but generally if one wants to \"upgrade\" to\n`v2` *now* and accept the volatility (read: \"awesomeness\") that comes along with\nthat, please use whatever version pinning of your preference, such as via\n`gopkg.in`:\n\n```\n$ go get gopkg.in/urfave/cli.v2\n```\n\n``` go\n...\nimport (\n  \"gopkg.in/urfave/cli.v2\" // imports as package \"cli\"\n)\n...\n```\n\n### Pinning to the `v1` releases\n\nSimilarly to the section above describing use of the `v2` branch, if one wants\nto avoid any unexpected compatibility pains once `v2` becomes `master`, then\npinning to `v1` is an acceptable option, e.g.:\n\n```\n$ go get gopkg.in/urfave/cli.v1\n```\n\n``` go\n...\nimport (\n  \"gopkg.in/urfave/cli.v1\" // imports as package \"cli\"\n)\n...\n```\n\nThis will pull the latest tagged `v1` release (e.g. `v1.18.1` at the time of writing).\n\n## Getting Started\n\nOne of the philosophies behind cli is that an API should be playful and full of\ndiscovery. So a cli app can be as little as one line of code in `main()`.\n\n<!-- {\n  \"args\": [\"&#45;&#45;help\"],\n  \"output\": \"A new cli application\"\n} -->\n``` go\npackage main\n\nimport (\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  cli.NewApp().Run(os.Args)\n}\n```\n\nThis app will run and show help text, but is not very useful. Let's give an\naction to execute and some help documentation:\n\n<!-- {\n  \"output\": \"boom! I say!\"\n} -->\n``` go\npackage main\n\nimport (\n  \"fmt\"\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n  app.Name = \"boom\"\n  app.Usage = \"make an explosive entrance\"\n  app.Action = func(c *cli.Context) error {\n    fmt.Println(\"boom! I say!\")\n    return nil\n  }\n\n  app.Run(os.Args)\n}\n```\n\nRunning this already gives you a ton of functionality, plus support for things\nlike subcommands and flags, which are covered below.\n\n## Examples\n\nBeing a programmer can be a lonely job. Thankfully by the power of automation\nthat is not the case! Let's create a greeter app to fend off our demons of\nloneliness!\n\nStart by creating a directory named `greet`, and within it, add a file,\n`greet.go` with the following code in it:\n\n<!-- {\n  \"output\": \"Hello friend!\"\n} -->\n``` go\npackage main\n\nimport (\n  \"fmt\"\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n  app.Name = \"greet\"\n  app.Usage = \"fight the loneliness!\"\n  app.Action = func(c *cli.Context) error {\n    fmt.Println(\"Hello friend!\")\n    return nil\n  }\n\n  app.Run(os.Args)\n}\n```\n\nInstall our command to the `$GOPATH/bin` directory:\n\n```\n$ go install\n```\n\nFinally run our new command:\n\n```\n$ greet\nHello friend!\n```\n\ncli also generates neat help text:\n\n```\n$ greet help\nNAME:\n    greet - fight the loneliness!\n\nUSAGE:\n    greet [global options] command [command options] [arguments...]\n\nVERSION:\n    0.0.0\n\nCOMMANDS:\n    help, h  Shows a list of commands or help for one command\n\nGLOBAL OPTIONS\n    --version Shows version information\n```\n\n### Arguments\n\nYou can lookup arguments by calling the `Args` function on `cli.Context`, e.g.:\n\n<!-- {\n  \"output\": \"Hello \\\"\"\n} -->\n``` go\npackage main\n\nimport (\n  \"fmt\"\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n\n  app.Action = func(c *cli.Context) error {\n    fmt.Printf(\"Hello %q\", c.Args().Get(0))\n    return nil\n  }\n\n  app.Run(os.Args)\n}\n```\n\n### Flags\n\nSetting and querying flags is simple.\n\n<!-- {\n  \"output\": \"Hello Nefertiti\"\n} -->\n``` go\npackage main\n\nimport (\n  \"fmt\"\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n\n  app.Flags = []cli.Flag {\n    cli.StringFlag{\n      Name: \"lang\",\n      Value: \"english\",\n      Usage: \"language for the greeting\",\n    },\n  }\n\n  app.Action = func(c *cli.Context) error {\n    name := \"Nefertiti\"\n    if c.NArg() > 0 {\n      name = c.Args().Get(0)\n    }\n    if c.String(\"lang\") == \"spanish\" {\n      fmt.Println(\"Hola\", name)\n    } else {\n      fmt.Println(\"Hello\", name)\n    }\n    return nil\n  }\n\n  app.Run(os.Args)\n}\n```\n\nYou can also set a destination variable for a flag, to which the content will be\nscanned.\n\n<!-- {\n  \"output\": \"Hello someone\"\n} -->\n``` go\npackage main\n\nimport (\n  \"os\"\n  \"fmt\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  var language string\n\n  app := cli.NewApp()\n\n  app.Flags = []cli.Flag {\n    cli.StringFlag{\n      Name:        \"lang\",\n      Value:       \"english\",\n      Usage:       \"language for the greeting\",\n      Destination: &language,\n    },\n  }\n\n  app.Action = func(c *cli.Context) error {\n    name := \"someone\"\n    if c.NArg() > 0 {\n      name = c.Args()[0]\n    }\n    if language == \"spanish\" {\n      fmt.Println(\"Hola\", name)\n    } else {\n      fmt.Println(\"Hello\", name)\n    }\n    return nil\n  }\n\n  app.Run(os.Args)\n}\n```\n\nSee full list of flags at http://godoc.org/github.com/urfave/cli\n\n#### Placeholder Values\n\nSometimes it's useful to specify a flag's value within the usage string itself.\nSuch placeholders are indicated with back quotes.\n\nFor example this:\n\n<!-- {\n  \"args\": [\"&#45;&#45;help\"],\n  \"output\": \"&#45;&#45;config FILE, &#45;c FILE\"\n} -->\n```go\npackage main\n\nimport (\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n\n  app.Flags = []cli.Flag{\n    cli.StringFlag{\n      Name:  \"config, c\",\n      Usage: \"Load configuration from `FILE`\",\n    },\n  }\n\n  app.Run(os.Args)\n}\n```\n\nWill result in help output like:\n\n```\n--config FILE, -c FILE   Load configuration from FILE\n```\n\nNote that only the first placeholder is used. Subsequent back-quoted words will\nbe left as-is.\n\n#### Alternate Names\n\nYou can set alternate (or short) names for flags by providing a comma-delimited\nlist for the `Name`. e.g.\n\n<!-- {\n  \"args\": [\"&#45;&#45;help\"],\n  \"output\": \"&#45;&#45;lang value, &#45;l value.*language for the greeting.*default: \\\"english\\\"\"\n} -->\n``` go\npackage main\n\nimport (\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n\n  app.Flags = []cli.Flag {\n    cli.StringFlag{\n      Name: \"lang, l\",\n      Value: \"english\",\n      Usage: \"language for the greeting\",\n    },\n  }\n\n  app.Run(os.Args)\n}\n```\n\nThat flag can then be set with `--lang spanish` or `-l spanish`. Note that\ngiving two different forms of the same flag in the same command invocation is an\nerror.\n\n#### Ordering\n\nFlags for the application and commands are shown in the order they are defined.\nHowever, it's possible to sort them from outside this library by using `FlagsByName`\nor `CommandsByName` with `sort`.\n\nFor example this:\n\n<!-- {\n  \"args\": [\"&#45;&#45;help\"],\n  \"output\": \"add a task to the list\\n.*complete a task on the list\\n.*\\n\\n.*\\n.*Load configuration from FILE\\n.*Language for the greeting.*\"\n} -->\n``` go\npackage main\n\nimport (\n  \"os\"\n  \"sort\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n\n  app.Flags = []cli.Flag {\n    cli.StringFlag{\n      Name: \"lang, l\",\n      Value: \"english\",\n      Usage: \"Language for the greeting\",\n    },\n    cli.StringFlag{\n      Name: \"config, c\",\n      Usage: \"Load configuration from `FILE`\",\n    },\n  }\n\n  app.Commands = []cli.Command{\n    {\n      Name:    \"complete\",\n      Aliases: []string{\"c\"},\n      Usage:   \"complete a task on the list\",\n      Action:  func(c *cli.Context) error {\n        return nil\n      },\n    },\n    {\n      Name:    \"add\",\n      Aliases: []string{\"a\"},\n      Usage:   \"add a task to the list\",\n      Action:  func(c *cli.Context) error {\n        return nil\n      },\n    },\n  }\n\n  sort.Sort(cli.FlagsByName(app.Flags))\n  sort.Sort(cli.CommandsByName(app.Commands))\n\n  app.Run(os.Args)\n}\n```\n\nWill result in help output like:\n\n```\n--config FILE, -c FILE  Load configuration from FILE\n--lang value, -l value  Language for the greeting (default: \"english\")\n```\n\n#### Values from the Environment\n\nYou can also have the default value set from the environment via `EnvVar`.  e.g.\n\n<!-- {\n  \"args\": [\"&#45;&#45;help\"],\n  \"output\": \"language for the greeting.*APP_LANG\"\n} -->\n``` go\npackage main\n\nimport (\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n\n  app.Flags = []cli.Flag {\n    cli.StringFlag{\n      Name: \"lang, l\",\n      Value: \"english\",\n      Usage: \"language for the greeting\",\n      EnvVar: \"APP_LANG\",\n    },\n  }\n\n  app.Run(os.Args)\n}\n```\n\nThe `EnvVar` may also be given as a comma-delimited \"cascade\", where the first\nenvironment variable that resolves is used as the default.\n\n<!-- {\n  \"args\": [\"&#45;&#45;help\"],\n  \"output\": \"language for the greeting.*LEGACY_COMPAT_LANG.*APP_LANG.*LANG\"\n} -->\n``` go\npackage main\n\nimport (\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n\n  app.Flags = []cli.Flag {\n    cli.StringFlag{\n      Name: \"lang, l\",\n      Value: \"english\",\n      Usage: \"language for the greeting\",\n      EnvVar: \"LEGACY_COMPAT_LANG,APP_LANG,LANG\",\n    },\n  }\n\n  app.Run(os.Args)\n}\n```\n\n#### Values from files\n\nYou can also have the default value set from file via `FilePath`.  e.g.\n\n<!-- {\n  \"args\": [\"&#45;&#45;help\"],\n  \"output\": \"password for the mysql database\"\n} -->\n``` go\npackage main\n\nimport (\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n\n  app.Flags = []cli.Flag {\n    cli.StringFlag{\n      Name: \"password, p\",\n      Usage: \"password for the mysql database\",\n      FilePath: \"/etc/mysql/password\",\n    },\n  }\n\n  app.Run(os.Args)\n}\n```\n\nNote that default values set from file (e.g. `FilePath`) take precedence over\ndefault values set from the enviornment (e.g. `EnvVar`).\n\n#### Values from alternate input sources (YAML, TOML, and others)\n\nThere is a separate package altsrc that adds support for getting flag values\nfrom other file input sources.\n\nCurrently supported input source formats:\n* YAML\n* TOML\n\nIn order to get values for a flag from an alternate input source the following\ncode would be added to wrap an existing cli.Flag like below:\n\n``` go\n  altsrc.NewIntFlag(cli.IntFlag{Name: \"test\"})\n```\n\nInitialization must also occur for these flags. Below is an example initializing\ngetting data from a yaml file below.\n\n``` go\n  command.Before = altsrc.InitInputSourceWithContext(command.Flags, NewYamlSourceFromFlagFunc(\"load\"))\n```\n\nThe code above will use the \"load\" string as a flag name to get the file name of\na yaml file from the cli.Context.  It will then use that file name to initialize\nthe yaml input source for any flags that are defined on that command.  As a note\nthe \"load\" flag used would also have to be defined on the command flags in order\nfor this code snipped to work.\n\nCurrently only the aboved specified formats are supported but developers can\nadd support for other input sources by implementing the\naltsrc.InputSourceContext for their given sources.\n\nHere is a more complete sample of a command using YAML support:\n\n<!-- {\n  \"args\": [\"test-cmd\", \"&#45;&#45;help\"],\n  \"output\": \"&#45&#45;test value.*default: 0\"\n} -->\n``` go\npackage notmain\n\nimport (\n  \"fmt\"\n  \"os\"\n\n  \"github.com/urfave/cli\"\n  \"github.com/urfave/cli/altsrc\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n\n  flags := []cli.Flag{\n    altsrc.NewIntFlag(cli.IntFlag{Name: \"test\"}),\n    cli.StringFlag{Name: \"load\"},\n  }\n\n  app.Action = func(c *cli.Context) error {\n    fmt.Println(\"yaml ist rad\")\n    return nil\n  }\n\n  app.Before = altsrc.InitInputSourceWithContext(flags, altsrc.NewYamlSourceFromFlagFunc(\"load\"))\n  app.Flags = flags\n\n  app.Run(os.Args)\n}\n```\n\n#### Precedence\n\nThe precedence for flag value sources is as follows (highest to lowest):\n\n0. Command line flag value from user\n0. Environment variable (if specified)\n0. Configuration file (if specified)\n0. Default defined on the flag\n\n### Subcommands\n\nSubcommands can be defined for a more git-like command line app.\n\n<!-- {\n  \"args\": [\"template\", \"add\"],\n  \"output\": \"new task template: .+\"\n} -->\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n\n  app.Commands = []cli.Command{\n    {\n      Name:    \"add\",\n      Aliases: []string{\"a\"},\n      Usage:   \"add a task to the list\",\n      Action:  func(c *cli.Context) error {\n        fmt.Println(\"added task: \", c.Args().First())\n        return nil\n      },\n    },\n    {\n      Name:    \"complete\",\n      Aliases: []string{\"c\"},\n      Usage:   \"complete a task on the list\",\n      Action:  func(c *cli.Context) error {\n        fmt.Println(\"completed task: \", c.Args().First())\n        return nil\n      },\n    },\n    {\n      Name:        \"template\",\n      Aliases:     []string{\"t\"},\n      Usage:       \"options for task templates\",\n      Subcommands: []cli.Command{\n        {\n          Name:  \"add\",\n          Usage: \"add a new template\",\n          Action: func(c *cli.Context) error {\n            fmt.Println(\"new task template: \", c.Args().First())\n            return nil\n          },\n        },\n        {\n          Name:  \"remove\",\n          Usage: \"remove an existing template\",\n          Action: func(c *cli.Context) error {\n            fmt.Println(\"removed task template: \", c.Args().First())\n            return nil\n          },\n        },\n      },\n    },\n  }\n\n  app.Run(os.Args)\n}\n```\n\n### Subcommands categories\n\nFor additional organization in apps that have many subcommands, you can\nassociate a category for each command to group them together in the help\noutput.\n\nE.g.\n\n```go\npackage main\n\nimport (\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n\n  app.Commands = []cli.Command{\n    {\n      Name: \"noop\",\n    },\n    {\n      Name:     \"add\",\n      Category: \"Template actions\",\n    },\n    {\n      Name:     \"remove\",\n      Category: \"Template actions\",\n    },\n  }\n\n  app.Run(os.Args)\n}\n```\n\nWill include:\n\n```\nCOMMANDS:\n    noop\n\n  Template actions:\n    add\n    remove\n```\n\n### Exit code\n\nCalling `App.Run` will not automatically call `os.Exit`, which means that by\ndefault the exit code will \"fall through\" to being `0`.  An explicit exit code\nmay be set by returning a non-nil error that fulfills `cli.ExitCoder`, *or* a\n`cli.MultiError` that includes an error that fulfills `cli.ExitCoder`, e.g.:\n\n``` go\npackage main\n\nimport (\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  app := cli.NewApp()\n  app.Flags = []cli.Flag{\n    cli.BoolTFlag{\n      Name:  \"ginger-crouton\",\n      Usage: \"is it in the soup?\",\n    },\n  }\n  app.Action = func(ctx *cli.Context) error {\n    if !ctx.Bool(\"ginger-crouton\") {\n      return cli.NewExitError(\"it is not in the soup\", 86)\n    }\n    return nil\n  }\n\n  app.Run(os.Args)\n}\n```\n\n### Bash Completion\n\nYou can enable completion commands by setting the `EnableBashCompletion`\nflag on the `App` object.  By default, this setting will only auto-complete to\nshow an app's subcommands, but you can write your own completion methods for\nthe App or its subcommands.\n\n<!-- {\n  \"args\": [\"complete\", \"&#45;&#45;generate&#45;bash&#45;completion\"],\n  \"output\": \"laundry\"\n} -->\n``` go\npackage main\n\nimport (\n  \"fmt\"\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  tasks := []string{\"cook\", \"clean\", \"laundry\", \"eat\", \"sleep\", \"code\"}\n\n  app := cli.NewApp()\n  app.EnableBashCompletion = true\n  app.Commands = []cli.Command{\n    {\n      Name:  \"complete\",\n      Aliases: []string{\"c\"},\n      Usage: \"complete a task on the list\",\n      Action: func(c *cli.Context) error {\n         fmt.Println(\"completed task: \", c.Args().First())\n         return nil\n      },\n      BashComplete: func(c *cli.Context) {\n        // This will complete if no args are passed\n        if c.NArg() > 0 {\n          return\n        }\n        for _, t := range tasks {\n          fmt.Println(t)\n        }\n      },\n    },\n  }\n\n  app.Run(os.Args)\n}\n```\n\n#### Enabling\n\nSource the `autocomplete/bash_autocomplete` file in your `.bashrc` file while\nsetting the `PROG` variable to the name of your program:\n\n`PROG=myprogram source /.../cli/autocomplete/bash_autocomplete`\n\n#### Distribution\n\nCopy `autocomplete/bash_autocomplete` into `/etc/bash_completion.d/` and rename\nit to the name of the program you wish to add autocomplete support for (or\nautomatically install it there if you are distributing a package). Don't forget\nto source the file to make it active in the current shell.\n\n```\nsudo cp src/bash_autocomplete /etc/bash_completion.d/<myprogram>\nsource /etc/bash_completion.d/<myprogram>\n```\n\nAlternatively, you can just document that users should source the generic\n`autocomplete/bash_autocomplete` in their bash configuration with `$PROG` set\nto the name of their program (as above).\n\n#### Customization\n\nThe default bash completion flag (`--generate-bash-completion`) is defined as\n`cli.BashCompletionFlag`, and may be redefined if desired, e.g.:\n\n<!-- {\n  \"args\": [\"&#45;&#45;compgen\"],\n  \"output\": \"wat\\nhelp\\nh\"\n} -->\n``` go\npackage main\n\nimport (\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  cli.BashCompletionFlag = cli.BoolFlag{\n    Name:   \"compgen\",\n    Hidden: true,\n  }\n\n  app := cli.NewApp()\n  app.EnableBashCompletion = true\n  app.Commands = []cli.Command{\n    {\n      Name: \"wat\",\n    },\n  }\n  app.Run(os.Args)\n}\n```\n\n### Generated Help Text\n\nThe default help flag (`-h/--help`) is defined as `cli.HelpFlag` and is checked\nby the cli internals in order to print generated help text for the app, command,\nor subcommand, and break execution.\n\n#### Customization\n\nAll of the help text generation may be customized, and at multiple levels.  The\ntemplates are exposed as variables `AppHelpTemplate`, `CommandHelpTemplate`, and\n`SubcommandHelpTemplate` which may be reassigned or augmented, and full override\nis possible by assigning a compatible func to the `cli.HelpPrinter` variable,\ne.g.:\n\n<!-- {\n  \"output\": \"Ha HA.  I pwnd the help!!1\"\n} -->\n``` go\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  // EXAMPLE: Append to an existing template\n  cli.AppHelpTemplate = fmt.Sprintf(`%s\n\nWEBSITE: http://awesometown.example.com\n\nSUPPORT: support@awesometown.example.com\n\n`, cli.AppHelpTemplate)\n\n  // EXAMPLE: Override a template\n  cli.AppHelpTemplate = `NAME:\n   {{.Name}} - {{.Usage}}\nUSAGE:\n   {{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}\n   {{if len .Authors}}\nAUTHOR:\n   {{range .Authors}}{{ . }}{{end}}\n   {{end}}{{if .Commands}}\nCOMMANDS:\n{{range .Commands}}{{if not .HideHelp}}   {{join .Names \", \"}}{{ \"\\t\"}}{{.Usage}}{{ \"\\n\" }}{{end}}{{end}}{{end}}{{if .VisibleFlags}}\nGLOBAL OPTIONS:\n   {{range .VisibleFlags}}{{.}}\n   {{end}}{{end}}{{if .Copyright }}\nCOPYRIGHT:\n   {{.Copyright}}\n   {{end}}{{if .Version}}\nVERSION:\n   {{.Version}}\n   {{end}}\n`\n\n  // EXAMPLE: Replace the `HelpPrinter` func\n  cli.HelpPrinter = func(w io.Writer, templ string, data interface{}) {\n    fmt.Println(\"Ha HA.  I pwnd the help!!1\")\n  }\n\n  cli.NewApp().Run(os.Args)\n}\n```\n\nThe default flag may be customized to something other than `-h/--help` by\nsetting `cli.HelpFlag`, e.g.:\n\n<!-- {\n  \"args\": [\"&#45;&#45halp\"],\n  \"output\": \"haaaaalp.*HALP\"\n} -->\n``` go\npackage main\n\nimport (\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  cli.HelpFlag = cli.BoolFlag{\n    Name: \"halp, haaaaalp\",\n    Usage: \"HALP\",\n    EnvVar: \"SHOW_HALP,HALPPLZ\",\n  }\n\n  cli.NewApp().Run(os.Args)\n}\n```\n\n### Version Flag\n\nThe default version flag (`-v/--version`) is defined as `cli.VersionFlag`, which\nis checked by the cli internals in order to print the `App.Version` via\n`cli.VersionPrinter` and break execution.\n\n#### Customization\n\nThe default flag may be customized to something other than `-v/--version` by\nsetting `cli.VersionFlag`, e.g.:\n\n<!-- {\n  \"args\": [\"&#45;&#45print-version\"],\n  \"output\": \"partay version 19\\\\.99\\\\.0\"\n} -->\n``` go\npackage main\n\nimport (\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc main() {\n  cli.VersionFlag = cli.BoolFlag{\n    Name: \"print-version, V\",\n    Usage: \"print only the version\",\n  }\n\n  app := cli.NewApp()\n  app.Name = \"partay\"\n  app.Version = \"19.99.0\"\n  app.Run(os.Args)\n}\n```\n\nAlternatively, the version printer at `cli.VersionPrinter` may be overridden, e.g.:\n\n<!-- {\n  \"args\": [\"&#45;&#45version\"],\n  \"output\": \"version=19\\\\.99\\\\.0 revision=fafafaf\"\n} -->\n``` go\npackage main\n\nimport (\n  \"fmt\"\n  \"os\"\n\n  \"github.com/urfave/cli\"\n)\n\nvar (\n  Revision = \"fafafaf\"\n)\n\nfunc main() {\n  cli.VersionPrinter = func(c *cli.Context) {\n    fmt.Printf(\"version=%s revision=%s\\n\", c.App.Version, Revision)\n  }\n\n  app := cli.NewApp()\n  app.Name = \"partay\"\n  app.Version = \"19.99.0\"\n  app.Run(os.Args)\n}\n```\n\n#### Full API Example\n\n**Notice**: This is a contrived (functioning) example meant strictly for API\ndemonstration purposes.  Use of one's imagination is encouraged.\n\n<!-- {\n  \"output\": \"made it!\\nPhew!\"\n} -->\n``` go\npackage main\n\nimport (\n  \"errors\"\n  \"flag\"\n  \"fmt\"\n  \"io\"\n  \"io/ioutil\"\n  \"os\"\n  \"time\"\n\n  \"github.com/urfave/cli\"\n)\n\nfunc init() {\n  cli.AppHelpTemplate += \"\\nCUSTOMIZED: you bet ur muffins\\n\"\n  cli.CommandHelpTemplate += \"\\nYMMV\\n\"\n  cli.SubcommandHelpTemplate += \"\\nor something\\n\"\n\n  cli.HelpFlag = cli.BoolFlag{Name: \"halp\"}\n  cli.BashCompletionFlag = cli.BoolFlag{Name: \"compgen\", Hidden: true}\n  cli.VersionFlag = cli.BoolFlag{Name: \"print-version, V\"}\n\n  cli.HelpPrinter = func(w io.Writer, templ string, data interface{}) {\n    fmt.Fprintf(w, \"best of luck to you\\n\")\n  }\n  cli.VersionPrinter = func(c *cli.Context) {\n    fmt.Fprintf(c.App.Writer, \"version=%s\\n\", c.App.Version)\n  }\n  cli.OsExiter = func(c int) {\n    fmt.Fprintf(cli.ErrWriter, \"refusing to exit %d\\n\", c)\n  }\n  cli.ErrWriter = ioutil.Discard\n  cli.FlagStringer = func(fl cli.Flag) string {\n    return fmt.Sprintf(\"\\t\\t%s\", fl.GetName())\n  }\n}\n\ntype hexWriter struct{}\n\nfunc (w *hexWriter) Write(p []byte) (int, error) {\n  for _, b := range p {\n    fmt.Printf(\"%x\", b)\n  }\n  fmt.Printf(\"\\n\")\n\n  return len(p), nil\n}\n\ntype genericType struct{\n  s string\n}\n\nfunc (g *genericType) Set(value string) error {\n  g.s = value\n  return nil\n}\n\nfunc (g *genericType) String() string {\n  return g.s\n}\n\nfunc main() {\n  app := cli.NewApp()\n  app.Name = \"kənˈtrīv\"\n  app.Version = \"19.99.0\"\n  app.Compiled = time.Now()\n  app.Authors = []cli.Author{\n    cli.Author{\n      Name:  \"Example Human\",\n      Email: \"human@example.com\",\n    },\n  }\n  app.Copyright = \"(c) 1999 Serious Enterprise\"\n  app.HelpName = \"contrive\"\n  app.Usage = \"demonstrate available API\"\n  app.UsageText = \"contrive - demonstrating the available API\"\n  app.ArgsUsage = \"[args and such]\"\n  app.Commands = []cli.Command{\n    cli.Command{\n      Name:        \"doo\",\n      Aliases:     []string{\"do\"},\n      Category:    \"motion\",\n      Usage:       \"do the doo\",\n      UsageText:   \"doo - does the dooing\",\n      Description: \"no really, there is a lot of dooing to be done\",\n      ArgsUsage:   \"[arrgh]\",\n      Flags: []cli.Flag{\n        cli.BoolFlag{Name: \"forever, forevvarr\"},\n      },\n      Subcommands: cli.Commands{\n        cli.Command{\n          Name:   \"wop\",\n          Action: wopAction,\n        },\n      },\n      SkipFlagParsing: false,\n      HideHelp:        false,\n      Hidden:          false,\n      HelpName:        \"doo!\",\n      BashComplete: func(c *cli.Context) {\n        fmt.Fprintf(c.App.Writer, \"--better\\n\")\n      },\n      Before: func(c *cli.Context) error {\n        fmt.Fprintf(c.App.Writer, \"brace for impact\\n\")\n        return nil\n      },\n      After: func(c *cli.Context) error {\n        fmt.Fprintf(c.App.Writer, \"did we lose anyone?\\n\")\n        return nil\n      },\n      Action: func(c *cli.Context) error {\n        c.Command.FullName()\n        c.Command.HasName(\"wop\")\n        c.Command.Names()\n        c.Command.VisibleFlags()\n        fmt.Fprintf(c.App.Writer, \"dodododododoodododddooooododododooo\\n\")\n        if c.Bool(\"forever\") {\n          c.Command.Run(c)\n        }\n        return nil\n      },\n      OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error {\n        fmt.Fprintf(c.App.Writer, \"for shame\\n\")\n        return err\n      },\n    },\n  }\n  app.Flags = []cli.Flag{\n    cli.BoolFlag{Name: \"fancy\"},\n    cli.BoolTFlag{Name: \"fancier\"},\n    cli.DurationFlag{Name: \"howlong, H\", Value: time.Second * 3},\n    cli.Float64Flag{Name: \"howmuch\"},\n    cli.GenericFlag{Name: \"wat\", Value: &genericType{}},\n    cli.Int64Flag{Name: \"longdistance\"},\n    cli.Int64SliceFlag{Name: \"intervals\"},\n    cli.IntFlag{Name: \"distance\"},\n    cli.IntSliceFlag{Name: \"times\"},\n    cli.StringFlag{Name: \"dance-move, d\"},\n    cli.StringSliceFlag{Name: \"names, N\"},\n    cli.UintFlag{Name: \"age\"},\n    cli.Uint64Flag{Name: \"bigage\"},\n  }\n  app.EnableBashCompletion = true\n  app.HideHelp = false\n  app.HideVersion = false\n  app.BashComplete = func(c *cli.Context) {\n    fmt.Fprintf(c.App.Writer, \"lipstick\\nkiss\\nme\\nlipstick\\nringo\\n\")\n  }\n  app.Before = func(c *cli.Context) error {\n    fmt.Fprintf(c.App.Writer, \"HEEEERE GOES\\n\")\n    return nil\n  }\n  app.After = func(c *cli.Context) error {\n    fmt.Fprintf(c.App.Writer, \"Phew!\\n\")\n    return nil\n  }\n  app.CommandNotFound = func(c *cli.Context, command string) {\n    fmt.Fprintf(c.App.Writer, \"Thar be no %q here.\\n\", command)\n  }\n  app.OnUsageError = func(c *cli.Context, err error, isSubcommand bool) error {\n    if isSubcommand {\n      return err\n    }\n\n    fmt.Fprintf(c.App.Writer, \"WRONG: %#v\\n\", err)\n    return nil\n  }\n  app.Action = func(c *cli.Context) error {\n    cli.DefaultAppComplete(c)\n    cli.HandleExitCoder(errors.New(\"not an exit coder, though\"))\n    cli.ShowAppHelp(c)\n    cli.ShowCommandCompletions(c, \"nope\")\n    cli.ShowCommandHelp(c, \"also-nope\")\n    cli.ShowCompletions(c)\n    cli.ShowSubcommandHelp(c)\n    cli.ShowVersion(c)\n\n    categories := c.App.Categories()\n    categories.AddCommand(\"sounds\", cli.Command{\n      Name: \"bloop\",\n    })\n\n    for _, category := range c.App.Categories() {\n      fmt.Fprintf(c.App.Writer, \"%s\\n\", category.Name)\n      fmt.Fprintf(c.App.Writer, \"%#v\\n\", category.Commands)\n      fmt.Fprintf(c.App.Writer, \"%#v\\n\", category.VisibleCommands())\n    }\n\n    fmt.Printf(\"%#v\\n\", c.App.Command(\"doo\"))\n    if c.Bool(\"infinite\") {\n      c.App.Run([]string{\"app\", \"doo\", \"wop\"})\n    }\n\n    if c.Bool(\"forevar\") {\n      c.App.RunAsSubcommand(c)\n    }\n    c.App.Setup()\n    fmt.Printf(\"%#v\\n\", c.App.VisibleCategories())\n    fmt.Printf(\"%#v\\n\", c.App.VisibleCommands())\n    fmt.Printf(\"%#v\\n\", c.App.VisibleFlags())\n\n    fmt.Printf(\"%#v\\n\", c.Args().First())\n    if len(c.Args()) > 0 {\n      fmt.Printf(\"%#v\\n\", c.Args()[1])\n    }\n    fmt.Printf(\"%#v\\n\", c.Args().Present())\n    fmt.Printf(\"%#v\\n\", c.Args().Tail())\n\n    set := flag.NewFlagSet(\"contrive\", 0)\n    nc := cli.NewContext(c.App, set, c)\n\n    fmt.Printf(\"%#v\\n\", nc.Args())\n    fmt.Printf(\"%#v\\n\", nc.Bool(\"nope\"))\n    fmt.Printf(\"%#v\\n\", nc.BoolT(\"nerp\"))\n    fmt.Printf(\"%#v\\n\", nc.Duration(\"howlong\"))\n    fmt.Printf(\"%#v\\n\", nc.Float64(\"hay\"))\n    fmt.Printf(\"%#v\\n\", nc.Generic(\"bloop\"))\n    fmt.Printf(\"%#v\\n\", nc.Int64(\"bonk\"))\n    fmt.Printf(\"%#v\\n\", nc.Int64Slice(\"burnks\"))\n    fmt.Printf(\"%#v\\n\", nc.Int(\"bips\"))\n    fmt.Printf(\"%#v\\n\", nc.IntSlice(\"blups\"))\n    fmt.Printf(\"%#v\\n\", nc.String(\"snurt\"))\n    fmt.Printf(\"%#v\\n\", nc.StringSlice(\"snurkles\"))\n    fmt.Printf(\"%#v\\n\", nc.Uint(\"flub\"))\n    fmt.Printf(\"%#v\\n\", nc.Uint64(\"florb\"))\n    fmt.Printf(\"%#v\\n\", nc.GlobalBool(\"global-nope\"))\n    fmt.Printf(\"%#v\\n\", nc.GlobalBoolT(\"global-nerp\"))\n    fmt.Printf(\"%#v\\n\", nc.GlobalDuration(\"global-howlong\"))\n    fmt.Printf(\"%#v\\n\", nc.GlobalFloat64(\"global-hay\"))\n    fmt.Printf(\"%#v\\n\", nc.GlobalGeneric(\"global-bloop\"))\n    fmt.Printf(\"%#v\\n\", nc.GlobalInt(\"global-bips\"))\n    fmt.Printf(\"%#v\\n\", nc.GlobalIntSlice(\"global-blups\"))\n    fmt.Printf(\"%#v\\n\", nc.GlobalString(\"global-snurt\"))\n    fmt.Printf(\"%#v\\n\", nc.GlobalStringSlice(\"global-snurkles\"))\n\n    fmt.Printf(\"%#v\\n\", nc.FlagNames())\n    fmt.Printf(\"%#v\\n\", nc.GlobalFlagNames())\n    fmt.Printf(\"%#v\\n\", nc.GlobalIsSet(\"wat\"))\n    fmt.Printf(\"%#v\\n\", nc.GlobalSet(\"wat\", \"nope\"))\n    fmt.Printf(\"%#v\\n\", nc.NArg())\n    fmt.Printf(\"%#v\\n\", nc.NumFlags())\n    fmt.Printf(\"%#v\\n\", nc.Parent())\n\n    nc.Set(\"wat\", \"also-nope\")\n\n    ec := cli.NewExitError(\"ohwell\", 86)\n    fmt.Fprintf(c.App.Writer, \"%d\", ec.ExitCode())\n    fmt.Printf(\"made it!\\n\")\n    return ec\n  }\n\n  if os.Getenv(\"HEXY\") != \"\" {\n    app.Writer = &hexWriter{}\n    app.ErrWriter = &hexWriter{}\n  }\n\n  app.Metadata = map[string]interface{}{\n    \"layers\":     \"many\",\n    \"explicable\": false,\n    \"whatever-values\": 19.99,\n  }\n\n  app.Run(os.Args)\n}\n\nfunc wopAction(c *cli.Context) error {\n  fmt.Fprintf(c.App.Writer, \":wave: over here, eh\\n\")\n  return nil\n}\n```\n\n### Combining short Bool options\n\nTraditional use of boolean options using their shortnames look like this:\n```\n# cmd foobar -s -o\n```\n\nSuppose you want users to be able to combine your bool options with their shortname.  This\ncan be done using the **UseShortOptionHandling** bool in your commands.  Suppose your program\nhas a two bool flags such as *serve* and *option* with the short options of *-o* and\n*-s* respectively. With **UseShortOptionHandling** set to *true*, a user can use a syntax\nlike:\n```\n# cmd foobar -so\n```\n\nIf you enable the **UseShortOptionHandling*, then you must not use any flags that have a single\nleading *-* or this will result in failures.  For example, **-option** can no longer be used.  Flags\nwith two leading dashes (such as **--options**) are still valid.\n\n## Contribution Guidelines\n\nFeel free to put up a pull request to fix a bug or maybe add a feature. I will\ngive it a code review and make sure that it does not break backwards\ncompatibility. If I or any other collaborators agree that it is in line with\nthe vision of the project, we will work with you to get the code into\na mergeable state and merge it into the master branch.\n\nIf you have contributed something significant to the project, we will most\nlikely add you as a collaborator. As a collaborator you are given the ability\nto merge others pull requests. It is very important that new code does not\nbreak existing code, so be careful about what code you do choose to merge.\n\nIf you feel like you have contributed to the project but have not yet been\nadded as a collaborator, we probably forgot to add you, please open an issue.\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/app.go",
    "content": "package cli\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"time\"\n)\n\nvar (\n\tchangeLogURL                    = \"https://github.com/urfave/cli/blob/master/CHANGELOG.md\"\n\tappActionDeprecationURL         = fmt.Sprintf(\"%s#deprecated-cli-app-action-signature\", changeLogURL)\n\trunAndExitOnErrorDeprecationURL = fmt.Sprintf(\"%s#deprecated-cli-app-runandexitonerror\", changeLogURL)\n\n\tcontactSysadmin = \"This is an error in the application.  Please contact the distributor of this application if this is not you.\"\n\n\terrInvalidActionType = NewExitError(\"ERROR invalid Action type. \"+\n\t\tfmt.Sprintf(\"Must be `func(*Context`)` or `func(*Context) error).  %s\", contactSysadmin)+\n\t\tfmt.Sprintf(\"See %s\", appActionDeprecationURL), 2)\n)\n\n// App is the main structure of a cli application. It is recommended that\n// an app be created with the cli.NewApp() function\ntype App struct {\n\t// The name of the program. Defaults to path.Base(os.Args[0])\n\tName string\n\t// Full name of command for help, defaults to Name\n\tHelpName string\n\t// Description of the program.\n\tUsage string\n\t// Text to override the USAGE section of help\n\tUsageText string\n\t// Description of the program argument format.\n\tArgsUsage string\n\t// Version of the program\n\tVersion string\n\t// Description of the program\n\tDescription string\n\t// List of commands to execute\n\tCommands []Command\n\t// List of flags to parse\n\tFlags []Flag\n\t// Boolean to enable bash completion commands\n\tEnableBashCompletion bool\n\t// Boolean to hide built-in help command\n\tHideHelp bool\n\t// Boolean to hide built-in version flag and the VERSION section of help\n\tHideVersion bool\n\t// Populate on app startup, only gettable through method Categories()\n\tcategories CommandCategories\n\t// An action to execute when the bash-completion flag is set\n\tBashComplete BashCompleteFunc\n\t// An action to execute before any subcommands are run, but after the context is ready\n\t// If a non-nil error is returned, no subcommands are run\n\tBefore BeforeFunc\n\t// An action to execute after any subcommands are run, but after the subcommand has finished\n\t// It is run even if Action() panics\n\tAfter AfterFunc\n\n\t// The action to execute when no subcommands are specified\n\t// Expects a `cli.ActionFunc` but will accept the *deprecated* signature of `func(*cli.Context) {}`\n\t// *Note*: support for the deprecated `Action` signature will be removed in a future version\n\tAction interface{}\n\n\t// Execute this function if the proper command cannot be found\n\tCommandNotFound CommandNotFoundFunc\n\t// Execute this function if an usage error occurs\n\tOnUsageError OnUsageErrorFunc\n\t// Compilation date\n\tCompiled time.Time\n\t// List of all authors who contributed\n\tAuthors []Author\n\t// Copyright of the binary if any\n\tCopyright string\n\t// Name of Author (Note: Use App.Authors, this is deprecated)\n\tAuthor string\n\t// Email of Author (Note: Use App.Authors, this is deprecated)\n\tEmail string\n\t// Writer writer to write output to\n\tWriter io.Writer\n\t// ErrWriter writes error output\n\tErrWriter io.Writer\n\t// Execute this function to handle ExitErrors. If not provided, HandleExitCoder is provided to\n\t// function as a default, so this is optional.\n\tExitErrHandler ExitErrHandlerFunc\n\t// Other custom info\n\tMetadata map[string]interface{}\n\t// Carries a function which returns app specific info.\n\tExtraInfo func() map[string]string\n\t// CustomAppHelpTemplate the text template for app help topic.\n\t// cli.go uses text/template to render templates. You can\n\t// render custom help text by setting this variable.\n\tCustomAppHelpTemplate string\n\n\tdidSetup bool\n}\n\n// Tries to find out when this binary was compiled.\n// Returns the current time if it fails to find it.\nfunc compileTime() time.Time {\n\tinfo, err := os.Stat(os.Args[0])\n\tif err != nil {\n\t\treturn time.Now()\n\t}\n\treturn info.ModTime()\n}\n\n// NewApp creates a new cli Application with some reasonable defaults for Name,\n// Usage, Version and Action.\nfunc NewApp() *App {\n\treturn &App{\n\t\tName:         filepath.Base(os.Args[0]),\n\t\tHelpName:     filepath.Base(os.Args[0]),\n\t\tUsage:        \"A new cli application\",\n\t\tUsageText:    \"\",\n\t\tVersion:      \"0.0.0\",\n\t\tBashComplete: DefaultAppComplete,\n\t\tAction:       helpCommand.Action,\n\t\tCompiled:     compileTime(),\n\t\tWriter:       os.Stdout,\n\t}\n}\n\n// Setup runs initialization code to ensure all data structures are ready for\n// `Run` or inspection prior to `Run`.  It is internally called by `Run`, but\n// will return early if setup has already happened.\nfunc (a *App) Setup() {\n\tif a.didSetup {\n\t\treturn\n\t}\n\n\ta.didSetup = true\n\n\tif a.Author != \"\" || a.Email != \"\" {\n\t\ta.Authors = append(a.Authors, Author{Name: a.Author, Email: a.Email})\n\t}\n\n\tnewCmds := []Command{}\n\tfor _, c := range a.Commands {\n\t\tif c.HelpName == \"\" {\n\t\t\tc.HelpName = fmt.Sprintf(\"%s %s\", a.HelpName, c.Name)\n\t\t}\n\t\tnewCmds = append(newCmds, c)\n\t}\n\ta.Commands = newCmds\n\n\tif a.Command(helpCommand.Name) == nil && !a.HideHelp {\n\t\ta.Commands = append(a.Commands, helpCommand)\n\t\tif (HelpFlag != BoolFlag{}) {\n\t\t\ta.appendFlag(HelpFlag)\n\t\t}\n\t}\n\n\tif !a.HideVersion {\n\t\ta.appendFlag(VersionFlag)\n\t}\n\n\ta.categories = CommandCategories{}\n\tfor _, command := range a.Commands {\n\t\ta.categories = a.categories.AddCommand(command.Category, command)\n\t}\n\tsort.Sort(a.categories)\n\n\tif a.Metadata == nil {\n\t\ta.Metadata = make(map[string]interface{})\n\t}\n\n\tif a.Writer == nil {\n\t\ta.Writer = os.Stdout\n\t}\n}\n\n// Run is the entry point to the cli app. Parses the arguments slice and routes\n// to the proper flag/args combination\nfunc (a *App) Run(arguments []string) (err error) {\n\ta.Setup()\n\n\t// handle the completion flag separately from the flagset since\n\t// completion could be attempted after a flag, but before its value was put\n\t// on the command line. this causes the flagset to interpret the completion\n\t// flag name as the value of the flag before it which is undesirable\n\t// note that we can only do this because the shell autocomplete function\n\t// always appends the completion flag at the end of the command\n\tshellComplete, arguments := checkShellCompleteFlag(a, arguments)\n\n\t// parse flags\n\tset, err := flagSet(a.Name, a.Flags)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tset.SetOutput(ioutil.Discard)\n\terr = set.Parse(arguments[1:])\n\tnerr := normalizeFlags(a.Flags, set)\n\tcontext := NewContext(a, set, nil)\n\tif nerr != nil {\n\t\tfmt.Fprintln(a.Writer, nerr)\n\t\tShowAppHelp(context)\n\t\treturn nerr\n\t}\n\tcontext.shellComplete = shellComplete\n\n\tif checkCompletions(context) {\n\t\treturn nil\n\t}\n\n\tif err != nil {\n\t\tif a.OnUsageError != nil {\n\t\t\terr := a.OnUsageError(context, err, false)\n\t\t\ta.handleExitCoder(context, err)\n\t\t\treturn err\n\t\t}\n\t\tfmt.Fprintf(a.Writer, \"%s %s\\n\\n\", \"Incorrect Usage.\", err.Error())\n\t\tShowAppHelp(context)\n\t\treturn err\n\t}\n\n\tif !a.HideHelp && checkHelp(context) {\n\t\tShowAppHelp(context)\n\t\treturn nil\n\t}\n\n\tif !a.HideVersion && checkVersion(context) {\n\t\tShowVersion(context)\n\t\treturn nil\n\t}\n\n\tif a.After != nil {\n\t\tdefer func() {\n\t\t\tif afterErr := a.After(context); afterErr != nil {\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = NewMultiError(err, afterErr)\n\t\t\t\t} else {\n\t\t\t\t\terr = afterErr\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t}\n\n\tif a.Before != nil {\n\t\tbeforeErr := a.Before(context)\n\t\tif beforeErr != nil {\n\t\t\tfmt.Fprintf(a.Writer, \"%v\\n\\n\", beforeErr)\n\t\t\tShowAppHelp(context)\n\t\t\ta.handleExitCoder(context, beforeErr)\n\t\t\terr = beforeErr\n\t\t\treturn err\n\t\t}\n\t}\n\n\targs := context.Args()\n\tif args.Present() {\n\t\tname := args.First()\n\t\tc := a.Command(name)\n\t\tif c != nil {\n\t\t\treturn c.Run(context)\n\t\t}\n\t}\n\n\tif a.Action == nil {\n\t\ta.Action = helpCommand.Action\n\t}\n\n\t// Run default Action\n\terr = HandleAction(a.Action, context)\n\n\ta.handleExitCoder(context, err)\n\treturn err\n}\n\n// RunAndExitOnError calls .Run() and exits non-zero if an error was returned\n//\n// Deprecated: instead you should return an error that fulfills cli.ExitCoder\n// to cli.App.Run. This will cause the application to exit with the given eror\n// code in the cli.ExitCoder\nfunc (a *App) RunAndExitOnError() {\n\tif err := a.Run(os.Args); err != nil {\n\t\tfmt.Fprintln(a.errWriter(), err)\n\t\tOsExiter(1)\n\t}\n}\n\n// RunAsSubcommand invokes the subcommand given the context, parses ctx.Args() to\n// generate command-specific flags\nfunc (a *App) RunAsSubcommand(ctx *Context) (err error) {\n\t// append help to commands\n\tif len(a.Commands) > 0 {\n\t\tif a.Command(helpCommand.Name) == nil && !a.HideHelp {\n\t\t\ta.Commands = append(a.Commands, helpCommand)\n\t\t\tif (HelpFlag != BoolFlag{}) {\n\t\t\t\ta.appendFlag(HelpFlag)\n\t\t\t}\n\t\t}\n\t}\n\n\tnewCmds := []Command{}\n\tfor _, c := range a.Commands {\n\t\tif c.HelpName == \"\" {\n\t\t\tc.HelpName = fmt.Sprintf(\"%s %s\", a.HelpName, c.Name)\n\t\t}\n\t\tnewCmds = append(newCmds, c)\n\t}\n\ta.Commands = newCmds\n\n\t// parse flags\n\tset, err := flagSet(a.Name, a.Flags)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tset.SetOutput(ioutil.Discard)\n\terr = set.Parse(ctx.Args().Tail())\n\tnerr := normalizeFlags(a.Flags, set)\n\tcontext := NewContext(a, set, ctx)\n\n\tif nerr != nil {\n\t\tfmt.Fprintln(a.Writer, nerr)\n\t\tfmt.Fprintln(a.Writer)\n\t\tif len(a.Commands) > 0 {\n\t\t\tShowSubcommandHelp(context)\n\t\t} else {\n\t\t\tShowCommandHelp(ctx, context.Args().First())\n\t\t}\n\t\treturn nerr\n\t}\n\n\tif checkCompletions(context) {\n\t\treturn nil\n\t}\n\n\tif err != nil {\n\t\tif a.OnUsageError != nil {\n\t\t\terr = a.OnUsageError(context, err, true)\n\t\t\ta.handleExitCoder(context, err)\n\t\t\treturn err\n\t\t}\n\t\tfmt.Fprintf(a.Writer, \"%s %s\\n\\n\", \"Incorrect Usage.\", err.Error())\n\t\tShowSubcommandHelp(context)\n\t\treturn err\n\t}\n\n\tif len(a.Commands) > 0 {\n\t\tif checkSubcommandHelp(context) {\n\t\t\treturn nil\n\t\t}\n\t} else {\n\t\tif checkCommandHelp(ctx, context.Args().First()) {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tif a.After != nil {\n\t\tdefer func() {\n\t\t\tafterErr := a.After(context)\n\t\t\tif afterErr != nil {\n\t\t\t\ta.handleExitCoder(context, err)\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = NewMultiError(err, afterErr)\n\t\t\t\t} else {\n\t\t\t\t\terr = afterErr\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t}\n\n\tif a.Before != nil {\n\t\tbeforeErr := a.Before(context)\n\t\tif beforeErr != nil {\n\t\t\ta.handleExitCoder(context, beforeErr)\n\t\t\terr = beforeErr\n\t\t\treturn err\n\t\t}\n\t}\n\n\targs := context.Args()\n\tif args.Present() {\n\t\tname := args.First()\n\t\tc := a.Command(name)\n\t\tif c != nil {\n\t\t\treturn c.Run(context)\n\t\t}\n\t}\n\n\t// Run default Action\n\terr = HandleAction(a.Action, context)\n\n\ta.handleExitCoder(context, err)\n\treturn err\n}\n\n// Command returns the named command on App. Returns nil if the command does not exist\nfunc (a *App) Command(name string) *Command {\n\tfor _, c := range a.Commands {\n\t\tif c.HasName(name) {\n\t\t\treturn &c\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// Categories returns a slice containing all the categories with the commands they contain\nfunc (a *App) Categories() CommandCategories {\n\treturn a.categories\n}\n\n// VisibleCategories returns a slice of categories and commands that are\n// Hidden=false\nfunc (a *App) VisibleCategories() []*CommandCategory {\n\tret := []*CommandCategory{}\n\tfor _, category := range a.categories {\n\t\tif visible := func() *CommandCategory {\n\t\t\tfor _, command := range category.Commands {\n\t\t\t\tif !command.Hidden {\n\t\t\t\t\treturn category\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t}(); visible != nil {\n\t\t\tret = append(ret, visible)\n\t\t}\n\t}\n\treturn ret\n}\n\n// VisibleCommands returns a slice of the Commands with Hidden=false\nfunc (a *App) VisibleCommands() []Command {\n\tret := []Command{}\n\tfor _, command := range a.Commands {\n\t\tif !command.Hidden {\n\t\t\tret = append(ret, command)\n\t\t}\n\t}\n\treturn ret\n}\n\n// VisibleFlags returns a slice of the Flags with Hidden=false\nfunc (a *App) VisibleFlags() []Flag {\n\treturn visibleFlags(a.Flags)\n}\n\nfunc (a *App) hasFlag(flag Flag) bool {\n\tfor _, f := range a.Flags {\n\t\tif flag == f {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc (a *App) errWriter() io.Writer {\n\t// When the app ErrWriter is nil use the package level one.\n\tif a.ErrWriter == nil {\n\t\treturn ErrWriter\n\t}\n\n\treturn a.ErrWriter\n}\n\nfunc (a *App) appendFlag(flag Flag) {\n\tif !a.hasFlag(flag) {\n\t\ta.Flags = append(a.Flags, flag)\n\t}\n}\n\nfunc (a *App) handleExitCoder(context *Context, err error) {\n\tif a.ExitErrHandler != nil {\n\t\ta.ExitErrHandler(context, err)\n\t} else {\n\t\tHandleExitCoder(err)\n\t}\n}\n\n// Author represents someone who has contributed to a cli project.\ntype Author struct {\n\tName  string // The Authors name\n\tEmail string // The Authors email\n}\n\n// String makes Author comply to the Stringer interface, to allow an easy print in the templating process\nfunc (a Author) String() string {\n\te := \"\"\n\tif a.Email != \"\" {\n\t\te = \" <\" + a.Email + \">\"\n\t}\n\n\treturn fmt.Sprintf(\"%v%v\", a.Name, e)\n}\n\n// HandleAction attempts to figure out which Action signature was used.  If\n// it's an ActionFunc or a func with the legacy signature for Action, the func\n// is run!\nfunc HandleAction(action interface{}, context *Context) (err error) {\n\tif a, ok := action.(ActionFunc); ok {\n\t\treturn a(context)\n\t} else if a, ok := action.(func(*Context) error); ok {\n\t\treturn a(context)\n\t} else if a, ok := action.(func(*Context)); ok { // deprecated function signature\n\t\ta(context)\n\t\treturn nil\n\t}\n\n\treturn errInvalidActionType\n}\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/appveyor.yml",
    "content": "version: \"{build}\"\n\nos: Windows Server 2016\n\nimage: Visual Studio 2017\n\nclone_folder: c:\\gopath\\src\\github.com\\urfave\\cli\n\nenvironment:\n  GOPATH: C:\\gopath\n  GOVERSION: 1.8.x\n  PYTHON: C:\\Python36-x64\n  PYTHON_VERSION: 3.6.x\n  PYTHON_ARCH: 64\n\ninstall:\n- set PATH=%GOPATH%\\bin;C:\\go\\bin;%PATH%\n- go version\n- go env\n- go get github.com/urfave/gfmrun/...\n- go get -v -t ./...\n\nbuild_script:\n- python runtests vet\n- python runtests test\n- python runtests gfmrun\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/category.go",
    "content": "package cli\n\n// CommandCategories is a slice of *CommandCategory.\ntype CommandCategories []*CommandCategory\n\n// CommandCategory is a category containing commands.\ntype CommandCategory struct {\n\tName     string\n\tCommands Commands\n}\n\nfunc (c CommandCategories) Less(i, j int) bool {\n\treturn lexicographicLess(c[i].Name, c[j].Name)\n}\n\nfunc (c CommandCategories) Len() int {\n\treturn len(c)\n}\n\nfunc (c CommandCategories) Swap(i, j int) {\n\tc[i], c[j] = c[j], c[i]\n}\n\n// AddCommand adds a command to a category.\nfunc (c CommandCategories) AddCommand(category string, command Command) CommandCategories {\n\tfor _, commandCategory := range c {\n\t\tif commandCategory.Name == category {\n\t\t\tcommandCategory.Commands = append(commandCategory.Commands, command)\n\t\t\treturn c\n\t\t}\n\t}\n\treturn append(c, &CommandCategory{Name: category, Commands: []Command{command}})\n}\n\n// VisibleCommands returns a slice of the Commands with Hidden=false\nfunc (c *CommandCategory) VisibleCommands() []Command {\n\tret := []Command{}\n\tfor _, command := range c.Commands {\n\t\tif !command.Hidden {\n\t\t\tret = append(ret, command)\n\t\t}\n\t}\n\treturn ret\n}\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/cli.go",
    "content": "// Package cli provides a minimal framework for creating and organizing command line\n// Go applications. cli is designed to be easy to understand and write, the most simple\n// cli application can be written as follows:\n//   func main() {\n//     cli.NewApp().Run(os.Args)\n//   }\n//\n// Of course this application does not do much, so let's make this an actual application:\n//   func main() {\n//     app := cli.NewApp()\n//     app.Name = \"greet\"\n//     app.Usage = \"say a greeting\"\n//     app.Action = func(c *cli.Context) error {\n//       println(\"Greetings\")\n//       return nil\n//     }\n//\n//     app.Run(os.Args)\n//   }\npackage cli\n\n//go:generate python ./generate-flag-types cli -i flag-types.json -o flag_generated.go\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/command.go",
    "content": "package cli\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// Command is a subcommand for a cli.App.\ntype Command struct {\n\t// The name of the command\n\tName string\n\t// short name of the command. Typically one character (deprecated, use `Aliases`)\n\tShortName string\n\t// A list of aliases for the command\n\tAliases []string\n\t// A short description of the usage of this command\n\tUsage string\n\t// Custom text to show on USAGE section of help\n\tUsageText string\n\t// A longer explanation of how the command works\n\tDescription string\n\t// A short description of the arguments of this command\n\tArgsUsage string\n\t// The category the command is part of\n\tCategory string\n\t// The function to call when checking for bash command completions\n\tBashComplete BashCompleteFunc\n\t// An action to execute before any sub-subcommands are run, but after the context is ready\n\t// If a non-nil error is returned, no sub-subcommands are run\n\tBefore BeforeFunc\n\t// An action to execute after any subcommands are run, but after the subcommand has finished\n\t// It is run even if Action() panics\n\tAfter AfterFunc\n\t// The function to call when this command is invoked\n\tAction interface{}\n\t// TODO: replace `Action: interface{}` with `Action: ActionFunc` once some kind\n\t// of deprecation period has passed, maybe?\n\n\t// Execute this function if a usage error occurs.\n\tOnUsageError OnUsageErrorFunc\n\t// List of child commands\n\tSubcommands Commands\n\t// List of flags to parse\n\tFlags []Flag\n\t// Treat all flags as normal arguments if true\n\tSkipFlagParsing bool\n\t// Skip argument reordering which attempts to move flags before arguments,\n\t// but only works if all flags appear after all arguments. This behavior was\n\t// removed n version 2 since it only works under specific conditions so we\n\t// backport here by exposing it as an option for compatibility.\n\tSkipArgReorder bool\n\t// Boolean to hide built-in help command\n\tHideHelp bool\n\t// Boolean to hide this command from help or completion\n\tHidden bool\n\t// Boolean to enable short-option handling so user can combine several\n\t// single-character bool arguements into one\n\t// i.e. foobar -o -v -> foobar -ov\n\tUseShortOptionHandling bool\n\n\t// Full name of command for help, defaults to full command name, including parent commands.\n\tHelpName        string\n\tcommandNamePath []string\n\n\t// CustomHelpTemplate the text template for the command help topic.\n\t// cli.go uses text/template to render templates. You can\n\t// render custom help text by setting this variable.\n\tCustomHelpTemplate string\n}\n\ntype CommandsByName []Command\n\nfunc (c CommandsByName) Len() int {\n\treturn len(c)\n}\n\nfunc (c CommandsByName) Less(i, j int) bool {\n\treturn lexicographicLess(c[i].Name, c[j].Name)\n}\n\nfunc (c CommandsByName) Swap(i, j int) {\n\tc[i], c[j] = c[j], c[i]\n}\n\n// FullName returns the full name of the command.\n// For subcommands this ensures that parent commands are part of the command path\nfunc (c Command) FullName() string {\n\tif c.commandNamePath == nil {\n\t\treturn c.Name\n\t}\n\treturn strings.Join(c.commandNamePath, \" \")\n}\n\n// Commands is a slice of Command\ntype Commands []Command\n\n// Run invokes the command given the context, parses ctx.Args() to generate command-specific flags\nfunc (c Command) Run(ctx *Context) (err error) {\n\tif len(c.Subcommands) > 0 {\n\t\treturn c.startApp(ctx)\n\t}\n\n\tif !c.HideHelp && (HelpFlag != BoolFlag{}) {\n\t\t// append help to flags\n\t\tc.Flags = append(\n\t\t\tc.Flags,\n\t\t\tHelpFlag,\n\t\t)\n\t}\n\n\tset, err := c.parseFlags(ctx.Args().Tail())\n\n\tcontext := NewContext(ctx.App, set, ctx)\n\tcontext.Command = c\n\tif checkCommandCompletions(context, c.Name) {\n\t\treturn nil\n\t}\n\n\tif err != nil {\n\t\tif c.OnUsageError != nil {\n\t\t\terr := c.OnUsageError(context, err, false)\n\t\t\tcontext.App.handleExitCoder(context, err)\n\t\t\treturn err\n\t\t}\n\t\tfmt.Fprintln(context.App.Writer, \"Incorrect Usage:\", err.Error())\n\t\tfmt.Fprintln(context.App.Writer)\n\t\tShowCommandHelp(context, c.Name)\n\t\treturn err\n\t}\n\n\tif checkCommandHelp(context, c.Name) {\n\t\treturn nil\n\t}\n\n\tif c.After != nil {\n\t\tdefer func() {\n\t\t\tafterErr := c.After(context)\n\t\t\tif afterErr != nil {\n\t\t\t\tcontext.App.handleExitCoder(context, err)\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = NewMultiError(err, afterErr)\n\t\t\t\t} else {\n\t\t\t\t\terr = afterErr\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t}\n\n\tif c.Before != nil {\n\t\terr = c.Before(context)\n\t\tif err != nil {\n\t\t\tShowCommandHelp(context, c.Name)\n\t\t\tcontext.App.handleExitCoder(context, err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif c.Action == nil {\n\t\tc.Action = helpSubcommand.Action\n\t}\n\n\terr = HandleAction(c.Action, context)\n\n\tif err != nil {\n\t\tcontext.App.handleExitCoder(context, err)\n\t}\n\treturn err\n}\n\nfunc (c *Command) parseFlags(args Args) (*flag.FlagSet, error) {\n\tset, err := flagSet(c.Name, c.Flags)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tset.SetOutput(ioutil.Discard)\n\n\tif c.SkipFlagParsing {\n\t\treturn set, set.Parse(append([]string{\"--\"}, args...))\n\t}\n\n\tif c.UseShortOptionHandling {\n\t\targs = translateShortOptions(args)\n\t}\n\n\tif !c.SkipArgReorder {\n\t\targs = reorderArgs(args)\n\t}\n\n\terr = set.Parse(args)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = normalizeFlags(c.Flags, set)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn set, nil\n}\n\n// reorderArgs moves all flags before arguments as this is what flag expects\nfunc reorderArgs(args []string) []string {\n\tvar nonflags, flags []string\n\n\treadFlagValue := false\n\tfor i, arg := range args {\n\t\tif arg == \"--\" {\n\t\t\tnonflags = append(nonflags, args[i:]...)\n\t\t\tbreak\n\t\t}\n\n\t\tif readFlagValue {\n\t\t\treadFlagValue = false\n\t\t\tflags = append(flags, arg)\n\t\t\tcontinue\n\t\t}\n\n\t\tif arg != \"-\" && strings.HasPrefix(arg, \"-\") {\n\t\t\tflags = append(flags, arg)\n\n\t\t\treadFlagValue = !strings.Contains(arg, \"=\")\n\t\t} else {\n\t\t\tnonflags = append(nonflags, arg)\n\t\t}\n\t}\n\n\treturn append(flags, nonflags...)\n}\n\nfunc translateShortOptions(flagArgs Args) []string {\n\t// separate combined flags\n\tvar flagArgsSeparated []string\n\tfor _, flagArg := range flagArgs {\n\t\tif strings.HasPrefix(flagArg, \"-\") && strings.HasPrefix(flagArg, \"--\") == false && len(flagArg) > 2 {\n\t\t\tfor _, flagChar := range flagArg[1:] {\n\t\t\t\tflagArgsSeparated = append(flagArgsSeparated, \"-\"+string(flagChar))\n\t\t\t}\n\t\t} else {\n\t\t\tflagArgsSeparated = append(flagArgsSeparated, flagArg)\n\t\t}\n\t}\n\treturn flagArgsSeparated\n}\n\n// Names returns the names including short names and aliases.\nfunc (c Command) Names() []string {\n\tnames := []string{c.Name}\n\n\tif c.ShortName != \"\" {\n\t\tnames = append(names, c.ShortName)\n\t}\n\n\treturn append(names, c.Aliases...)\n}\n\n// HasName returns true if Command.Name or Command.ShortName matches given name\nfunc (c Command) HasName(name string) bool {\n\tfor _, n := range c.Names() {\n\t\tif n == name {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (c Command) startApp(ctx *Context) error {\n\tapp := NewApp()\n\tapp.Metadata = ctx.App.Metadata\n\t// set the name and usage\n\tapp.Name = fmt.Sprintf(\"%s %s\", ctx.App.Name, c.Name)\n\tif c.HelpName == \"\" {\n\t\tapp.HelpName = c.HelpName\n\t} else {\n\t\tapp.HelpName = app.Name\n\t}\n\n\tapp.Usage = c.Usage\n\tapp.Description = c.Description\n\tapp.ArgsUsage = c.ArgsUsage\n\n\t// set CommandNotFound\n\tapp.CommandNotFound = ctx.App.CommandNotFound\n\tapp.CustomAppHelpTemplate = c.CustomHelpTemplate\n\n\t// set the flags and commands\n\tapp.Commands = c.Subcommands\n\tapp.Flags = c.Flags\n\tapp.HideHelp = c.HideHelp\n\n\tapp.Version = ctx.App.Version\n\tapp.HideVersion = ctx.App.HideVersion\n\tapp.Compiled = ctx.App.Compiled\n\tapp.Author = ctx.App.Author\n\tapp.Email = ctx.App.Email\n\tapp.Writer = ctx.App.Writer\n\tapp.ErrWriter = ctx.App.ErrWriter\n\n\tapp.categories = CommandCategories{}\n\tfor _, command := range c.Subcommands {\n\t\tapp.categories = app.categories.AddCommand(command.Category, command)\n\t}\n\n\tsort.Sort(app.categories)\n\n\t// bash completion\n\tapp.EnableBashCompletion = ctx.App.EnableBashCompletion\n\tif c.BashComplete != nil {\n\t\tapp.BashComplete = c.BashComplete\n\t}\n\n\t// set the actions\n\tapp.Before = c.Before\n\tapp.After = c.After\n\tif c.Action != nil {\n\t\tapp.Action = c.Action\n\t} else {\n\t\tapp.Action = helpSubcommand.Action\n\t}\n\tapp.OnUsageError = c.OnUsageError\n\n\tfor index, cc := range app.Commands {\n\t\tapp.Commands[index].commandNamePath = []string{c.Name, cc.Name}\n\t}\n\n\treturn app.RunAsSubcommand(ctx)\n}\n\n// VisibleFlags returns a slice of the Flags with Hidden=false\nfunc (c Command) VisibleFlags() []Flag {\n\treturn visibleFlags(c.Flags)\n}\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/context.go",
    "content": "package cli\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\t\"syscall\"\n)\n\n// Context is a type that is passed through to\n// each Handler action in a cli application. Context\n// can be used to retrieve context-specific Args and\n// parsed command-line options.\ntype Context struct {\n\tApp           *App\n\tCommand       Command\n\tshellComplete bool\n\tflagSet       *flag.FlagSet\n\tsetFlags      map[string]bool\n\tparentContext *Context\n}\n\n// NewContext creates a new context. For use in when invoking an App or Command action.\nfunc NewContext(app *App, set *flag.FlagSet, parentCtx *Context) *Context {\n\tc := &Context{App: app, flagSet: set, parentContext: parentCtx}\n\n\tif parentCtx != nil {\n\t\tc.shellComplete = parentCtx.shellComplete\n\t}\n\n\treturn c\n}\n\n// NumFlags returns the number of flags set\nfunc (c *Context) NumFlags() int {\n\treturn c.flagSet.NFlag()\n}\n\n// Set sets a context flag to a value.\nfunc (c *Context) Set(name, value string) error {\n\tc.setFlags = nil\n\treturn c.flagSet.Set(name, value)\n}\n\n// GlobalSet sets a context flag to a value on the global flagset\nfunc (c *Context) GlobalSet(name, value string) error {\n\tglobalContext(c).setFlags = nil\n\treturn globalContext(c).flagSet.Set(name, value)\n}\n\n// IsSet determines if the flag was actually set\nfunc (c *Context) IsSet(name string) bool {\n\tif c.setFlags == nil {\n\t\tc.setFlags = make(map[string]bool)\n\n\t\tc.flagSet.Visit(func(f *flag.Flag) {\n\t\t\tc.setFlags[f.Name] = true\n\t\t})\n\n\t\tc.flagSet.VisitAll(func(f *flag.Flag) {\n\t\t\tif _, ok := c.setFlags[f.Name]; ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc.setFlags[f.Name] = false\n\t\t})\n\n\t\t// XXX hack to support IsSet for flags with EnvVar\n\t\t//\n\t\t// There isn't an easy way to do this with the current implementation since\n\t\t// whether a flag was set via an environment variable is very difficult to\n\t\t// determine here. Instead, we intend to introduce a backwards incompatible\n\t\t// change in version 2 to add `IsSet` to the Flag interface to push the\n\t\t// responsibility closer to where the information required to determine\n\t\t// whether a flag is set by non-standard means such as environment\n\t\t// variables is available.\n\t\t//\n\t\t// See https://github.com/urfave/cli/issues/294 for additional discussion\n\t\tflags := c.Command.Flags\n\t\tif c.Command.Name == \"\" { // cannot == Command{} since it contains slice types\n\t\t\tif c.App != nil {\n\t\t\t\tflags = c.App.Flags\n\t\t\t}\n\t\t}\n\t\tfor _, f := range flags {\n\t\t\teachName(f.GetName(), func(name string) {\n\t\t\t\tif isSet, ok := c.setFlags[name]; isSet || !ok {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tval := reflect.ValueOf(f)\n\t\t\t\tif val.Kind() == reflect.Ptr {\n\t\t\t\t\tval = val.Elem()\n\t\t\t\t}\n\n\t\t\t\tfilePathValue := val.FieldByName(\"FilePath\")\n\t\t\t\tif filePathValue.IsValid() {\n\t\t\t\t\teachName(filePathValue.String(), func(filePath string) {\n\t\t\t\t\t\tif _, err := os.Stat(filePath); err == nil {\n\t\t\t\t\t\t\tc.setFlags[name] = true\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\tenvVarValue := val.FieldByName(\"EnvVar\")\n\t\t\t\tif envVarValue.IsValid() {\n\t\t\t\t\teachName(envVarValue.String(), func(envVar string) {\n\t\t\t\t\t\tenvVar = strings.TrimSpace(envVar)\n\t\t\t\t\t\tif _, ok := syscall.Getenv(envVar); ok {\n\t\t\t\t\t\t\tc.setFlags[name] = true\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n\n\treturn c.setFlags[name]\n}\n\n// GlobalIsSet determines if the global flag was actually set\nfunc (c *Context) GlobalIsSet(name string) bool {\n\tctx := c\n\tif ctx.parentContext != nil {\n\t\tctx = ctx.parentContext\n\t}\n\n\tfor ; ctx != nil; ctx = ctx.parentContext {\n\t\tif ctx.IsSet(name) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// FlagNames returns a slice of flag names used in this context.\nfunc (c *Context) FlagNames() (names []string) {\n\tfor _, flag := range c.Command.Flags {\n\t\tname := strings.Split(flag.GetName(), \",\")[0]\n\t\tif name == \"help\" {\n\t\t\tcontinue\n\t\t}\n\t\tnames = append(names, name)\n\t}\n\treturn\n}\n\n// GlobalFlagNames returns a slice of global flag names used by the app.\nfunc (c *Context) GlobalFlagNames() (names []string) {\n\tfor _, flag := range c.App.Flags {\n\t\tname := strings.Split(flag.GetName(), \",\")[0]\n\t\tif name == \"help\" || name == \"version\" {\n\t\t\tcontinue\n\t\t}\n\t\tnames = append(names, name)\n\t}\n\treturn\n}\n\n// Parent returns the parent context, if any\nfunc (c *Context) Parent() *Context {\n\treturn c.parentContext\n}\n\n// value returns the value of the flag coressponding to `name`\nfunc (c *Context) value(name string) interface{} {\n\treturn c.flagSet.Lookup(name).Value.(flag.Getter).Get()\n}\n\n// Args contains apps console arguments\ntype Args []string\n\n// Args returns the command line arguments associated with the context.\nfunc (c *Context) Args() Args {\n\targs := Args(c.flagSet.Args())\n\treturn args\n}\n\n// NArg returns the number of the command line arguments.\nfunc (c *Context) NArg() int {\n\treturn len(c.Args())\n}\n\n// Get returns the nth argument, or else a blank string\nfunc (a Args) Get(n int) string {\n\tif len(a) > n {\n\t\treturn a[n]\n\t}\n\treturn \"\"\n}\n\n// First returns the first argument, or else a blank string\nfunc (a Args) First() string {\n\treturn a.Get(0)\n}\n\n// Tail returns the rest of the arguments (not the first one)\n// or else an empty string slice\nfunc (a Args) Tail() []string {\n\tif len(a) >= 2 {\n\t\treturn []string(a)[1:]\n\t}\n\treturn []string{}\n}\n\n// Present checks if there are any arguments present\nfunc (a Args) Present() bool {\n\treturn len(a) != 0\n}\n\n// Swap swaps arguments at the given indexes\nfunc (a Args) Swap(from, to int) error {\n\tif from >= len(a) || to >= len(a) {\n\t\treturn errors.New(\"index out of range\")\n\t}\n\ta[from], a[to] = a[to], a[from]\n\treturn nil\n}\n\nfunc globalContext(ctx *Context) *Context {\n\tif ctx == nil {\n\t\treturn nil\n\t}\n\n\tfor {\n\t\tif ctx.parentContext == nil {\n\t\t\treturn ctx\n\t\t}\n\t\tctx = ctx.parentContext\n\t}\n}\n\nfunc lookupGlobalFlagSet(name string, ctx *Context) *flag.FlagSet {\n\tif ctx.parentContext != nil {\n\t\tctx = ctx.parentContext\n\t}\n\tfor ; ctx != nil; ctx = ctx.parentContext {\n\t\tif f := ctx.flagSet.Lookup(name); f != nil {\n\t\t\treturn ctx.flagSet\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc copyFlag(name string, ff *flag.Flag, set *flag.FlagSet) {\n\tswitch ff.Value.(type) {\n\tcase *StringSlice:\n\tdefault:\n\t\tset.Set(name, ff.Value.String())\n\t}\n}\n\nfunc normalizeFlags(flags []Flag, set *flag.FlagSet) error {\n\tvisited := make(map[string]bool)\n\tset.Visit(func(f *flag.Flag) {\n\t\tvisited[f.Name] = true\n\t})\n\tfor _, f := range flags {\n\t\tparts := strings.Split(f.GetName(), \",\")\n\t\tif len(parts) == 1 {\n\t\t\tcontinue\n\t\t}\n\t\tvar ff *flag.Flag\n\t\tfor _, name := range parts {\n\t\t\tname = strings.Trim(name, \" \")\n\t\t\tif visited[name] {\n\t\t\t\tif ff != nil {\n\t\t\t\t\treturn errors.New(\"Cannot use two forms of the same flag: \" + name + \" \" + ff.Name)\n\t\t\t\t}\n\t\t\t\tff = set.Lookup(name)\n\t\t\t}\n\t\t}\n\t\tif ff == nil {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, name := range parts {\n\t\t\tname = strings.Trim(name, \" \")\n\t\t\tif !visited[name] {\n\t\t\t\tcopyFlag(name, ff, set)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/errors.go",
    "content": "package cli\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\n// OsExiter is the function used when the app exits. If not set defaults to os.Exit.\nvar OsExiter = os.Exit\n\n// ErrWriter is used to write errors to the user. This can be anything\n// implementing the io.Writer interface and defaults to os.Stderr.\nvar ErrWriter io.Writer = os.Stderr\n\n// MultiError is an error that wraps multiple errors.\ntype MultiError struct {\n\tErrors []error\n}\n\n// NewMultiError creates a new MultiError. Pass in one or more errors.\nfunc NewMultiError(err ...error) MultiError {\n\treturn MultiError{Errors: err}\n}\n\n// Error implements the error interface.\nfunc (m MultiError) Error() string {\n\terrs := make([]string, len(m.Errors))\n\tfor i, err := range m.Errors {\n\t\terrs[i] = err.Error()\n\t}\n\n\treturn strings.Join(errs, \"\\n\")\n}\n\ntype ErrorFormatter interface {\n\tFormat(s fmt.State, verb rune)\n}\n\n// ExitCoder is the interface checked by `App` and `Command` for a custom exit\n// code\ntype ExitCoder interface {\n\terror\n\tExitCode() int\n}\n\n// ExitError fulfills both the builtin `error` interface and `ExitCoder`\ntype ExitError struct {\n\texitCode int\n\tmessage  interface{}\n}\n\n// NewExitError makes a new *ExitError\nfunc NewExitError(message interface{}, exitCode int) *ExitError {\n\treturn &ExitError{\n\t\texitCode: exitCode,\n\t\tmessage:  message,\n\t}\n}\n\n// Error returns the string message, fulfilling the interface required by\n// `error`\nfunc (ee *ExitError) Error() string {\n\treturn fmt.Sprintf(\"%v\", ee.message)\n}\n\n// ExitCode returns the exit code, fulfilling the interface required by\n// `ExitCoder`\nfunc (ee *ExitError) ExitCode() int {\n\treturn ee.exitCode\n}\n\n// HandleExitCoder checks if the error fulfills the ExitCoder interface, and if\n// so prints the error to stderr (if it is non-empty) and calls OsExiter with the\n// given exit code.  If the given error is a MultiError, then this func is\n// called on all members of the Errors slice and calls OsExiter with the last exit code.\nfunc HandleExitCoder(err error) {\n\tif err == nil {\n\t\treturn\n\t}\n\n\tif exitErr, ok := err.(ExitCoder); ok {\n\t\tif err.Error() != \"\" {\n\t\t\tif _, ok := exitErr.(ErrorFormatter); ok {\n\t\t\t\tfmt.Fprintf(ErrWriter, \"%+v\\n\", err)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(ErrWriter, err)\n\t\t\t}\n\t\t}\n\t\tOsExiter(exitErr.ExitCode())\n\t\treturn\n\t}\n\n\tif multiErr, ok := err.(MultiError); ok {\n\t\tcode := handleMultiError(multiErr)\n\t\tOsExiter(code)\n\t\treturn\n\t}\n}\n\nfunc handleMultiError(multiErr MultiError) int {\n\tcode := 1\n\tfor _, merr := range multiErr.Errors {\n\t\tif multiErr2, ok := merr.(MultiError); ok {\n\t\t\tcode = handleMultiError(multiErr2)\n\t\t} else {\n\t\t\tfmt.Fprintln(ErrWriter, merr)\n\t\t\tif exitErr, ok := merr.(ExitCoder); ok {\n\t\t\t\tcode = exitErr.ExitCode()\n\t\t\t}\n\t\t}\n\t}\n\treturn code\n}\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/flag-types.json",
    "content": "[\n  {\n    \"name\": \"Bool\",\n    \"type\": \"bool\",\n    \"value\": false,\n    \"context_default\": \"false\",\n    \"parser\": \"strconv.ParseBool(f.Value.String())\"\n  },\n  {\n    \"name\": \"BoolT\",\n    \"type\": \"bool\",\n    \"value\": false,\n    \"doctail\": \" that is true by default\",\n    \"context_default\": \"false\",\n    \"parser\": \"strconv.ParseBool(f.Value.String())\"\n  },\n  {\n    \"name\": \"Duration\",\n    \"type\": \"time.Duration\",\n    \"doctail\": \" (see https://golang.org/pkg/time/#ParseDuration)\",\n    \"context_default\": \"0\",\n    \"parser\": \"time.ParseDuration(f.Value.String())\"\n  },\n  {\n    \"name\": \"Float64\",\n    \"type\": \"float64\",\n    \"context_default\": \"0\",\n    \"parser\": \"strconv.ParseFloat(f.Value.String(), 64)\"\n  },\n  {\n    \"name\": \"Generic\",\n    \"type\": \"Generic\",\n    \"dest\": false,\n    \"context_default\": \"nil\",\n    \"context_type\": \"interface{}\"\n  },\n  {\n    \"name\": \"Int64\",\n    \"type\": \"int64\",\n    \"context_default\": \"0\",\n    \"parser\": \"strconv.ParseInt(f.Value.String(), 0, 64)\"\n  },\n  {\n    \"name\": \"Int\",\n    \"type\": \"int\",\n    \"context_default\": \"0\",\n    \"parser\": \"strconv.ParseInt(f.Value.String(), 0, 64)\",\n    \"parser_cast\": \"int(parsed)\"\n  },\n  {\n    \"name\": \"IntSlice\",\n    \"type\": \"*IntSlice\",\n    \"dest\": false,\n    \"context_default\": \"nil\",\n    \"context_type\": \"[]int\",\n    \"parser\": \"(f.Value.(*IntSlice)).Value(), error(nil)\"\n  },\n  {\n    \"name\": \"Int64Slice\",\n    \"type\": \"*Int64Slice\",\n    \"dest\": false,\n    \"context_default\": \"nil\",\n    \"context_type\": \"[]int64\",\n    \"parser\": \"(f.Value.(*Int64Slice)).Value(), error(nil)\"\n  },\n  {\n    \"name\": \"String\",\n    \"type\": \"string\",\n    \"context_default\": \"\\\"\\\"\",\n    \"parser\": \"f.Value.String(), error(nil)\"\n  },\n  {\n    \"name\": \"StringSlice\",\n    \"type\": \"*StringSlice\",\n    \"dest\": false,\n    \"context_default\": \"nil\",\n    \"context_type\": \"[]string\",\n    \"parser\": \"(f.Value.(*StringSlice)).Value(), error(nil)\"\n  },\n  {\n    \"name\": \"Uint64\",\n    \"type\": \"uint64\",\n    \"context_default\": \"0\",\n    \"parser\": \"strconv.ParseUint(f.Value.String(), 0, 64)\"\n  },\n  {\n    \"name\": \"Uint\",\n    \"type\": \"uint\",\n    \"context_default\": \"0\",\n    \"parser\": \"strconv.ParseUint(f.Value.String(), 0, 64)\",\n    \"parser_cast\": \"uint(parsed)\"\n  }\n]\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/flag.go",
    "content": "package cli\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n\t\"time\"\n)\n\nconst defaultPlaceholder = \"value\"\n\n// BashCompletionFlag enables bash-completion for all commands and subcommands\nvar BashCompletionFlag Flag = BoolFlag{\n\tName:   \"generate-bash-completion\",\n\tHidden: true,\n}\n\n// VersionFlag prints the version for the application\nvar VersionFlag Flag = BoolFlag{\n\tName:  \"version, v\",\n\tUsage: \"print the version\",\n}\n\n// HelpFlag prints the help for all commands and subcommands\n// Set to the zero value (BoolFlag{}) to disable flag -- keeps subcommand\n// unless HideHelp is set to true)\nvar HelpFlag Flag = BoolFlag{\n\tName:  \"help, h\",\n\tUsage: \"show help\",\n}\n\n// FlagStringer converts a flag definition to a string. This is used by help\n// to display a flag.\nvar FlagStringer FlagStringFunc = stringifyFlag\n\n// FlagNamePrefixer converts a full flag name and its placeholder into the help\n// message flag prefix. This is used by the default FlagStringer.\nvar FlagNamePrefixer FlagNamePrefixFunc = prefixedNames\n\n// FlagEnvHinter annotates flag help message with the environment variable\n// details. This is used by the default FlagStringer.\nvar FlagEnvHinter FlagEnvHintFunc = withEnvHint\n\n// FlagFileHinter annotates flag help message with the environment variable\n// details. This is used by the default FlagStringer.\nvar FlagFileHinter FlagFileHintFunc = withFileHint\n\n// FlagsByName is a slice of Flag.\ntype FlagsByName []Flag\n\nfunc (f FlagsByName) Len() int {\n\treturn len(f)\n}\n\nfunc (f FlagsByName) Less(i, j int) bool {\n\treturn lexicographicLess(f[i].GetName(), f[j].GetName())\n}\n\nfunc (f FlagsByName) Swap(i, j int) {\n\tf[i], f[j] = f[j], f[i]\n}\n\n// Flag is a common interface related to parsing flags in cli.\n// For more advanced flag parsing techniques, it is recommended that\n// this interface be implemented.\ntype Flag interface {\n\tfmt.Stringer\n\t// Apply Flag settings to the given flag set\n\tApply(*flag.FlagSet)\n\tGetName() string\n}\n\n// errorableFlag is an interface that allows us to return errors during apply\n// it allows flags defined in this library to return errors in a fashion backwards compatible\n// TODO remove in v2 and modify the existing Flag interface to return errors\ntype errorableFlag interface {\n\tFlag\n\n\tApplyWithError(*flag.FlagSet) error\n}\n\nfunc flagSet(name string, flags []Flag) (*flag.FlagSet, error) {\n\tset := flag.NewFlagSet(name, flag.ContinueOnError)\n\n\tfor _, f := range flags {\n\t\t//TODO remove in v2 when errorableFlag is removed\n\t\tif ef, ok := f.(errorableFlag); ok {\n\t\t\tif err := ef.ApplyWithError(set); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\tf.Apply(set)\n\t\t}\n\t}\n\treturn set, nil\n}\n\nfunc eachName(longName string, fn func(string)) {\n\tparts := strings.Split(longName, \",\")\n\tfor _, name := range parts {\n\t\tname = strings.Trim(name, \" \")\n\t\tfn(name)\n\t}\n}\n\n// Generic is a generic parseable type identified by a specific flag\ntype Generic interface {\n\tSet(value string) error\n\tString() string\n}\n\n// Apply takes the flagset and calls Set on the generic flag with the value\n// provided by the user for parsing by the flag\n// Ignores parsing errors\nfunc (f GenericFlag) Apply(set *flag.FlagSet) {\n\tf.ApplyWithError(set)\n}\n\n// ApplyWithError takes the flagset and calls Set on the generic flag with the value\n// provided by the user for parsing by the flag\nfunc (f GenericFlag) ApplyWithError(set *flag.FlagSet) error {\n\tval := f.Value\n\tif fileEnvVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {\n\t\tif err := val.Set(fileEnvVal); err != nil {\n\t\t\treturn fmt.Errorf(\"could not parse %s as value for flag %s: %s\", fileEnvVal, f.Name, err)\n\t\t}\n\t}\n\n\teachName(f.Name, func(name string) {\n\t\tset.Var(f.Value, name, f.Usage)\n\t})\n\n\treturn nil\n}\n\n// StringSlice is an opaque type for []string to satisfy flag.Value and flag.Getter\ntype StringSlice []string\n\n// Set appends the string value to the list of values\nfunc (f *StringSlice) Set(value string) error {\n\t*f = append(*f, value)\n\treturn nil\n}\n\n// String returns a readable representation of this value (for usage defaults)\nfunc (f *StringSlice) String() string {\n\treturn fmt.Sprintf(\"%s\", *f)\n}\n\n// Value returns the slice of strings set by this flag\nfunc (f *StringSlice) Value() []string {\n\treturn *f\n}\n\n// Get returns the slice of strings set by this flag\nfunc (f *StringSlice) Get() interface{} {\n\treturn *f\n}\n\n// Apply populates the flag given the flag set and environment\n// Ignores errors\nfunc (f StringSliceFlag) Apply(set *flag.FlagSet) {\n\tf.ApplyWithError(set)\n}\n\n// ApplyWithError populates the flag given the flag set and environment\nfunc (f StringSliceFlag) ApplyWithError(set *flag.FlagSet) error {\n\tif envVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {\n\t\tnewVal := &StringSlice{}\n\t\tfor _, s := range strings.Split(envVal, \",\") {\n\t\t\ts = strings.TrimSpace(s)\n\t\t\tif err := newVal.Set(s); err != nil {\n\t\t\t\treturn fmt.Errorf(\"could not parse %s as string value for flag %s: %s\", envVal, f.Name, err)\n\t\t\t}\n\t\t}\n\t\tif f.Value == nil {\n\t\t\tf.Value = newVal\n\t\t} else {\n\t\t\t*f.Value = *newVal\n\t\t}\n\t}\n\n\teachName(f.Name, func(name string) {\n\t\tif f.Value == nil {\n\t\t\tf.Value = &StringSlice{}\n\t\t}\n\t\tset.Var(f.Value, name, f.Usage)\n\t})\n\n\treturn nil\n}\n\n// IntSlice is an opaque type for []int to satisfy flag.Value and flag.Getter\ntype IntSlice []int\n\n// Set parses the value into an integer and appends it to the list of values\nfunc (f *IntSlice) Set(value string) error {\n\ttmp, err := strconv.Atoi(value)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*f = append(*f, tmp)\n\treturn nil\n}\n\n// String returns a readable representation of this value (for usage defaults)\nfunc (f *IntSlice) String() string {\n\treturn fmt.Sprintf(\"%#v\", *f)\n}\n\n// Value returns the slice of ints set by this flag\nfunc (f *IntSlice) Value() []int {\n\treturn *f\n}\n\n// Get returns the slice of ints set by this flag\nfunc (f *IntSlice) Get() interface{} {\n\treturn *f\n}\n\n// Apply populates the flag given the flag set and environment\n// Ignores errors\nfunc (f IntSliceFlag) Apply(set *flag.FlagSet) {\n\tf.ApplyWithError(set)\n}\n\n// ApplyWithError populates the flag given the flag set and environment\nfunc (f IntSliceFlag) ApplyWithError(set *flag.FlagSet) error {\n\tif envVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {\n\t\tnewVal := &IntSlice{}\n\t\tfor _, s := range strings.Split(envVal, \",\") {\n\t\t\ts = strings.TrimSpace(s)\n\t\t\tif err := newVal.Set(s); err != nil {\n\t\t\t\treturn fmt.Errorf(\"could not parse %s as int slice value for flag %s: %s\", envVal, f.Name, err)\n\t\t\t}\n\t\t}\n\t\tif f.Value == nil {\n\t\t\tf.Value = newVal\n\t\t} else {\n\t\t\t*f.Value = *newVal\n\t\t}\n\t}\n\n\teachName(f.Name, func(name string) {\n\t\tif f.Value == nil {\n\t\t\tf.Value = &IntSlice{}\n\t\t}\n\t\tset.Var(f.Value, name, f.Usage)\n\t})\n\n\treturn nil\n}\n\n// Int64Slice is an opaque type for []int to satisfy flag.Value and flag.Getter\ntype Int64Slice []int64\n\n// Set parses the value into an integer and appends it to the list of values\nfunc (f *Int64Slice) Set(value string) error {\n\ttmp, err := strconv.ParseInt(value, 10, 64)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*f = append(*f, tmp)\n\treturn nil\n}\n\n// String returns a readable representation of this value (for usage defaults)\nfunc (f *Int64Slice) String() string {\n\treturn fmt.Sprintf(\"%#v\", *f)\n}\n\n// Value returns the slice of ints set by this flag\nfunc (f *Int64Slice) Value() []int64 {\n\treturn *f\n}\n\n// Get returns the slice of ints set by this flag\nfunc (f *Int64Slice) Get() interface{} {\n\treturn *f\n}\n\n// Apply populates the flag given the flag set and environment\n// Ignores errors\nfunc (f Int64SliceFlag) Apply(set *flag.FlagSet) {\n\tf.ApplyWithError(set)\n}\n\n// ApplyWithError populates the flag given the flag set and environment\nfunc (f Int64SliceFlag) ApplyWithError(set *flag.FlagSet) error {\n\tif envVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {\n\t\tnewVal := &Int64Slice{}\n\t\tfor _, s := range strings.Split(envVal, \",\") {\n\t\t\ts = strings.TrimSpace(s)\n\t\t\tif err := newVal.Set(s); err != nil {\n\t\t\t\treturn fmt.Errorf(\"could not parse %s as int64 slice value for flag %s: %s\", envVal, f.Name, err)\n\t\t\t}\n\t\t}\n\t\tif f.Value == nil {\n\t\t\tf.Value = newVal\n\t\t} else {\n\t\t\t*f.Value = *newVal\n\t\t}\n\t}\n\n\teachName(f.Name, func(name string) {\n\t\tif f.Value == nil {\n\t\t\tf.Value = &Int64Slice{}\n\t\t}\n\t\tset.Var(f.Value, name, f.Usage)\n\t})\n\treturn nil\n}\n\n// Apply populates the flag given the flag set and environment\n// Ignores errors\nfunc (f BoolFlag) Apply(set *flag.FlagSet) {\n\tf.ApplyWithError(set)\n}\n\n// ApplyWithError populates the flag given the flag set and environment\nfunc (f BoolFlag) ApplyWithError(set *flag.FlagSet) error {\n\tval := false\n\tif envVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {\n\t\tif envVal == \"\" {\n\t\t\tval = false\n\t\t} else {\n\t\t\tenvValBool, err := strconv.ParseBool(envVal)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"could not parse %s as bool value for flag %s: %s\", envVal, f.Name, err)\n\t\t\t}\n\t\t\tval = envValBool\n\t\t}\n\t}\n\n\teachName(f.Name, func(name string) {\n\t\tif f.Destination != nil {\n\t\t\tset.BoolVar(f.Destination, name, val, f.Usage)\n\t\t\treturn\n\t\t}\n\t\tset.Bool(name, val, f.Usage)\n\t})\n\n\treturn nil\n}\n\n// Apply populates the flag given the flag set and environment\n// Ignores errors\nfunc (f BoolTFlag) Apply(set *flag.FlagSet) {\n\tf.ApplyWithError(set)\n}\n\n// ApplyWithError populates the flag given the flag set and environment\nfunc (f BoolTFlag) ApplyWithError(set *flag.FlagSet) error {\n\tval := true\n\n\tif envVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {\n\t\tif envVal == \"\" {\n\t\t\tval = false\n\t\t} else {\n\t\t\tenvValBool, err := strconv.ParseBool(envVal)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"could not parse %s as bool value for flag %s: %s\", envVal, f.Name, err)\n\t\t\t}\n\t\t\tval = envValBool\n\t\t}\n\t}\n\n\teachName(f.Name, func(name string) {\n\t\tif f.Destination != nil {\n\t\t\tset.BoolVar(f.Destination, name, val, f.Usage)\n\t\t\treturn\n\t\t}\n\t\tset.Bool(name, val, f.Usage)\n\t})\n\n\treturn nil\n}\n\n// Apply populates the flag given the flag set and environment\n// Ignores errors\nfunc (f StringFlag) Apply(set *flag.FlagSet) {\n\tf.ApplyWithError(set)\n}\n\n// ApplyWithError populates the flag given the flag set and environment\nfunc (f StringFlag) ApplyWithError(set *flag.FlagSet) error {\n\tif envVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {\n\t\tf.Value = envVal\n\t}\n\n\teachName(f.Name, func(name string) {\n\t\tif f.Destination != nil {\n\t\t\tset.StringVar(f.Destination, name, f.Value, f.Usage)\n\t\t\treturn\n\t\t}\n\t\tset.String(name, f.Value, f.Usage)\n\t})\n\n\treturn nil\n}\n\n// Apply populates the flag given the flag set and environment\n// Ignores errors\nfunc (f IntFlag) Apply(set *flag.FlagSet) {\n\tf.ApplyWithError(set)\n}\n\n// ApplyWithError populates the flag given the flag set and environment\nfunc (f IntFlag) ApplyWithError(set *flag.FlagSet) error {\n\tif envVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {\n\t\tenvValInt, err := strconv.ParseInt(envVal, 0, 64)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not parse %s as int value for flag %s: %s\", envVal, f.Name, err)\n\t\t}\n\t\tf.Value = int(envValInt)\n\t}\n\n\teachName(f.Name, func(name string) {\n\t\tif f.Destination != nil {\n\t\t\tset.IntVar(f.Destination, name, f.Value, f.Usage)\n\t\t\treturn\n\t\t}\n\t\tset.Int(name, f.Value, f.Usage)\n\t})\n\n\treturn nil\n}\n\n// Apply populates the flag given the flag set and environment\n// Ignores errors\nfunc (f Int64Flag) Apply(set *flag.FlagSet) {\n\tf.ApplyWithError(set)\n}\n\n// ApplyWithError populates the flag given the flag set and environment\nfunc (f Int64Flag) ApplyWithError(set *flag.FlagSet) error {\n\tif envVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {\n\t\tenvValInt, err := strconv.ParseInt(envVal, 0, 64)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not parse %s as int value for flag %s: %s\", envVal, f.Name, err)\n\t\t}\n\n\t\tf.Value = envValInt\n\t}\n\n\teachName(f.Name, func(name string) {\n\t\tif f.Destination != nil {\n\t\t\tset.Int64Var(f.Destination, name, f.Value, f.Usage)\n\t\t\treturn\n\t\t}\n\t\tset.Int64(name, f.Value, f.Usage)\n\t})\n\n\treturn nil\n}\n\n// Apply populates the flag given the flag set and environment\n// Ignores errors\nfunc (f UintFlag) Apply(set *flag.FlagSet) {\n\tf.ApplyWithError(set)\n}\n\n// ApplyWithError populates the flag given the flag set and environment\nfunc (f UintFlag) ApplyWithError(set *flag.FlagSet) error {\n\tif envVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {\n\t\tenvValInt, err := strconv.ParseUint(envVal, 0, 64)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not parse %s as uint value for flag %s: %s\", envVal, f.Name, err)\n\t\t}\n\n\t\tf.Value = uint(envValInt)\n\t}\n\n\teachName(f.Name, func(name string) {\n\t\tif f.Destination != nil {\n\t\t\tset.UintVar(f.Destination, name, f.Value, f.Usage)\n\t\t\treturn\n\t\t}\n\t\tset.Uint(name, f.Value, f.Usage)\n\t})\n\n\treturn nil\n}\n\n// Apply populates the flag given the flag set and environment\n// Ignores errors\nfunc (f Uint64Flag) Apply(set *flag.FlagSet) {\n\tf.ApplyWithError(set)\n}\n\n// ApplyWithError populates the flag given the flag set and environment\nfunc (f Uint64Flag) ApplyWithError(set *flag.FlagSet) error {\n\tif envVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {\n\t\tenvValInt, err := strconv.ParseUint(envVal, 0, 64)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not parse %s as uint64 value for flag %s: %s\", envVal, f.Name, err)\n\t\t}\n\n\t\tf.Value = uint64(envValInt)\n\t}\n\n\teachName(f.Name, func(name string) {\n\t\tif f.Destination != nil {\n\t\t\tset.Uint64Var(f.Destination, name, f.Value, f.Usage)\n\t\t\treturn\n\t\t}\n\t\tset.Uint64(name, f.Value, f.Usage)\n\t})\n\n\treturn nil\n}\n\n// Apply populates the flag given the flag set and environment\n// Ignores errors\nfunc (f DurationFlag) Apply(set *flag.FlagSet) {\n\tf.ApplyWithError(set)\n}\n\n// ApplyWithError populates the flag given the flag set and environment\nfunc (f DurationFlag) ApplyWithError(set *flag.FlagSet) error {\n\tif envVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {\n\t\tenvValDuration, err := time.ParseDuration(envVal)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not parse %s as duration for flag %s: %s\", envVal, f.Name, err)\n\t\t}\n\n\t\tf.Value = envValDuration\n\t}\n\n\teachName(f.Name, func(name string) {\n\t\tif f.Destination != nil {\n\t\t\tset.DurationVar(f.Destination, name, f.Value, f.Usage)\n\t\t\treturn\n\t\t}\n\t\tset.Duration(name, f.Value, f.Usage)\n\t})\n\n\treturn nil\n}\n\n// Apply populates the flag given the flag set and environment\n// Ignores errors\nfunc (f Float64Flag) Apply(set *flag.FlagSet) {\n\tf.ApplyWithError(set)\n}\n\n// ApplyWithError populates the flag given the flag set and environment\nfunc (f Float64Flag) ApplyWithError(set *flag.FlagSet) error {\n\tif envVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {\n\t\tenvValFloat, err := strconv.ParseFloat(envVal, 10)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not parse %s as float64 value for flag %s: %s\", envVal, f.Name, err)\n\t\t}\n\n\t\tf.Value = float64(envValFloat)\n\t}\n\n\teachName(f.Name, func(name string) {\n\t\tif f.Destination != nil {\n\t\t\tset.Float64Var(f.Destination, name, f.Value, f.Usage)\n\t\t\treturn\n\t\t}\n\t\tset.Float64(name, f.Value, f.Usage)\n\t})\n\n\treturn nil\n}\n\nfunc visibleFlags(fl []Flag) []Flag {\n\tvisible := []Flag{}\n\tfor _, flag := range fl {\n\t\tfield := flagValue(flag).FieldByName(\"Hidden\")\n\t\tif !field.IsValid() || !field.Bool() {\n\t\t\tvisible = append(visible, flag)\n\t\t}\n\t}\n\treturn visible\n}\n\nfunc prefixFor(name string) (prefix string) {\n\tif len(name) == 1 {\n\t\tprefix = \"-\"\n\t} else {\n\t\tprefix = \"--\"\n\t}\n\n\treturn\n}\n\n// Returns the placeholder, if any, and the unquoted usage string.\nfunc unquoteUsage(usage string) (string, string) {\n\tfor i := 0; i < len(usage); i++ {\n\t\tif usage[i] == '`' {\n\t\t\tfor j := i + 1; j < len(usage); j++ {\n\t\t\t\tif usage[j] == '`' {\n\t\t\t\t\tname := usage[i+1 : j]\n\t\t\t\t\tusage = usage[:i] + name + usage[j+1:]\n\t\t\t\t\treturn name, usage\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn \"\", usage\n}\n\nfunc prefixedNames(fullName, placeholder string) string {\n\tvar prefixed string\n\tparts := strings.Split(fullName, \",\")\n\tfor i, name := range parts {\n\t\tname = strings.Trim(name, \" \")\n\t\tprefixed += prefixFor(name) + name\n\t\tif placeholder != \"\" {\n\t\t\tprefixed += \" \" + placeholder\n\t\t}\n\t\tif i < len(parts)-1 {\n\t\t\tprefixed += \", \"\n\t\t}\n\t}\n\treturn prefixed\n}\n\nfunc withEnvHint(envVar, str string) string {\n\tenvText := \"\"\n\tif envVar != \"\" {\n\t\tprefix := \"$\"\n\t\tsuffix := \"\"\n\t\tsep := \", $\"\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\tprefix = \"%\"\n\t\t\tsuffix = \"%\"\n\t\t\tsep = \"%, %\"\n\t\t}\n\t\tenvText = fmt.Sprintf(\" [%s%s%s]\", prefix, strings.Join(strings.Split(envVar, \",\"), sep), suffix)\n\t}\n\treturn str + envText\n}\n\nfunc withFileHint(filePath, str string) string {\n\tfileText := \"\"\n\tif filePath != \"\" {\n\t\tfileText = fmt.Sprintf(\" [%s]\", filePath)\n\t}\n\treturn str + fileText\n}\n\nfunc flagValue(f Flag) reflect.Value {\n\tfv := reflect.ValueOf(f)\n\tfor fv.Kind() == reflect.Ptr {\n\t\tfv = reflect.Indirect(fv)\n\t}\n\treturn fv\n}\n\nfunc stringifyFlag(f Flag) string {\n\tfv := flagValue(f)\n\n\tswitch f.(type) {\n\tcase IntSliceFlag:\n\t\treturn FlagFileHinter(\n\t\t\tfv.FieldByName(\"FilePath\").String(),\n\t\t\tFlagEnvHinter(\n\t\t\t\tfv.FieldByName(\"EnvVar\").String(),\n\t\t\t\tstringifyIntSliceFlag(f.(IntSliceFlag)),\n\t\t\t),\n\t\t)\n\tcase Int64SliceFlag:\n\t\treturn FlagFileHinter(\n\t\t\tfv.FieldByName(\"FilePath\").String(),\n\t\t\tFlagEnvHinter(\n\t\t\t\tfv.FieldByName(\"EnvVar\").String(),\n\t\t\t\tstringifyInt64SliceFlag(f.(Int64SliceFlag)),\n\t\t\t),\n\t\t)\n\tcase StringSliceFlag:\n\t\treturn FlagFileHinter(\n\t\t\tfv.FieldByName(\"FilePath\").String(),\n\t\t\tFlagEnvHinter(\n\t\t\t\tfv.FieldByName(\"EnvVar\").String(),\n\t\t\t\tstringifyStringSliceFlag(f.(StringSliceFlag)),\n\t\t\t),\n\t\t)\n\t}\n\n\tplaceholder, usage := unquoteUsage(fv.FieldByName(\"Usage\").String())\n\n\tneedsPlaceholder := false\n\tdefaultValueString := \"\"\n\n\tif val := fv.FieldByName(\"Value\"); val.IsValid() {\n\t\tneedsPlaceholder = true\n\t\tdefaultValueString = fmt.Sprintf(\" (default: %v)\", val.Interface())\n\n\t\tif val.Kind() == reflect.String && val.String() != \"\" {\n\t\t\tdefaultValueString = fmt.Sprintf(\" (default: %q)\", val.String())\n\t\t}\n\t}\n\n\tif defaultValueString == \" (default: )\" {\n\t\tdefaultValueString = \"\"\n\t}\n\n\tif needsPlaceholder && placeholder == \"\" {\n\t\tplaceholder = defaultPlaceholder\n\t}\n\n\tusageWithDefault := strings.TrimSpace(fmt.Sprintf(\"%s%s\", usage, defaultValueString))\n\n\treturn FlagFileHinter(\n\t\tfv.FieldByName(\"FilePath\").String(),\n\t\tFlagEnvHinter(\n\t\t\tfv.FieldByName(\"EnvVar\").String(),\n\t\t\tfmt.Sprintf(\"%s\\t%s\", FlagNamePrefixer(fv.FieldByName(\"Name\").String(), placeholder), usageWithDefault),\n\t\t),\n\t)\n}\n\nfunc stringifyIntSliceFlag(f IntSliceFlag) string {\n\tdefaultVals := []string{}\n\tif f.Value != nil && len(f.Value.Value()) > 0 {\n\t\tfor _, i := range f.Value.Value() {\n\t\t\tdefaultVals = append(defaultVals, fmt.Sprintf(\"%d\", i))\n\t\t}\n\t}\n\n\treturn stringifySliceFlag(f.Usage, f.Name, defaultVals)\n}\n\nfunc stringifyInt64SliceFlag(f Int64SliceFlag) string {\n\tdefaultVals := []string{}\n\tif f.Value != nil && len(f.Value.Value()) > 0 {\n\t\tfor _, i := range f.Value.Value() {\n\t\t\tdefaultVals = append(defaultVals, fmt.Sprintf(\"%d\", i))\n\t\t}\n\t}\n\n\treturn stringifySliceFlag(f.Usage, f.Name, defaultVals)\n}\n\nfunc stringifyStringSliceFlag(f StringSliceFlag) string {\n\tdefaultVals := []string{}\n\tif f.Value != nil && len(f.Value.Value()) > 0 {\n\t\tfor _, s := range f.Value.Value() {\n\t\t\tif len(s) > 0 {\n\t\t\t\tdefaultVals = append(defaultVals, fmt.Sprintf(\"%q\", s))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn stringifySliceFlag(f.Usage, f.Name, defaultVals)\n}\n\nfunc stringifySliceFlag(usage, name string, defaultVals []string) string {\n\tplaceholder, usage := unquoteUsage(usage)\n\tif placeholder == \"\" {\n\t\tplaceholder = defaultPlaceholder\n\t}\n\n\tdefaultVal := \"\"\n\tif len(defaultVals) > 0 {\n\t\tdefaultVal = fmt.Sprintf(\" (default: %s)\", strings.Join(defaultVals, \", \"))\n\t}\n\n\tusageWithDefault := strings.TrimSpace(fmt.Sprintf(\"%s%s\", usage, defaultVal))\n\treturn fmt.Sprintf(\"%s\\t%s\", FlagNamePrefixer(name, placeholder), usageWithDefault)\n}\n\nfunc flagFromFileEnv(filePath, envName string) (val string, ok bool) {\n\tfor _, envVar := range strings.Split(envName, \",\") {\n\t\tenvVar = strings.TrimSpace(envVar)\n\t\tif envVal, ok := syscall.Getenv(envVar); ok {\n\t\t\treturn envVal, true\n\t\t}\n\t}\n\tfor _, fileVar := range strings.Split(filePath, \",\") {\n\t\tif data, err := ioutil.ReadFile(fileVar); err == nil {\n\t\t\treturn string(data), true\n\t\t}\n\t}\n\treturn \"\", false\n}\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/flag_generated.go",
    "content": "package cli\n\nimport (\n\t\"flag\"\n\t\"strconv\"\n\t\"time\"\n)\n\n// WARNING: This file is generated!\n\n// BoolFlag is a flag with type bool\ntype BoolFlag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tFilePath    string\n\tHidden      bool\n\tDestination *bool\n}\n\n// String returns a readable representation of this value\n// (for usage defaults)\nfunc (f BoolFlag) String() string {\n\treturn FlagStringer(f)\n}\n\n// GetName returns the name of the flag\nfunc (f BoolFlag) GetName() string {\n\treturn f.Name\n}\n\n// Bool looks up the value of a local BoolFlag, returns\n// false if not found\nfunc (c *Context) Bool(name string) bool {\n\treturn lookupBool(name, c.flagSet)\n}\n\n// GlobalBool looks up the value of a global BoolFlag, returns\n// false if not found\nfunc (c *Context) GlobalBool(name string) bool {\n\tif fs := lookupGlobalFlagSet(name, c); fs != nil {\n\t\treturn lookupBool(name, fs)\n\t}\n\treturn false\n}\n\nfunc lookupBool(name string, set *flag.FlagSet) bool {\n\tf := set.Lookup(name)\n\tif f != nil {\n\t\tparsed, err := strconv.ParseBool(f.Value.String())\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\t\treturn parsed\n\t}\n\treturn false\n}\n\n// BoolTFlag is a flag with type bool that is true by default\ntype BoolTFlag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tFilePath    string\n\tHidden      bool\n\tDestination *bool\n}\n\n// String returns a readable representation of this value\n// (for usage defaults)\nfunc (f BoolTFlag) String() string {\n\treturn FlagStringer(f)\n}\n\n// GetName returns the name of the flag\nfunc (f BoolTFlag) GetName() string {\n\treturn f.Name\n}\n\n// BoolT looks up the value of a local BoolTFlag, returns\n// false if not found\nfunc (c *Context) BoolT(name string) bool {\n\treturn lookupBoolT(name, c.flagSet)\n}\n\n// GlobalBoolT looks up the value of a global BoolTFlag, returns\n// false if not found\nfunc (c *Context) GlobalBoolT(name string) bool {\n\tif fs := lookupGlobalFlagSet(name, c); fs != nil {\n\t\treturn lookupBoolT(name, fs)\n\t}\n\treturn false\n}\n\nfunc lookupBoolT(name string, set *flag.FlagSet) bool {\n\tf := set.Lookup(name)\n\tif f != nil {\n\t\tparsed, err := strconv.ParseBool(f.Value.String())\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\t\treturn parsed\n\t}\n\treturn false\n}\n\n// DurationFlag is a flag with type time.Duration (see https://golang.org/pkg/time/#ParseDuration)\ntype DurationFlag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tFilePath    string\n\tHidden      bool\n\tValue       time.Duration\n\tDestination *time.Duration\n}\n\n// String returns a readable representation of this value\n// (for usage defaults)\nfunc (f DurationFlag) String() string {\n\treturn FlagStringer(f)\n}\n\n// GetName returns the name of the flag\nfunc (f DurationFlag) GetName() string {\n\treturn f.Name\n}\n\n// Duration looks up the value of a local DurationFlag, returns\n// 0 if not found\nfunc (c *Context) Duration(name string) time.Duration {\n\treturn lookupDuration(name, c.flagSet)\n}\n\n// GlobalDuration looks up the value of a global DurationFlag, returns\n// 0 if not found\nfunc (c *Context) GlobalDuration(name string) time.Duration {\n\tif fs := lookupGlobalFlagSet(name, c); fs != nil {\n\t\treturn lookupDuration(name, fs)\n\t}\n\treturn 0\n}\n\nfunc lookupDuration(name string, set *flag.FlagSet) time.Duration {\n\tf := set.Lookup(name)\n\tif f != nil {\n\t\tparsed, err := time.ParseDuration(f.Value.String())\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\treturn parsed\n\t}\n\treturn 0\n}\n\n// Float64Flag is a flag with type float64\ntype Float64Flag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tFilePath    string\n\tHidden      bool\n\tValue       float64\n\tDestination *float64\n}\n\n// String returns a readable representation of this value\n// (for usage defaults)\nfunc (f Float64Flag) String() string {\n\treturn FlagStringer(f)\n}\n\n// GetName returns the name of the flag\nfunc (f Float64Flag) GetName() string {\n\treturn f.Name\n}\n\n// Float64 looks up the value of a local Float64Flag, returns\n// 0 if not found\nfunc (c *Context) Float64(name string) float64 {\n\treturn lookupFloat64(name, c.flagSet)\n}\n\n// GlobalFloat64 looks up the value of a global Float64Flag, returns\n// 0 if not found\nfunc (c *Context) GlobalFloat64(name string) float64 {\n\tif fs := lookupGlobalFlagSet(name, c); fs != nil {\n\t\treturn lookupFloat64(name, fs)\n\t}\n\treturn 0\n}\n\nfunc lookupFloat64(name string, set *flag.FlagSet) float64 {\n\tf := set.Lookup(name)\n\tif f != nil {\n\t\tparsed, err := strconv.ParseFloat(f.Value.String(), 64)\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\treturn parsed\n\t}\n\treturn 0\n}\n\n// GenericFlag is a flag with type Generic\ntype GenericFlag struct {\n\tName     string\n\tUsage    string\n\tEnvVar   string\n\tFilePath string\n\tHidden   bool\n\tValue    Generic\n}\n\n// String returns a readable representation of this value\n// (for usage defaults)\nfunc (f GenericFlag) String() string {\n\treturn FlagStringer(f)\n}\n\n// GetName returns the name of the flag\nfunc (f GenericFlag) GetName() string {\n\treturn f.Name\n}\n\n// Generic looks up the value of a local GenericFlag, returns\n// nil if not found\nfunc (c *Context) Generic(name string) interface{} {\n\treturn lookupGeneric(name, c.flagSet)\n}\n\n// GlobalGeneric looks up the value of a global GenericFlag, returns\n// nil if not found\nfunc (c *Context) GlobalGeneric(name string) interface{} {\n\tif fs := lookupGlobalFlagSet(name, c); fs != nil {\n\t\treturn lookupGeneric(name, fs)\n\t}\n\treturn nil\n}\n\nfunc lookupGeneric(name string, set *flag.FlagSet) interface{} {\n\tf := set.Lookup(name)\n\tif f != nil {\n\t\tparsed, err := f.Value, error(nil)\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn parsed\n\t}\n\treturn nil\n}\n\n// Int64Flag is a flag with type int64\ntype Int64Flag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tFilePath    string\n\tHidden      bool\n\tValue       int64\n\tDestination *int64\n}\n\n// String returns a readable representation of this value\n// (for usage defaults)\nfunc (f Int64Flag) String() string {\n\treturn FlagStringer(f)\n}\n\n// GetName returns the name of the flag\nfunc (f Int64Flag) GetName() string {\n\treturn f.Name\n}\n\n// Int64 looks up the value of a local Int64Flag, returns\n// 0 if not found\nfunc (c *Context) Int64(name string) int64 {\n\treturn lookupInt64(name, c.flagSet)\n}\n\n// GlobalInt64 looks up the value of a global Int64Flag, returns\n// 0 if not found\nfunc (c *Context) GlobalInt64(name string) int64 {\n\tif fs := lookupGlobalFlagSet(name, c); fs != nil {\n\t\treturn lookupInt64(name, fs)\n\t}\n\treturn 0\n}\n\nfunc lookupInt64(name string, set *flag.FlagSet) int64 {\n\tf := set.Lookup(name)\n\tif f != nil {\n\t\tparsed, err := strconv.ParseInt(f.Value.String(), 0, 64)\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\treturn parsed\n\t}\n\treturn 0\n}\n\n// IntFlag is a flag with type int\ntype IntFlag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tFilePath    string\n\tHidden      bool\n\tValue       int\n\tDestination *int\n}\n\n// String returns a readable representation of this value\n// (for usage defaults)\nfunc (f IntFlag) String() string {\n\treturn FlagStringer(f)\n}\n\n// GetName returns the name of the flag\nfunc (f IntFlag) GetName() string {\n\treturn f.Name\n}\n\n// Int looks up the value of a local IntFlag, returns\n// 0 if not found\nfunc (c *Context) Int(name string) int {\n\treturn lookupInt(name, c.flagSet)\n}\n\n// GlobalInt looks up the value of a global IntFlag, returns\n// 0 if not found\nfunc (c *Context) GlobalInt(name string) int {\n\tif fs := lookupGlobalFlagSet(name, c); fs != nil {\n\t\treturn lookupInt(name, fs)\n\t}\n\treturn 0\n}\n\nfunc lookupInt(name string, set *flag.FlagSet) int {\n\tf := set.Lookup(name)\n\tif f != nil {\n\t\tparsed, err := strconv.ParseInt(f.Value.String(), 0, 64)\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\treturn int(parsed)\n\t}\n\treturn 0\n}\n\n// IntSliceFlag is a flag with type *IntSlice\ntype IntSliceFlag struct {\n\tName     string\n\tUsage    string\n\tEnvVar   string\n\tFilePath string\n\tHidden   bool\n\tValue    *IntSlice\n}\n\n// String returns a readable representation of this value\n// (for usage defaults)\nfunc (f IntSliceFlag) String() string {\n\treturn FlagStringer(f)\n}\n\n// GetName returns the name of the flag\nfunc (f IntSliceFlag) GetName() string {\n\treturn f.Name\n}\n\n// IntSlice looks up the value of a local IntSliceFlag, returns\n// nil if not found\nfunc (c *Context) IntSlice(name string) []int {\n\treturn lookupIntSlice(name, c.flagSet)\n}\n\n// GlobalIntSlice looks up the value of a global IntSliceFlag, returns\n// nil if not found\nfunc (c *Context) GlobalIntSlice(name string) []int {\n\tif fs := lookupGlobalFlagSet(name, c); fs != nil {\n\t\treturn lookupIntSlice(name, fs)\n\t}\n\treturn nil\n}\n\nfunc lookupIntSlice(name string, set *flag.FlagSet) []int {\n\tf := set.Lookup(name)\n\tif f != nil {\n\t\tparsed, err := (f.Value.(*IntSlice)).Value(), error(nil)\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn parsed\n\t}\n\treturn nil\n}\n\n// Int64SliceFlag is a flag with type *Int64Slice\ntype Int64SliceFlag struct {\n\tName     string\n\tUsage    string\n\tEnvVar   string\n\tFilePath string\n\tHidden   bool\n\tValue    *Int64Slice\n}\n\n// String returns a readable representation of this value\n// (for usage defaults)\nfunc (f Int64SliceFlag) String() string {\n\treturn FlagStringer(f)\n}\n\n// GetName returns the name of the flag\nfunc (f Int64SliceFlag) GetName() string {\n\treturn f.Name\n}\n\n// Int64Slice looks up the value of a local Int64SliceFlag, returns\n// nil if not found\nfunc (c *Context) Int64Slice(name string) []int64 {\n\treturn lookupInt64Slice(name, c.flagSet)\n}\n\n// GlobalInt64Slice looks up the value of a global Int64SliceFlag, returns\n// nil if not found\nfunc (c *Context) GlobalInt64Slice(name string) []int64 {\n\tif fs := lookupGlobalFlagSet(name, c); fs != nil {\n\t\treturn lookupInt64Slice(name, fs)\n\t}\n\treturn nil\n}\n\nfunc lookupInt64Slice(name string, set *flag.FlagSet) []int64 {\n\tf := set.Lookup(name)\n\tif f != nil {\n\t\tparsed, err := (f.Value.(*Int64Slice)).Value(), error(nil)\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn parsed\n\t}\n\treturn nil\n}\n\n// StringFlag is a flag with type string\ntype StringFlag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tFilePath    string\n\tHidden      bool\n\tValue       string\n\tDestination *string\n}\n\n// String returns a readable representation of this value\n// (for usage defaults)\nfunc (f StringFlag) String() string {\n\treturn FlagStringer(f)\n}\n\n// GetName returns the name of the flag\nfunc (f StringFlag) GetName() string {\n\treturn f.Name\n}\n\n// String looks up the value of a local StringFlag, returns\n// \"\" if not found\nfunc (c *Context) String(name string) string {\n\treturn lookupString(name, c.flagSet)\n}\n\n// GlobalString looks up the value of a global StringFlag, returns\n// \"\" if not found\nfunc (c *Context) GlobalString(name string) string {\n\tif fs := lookupGlobalFlagSet(name, c); fs != nil {\n\t\treturn lookupString(name, fs)\n\t}\n\treturn \"\"\n}\n\nfunc lookupString(name string, set *flag.FlagSet) string {\n\tf := set.Lookup(name)\n\tif f != nil {\n\t\tparsed, err := f.Value.String(), error(nil)\n\t\tif err != nil {\n\t\t\treturn \"\"\n\t\t}\n\t\treturn parsed\n\t}\n\treturn \"\"\n}\n\n// StringSliceFlag is a flag with type *StringSlice\ntype StringSliceFlag struct {\n\tName     string\n\tUsage    string\n\tEnvVar   string\n\tFilePath string\n\tHidden   bool\n\tValue    *StringSlice\n}\n\n// String returns a readable representation of this value\n// (for usage defaults)\nfunc (f StringSliceFlag) String() string {\n\treturn FlagStringer(f)\n}\n\n// GetName returns the name of the flag\nfunc (f StringSliceFlag) GetName() string {\n\treturn f.Name\n}\n\n// StringSlice looks up the value of a local StringSliceFlag, returns\n// nil if not found\nfunc (c *Context) StringSlice(name string) []string {\n\treturn lookupStringSlice(name, c.flagSet)\n}\n\n// GlobalStringSlice looks up the value of a global StringSliceFlag, returns\n// nil if not found\nfunc (c *Context) GlobalStringSlice(name string) []string {\n\tif fs := lookupGlobalFlagSet(name, c); fs != nil {\n\t\treturn lookupStringSlice(name, fs)\n\t}\n\treturn nil\n}\n\nfunc lookupStringSlice(name string, set *flag.FlagSet) []string {\n\tf := set.Lookup(name)\n\tif f != nil {\n\t\tparsed, err := (f.Value.(*StringSlice)).Value(), error(nil)\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn parsed\n\t}\n\treturn nil\n}\n\n// Uint64Flag is a flag with type uint64\ntype Uint64Flag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tFilePath    string\n\tHidden      bool\n\tValue       uint64\n\tDestination *uint64\n}\n\n// String returns a readable representation of this value\n// (for usage defaults)\nfunc (f Uint64Flag) String() string {\n\treturn FlagStringer(f)\n}\n\n// GetName returns the name of the flag\nfunc (f Uint64Flag) GetName() string {\n\treturn f.Name\n}\n\n// Uint64 looks up the value of a local Uint64Flag, returns\n// 0 if not found\nfunc (c *Context) Uint64(name string) uint64 {\n\treturn lookupUint64(name, c.flagSet)\n}\n\n// GlobalUint64 looks up the value of a global Uint64Flag, returns\n// 0 if not found\nfunc (c *Context) GlobalUint64(name string) uint64 {\n\tif fs := lookupGlobalFlagSet(name, c); fs != nil {\n\t\treturn lookupUint64(name, fs)\n\t}\n\treturn 0\n}\n\nfunc lookupUint64(name string, set *flag.FlagSet) uint64 {\n\tf := set.Lookup(name)\n\tif f != nil {\n\t\tparsed, err := strconv.ParseUint(f.Value.String(), 0, 64)\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\treturn parsed\n\t}\n\treturn 0\n}\n\n// UintFlag is a flag with type uint\ntype UintFlag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tFilePath    string\n\tHidden      bool\n\tValue       uint\n\tDestination *uint\n}\n\n// String returns a readable representation of this value\n// (for usage defaults)\nfunc (f UintFlag) String() string {\n\treturn FlagStringer(f)\n}\n\n// GetName returns the name of the flag\nfunc (f UintFlag) GetName() string {\n\treturn f.Name\n}\n\n// Uint looks up the value of a local UintFlag, returns\n// 0 if not found\nfunc (c *Context) Uint(name string) uint {\n\treturn lookupUint(name, c.flagSet)\n}\n\n// GlobalUint looks up the value of a global UintFlag, returns\n// 0 if not found\nfunc (c *Context) GlobalUint(name string) uint {\n\tif fs := lookupGlobalFlagSet(name, c); fs != nil {\n\t\treturn lookupUint(name, fs)\n\t}\n\treturn 0\n}\n\nfunc lookupUint(name string, set *flag.FlagSet) uint {\n\tf := set.Lookup(name)\n\tif f != nil {\n\t\tparsed, err := strconv.ParseUint(f.Value.String(), 0, 64)\n\t\tif err != nil {\n\t\t\treturn 0\n\t\t}\n\t\treturn uint(parsed)\n\t}\n\treturn 0\n}\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/funcs.go",
    "content": "package cli\n\n// BashCompleteFunc is an action to execute when the bash-completion flag is set\ntype BashCompleteFunc func(*Context)\n\n// BeforeFunc is an action to execute before any subcommands are run, but after\n// the context is ready if a non-nil error is returned, no subcommands are run\ntype BeforeFunc func(*Context) error\n\n// AfterFunc is an action to execute after any subcommands are run, but after the\n// subcommand has finished it is run even if Action() panics\ntype AfterFunc func(*Context) error\n\n// ActionFunc is the action to execute when no subcommands are specified\ntype ActionFunc func(*Context) error\n\n// CommandNotFoundFunc is executed if the proper command cannot be found\ntype CommandNotFoundFunc func(*Context, string)\n\n// OnUsageErrorFunc is executed if an usage error occurs. This is useful for displaying\n// customized usage error messages.  This function is able to replace the\n// original error messages.  If this function is not set, the \"Incorrect usage\"\n// is displayed and the execution is interrupted.\ntype OnUsageErrorFunc func(context *Context, err error, isSubcommand bool) error\n\n// ExitErrHandlerFunc is executed if provided in order to handle ExitError values\n// returned by Actions and Before/After functions.\ntype ExitErrHandlerFunc func(context *Context, err error)\n\n// FlagStringFunc is used by the help generation to display a flag, which is\n// expected to be a single line.\ntype FlagStringFunc func(Flag) string\n\n// FlagNamePrefixFunc is used by the default FlagStringFunc to create prefix\n// text for a flag's full name.\ntype FlagNamePrefixFunc func(fullName, placeholder string) string\n\n// FlagEnvHintFunc is used by the default FlagStringFunc to annotate flag help\n// with the environment variable details.\ntype FlagEnvHintFunc func(envVar, str string) string\n\n// FlagFileHintFunc is used by the default FlagStringFunc to annotate flag help\n// with the file path details.\ntype FlagFileHintFunc func(filePath, str string) string\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/generate-flag-types",
    "content": "#!/usr/bin/env python\n\"\"\"\nThe flag types that ship with the cli library have many things in common, and\nso we can take advantage of the `go generate` command to create much of the\nsource code from a list of definitions.  These definitions attempt to cover\nthe parts that vary between flag types, and should evolve as needed.\n\nAn example of the minimum definition needed is:\n\n    {\n      \"name\": \"SomeType\",\n      \"type\": \"sometype\",\n      \"context_default\": \"nil\"\n    }\n\nIn this example, the code generated for the `cli` package will include a type\nnamed `SomeTypeFlag` that is expected to wrap a value of type `sometype`.\nFetching values by name via `*cli.Context` will default to a value of `nil`.\n\nA more complete, albeit somewhat redundant, example showing all available\ndefinition keys is:\n\n    {\n      \"name\": \"VeryMuchType\",\n      \"type\": \"*VeryMuchType\",\n      \"value\": true,\n      \"dest\": false,\n      \"doctail\": \" which really only wraps a []float64, oh well!\",\n      \"context_type\": \"[]float64\",\n      \"context_default\": \"nil\",\n      \"parser\": \"parseVeryMuchType(f.Value.String())\",\n      \"parser_cast\": \"[]float64(parsed)\"\n    }\n\nThe meaning of each field is as follows:\n\n               name (string) - The type \"name\", which will be suffixed with\n                               `Flag` when generating the type definition\n                               for `cli` and the wrapper type for `altsrc`\n               type (string) - The type that the generated `Flag` type for `cli`\n                               is expected to \"contain\" as its `.Value` member\n                value (bool) - Should the generated `cli` type have a `Value`\n                               member?\n                 dest (bool) - Should the generated `cli` type support a\n                               destination pointer?\n            doctail (string) - Additional docs for the `cli` flag type comment\n       context_type (string) - The literal type used in the `*cli.Context`\n                               reader func signature\n    context_default (string) - The literal value used as the default by the\n                               `*cli.Context` reader funcs when no value is\n                               present\n             parser (string) - Literal code used to parse the flag `f`,\n                               expected to have a return signature of\n                               (value, error)\n        parser_cast (string) - Literal code used to cast the `parsed` value\n                               returned from the `parser` code\n\"\"\"\n\nfrom __future__ import print_function, unicode_literals\n\nimport argparse\nimport json\nimport os\nimport subprocess\nimport sys\nimport tempfile\nimport textwrap\n\n\nclass _FancyFormatter(argparse.ArgumentDefaultsHelpFormatter,\n                      argparse.RawDescriptionHelpFormatter):\n    pass\n\n\ndef main(sysargs=sys.argv[:]):\n    parser = argparse.ArgumentParser(\n        description='Generate flag type code!',\n        formatter_class=_FancyFormatter)\n    parser.add_argument(\n        'package',\n        type=str, default='cli', choices=_WRITEFUNCS.keys(),\n        help='Package for which flag types will be generated'\n    )\n    parser.add_argument(\n        '-i', '--in-json',\n        type=argparse.FileType('r'),\n        default=sys.stdin,\n        help='Input JSON file which defines each type to be generated'\n    )\n    parser.add_argument(\n        '-o', '--out-go',\n        type=argparse.FileType('w'),\n        default=sys.stdout,\n        help='Output file/stream to which generated source will be written'\n    )\n    parser.epilog = __doc__\n\n    args = parser.parse_args(sysargs[1:])\n    _generate_flag_types(_WRITEFUNCS[args.package], args.out_go, args.in_json)\n    return 0\n\n\ndef _generate_flag_types(writefunc, output_go, input_json):\n    types = json.load(input_json)\n\n    tmp = tempfile.NamedTemporaryFile(suffix='.go', delete=False)\n    writefunc(tmp, types)\n    tmp.close()\n\n    new_content = subprocess.check_output(\n        ['goimports', tmp.name]\n    ).decode('utf-8')\n\n    print(new_content, file=output_go, end='')\n    output_go.flush()\n    os.remove(tmp.name)\n\n\ndef _set_typedef_defaults(typedef):\n    typedef.setdefault('doctail', '')\n    typedef.setdefault('context_type', typedef['type'])\n    typedef.setdefault('dest', True)\n    typedef.setdefault('value', True)\n    typedef.setdefault('parser', 'f.Value, error(nil)')\n    typedef.setdefault('parser_cast', 'parsed')\n\n\ndef _write_cli_flag_types(outfile, types):\n    _fwrite(outfile, \"\"\"\\\n        package cli\n\n        // WARNING: This file is generated!\n\n        \"\"\")\n\n    for typedef in types:\n        _set_typedef_defaults(typedef)\n\n        _fwrite(outfile, \"\"\"\\\n        // {name}Flag is a flag with type {type}{doctail}\n        type {name}Flag struct {{\n            Name string\n            Usage string\n            EnvVar string\n            FilePath string\n            Hidden bool\n        \"\"\".format(**typedef))\n\n        if typedef['value']:\n            _fwrite(outfile, \"\"\"\\\n            Value {type}\n            \"\"\".format(**typedef))\n\n        if typedef['dest']:\n            _fwrite(outfile, \"\"\"\\\n            Destination *{type}\n            \"\"\".format(**typedef))\n\n        _fwrite(outfile, \"\\n}\\n\\n\")\n\n        _fwrite(outfile, \"\"\"\\\n            // String returns a readable representation of this value\n            // (for usage defaults)\n            func (f {name}Flag) String() string {{\n                return FlagStringer(f)\n            }}\n\n            // GetName returns the name of the flag\n            func (f {name}Flag) GetName() string {{\n                return f.Name\n            }}\n\n            // {name} looks up the value of a local {name}Flag, returns\n            // {context_default} if not found\n            func (c *Context) {name}(name string) {context_type} {{\n                return lookup{name}(name, c.flagSet)\n            }}\n\n            // Global{name} looks up the value of a global {name}Flag, returns\n            // {context_default} if not found\n            func (c *Context) Global{name}(name string) {context_type} {{\n                if fs := lookupGlobalFlagSet(name, c); fs != nil {{\n                    return lookup{name}(name, fs)\n                }}\n                return {context_default}\n            }}\n\n            func lookup{name}(name string, set *flag.FlagSet) {context_type} {{\n                f := set.Lookup(name)\n                if f != nil {{\n                    parsed, err := {parser}\n                    if err != nil {{\n                        return {context_default}\n                    }}\n                    return {parser_cast}\n                }}\n                return {context_default}\n            }}\n            \"\"\".format(**typedef))\n\n\ndef _write_altsrc_flag_types(outfile, types):\n    _fwrite(outfile, \"\"\"\\\n        package altsrc\n\n        import (\n            \"gopkg.in/urfave/cli.v1\"\n        )\n\n        // WARNING: This file is generated!\n\n        \"\"\")\n\n    for typedef in types:\n        _set_typedef_defaults(typedef)\n\n        _fwrite(outfile, \"\"\"\\\n        // {name}Flag is the flag type that wraps cli.{name}Flag to allow\n        // for other values to be specified\n        type {name}Flag struct {{\n            cli.{name}Flag\n            set *flag.FlagSet\n        }}\n\n        // New{name}Flag creates a new {name}Flag\n        func New{name}Flag(fl cli.{name}Flag) *{name}Flag {{\n            return &{name}Flag{{{name}Flag: fl, set: nil}}\n        }}\n\n        // Apply saves the flagSet for later usage calls, then calls the\n        // wrapped {name}Flag.Apply\n        func (f *{name}Flag) Apply(set *flag.FlagSet) {{\n            f.set = set\n            f.{name}Flag.Apply(set)\n        }}\n\n        // ApplyWithError saves the flagSet for later usage calls, then calls the\n        // wrapped {name}Flag.ApplyWithError\n        func (f *{name}Flag) ApplyWithError(set *flag.FlagSet) error {{\n            f.set = set\n            return f.{name}Flag.ApplyWithError(set)\n        }}\n        \"\"\".format(**typedef))\n\n\ndef _fwrite(outfile, text):\n    print(textwrap.dedent(text), end='', file=outfile)\n\n\n_WRITEFUNCS = {\n    'cli': _write_cli_flag_types,\n    'altsrc': _write_altsrc_flag_types\n}\n\nif __name__ == '__main__':\n    sys.exit(main())\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/help.go",
    "content": "package cli\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\t\"text/tabwriter\"\n\t\"text/template\"\n)\n\n// AppHelpTemplate is the text template for the Default help topic.\n// cli.go uses text/template to render templates. You can\n// render custom help text by setting this variable.\nvar AppHelpTemplate = `NAME:\n   {{.Name}}{{if .Usage}} - {{.Usage}}{{end}}\n\nUSAGE:\n   {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Version}}{{if not .HideVersion}}\n\nVERSION:\n   {{.Version}}{{end}}{{end}}{{if .Description}}\n\nDESCRIPTION:\n   {{.Description}}{{end}}{{if len .Authors}}\n\nAUTHOR{{with $length := len .Authors}}{{if ne 1 $length}}S{{end}}{{end}}:\n   {{range $index, $author := .Authors}}{{if $index}}\n   {{end}}{{$author}}{{end}}{{end}}{{if .VisibleCommands}}\n\nCOMMANDS:{{range .VisibleCategories}}{{if .Name}}\n\n   {{.Name}}:{{end}}{{range .VisibleCommands}}\n     {{join .Names \", \"}}{{\"\\t\"}}{{.Usage}}{{end}}{{end}}{{end}}{{if .VisibleFlags}}\n\nGLOBAL OPTIONS:\n   {{range $index, $option := .VisibleFlags}}{{if $index}}\n   {{end}}{{$option}}{{end}}{{end}}{{if .Copyright}}\n\nCOPYRIGHT:\n   {{.Copyright}}{{end}}\n`\n\n// CommandHelpTemplate is the text template for the command help topic.\n// cli.go uses text/template to render templates. You can\n// render custom help text by setting this variable.\nvar CommandHelpTemplate = `NAME:\n   {{.HelpName}} - {{.Usage}}\n\nUSAGE:\n   {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}}{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Category}}\n\nCATEGORY:\n   {{.Category}}{{end}}{{if .Description}}\n\nDESCRIPTION:\n   {{.Description}}{{end}}{{if .VisibleFlags}}\n\nOPTIONS:\n   {{range .VisibleFlags}}{{.}}\n   {{end}}{{end}}\n`\n\n// SubcommandHelpTemplate is the text template for the subcommand help topic.\n// cli.go uses text/template to render templates. You can\n// render custom help text by setting this variable.\nvar SubcommandHelpTemplate = `NAME:\n   {{.HelpName}} - {{if .Description}}{{.Description}}{{else}}{{.Usage}}{{end}}\n\nUSAGE:\n   {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}\n\nCOMMANDS:{{range .VisibleCategories}}{{if .Name}}\n   {{.Name}}:{{end}}{{range .VisibleCommands}}\n     {{join .Names \", \"}}{{\"\\t\"}}{{.Usage}}{{end}}\n{{end}}{{if .VisibleFlags}}\nOPTIONS:\n   {{range .VisibleFlags}}{{.}}\n   {{end}}{{end}}\n`\n\nvar helpCommand = Command{\n\tName:      \"help\",\n\tAliases:   []string{\"h\"},\n\tUsage:     \"Shows a list of commands or help for one command\",\n\tArgsUsage: \"[command]\",\n\tAction: func(c *Context) error {\n\t\targs := c.Args()\n\t\tif args.Present() {\n\t\t\treturn ShowCommandHelp(c, args.First())\n\t\t}\n\n\t\tShowAppHelp(c)\n\t\treturn nil\n\t},\n}\n\nvar helpSubcommand = Command{\n\tName:      \"help\",\n\tAliases:   []string{\"h\"},\n\tUsage:     \"Shows a list of commands or help for one command\",\n\tArgsUsage: \"[command]\",\n\tAction: func(c *Context) error {\n\t\targs := c.Args()\n\t\tif args.Present() {\n\t\t\treturn ShowCommandHelp(c, args.First())\n\t\t}\n\n\t\treturn ShowSubcommandHelp(c)\n\t},\n}\n\n// Prints help for the App or Command\ntype helpPrinter func(w io.Writer, templ string, data interface{})\n\n// Prints help for the App or Command with custom template function.\ntype helpPrinterCustom func(w io.Writer, templ string, data interface{}, customFunc map[string]interface{})\n\n// HelpPrinter is a function that writes the help output. If not set a default\n// is used. The function signature is:\n// func(w io.Writer, templ string, data interface{})\nvar HelpPrinter helpPrinter = printHelp\n\n// HelpPrinterCustom is same as HelpPrinter but\n// takes a custom function for template function map.\nvar HelpPrinterCustom helpPrinterCustom = printHelpCustom\n\n// VersionPrinter prints the version for the App\nvar VersionPrinter = printVersion\n\n// ShowAppHelpAndExit - Prints the list of subcommands for the app and exits with exit code.\nfunc ShowAppHelpAndExit(c *Context, exitCode int) {\n\tShowAppHelp(c)\n\tos.Exit(exitCode)\n}\n\n// ShowAppHelp is an action that displays the help.\nfunc ShowAppHelp(c *Context) (err error) {\n\tif c.App.CustomAppHelpTemplate == \"\" {\n\t\tHelpPrinter(c.App.Writer, AppHelpTemplate, c.App)\n\t\treturn\n\t}\n\tcustomAppData := func() map[string]interface{} {\n\t\tif c.App.ExtraInfo == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn map[string]interface{}{\n\t\t\t\"ExtraInfo\": c.App.ExtraInfo,\n\t\t}\n\t}\n\tHelpPrinterCustom(c.App.Writer, c.App.CustomAppHelpTemplate, c.App, customAppData())\n\treturn nil\n}\n\n// DefaultAppComplete prints the list of subcommands as the default app completion method\nfunc DefaultAppComplete(c *Context) {\n\tfor _, command := range c.App.Commands {\n\t\tif command.Hidden {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, name := range command.Names() {\n\t\t\tfmt.Fprintln(c.App.Writer, name)\n\t\t}\n\t}\n}\n\n// ShowCommandHelpAndExit - exits with code after showing help\nfunc ShowCommandHelpAndExit(c *Context, command string, code int) {\n\tShowCommandHelp(c, command)\n\tos.Exit(code)\n}\n\n// ShowCommandHelp prints help for the given command\nfunc ShowCommandHelp(ctx *Context, command string) error {\n\t// show the subcommand help for a command with subcommands\n\tif command == \"\" {\n\t\tHelpPrinter(ctx.App.Writer, SubcommandHelpTemplate, ctx.App)\n\t\treturn nil\n\t}\n\n\tfor _, c := range ctx.App.Commands {\n\t\tif c.HasName(command) {\n\t\t\tif c.CustomHelpTemplate != \"\" {\n\t\t\t\tHelpPrinterCustom(ctx.App.Writer, c.CustomHelpTemplate, c, nil)\n\t\t\t} else {\n\t\t\t\tHelpPrinter(ctx.App.Writer, CommandHelpTemplate, c)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tif ctx.App.CommandNotFound == nil {\n\t\treturn NewExitError(fmt.Sprintf(\"No help topic for '%v'\", command), 3)\n\t}\n\n\tctx.App.CommandNotFound(ctx, command)\n\treturn nil\n}\n\n// ShowSubcommandHelp prints help for the given subcommand\nfunc ShowSubcommandHelp(c *Context) error {\n\treturn ShowCommandHelp(c, c.Command.Name)\n}\n\n// ShowVersion prints the version number of the App\nfunc ShowVersion(c *Context) {\n\tVersionPrinter(c)\n}\n\nfunc printVersion(c *Context) {\n\tfmt.Fprintf(c.App.Writer, \"%v version %v\\n\", c.App.Name, c.App.Version)\n}\n\n// ShowCompletions prints the lists of commands within a given context\nfunc ShowCompletions(c *Context) {\n\ta := c.App\n\tif a != nil && a.BashComplete != nil {\n\t\ta.BashComplete(c)\n\t}\n}\n\n// ShowCommandCompletions prints the custom completions for a given command\nfunc ShowCommandCompletions(ctx *Context, command string) {\n\tc := ctx.App.Command(command)\n\tif c != nil && c.BashComplete != nil {\n\t\tc.BashComplete(ctx)\n\t}\n}\n\nfunc printHelpCustom(out io.Writer, templ string, data interface{}, customFunc map[string]interface{}) {\n\tfuncMap := template.FuncMap{\n\t\t\"join\": strings.Join,\n\t}\n\tif customFunc != nil {\n\t\tfor key, value := range customFunc {\n\t\t\tfuncMap[key] = value\n\t\t}\n\t}\n\n\tw := tabwriter.NewWriter(out, 1, 8, 2, ' ', 0)\n\tt := template.Must(template.New(\"help\").Funcs(funcMap).Parse(templ))\n\terr := t.Execute(w, data)\n\tif err != nil {\n\t\t// If the writer is closed, t.Execute will fail, and there's nothing\n\t\t// we can do to recover.\n\t\tif os.Getenv(\"CLI_TEMPLATE_ERROR_DEBUG\") != \"\" {\n\t\t\tfmt.Fprintf(ErrWriter, \"CLI TEMPLATE ERROR: %#v\\n\", err)\n\t\t}\n\t\treturn\n\t}\n\tw.Flush()\n}\n\nfunc printHelp(out io.Writer, templ string, data interface{}) {\n\tprintHelpCustom(out, templ, data, nil)\n}\n\nfunc checkVersion(c *Context) bool {\n\tfound := false\n\tif VersionFlag.GetName() != \"\" {\n\t\teachName(VersionFlag.GetName(), func(name string) {\n\t\t\tif c.GlobalBool(name) || c.Bool(name) {\n\t\t\t\tfound = true\n\t\t\t}\n\t\t})\n\t}\n\treturn found\n}\n\nfunc checkHelp(c *Context) bool {\n\tfound := false\n\tif HelpFlag.GetName() != \"\" {\n\t\teachName(HelpFlag.GetName(), func(name string) {\n\t\t\tif c.GlobalBool(name) || c.Bool(name) {\n\t\t\t\tfound = true\n\t\t\t}\n\t\t})\n\t}\n\treturn found\n}\n\nfunc checkCommandHelp(c *Context, name string) bool {\n\tif c.Bool(\"h\") || c.Bool(\"help\") {\n\t\tShowCommandHelp(c, name)\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc checkSubcommandHelp(c *Context) bool {\n\tif c.Bool(\"h\") || c.Bool(\"help\") {\n\t\tShowSubcommandHelp(c)\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc checkShellCompleteFlag(a *App, arguments []string) (bool, []string) {\n\tif !a.EnableBashCompletion {\n\t\treturn false, arguments\n\t}\n\n\tpos := len(arguments) - 1\n\tlastArg := arguments[pos]\n\n\tif lastArg != \"--\"+BashCompletionFlag.GetName() {\n\t\treturn false, arguments\n\t}\n\n\treturn true, arguments[:pos]\n}\n\nfunc checkCompletions(c *Context) bool {\n\tif !c.shellComplete {\n\t\treturn false\n\t}\n\n\tif args := c.Args(); args.Present() {\n\t\tname := args.First()\n\t\tif cmd := c.App.Command(name); cmd != nil {\n\t\t\t// let the command handle the completion\n\t\t\treturn false\n\t\t}\n\t}\n\n\tShowCompletions(c)\n\treturn true\n}\n\nfunc checkCommandCompletions(c *Context, name string) bool {\n\tif !c.shellComplete {\n\t\treturn false\n\t}\n\n\tShowCommandCompletions(c, name)\n\treturn true\n}\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/runtests",
    "content": "#!/usr/bin/env python\nfrom __future__ import print_function\n\nimport argparse\nimport os\nimport sys\nimport tempfile\n\nfrom subprocess import check_call, check_output\n\n\nPACKAGE_NAME = os.environ.get(\n    'CLI_PACKAGE_NAME', 'github.com/urfave/cli'\n)\n\n\ndef main(sysargs=sys.argv[:]):\n    targets = {\n        'vet': _vet,\n        'test': _test,\n        'gfmrun': _gfmrun,\n        'toc': _toc,\n        'gen': _gen,\n    }\n\n    parser = argparse.ArgumentParser()\n    parser.add_argument(\n        'target', nargs='?', choices=tuple(targets.keys()), default='test'\n    )\n    args = parser.parse_args(sysargs[1:])\n\n    targets[args.target]()\n    return 0\n\n\ndef _test():\n    if check_output('go version'.split()).split()[2] < 'go1.2':\n        _run('go test -v .')\n        return\n\n    coverprofiles = []\n    for subpackage in ['', 'altsrc']:\n        coverprofile = 'cli.coverprofile'\n        if subpackage != '':\n            coverprofile = '{}.coverprofile'.format(subpackage)\n\n        coverprofiles.append(coverprofile)\n\n        _run('go test -v'.split() + [\n            '-coverprofile={}'.format(coverprofile),\n            ('{}/{}'.format(PACKAGE_NAME, subpackage)).rstrip('/')\n        ])\n\n    combined_name = _combine_coverprofiles(coverprofiles)\n    _run('go tool cover -func={}'.format(combined_name))\n    os.remove(combined_name)\n\n\ndef _gfmrun():\n    go_version = check_output('go version'.split()).split()[2]\n    if go_version < 'go1.3':\n        print('runtests: skip on {}'.format(go_version), file=sys.stderr)\n        return\n    _run(['gfmrun', '-c', str(_gfmrun_count()), '-s', 'README.md'])\n\n\ndef _vet():\n    _run('go vet ./...')\n\n\ndef _toc():\n    _run('node_modules/.bin/markdown-toc -i README.md')\n    _run('git diff --exit-code')\n\n\ndef _gen():\n    go_version = check_output('go version'.split()).split()[2]\n    if go_version < 'go1.5':\n        print('runtests: skip on {}'.format(go_version), file=sys.stderr)\n        return\n\n    _run('go generate ./...')\n    _run('git diff --exit-code')\n\n\ndef _run(command):\n    if hasattr(command, 'split'):\n        command = command.split()\n    print('runtests: {}'.format(' '.join(command)), file=sys.stderr)\n    check_call(command)\n\n\ndef _gfmrun_count():\n    with open('README.md') as infile:\n        lines = infile.read().splitlines()\n        return len(filter(_is_go_runnable, lines))\n\n\ndef _is_go_runnable(line):\n    return line.startswith('package main')\n\n\ndef _combine_coverprofiles(coverprofiles):\n    combined = tempfile.NamedTemporaryFile(\n        suffix='.coverprofile', delete=False\n    )\n    combined.write('mode: set\\n')\n\n    for coverprofile in coverprofiles:\n        with open(coverprofile, 'r') as infile:\n            for line in infile.readlines():\n                if not line.startswith('mode: '):\n                    combined.write(line)\n\n    combined.flush()\n    name = combined.name\n    combined.close()\n    return name\n\n\nif __name__ == '__main__':\n    sys.exit(main())\n"
  },
  {
    "path": "vendor/github.com/urfave/cli/sort.go",
    "content": "package cli\n\nimport \"unicode\"\n\n// lexicographicLess compares strings alphabetically considering case.\nfunc lexicographicLess(i, j string) bool {\n\tiRunes := []rune(i)\n\tjRunes := []rune(j)\n\n\tlenShared := len(iRunes)\n\tif lenShared > len(jRunes) {\n\t\tlenShared = len(jRunes)\n\t}\n\n\tfor index := 0; index < lenShared; index++ {\n\t\tir := iRunes[index]\n\t\tjr := jRunes[index]\n\n\t\tif lir, ljr := unicode.ToLower(ir), unicode.ToLower(jr); lir != ljr {\n\t\t\treturn lir < ljr\n\t\t}\n\n\t\tif ir != jr {\n\t\t\treturn ir < jr\n\t\t}\n\t}\n\n\treturn i < j\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/LICENSE.libyaml",
    "content": "The following files were ported to Go from C files of libyaml, and thus\nare still covered by their original copyright and license:\n\n    apic.go\n    emitterc.go\n    parserc.go\n    readerc.go\n    scannerc.go\n    writerc.go\n    yamlh.go\n    yamlprivateh.go\n\nCopyright (c) 2006 Kirill Simonov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/README.md",
    "content": "# YAML support for the Go language\n\nIntroduction\n------------\n\nThe yaml package enables Go programs to comfortably encode and decode YAML\nvalues. It was developed within [Canonical](https://www.canonical.com) as\npart of the [juju](https://juju.ubuntu.com) project, and is based on a\npure Go port of the well-known [libyaml](http://pyyaml.org/wiki/LibYAML)\nC library to parse and generate YAML data quickly and reliably.\n\nCompatibility\n-------------\n\nThe yaml package supports most of YAML 1.1 and 1.2, including support for\nanchors, tags, map merging, etc. Multi-document unmarshalling is not yet\nimplemented, and base-60 floats from YAML 1.1 are purposefully not\nsupported since they're a poor design and are gone in YAML 1.2.\n\nInstallation and usage\n----------------------\n\nThe import path for the package is *gopkg.in/yaml.v2*.\n\nTo install it, run:\n\n    go get gopkg.in/yaml.v2\n\nAPI documentation\n-----------------\n\nIf opened in a browser, the import path itself leads to the API documentation:\n\n  * [https://gopkg.in/yaml.v2](https://gopkg.in/yaml.v2)\n\nAPI stability\n-------------\n\nThe package API for yaml v2 will remain stable as described in [gopkg.in](https://gopkg.in).\n\n\nLicense\n-------\n\nThe yaml package is licensed under the Apache License 2.0. Please see the LICENSE file for details.\n\n\nExample\n-------\n\nSome more examples can be found in the \"examples\" folder.\n\n```Go\npackage main\n\nimport (\n        \"fmt\"\n        \"log\"\n\n        \"gopkg.in/yaml.v2\"\n)\n\nvar data = `\na: Easy!\nb:\n  c: 2\n  d: [3, 4]\n`\n\n// Note: struct fields must be public in order for unmarshal to\n// correctly populate the data.\ntype T struct {\n        A string\n        B struct {\n                RenamedC int   `yaml:\"c\"`\n                D        []int `yaml:\",flow\"`\n        }\n}\n\nfunc main() {\n        t := T{}\n    \n        err := yaml.Unmarshal([]byte(data), &t)\n        if err != nil {\n                log.Fatalf(\"error: %v\", err)\n        }\n        fmt.Printf(\"--- t:\\n%v\\n\\n\", t)\n    \n        d, err := yaml.Marshal(&t)\n        if err != nil {\n                log.Fatalf(\"error: %v\", err)\n        }\n        fmt.Printf(\"--- t dump:\\n%s\\n\\n\", string(d))\n    \n        m := make(map[interface{}]interface{})\n    \n        err = yaml.Unmarshal([]byte(data), &m)\n        if err != nil {\n                log.Fatalf(\"error: %v\", err)\n        }\n        fmt.Printf(\"--- m:\\n%v\\n\\n\", m)\n    \n        d, err = yaml.Marshal(&m)\n        if err != nil {\n                log.Fatalf(\"error: %v\", err)\n        }\n        fmt.Printf(\"--- m dump:\\n%s\\n\\n\", string(d))\n}\n```\n\nThis example will generate the following output:\n\n```\n--- t:\n{Easy! {2 [3 4]}}\n\n--- t dump:\na: Easy!\nb:\n  c: 2\n  d: [3, 4]\n\n\n--- m:\nmap[a:Easy! b:map[c:2 d:[3 4]]]\n\n--- m dump:\na: Easy!\nb:\n  c: 2\n  d:\n  - 3\n  - 4\n```\n\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/apic.go",
    "content": "package yaml\n\nimport (\n\t\"io\"\n\t\"os\"\n)\n\nfunc yaml_insert_token(parser *yaml_parser_t, pos int, token *yaml_token_t) {\n\t//fmt.Println(\"yaml_insert_token\", \"pos:\", pos, \"typ:\", token.typ, \"head:\", parser.tokens_head, \"len:\", len(parser.tokens))\n\n\t// Check if we can move the queue at the beginning of the buffer.\n\tif parser.tokens_head > 0 && len(parser.tokens) == cap(parser.tokens) {\n\t\tif parser.tokens_head != len(parser.tokens) {\n\t\t\tcopy(parser.tokens, parser.tokens[parser.tokens_head:])\n\t\t}\n\t\tparser.tokens = parser.tokens[:len(parser.tokens)-parser.tokens_head]\n\t\tparser.tokens_head = 0\n\t}\n\tparser.tokens = append(parser.tokens, *token)\n\tif pos < 0 {\n\t\treturn\n\t}\n\tcopy(parser.tokens[parser.tokens_head+pos+1:], parser.tokens[parser.tokens_head+pos:])\n\tparser.tokens[parser.tokens_head+pos] = *token\n}\n\n// Create a new parser object.\nfunc yaml_parser_initialize(parser *yaml_parser_t) bool {\n\t*parser = yaml_parser_t{\n\t\traw_buffer: make([]byte, 0, input_raw_buffer_size),\n\t\tbuffer:     make([]byte, 0, input_buffer_size),\n\t}\n\treturn true\n}\n\n// Destroy a parser object.\nfunc yaml_parser_delete(parser *yaml_parser_t) {\n\t*parser = yaml_parser_t{}\n}\n\n// String read handler.\nfunc yaml_string_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) {\n\tif parser.input_pos == len(parser.input) {\n\t\treturn 0, io.EOF\n\t}\n\tn = copy(buffer, parser.input[parser.input_pos:])\n\tparser.input_pos += n\n\treturn n, nil\n}\n\n// File read handler.\nfunc yaml_file_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) {\n\treturn parser.input_file.Read(buffer)\n}\n\n// Set a string input.\nfunc yaml_parser_set_input_string(parser *yaml_parser_t, input []byte) {\n\tif parser.read_handler != nil {\n\t\tpanic(\"must set the input source only once\")\n\t}\n\tparser.read_handler = yaml_string_read_handler\n\tparser.input = input\n\tparser.input_pos = 0\n}\n\n// Set a file input.\nfunc yaml_parser_set_input_file(parser *yaml_parser_t, file *os.File) {\n\tif parser.read_handler != nil {\n\t\tpanic(\"must set the input source only once\")\n\t}\n\tparser.read_handler = yaml_file_read_handler\n\tparser.input_file = file\n}\n\n// Set the source encoding.\nfunc yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encoding_t) {\n\tif parser.encoding != yaml_ANY_ENCODING {\n\t\tpanic(\"must set the encoding only once\")\n\t}\n\tparser.encoding = encoding\n}\n\n// Create a new emitter object.\nfunc yaml_emitter_initialize(emitter *yaml_emitter_t) bool {\n\t*emitter = yaml_emitter_t{\n\t\tbuffer:     make([]byte, output_buffer_size),\n\t\traw_buffer: make([]byte, 0, output_raw_buffer_size),\n\t\tstates:     make([]yaml_emitter_state_t, 0, initial_stack_size),\n\t\tevents:     make([]yaml_event_t, 0, initial_queue_size),\n\t}\n\treturn true\n}\n\n// Destroy an emitter object.\nfunc yaml_emitter_delete(emitter *yaml_emitter_t) {\n\t*emitter = yaml_emitter_t{}\n}\n\n// String write handler.\nfunc yaml_string_write_handler(emitter *yaml_emitter_t, buffer []byte) error {\n\t*emitter.output_buffer = append(*emitter.output_buffer, buffer...)\n\treturn nil\n}\n\n// File write handler.\nfunc yaml_file_write_handler(emitter *yaml_emitter_t, buffer []byte) error {\n\t_, err := emitter.output_file.Write(buffer)\n\treturn err\n}\n\n// Set a string output.\nfunc yaml_emitter_set_output_string(emitter *yaml_emitter_t, output_buffer *[]byte) {\n\tif emitter.write_handler != nil {\n\t\tpanic(\"must set the output target only once\")\n\t}\n\temitter.write_handler = yaml_string_write_handler\n\temitter.output_buffer = output_buffer\n}\n\n// Set a file output.\nfunc yaml_emitter_set_output_file(emitter *yaml_emitter_t, file io.Writer) {\n\tif emitter.write_handler != nil {\n\t\tpanic(\"must set the output target only once\")\n\t}\n\temitter.write_handler = yaml_file_write_handler\n\temitter.output_file = file\n}\n\n// Set the output encoding.\nfunc yaml_emitter_set_encoding(emitter *yaml_emitter_t, encoding yaml_encoding_t) {\n\tif emitter.encoding != yaml_ANY_ENCODING {\n\t\tpanic(\"must set the output encoding only once\")\n\t}\n\temitter.encoding = encoding\n}\n\n// Set the canonical output style.\nfunc yaml_emitter_set_canonical(emitter *yaml_emitter_t, canonical bool) {\n\temitter.canonical = canonical\n}\n\n//// Set the indentation increment.\nfunc yaml_emitter_set_indent(emitter *yaml_emitter_t, indent int) {\n\tif indent < 2 || indent > 9 {\n\t\tindent = 2\n\t}\n\temitter.best_indent = indent\n}\n\n// Set the preferred line width.\nfunc yaml_emitter_set_width(emitter *yaml_emitter_t, width int) {\n\tif width < 0 {\n\t\twidth = -1\n\t}\n\temitter.best_width = width\n}\n\n// Set if unescaped non-ASCII characters are allowed.\nfunc yaml_emitter_set_unicode(emitter *yaml_emitter_t, unicode bool) {\n\temitter.unicode = unicode\n}\n\n// Set the preferred line break character.\nfunc yaml_emitter_set_break(emitter *yaml_emitter_t, line_break yaml_break_t) {\n\temitter.line_break = line_break\n}\n\n///*\n// * Destroy a token object.\n// */\n//\n//YAML_DECLARE(void)\n//yaml_token_delete(yaml_token_t *token)\n//{\n//    assert(token);  // Non-NULL token object expected.\n//\n//    switch (token.type)\n//    {\n//        case YAML_TAG_DIRECTIVE_TOKEN:\n//            yaml_free(token.data.tag_directive.handle);\n//            yaml_free(token.data.tag_directive.prefix);\n//            break;\n//\n//        case YAML_ALIAS_TOKEN:\n//            yaml_free(token.data.alias.value);\n//            break;\n//\n//        case YAML_ANCHOR_TOKEN:\n//            yaml_free(token.data.anchor.value);\n//            break;\n//\n//        case YAML_TAG_TOKEN:\n//            yaml_free(token.data.tag.handle);\n//            yaml_free(token.data.tag.suffix);\n//            break;\n//\n//        case YAML_SCALAR_TOKEN:\n//            yaml_free(token.data.scalar.value);\n//            break;\n//\n//        default:\n//            break;\n//    }\n//\n//    memset(token, 0, sizeof(yaml_token_t));\n//}\n//\n///*\n// * Check if a string is a valid UTF-8 sequence.\n// *\n// * Check 'reader.c' for more details on UTF-8 encoding.\n// */\n//\n//static int\n//yaml_check_utf8(yaml_char_t *start, size_t length)\n//{\n//    yaml_char_t *end = start+length;\n//    yaml_char_t *pointer = start;\n//\n//    while (pointer < end) {\n//        unsigned char octet;\n//        unsigned int width;\n//        unsigned int value;\n//        size_t k;\n//\n//        octet = pointer[0];\n//        width = (octet & 0x80) == 0x00 ? 1 :\n//                (octet & 0xE0) == 0xC0 ? 2 :\n//                (octet & 0xF0) == 0xE0 ? 3 :\n//                (octet & 0xF8) == 0xF0 ? 4 : 0;\n//        value = (octet & 0x80) == 0x00 ? octet & 0x7F :\n//                (octet & 0xE0) == 0xC0 ? octet & 0x1F :\n//                (octet & 0xF0) == 0xE0 ? octet & 0x0F :\n//                (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0;\n//        if (!width) return 0;\n//        if (pointer+width > end) return 0;\n//        for (k = 1; k < width; k ++) {\n//            octet = pointer[k];\n//            if ((octet & 0xC0) != 0x80) return 0;\n//            value = (value << 6) + (octet & 0x3F);\n//        }\n//        if (!((width == 1) ||\n//            (width == 2 && value >= 0x80) ||\n//            (width == 3 && value >= 0x800) ||\n//            (width == 4 && value >= 0x10000))) return 0;\n//\n//        pointer += width;\n//    }\n//\n//    return 1;\n//}\n//\n\n// Create STREAM-START.\nfunc yaml_stream_start_event_initialize(event *yaml_event_t, encoding yaml_encoding_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp:      yaml_STREAM_START_EVENT,\n\t\tencoding: encoding,\n\t}\n\treturn true\n}\n\n// Create STREAM-END.\nfunc yaml_stream_end_event_initialize(event *yaml_event_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp: yaml_STREAM_END_EVENT,\n\t}\n\treturn true\n}\n\n// Create DOCUMENT-START.\nfunc yaml_document_start_event_initialize(event *yaml_event_t, version_directive *yaml_version_directive_t,\n\ttag_directives []yaml_tag_directive_t, implicit bool) bool {\n\t*event = yaml_event_t{\n\t\ttyp:               yaml_DOCUMENT_START_EVENT,\n\t\tversion_directive: version_directive,\n\t\ttag_directives:    tag_directives,\n\t\timplicit:          implicit,\n\t}\n\treturn true\n}\n\n// Create DOCUMENT-END.\nfunc yaml_document_end_event_initialize(event *yaml_event_t, implicit bool) bool {\n\t*event = yaml_event_t{\n\t\ttyp:      yaml_DOCUMENT_END_EVENT,\n\t\timplicit: implicit,\n\t}\n\treturn true\n}\n\n///*\n// * Create ALIAS.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_alias_event_initialize(event *yaml_event_t, anchor *yaml_char_t)\n//{\n//    mark yaml_mark_t = { 0, 0, 0 }\n//    anchor_copy *yaml_char_t = NULL\n//\n//    assert(event) // Non-NULL event object is expected.\n//    assert(anchor) // Non-NULL anchor is expected.\n//\n//    if (!yaml_check_utf8(anchor, strlen((char *)anchor))) return 0\n//\n//    anchor_copy = yaml_strdup(anchor)\n//    if (!anchor_copy)\n//        return 0\n//\n//    ALIAS_EVENT_INIT(*event, anchor_copy, mark, mark)\n//\n//    return 1\n//}\n\n// Create SCALAR.\nfunc yaml_scalar_event_initialize(event *yaml_event_t, anchor, tag, value []byte, plain_implicit, quoted_implicit bool, style yaml_scalar_style_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp:             yaml_SCALAR_EVENT,\n\t\tanchor:          anchor,\n\t\ttag:             tag,\n\t\tvalue:           value,\n\t\timplicit:        plain_implicit,\n\t\tquoted_implicit: quoted_implicit,\n\t\tstyle:           yaml_style_t(style),\n\t}\n\treturn true\n}\n\n// Create SEQUENCE-START.\nfunc yaml_sequence_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_sequence_style_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp:      yaml_SEQUENCE_START_EVENT,\n\t\tanchor:   anchor,\n\t\ttag:      tag,\n\t\timplicit: implicit,\n\t\tstyle:    yaml_style_t(style),\n\t}\n\treturn true\n}\n\n// Create SEQUENCE-END.\nfunc yaml_sequence_end_event_initialize(event *yaml_event_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp: yaml_SEQUENCE_END_EVENT,\n\t}\n\treturn true\n}\n\n// Create MAPPING-START.\nfunc yaml_mapping_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_mapping_style_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp:      yaml_MAPPING_START_EVENT,\n\t\tanchor:   anchor,\n\t\ttag:      tag,\n\t\timplicit: implicit,\n\t\tstyle:    yaml_style_t(style),\n\t}\n\treturn true\n}\n\n// Create MAPPING-END.\nfunc yaml_mapping_end_event_initialize(event *yaml_event_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp: yaml_MAPPING_END_EVENT,\n\t}\n\treturn true\n}\n\n// Destroy an event object.\nfunc yaml_event_delete(event *yaml_event_t) {\n\t*event = yaml_event_t{}\n}\n\n///*\n// * Create a document object.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_document_initialize(document *yaml_document_t,\n//        version_directive *yaml_version_directive_t,\n//        tag_directives_start *yaml_tag_directive_t,\n//        tag_directives_end *yaml_tag_directive_t,\n//        start_implicit int, end_implicit int)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//    struct {\n//        start *yaml_node_t\n//        end *yaml_node_t\n//        top *yaml_node_t\n//    } nodes = { NULL, NULL, NULL }\n//    version_directive_copy *yaml_version_directive_t = NULL\n//    struct {\n//        start *yaml_tag_directive_t\n//        end *yaml_tag_directive_t\n//        top *yaml_tag_directive_t\n//    } tag_directives_copy = { NULL, NULL, NULL }\n//    value yaml_tag_directive_t = { NULL, NULL }\n//    mark yaml_mark_t = { 0, 0, 0 }\n//\n//    assert(document) // Non-NULL document object is expected.\n//    assert((tag_directives_start && tag_directives_end) ||\n//            (tag_directives_start == tag_directives_end))\n//                            // Valid tag directives are expected.\n//\n//    if (!STACK_INIT(&context, nodes, INITIAL_STACK_SIZE)) goto error\n//\n//    if (version_directive) {\n//        version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t))\n//        if (!version_directive_copy) goto error\n//        version_directive_copy.major = version_directive.major\n//        version_directive_copy.minor = version_directive.minor\n//    }\n//\n//    if (tag_directives_start != tag_directives_end) {\n//        tag_directive *yaml_tag_directive_t\n//        if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE))\n//            goto error\n//        for (tag_directive = tag_directives_start\n//                tag_directive != tag_directives_end; tag_directive ++) {\n//            assert(tag_directive.handle)\n//            assert(tag_directive.prefix)\n//            if (!yaml_check_utf8(tag_directive.handle,\n//                        strlen((char *)tag_directive.handle)))\n//                goto error\n//            if (!yaml_check_utf8(tag_directive.prefix,\n//                        strlen((char *)tag_directive.prefix)))\n//                goto error\n//            value.handle = yaml_strdup(tag_directive.handle)\n//            value.prefix = yaml_strdup(tag_directive.prefix)\n//            if (!value.handle || !value.prefix) goto error\n//            if (!PUSH(&context, tag_directives_copy, value))\n//                goto error\n//            value.handle = NULL\n//            value.prefix = NULL\n//        }\n//    }\n//\n//    DOCUMENT_INIT(*document, nodes.start, nodes.end, version_directive_copy,\n//            tag_directives_copy.start, tag_directives_copy.top,\n//            start_implicit, end_implicit, mark, mark)\n//\n//    return 1\n//\n//error:\n//    STACK_DEL(&context, nodes)\n//    yaml_free(version_directive_copy)\n//    while (!STACK_EMPTY(&context, tag_directives_copy)) {\n//        value yaml_tag_directive_t = POP(&context, tag_directives_copy)\n//        yaml_free(value.handle)\n//        yaml_free(value.prefix)\n//    }\n//    STACK_DEL(&context, tag_directives_copy)\n//    yaml_free(value.handle)\n//    yaml_free(value.prefix)\n//\n//    return 0\n//}\n//\n///*\n// * Destroy a document object.\n// */\n//\n//YAML_DECLARE(void)\n//yaml_document_delete(document *yaml_document_t)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//    tag_directive *yaml_tag_directive_t\n//\n//    context.error = YAML_NO_ERROR // Eliminate a compliler warning.\n//\n//    assert(document) // Non-NULL document object is expected.\n//\n//    while (!STACK_EMPTY(&context, document.nodes)) {\n//        node yaml_node_t = POP(&context, document.nodes)\n//        yaml_free(node.tag)\n//        switch (node.type) {\n//            case YAML_SCALAR_NODE:\n//                yaml_free(node.data.scalar.value)\n//                break\n//            case YAML_SEQUENCE_NODE:\n//                STACK_DEL(&context, node.data.sequence.items)\n//                break\n//            case YAML_MAPPING_NODE:\n//                STACK_DEL(&context, node.data.mapping.pairs)\n//                break\n//            default:\n//                assert(0) // Should not happen.\n//        }\n//    }\n//    STACK_DEL(&context, document.nodes)\n//\n//    yaml_free(document.version_directive)\n//    for (tag_directive = document.tag_directives.start\n//            tag_directive != document.tag_directives.end\n//            tag_directive++) {\n//        yaml_free(tag_directive.handle)\n//        yaml_free(tag_directive.prefix)\n//    }\n//    yaml_free(document.tag_directives.start)\n//\n//    memset(document, 0, sizeof(yaml_document_t))\n//}\n//\n///**\n// * Get a document node.\n// */\n//\n//YAML_DECLARE(yaml_node_t *)\n//yaml_document_get_node(document *yaml_document_t, index int)\n//{\n//    assert(document) // Non-NULL document object is expected.\n//\n//    if (index > 0 && document.nodes.start + index <= document.nodes.top) {\n//        return document.nodes.start + index - 1\n//    }\n//    return NULL\n//}\n//\n///**\n// * Get the root object.\n// */\n//\n//YAML_DECLARE(yaml_node_t *)\n//yaml_document_get_root_node(document *yaml_document_t)\n//{\n//    assert(document) // Non-NULL document object is expected.\n//\n//    if (document.nodes.top != document.nodes.start) {\n//        return document.nodes.start\n//    }\n//    return NULL\n//}\n//\n///*\n// * Add a scalar node to a document.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_document_add_scalar(document *yaml_document_t,\n//        tag *yaml_char_t, value *yaml_char_t, length int,\n//        style yaml_scalar_style_t)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//    mark yaml_mark_t = { 0, 0, 0 }\n//    tag_copy *yaml_char_t = NULL\n//    value_copy *yaml_char_t = NULL\n//    node yaml_node_t\n//\n//    assert(document) // Non-NULL document object is expected.\n//    assert(value) // Non-NULL value is expected.\n//\n//    if (!tag) {\n//        tag = (yaml_char_t *)YAML_DEFAULT_SCALAR_TAG\n//    }\n//\n//    if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error\n//    tag_copy = yaml_strdup(tag)\n//    if (!tag_copy) goto error\n//\n//    if (length < 0) {\n//        length = strlen((char *)value)\n//    }\n//\n//    if (!yaml_check_utf8(value, length)) goto error\n//    value_copy = yaml_malloc(length+1)\n//    if (!value_copy) goto error\n//    memcpy(value_copy, value, length)\n//    value_copy[length] = '\\0'\n//\n//    SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark)\n//    if (!PUSH(&context, document.nodes, node)) goto error\n//\n//    return document.nodes.top - document.nodes.start\n//\n//error:\n//    yaml_free(tag_copy)\n//    yaml_free(value_copy)\n//\n//    return 0\n//}\n//\n///*\n// * Add a sequence node to a document.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_document_add_sequence(document *yaml_document_t,\n//        tag *yaml_char_t, style yaml_sequence_style_t)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//    mark yaml_mark_t = { 0, 0, 0 }\n//    tag_copy *yaml_char_t = NULL\n//    struct {\n//        start *yaml_node_item_t\n//        end *yaml_node_item_t\n//        top *yaml_node_item_t\n//    } items = { NULL, NULL, NULL }\n//    node yaml_node_t\n//\n//    assert(document) // Non-NULL document object is expected.\n//\n//    if (!tag) {\n//        tag = (yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG\n//    }\n//\n//    if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error\n//    tag_copy = yaml_strdup(tag)\n//    if (!tag_copy) goto error\n//\n//    if (!STACK_INIT(&context, items, INITIAL_STACK_SIZE)) goto error\n//\n//    SEQUENCE_NODE_INIT(node, tag_copy, items.start, items.end,\n//            style, mark, mark)\n//    if (!PUSH(&context, document.nodes, node)) goto error\n//\n//    return document.nodes.top - document.nodes.start\n//\n//error:\n//    STACK_DEL(&context, items)\n//    yaml_free(tag_copy)\n//\n//    return 0\n//}\n//\n///*\n// * Add a mapping node to a document.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_document_add_mapping(document *yaml_document_t,\n//        tag *yaml_char_t, style yaml_mapping_style_t)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//    mark yaml_mark_t = { 0, 0, 0 }\n//    tag_copy *yaml_char_t = NULL\n//    struct {\n//        start *yaml_node_pair_t\n//        end *yaml_node_pair_t\n//        top *yaml_node_pair_t\n//    } pairs = { NULL, NULL, NULL }\n//    node yaml_node_t\n//\n//    assert(document) // Non-NULL document object is expected.\n//\n//    if (!tag) {\n//        tag = (yaml_char_t *)YAML_DEFAULT_MAPPING_TAG\n//    }\n//\n//    if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error\n//    tag_copy = yaml_strdup(tag)\n//    if (!tag_copy) goto error\n//\n//    if (!STACK_INIT(&context, pairs, INITIAL_STACK_SIZE)) goto error\n//\n//    MAPPING_NODE_INIT(node, tag_copy, pairs.start, pairs.end,\n//            style, mark, mark)\n//    if (!PUSH(&context, document.nodes, node)) goto error\n//\n//    return document.nodes.top - document.nodes.start\n//\n//error:\n//    STACK_DEL(&context, pairs)\n//    yaml_free(tag_copy)\n//\n//    return 0\n//}\n//\n///*\n// * Append an item to a sequence node.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_document_append_sequence_item(document *yaml_document_t,\n//        sequence int, item int)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//\n//    assert(document) // Non-NULL document is required.\n//    assert(sequence > 0\n//            && document.nodes.start + sequence <= document.nodes.top)\n//                            // Valid sequence id is required.\n//    assert(document.nodes.start[sequence-1].type == YAML_SEQUENCE_NODE)\n//                            // A sequence node is required.\n//    assert(item > 0 && document.nodes.start + item <= document.nodes.top)\n//                            // Valid item id is required.\n//\n//    if (!PUSH(&context,\n//                document.nodes.start[sequence-1].data.sequence.items, item))\n//        return 0\n//\n//    return 1\n//}\n//\n///*\n// * Append a pair of a key and a value to a mapping node.\n// */\n//\n//YAML_DECLARE(int)\n//yaml_document_append_mapping_pair(document *yaml_document_t,\n//        mapping int, key int, value int)\n//{\n//    struct {\n//        error yaml_error_type_t\n//    } context\n//\n//    pair yaml_node_pair_t\n//\n//    assert(document) // Non-NULL document is required.\n//    assert(mapping > 0\n//            && document.nodes.start + mapping <= document.nodes.top)\n//                            // Valid mapping id is required.\n//    assert(document.nodes.start[mapping-1].type == YAML_MAPPING_NODE)\n//                            // A mapping node is required.\n//    assert(key > 0 && document.nodes.start + key <= document.nodes.top)\n//                            // Valid key id is required.\n//    assert(value > 0 && document.nodes.start + value <= document.nodes.top)\n//                            // Valid value id is required.\n//\n//    pair.key = key\n//    pair.value = value\n//\n//    if (!PUSH(&context,\n//                document.nodes.start[mapping-1].data.mapping.pairs, pair))\n//        return 0\n//\n//    return 1\n//}\n//\n//\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/decode.go",
    "content": "package yaml\n\nimport (\n\t\"encoding\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"time\"\n)\n\nconst (\n\tdocumentNode = 1 << iota\n\tmappingNode\n\tsequenceNode\n\tscalarNode\n\taliasNode\n)\n\ntype node struct {\n\tkind         int\n\tline, column int\n\ttag          string\n\tvalue        string\n\timplicit     bool\n\tchildren     []*node\n\tanchors      map[string]*node\n}\n\n// ----------------------------------------------------------------------------\n// Parser, produces a node tree out of a libyaml event stream.\n\ntype parser struct {\n\tparser yaml_parser_t\n\tevent  yaml_event_t\n\tdoc    *node\n}\n\nfunc newParser(b []byte) *parser {\n\tp := parser{}\n\tif !yaml_parser_initialize(&p.parser) {\n\t\tpanic(\"failed to initialize YAML emitter\")\n\t}\n\n\tif len(b) == 0 {\n\t\tb = []byte{'\\n'}\n\t}\n\n\tyaml_parser_set_input_string(&p.parser, b)\n\n\tp.skip()\n\tif p.event.typ != yaml_STREAM_START_EVENT {\n\t\tpanic(\"expected stream start event, got \" + strconv.Itoa(int(p.event.typ)))\n\t}\n\tp.skip()\n\treturn &p\n}\n\nfunc (p *parser) destroy() {\n\tif p.event.typ != yaml_NO_EVENT {\n\t\tyaml_event_delete(&p.event)\n\t}\n\tyaml_parser_delete(&p.parser)\n}\n\nfunc (p *parser) skip() {\n\tif p.event.typ != yaml_NO_EVENT {\n\t\tif p.event.typ == yaml_STREAM_END_EVENT {\n\t\t\tfailf(\"attempted to go past the end of stream; corrupted value?\")\n\t\t}\n\t\tyaml_event_delete(&p.event)\n\t}\n\tif !yaml_parser_parse(&p.parser, &p.event) {\n\t\tp.fail()\n\t}\n}\n\nfunc (p *parser) fail() {\n\tvar where string\n\tvar line int\n\tif p.parser.problem_mark.line != 0 {\n\t\tline = p.parser.problem_mark.line\n\t} else if p.parser.context_mark.line != 0 {\n\t\tline = p.parser.context_mark.line\n\t}\n\tif line != 0 {\n\t\twhere = \"line \" + strconv.Itoa(line) + \": \"\n\t}\n\tvar msg string\n\tif len(p.parser.problem) > 0 {\n\t\tmsg = p.parser.problem\n\t} else {\n\t\tmsg = \"unknown problem parsing YAML content\"\n\t}\n\tfailf(\"%s%s\", where, msg)\n}\n\nfunc (p *parser) anchor(n *node, anchor []byte) {\n\tif anchor != nil {\n\t\tp.doc.anchors[string(anchor)] = n\n\t}\n}\n\nfunc (p *parser) parse() *node {\n\tswitch p.event.typ {\n\tcase yaml_SCALAR_EVENT:\n\t\treturn p.scalar()\n\tcase yaml_ALIAS_EVENT:\n\t\treturn p.alias()\n\tcase yaml_MAPPING_START_EVENT:\n\t\treturn p.mapping()\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\treturn p.sequence()\n\tcase yaml_DOCUMENT_START_EVENT:\n\t\treturn p.document()\n\tcase yaml_STREAM_END_EVENT:\n\t\t// Happens when attempting to decode an empty buffer.\n\t\treturn nil\n\tdefault:\n\t\tpanic(\"attempted to parse unknown event: \" + strconv.Itoa(int(p.event.typ)))\n\t}\n}\n\nfunc (p *parser) node(kind int) *node {\n\treturn &node{\n\t\tkind:   kind,\n\t\tline:   p.event.start_mark.line,\n\t\tcolumn: p.event.start_mark.column,\n\t}\n}\n\nfunc (p *parser) document() *node {\n\tn := p.node(documentNode)\n\tn.anchors = make(map[string]*node)\n\tp.doc = n\n\tp.skip()\n\tn.children = append(n.children, p.parse())\n\tif p.event.typ != yaml_DOCUMENT_END_EVENT {\n\t\tpanic(\"expected end of document event but got \" + strconv.Itoa(int(p.event.typ)))\n\t}\n\tp.skip()\n\treturn n\n}\n\nfunc (p *parser) alias() *node {\n\tn := p.node(aliasNode)\n\tn.value = string(p.event.anchor)\n\tp.skip()\n\treturn n\n}\n\nfunc (p *parser) scalar() *node {\n\tn := p.node(scalarNode)\n\tn.value = string(p.event.value)\n\tn.tag = string(p.event.tag)\n\tn.implicit = p.event.implicit\n\tp.anchor(n, p.event.anchor)\n\tp.skip()\n\treturn n\n}\n\nfunc (p *parser) sequence() *node {\n\tn := p.node(sequenceNode)\n\tp.anchor(n, p.event.anchor)\n\tp.skip()\n\tfor p.event.typ != yaml_SEQUENCE_END_EVENT {\n\t\tn.children = append(n.children, p.parse())\n\t}\n\tp.skip()\n\treturn n\n}\n\nfunc (p *parser) mapping() *node {\n\tn := p.node(mappingNode)\n\tp.anchor(n, p.event.anchor)\n\tp.skip()\n\tfor p.event.typ != yaml_MAPPING_END_EVENT {\n\t\tn.children = append(n.children, p.parse(), p.parse())\n\t}\n\tp.skip()\n\treturn n\n}\n\n// ----------------------------------------------------------------------------\n// Decoder, unmarshals a node into a provided value.\n\ntype decoder struct {\n\tdoc     *node\n\taliases map[string]bool\n\tmapType reflect.Type\n\tterrors []string\n\tstrict  bool\n}\n\nvar (\n\tmapItemType    = reflect.TypeOf(MapItem{})\n\tdurationType   = reflect.TypeOf(time.Duration(0))\n\tdefaultMapType = reflect.TypeOf(map[interface{}]interface{}{})\n\tifaceType      = defaultMapType.Elem()\n)\n\nfunc newDecoder(strict bool) *decoder {\n\td := &decoder{mapType: defaultMapType, strict: strict}\n\td.aliases = make(map[string]bool)\n\treturn d\n}\n\nfunc (d *decoder) terror(n *node, tag string, out reflect.Value) {\n\tif n.tag != \"\" {\n\t\ttag = n.tag\n\t}\n\tvalue := n.value\n\tif tag != yaml_SEQ_TAG && tag != yaml_MAP_TAG {\n\t\tif len(value) > 10 {\n\t\t\tvalue = \" `\" + value[:7] + \"...`\"\n\t\t} else {\n\t\t\tvalue = \" `\" + value + \"`\"\n\t\t}\n\t}\n\td.terrors = append(d.terrors, fmt.Sprintf(\"line %d: cannot unmarshal %s%s into %s\", n.line+1, shortTag(tag), value, out.Type()))\n}\n\nfunc (d *decoder) callUnmarshaler(n *node, u Unmarshaler) (good bool) {\n\tterrlen := len(d.terrors)\n\terr := u.UnmarshalYAML(func(v interface{}) (err error) {\n\t\tdefer handleErr(&err)\n\t\td.unmarshal(n, reflect.ValueOf(v))\n\t\tif len(d.terrors) > terrlen {\n\t\t\tissues := d.terrors[terrlen:]\n\t\t\td.terrors = d.terrors[:terrlen]\n\t\t\treturn &TypeError{issues}\n\t\t}\n\t\treturn nil\n\t})\n\tif e, ok := err.(*TypeError); ok {\n\t\td.terrors = append(d.terrors, e.Errors...)\n\t\treturn false\n\t}\n\tif err != nil {\n\t\tfail(err)\n\t}\n\treturn true\n}\n\n// d.prepare initializes and dereferences pointers and calls UnmarshalYAML\n// if a value is found to implement it.\n// It returns the initialized and dereferenced out value, whether\n// unmarshalling was already done by UnmarshalYAML, and if so whether\n// its types unmarshalled appropriately.\n//\n// If n holds a null value, prepare returns before doing anything.\nfunc (d *decoder) prepare(n *node, out reflect.Value) (newout reflect.Value, unmarshaled, good bool) {\n\tif n.tag == yaml_NULL_TAG || n.kind == scalarNode && n.tag == \"\" && (n.value == \"null\" || n.value == \"~\" || n.value == \"\" && n.implicit) {\n\t\treturn out, false, false\n\t}\n\tagain := true\n\tfor again {\n\t\tagain = false\n\t\tif out.Kind() == reflect.Ptr {\n\t\t\tif out.IsNil() {\n\t\t\t\tout.Set(reflect.New(out.Type().Elem()))\n\t\t\t}\n\t\t\tout = out.Elem()\n\t\t\tagain = true\n\t\t}\n\t\tif out.CanAddr() {\n\t\t\tif u, ok := out.Addr().Interface().(Unmarshaler); ok {\n\t\t\t\tgood = d.callUnmarshaler(n, u)\n\t\t\t\treturn out, true, good\n\t\t\t}\n\t\t}\n\t}\n\treturn out, false, false\n}\n\nfunc (d *decoder) unmarshal(n *node, out reflect.Value) (good bool) {\n\tswitch n.kind {\n\tcase documentNode:\n\t\treturn d.document(n, out)\n\tcase aliasNode:\n\t\treturn d.alias(n, out)\n\t}\n\tout, unmarshaled, good := d.prepare(n, out)\n\tif unmarshaled {\n\t\treturn good\n\t}\n\tswitch n.kind {\n\tcase scalarNode:\n\t\tgood = d.scalar(n, out)\n\tcase mappingNode:\n\t\tgood = d.mapping(n, out)\n\tcase sequenceNode:\n\t\tgood = d.sequence(n, out)\n\tdefault:\n\t\tpanic(\"internal error: unknown node kind: \" + strconv.Itoa(n.kind))\n\t}\n\treturn good\n}\n\nfunc (d *decoder) document(n *node, out reflect.Value) (good bool) {\n\tif len(n.children) == 1 {\n\t\td.doc = n\n\t\td.unmarshal(n.children[0], out)\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (d *decoder) alias(n *node, out reflect.Value) (good bool) {\n\tan, ok := d.doc.anchors[n.value]\n\tif !ok {\n\t\tfailf(\"unknown anchor '%s' referenced\", n.value)\n\t}\n\tif d.aliases[n.value] {\n\t\tfailf(\"anchor '%s' value contains itself\", n.value)\n\t}\n\td.aliases[n.value] = true\n\tgood = d.unmarshal(an, out)\n\tdelete(d.aliases, n.value)\n\treturn good\n}\n\nvar zeroValue reflect.Value\n\nfunc resetMap(out reflect.Value) {\n\tfor _, k := range out.MapKeys() {\n\t\tout.SetMapIndex(k, zeroValue)\n\t}\n}\n\nfunc (d *decoder) scalar(n *node, out reflect.Value) (good bool) {\n\tvar tag string\n\tvar resolved interface{}\n\tif n.tag == \"\" && !n.implicit {\n\t\ttag = yaml_STR_TAG\n\t\tresolved = n.value\n\t} else {\n\t\ttag, resolved = resolve(n.tag, n.value)\n\t\tif tag == yaml_BINARY_TAG {\n\t\t\tdata, err := base64.StdEncoding.DecodeString(resolved.(string))\n\t\t\tif err != nil {\n\t\t\t\tfailf(\"!!binary value contains invalid base64 data\")\n\t\t\t}\n\t\t\tresolved = string(data)\n\t\t}\n\t}\n\tif resolved == nil {\n\t\tif out.Kind() == reflect.Map && !out.CanAddr() {\n\t\t\tresetMap(out)\n\t\t} else {\n\t\t\tout.Set(reflect.Zero(out.Type()))\n\t\t}\n\t\treturn true\n\t}\n\tif s, ok := resolved.(string); ok && out.CanAddr() {\n\t\tif u, ok := out.Addr().Interface().(encoding.TextUnmarshaler); ok {\n\t\t\terr := u.UnmarshalText([]byte(s))\n\t\t\tif err != nil {\n\t\t\t\tfail(err)\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t}\n\tswitch out.Kind() {\n\tcase reflect.String:\n\t\tif tag == yaml_BINARY_TAG {\n\t\t\tout.SetString(resolved.(string))\n\t\t\tgood = true\n\t\t} else if resolved != nil {\n\t\t\tout.SetString(n.value)\n\t\t\tgood = true\n\t\t}\n\tcase reflect.Interface:\n\t\tif resolved == nil {\n\t\t\tout.Set(reflect.Zero(out.Type()))\n\t\t} else {\n\t\t\tout.Set(reflect.ValueOf(resolved))\n\t\t}\n\t\tgood = true\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tswitch resolved := resolved.(type) {\n\t\tcase int:\n\t\t\tif !out.OverflowInt(int64(resolved)) {\n\t\t\t\tout.SetInt(int64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase int64:\n\t\t\tif !out.OverflowInt(resolved) {\n\t\t\t\tout.SetInt(resolved)\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase uint64:\n\t\t\tif resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) {\n\t\t\t\tout.SetInt(int64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase float64:\n\t\t\tif resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) {\n\t\t\t\tout.SetInt(int64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase string:\n\t\t\tif out.Type() == durationType {\n\t\t\t\td, err := time.ParseDuration(resolved)\n\t\t\t\tif err == nil {\n\t\t\t\t\tout.SetInt(int64(d))\n\t\t\t\t\tgood = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\tswitch resolved := resolved.(type) {\n\t\tcase int:\n\t\t\tif resolved >= 0 && !out.OverflowUint(uint64(resolved)) {\n\t\t\t\tout.SetUint(uint64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase int64:\n\t\t\tif resolved >= 0 && !out.OverflowUint(uint64(resolved)) {\n\t\t\t\tout.SetUint(uint64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase uint64:\n\t\t\tif !out.OverflowUint(uint64(resolved)) {\n\t\t\t\tout.SetUint(uint64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\tcase float64:\n\t\t\tif resolved <= math.MaxUint64 && !out.OverflowUint(uint64(resolved)) {\n\t\t\t\tout.SetUint(uint64(resolved))\n\t\t\t\tgood = true\n\t\t\t}\n\t\t}\n\tcase reflect.Bool:\n\t\tswitch resolved := resolved.(type) {\n\t\tcase bool:\n\t\t\tout.SetBool(resolved)\n\t\t\tgood = true\n\t\t}\n\tcase reflect.Float32, reflect.Float64:\n\t\tswitch resolved := resolved.(type) {\n\t\tcase int:\n\t\t\tout.SetFloat(float64(resolved))\n\t\t\tgood = true\n\t\tcase int64:\n\t\t\tout.SetFloat(float64(resolved))\n\t\t\tgood = true\n\t\tcase uint64:\n\t\t\tout.SetFloat(float64(resolved))\n\t\t\tgood = true\n\t\tcase float64:\n\t\t\tout.SetFloat(resolved)\n\t\t\tgood = true\n\t\t}\n\tcase reflect.Ptr:\n\t\tif out.Type().Elem() == reflect.TypeOf(resolved) {\n\t\t\t// TODO DOes this make sense? When is out a Ptr except when decoding a nil value?\n\t\t\telem := reflect.New(out.Type().Elem())\n\t\t\telem.Elem().Set(reflect.ValueOf(resolved))\n\t\t\tout.Set(elem)\n\t\t\tgood = true\n\t\t}\n\t}\n\tif !good {\n\t\td.terror(n, tag, out)\n\t}\n\treturn good\n}\n\nfunc settableValueOf(i interface{}) reflect.Value {\n\tv := reflect.ValueOf(i)\n\tsv := reflect.New(v.Type()).Elem()\n\tsv.Set(v)\n\treturn sv\n}\n\nfunc (d *decoder) sequence(n *node, out reflect.Value) (good bool) {\n\tl := len(n.children)\n\n\tvar iface reflect.Value\n\tswitch out.Kind() {\n\tcase reflect.Slice:\n\t\tout.Set(reflect.MakeSlice(out.Type(), l, l))\n\tcase reflect.Interface:\n\t\t// No type hints. Will have to use a generic sequence.\n\t\tiface = out\n\t\tout = settableValueOf(make([]interface{}, l))\n\tdefault:\n\t\td.terror(n, yaml_SEQ_TAG, out)\n\t\treturn false\n\t}\n\tet := out.Type().Elem()\n\n\tj := 0\n\tfor i := 0; i < l; i++ {\n\t\te := reflect.New(et).Elem()\n\t\tif ok := d.unmarshal(n.children[i], e); ok {\n\t\t\tout.Index(j).Set(e)\n\t\t\tj++\n\t\t}\n\t}\n\tout.Set(out.Slice(0, j))\n\tif iface.IsValid() {\n\t\tiface.Set(out)\n\t}\n\treturn true\n}\n\nfunc (d *decoder) mapping(n *node, out reflect.Value) (good bool) {\n\tswitch out.Kind() {\n\tcase reflect.Struct:\n\t\treturn d.mappingStruct(n, out)\n\tcase reflect.Slice:\n\t\treturn d.mappingSlice(n, out)\n\tcase reflect.Map:\n\t\t// okay\n\tcase reflect.Interface:\n\t\tif d.mapType.Kind() == reflect.Map {\n\t\t\tiface := out\n\t\t\tout = reflect.MakeMap(d.mapType)\n\t\t\tiface.Set(out)\n\t\t} else {\n\t\t\tslicev := reflect.New(d.mapType).Elem()\n\t\t\tif !d.mappingSlice(n, slicev) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tout.Set(slicev)\n\t\t\treturn true\n\t\t}\n\tdefault:\n\t\td.terror(n, yaml_MAP_TAG, out)\n\t\treturn false\n\t}\n\toutt := out.Type()\n\tkt := outt.Key()\n\tet := outt.Elem()\n\n\tmapType := d.mapType\n\tif outt.Key() == ifaceType && outt.Elem() == ifaceType {\n\t\td.mapType = outt\n\t}\n\n\tif out.IsNil() {\n\t\tout.Set(reflect.MakeMap(outt))\n\t}\n\tl := len(n.children)\n\tfor i := 0; i < l; i += 2 {\n\t\tif isMerge(n.children[i]) {\n\t\t\td.merge(n.children[i+1], out)\n\t\t\tcontinue\n\t\t}\n\t\tk := reflect.New(kt).Elem()\n\t\tif d.unmarshal(n.children[i], k) {\n\t\t\tkkind := k.Kind()\n\t\t\tif kkind == reflect.Interface {\n\t\t\t\tkkind = k.Elem().Kind()\n\t\t\t}\n\t\t\tif kkind == reflect.Map || kkind == reflect.Slice {\n\t\t\t\tfailf(\"invalid map key: %#v\", k.Interface())\n\t\t\t}\n\t\t\te := reflect.New(et).Elem()\n\t\t\tif d.unmarshal(n.children[i+1], e) {\n\t\t\t\tout.SetMapIndex(k, e)\n\t\t\t}\n\t\t}\n\t}\n\td.mapType = mapType\n\treturn true\n}\n\nfunc (d *decoder) mappingSlice(n *node, out reflect.Value) (good bool) {\n\toutt := out.Type()\n\tif outt.Elem() != mapItemType {\n\t\td.terror(n, yaml_MAP_TAG, out)\n\t\treturn false\n\t}\n\n\tmapType := d.mapType\n\td.mapType = outt\n\n\tvar slice []MapItem\n\tvar l = len(n.children)\n\tfor i := 0; i < l; i += 2 {\n\t\tif isMerge(n.children[i]) {\n\t\t\td.merge(n.children[i+1], out)\n\t\t\tcontinue\n\t\t}\n\t\titem := MapItem{}\n\t\tk := reflect.ValueOf(&item.Key).Elem()\n\t\tif d.unmarshal(n.children[i], k) {\n\t\t\tv := reflect.ValueOf(&item.Value).Elem()\n\t\t\tif d.unmarshal(n.children[i+1], v) {\n\t\t\t\tslice = append(slice, item)\n\t\t\t}\n\t\t}\n\t}\n\tout.Set(reflect.ValueOf(slice))\n\td.mapType = mapType\n\treturn true\n}\n\nfunc (d *decoder) mappingStruct(n *node, out reflect.Value) (good bool) {\n\tsinfo, err := getStructInfo(out.Type())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tname := settableValueOf(\"\")\n\tl := len(n.children)\n\n\tvar inlineMap reflect.Value\n\tvar elemType reflect.Type\n\tif sinfo.InlineMap != -1 {\n\t\tinlineMap = out.Field(sinfo.InlineMap)\n\t\tinlineMap.Set(reflect.New(inlineMap.Type()).Elem())\n\t\telemType = inlineMap.Type().Elem()\n\t}\n\n\tfor i := 0; i < l; i += 2 {\n\t\tni := n.children[i]\n\t\tif isMerge(ni) {\n\t\t\td.merge(n.children[i+1], out)\n\t\t\tcontinue\n\t\t}\n\t\tif !d.unmarshal(ni, name) {\n\t\t\tcontinue\n\t\t}\n\t\tif info, ok := sinfo.FieldsMap[name.String()]; ok {\n\t\t\tvar field reflect.Value\n\t\t\tif info.Inline == nil {\n\t\t\t\tfield = out.Field(info.Num)\n\t\t\t} else {\n\t\t\t\tfield = out.FieldByIndex(info.Inline)\n\t\t\t}\n\t\t\td.unmarshal(n.children[i+1], field)\n\t\t} else if sinfo.InlineMap != -1 {\n\t\t\tif inlineMap.IsNil() {\n\t\t\t\tinlineMap.Set(reflect.MakeMap(inlineMap.Type()))\n\t\t\t}\n\t\t\tvalue := reflect.New(elemType).Elem()\n\t\t\td.unmarshal(n.children[i+1], value)\n\t\t\tinlineMap.SetMapIndex(name, value)\n\t\t} else if d.strict {\n\t\t\td.terrors = append(d.terrors, fmt.Sprintf(\"line %d: field %s not found in struct %s\", ni.line+1, name.String(), out.Type()))\n\t\t}\n\t}\n\treturn true\n}\n\nfunc failWantMap() {\n\tfailf(\"map merge requires map or sequence of maps as the value\")\n}\n\nfunc (d *decoder) merge(n *node, out reflect.Value) {\n\tswitch n.kind {\n\tcase mappingNode:\n\t\td.unmarshal(n, out)\n\tcase aliasNode:\n\t\tan, ok := d.doc.anchors[n.value]\n\t\tif ok && an.kind != mappingNode {\n\t\t\tfailWantMap()\n\t\t}\n\t\td.unmarshal(n, out)\n\tcase sequenceNode:\n\t\t// Step backwards as earlier nodes take precedence.\n\t\tfor i := len(n.children) - 1; i >= 0; i-- {\n\t\t\tni := n.children[i]\n\t\t\tif ni.kind == aliasNode {\n\t\t\t\tan, ok := d.doc.anchors[ni.value]\n\t\t\t\tif ok && an.kind != mappingNode {\n\t\t\t\t\tfailWantMap()\n\t\t\t\t}\n\t\t\t} else if ni.kind != mappingNode {\n\t\t\t\tfailWantMap()\n\t\t\t}\n\t\t\td.unmarshal(ni, out)\n\t\t}\n\tdefault:\n\t\tfailWantMap()\n\t}\n}\n\nfunc isMerge(n *node) bool {\n\treturn n.kind == scalarNode && n.value == \"<<\" && (n.implicit == true || n.tag == yaml_MERGE_TAG)\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/emitterc.go",
    "content": "package yaml\n\nimport (\n\t\"bytes\"\n)\n\n// Flush the buffer if needed.\nfunc flush(emitter *yaml_emitter_t) bool {\n\tif emitter.buffer_pos+5 >= len(emitter.buffer) {\n\t\treturn yaml_emitter_flush(emitter)\n\t}\n\treturn true\n}\n\n// Put a character to the output buffer.\nfunc put(emitter *yaml_emitter_t, value byte) bool {\n\tif emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) {\n\t\treturn false\n\t}\n\temitter.buffer[emitter.buffer_pos] = value\n\temitter.buffer_pos++\n\temitter.column++\n\treturn true\n}\n\n// Put a line break to the output buffer.\nfunc put_break(emitter *yaml_emitter_t) bool {\n\tif emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) {\n\t\treturn false\n\t}\n\tswitch emitter.line_break {\n\tcase yaml_CR_BREAK:\n\t\temitter.buffer[emitter.buffer_pos] = '\\r'\n\t\temitter.buffer_pos += 1\n\tcase yaml_LN_BREAK:\n\t\temitter.buffer[emitter.buffer_pos] = '\\n'\n\t\temitter.buffer_pos += 1\n\tcase yaml_CRLN_BREAK:\n\t\temitter.buffer[emitter.buffer_pos+0] = '\\r'\n\t\temitter.buffer[emitter.buffer_pos+1] = '\\n'\n\t\temitter.buffer_pos += 2\n\tdefault:\n\t\tpanic(\"unknown line break setting\")\n\t}\n\temitter.column = 0\n\temitter.line++\n\treturn true\n}\n\n// Copy a character from a string into buffer.\nfunc write(emitter *yaml_emitter_t, s []byte, i *int) bool {\n\tif emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) {\n\t\treturn false\n\t}\n\tp := emitter.buffer_pos\n\tw := width(s[*i])\n\tswitch w {\n\tcase 4:\n\t\temitter.buffer[p+3] = s[*i+3]\n\t\tfallthrough\n\tcase 3:\n\t\temitter.buffer[p+2] = s[*i+2]\n\t\tfallthrough\n\tcase 2:\n\t\temitter.buffer[p+1] = s[*i+1]\n\t\tfallthrough\n\tcase 1:\n\t\temitter.buffer[p+0] = s[*i+0]\n\tdefault:\n\t\tpanic(\"unknown character width\")\n\t}\n\temitter.column++\n\temitter.buffer_pos += w\n\t*i += w\n\treturn true\n}\n\n// Write a whole string into buffer.\nfunc write_all(emitter *yaml_emitter_t, s []byte) bool {\n\tfor i := 0; i < len(s); {\n\t\tif !write(emitter, s, &i) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Copy a line break character from a string into buffer.\nfunc write_break(emitter *yaml_emitter_t, s []byte, i *int) bool {\n\tif s[*i] == '\\n' {\n\t\tif !put_break(emitter) {\n\t\t\treturn false\n\t\t}\n\t\t*i++\n\t} else {\n\t\tif !write(emitter, s, i) {\n\t\t\treturn false\n\t\t}\n\t\temitter.column = 0\n\t\temitter.line++\n\t}\n\treturn true\n}\n\n// Set an emitter error and return false.\nfunc yaml_emitter_set_emitter_error(emitter *yaml_emitter_t, problem string) bool {\n\temitter.error = yaml_EMITTER_ERROR\n\temitter.problem = problem\n\treturn false\n}\n\n// Emit an event.\nfunc yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\temitter.events = append(emitter.events, *event)\n\tfor !yaml_emitter_need_more_events(emitter) {\n\t\tevent := &emitter.events[emitter.events_head]\n\t\tif !yaml_emitter_analyze_event(emitter, event) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_state_machine(emitter, event) {\n\t\t\treturn false\n\t\t}\n\t\tyaml_event_delete(event)\n\t\temitter.events_head++\n\t}\n\treturn true\n}\n\n// Check if we need to accumulate more events before emitting.\n//\n// We accumulate extra\n//  - 1 event for DOCUMENT-START\n//  - 2 events for SEQUENCE-START\n//  - 3 events for MAPPING-START\n//\nfunc yaml_emitter_need_more_events(emitter *yaml_emitter_t) bool {\n\tif emitter.events_head == len(emitter.events) {\n\t\treturn true\n\t}\n\tvar accumulate int\n\tswitch emitter.events[emitter.events_head].typ {\n\tcase yaml_DOCUMENT_START_EVENT:\n\t\taccumulate = 1\n\t\tbreak\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\taccumulate = 2\n\t\tbreak\n\tcase yaml_MAPPING_START_EVENT:\n\t\taccumulate = 3\n\t\tbreak\n\tdefault:\n\t\treturn false\n\t}\n\tif len(emitter.events)-emitter.events_head > accumulate {\n\t\treturn false\n\t}\n\tvar level int\n\tfor i := emitter.events_head; i < len(emitter.events); i++ {\n\t\tswitch emitter.events[i].typ {\n\t\tcase yaml_STREAM_START_EVENT, yaml_DOCUMENT_START_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT:\n\t\t\tlevel++\n\t\tcase yaml_STREAM_END_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_END_EVENT, yaml_MAPPING_END_EVENT:\n\t\t\tlevel--\n\t\t}\n\t\tif level == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Append a directive to the directives stack.\nfunc yaml_emitter_append_tag_directive(emitter *yaml_emitter_t, value *yaml_tag_directive_t, allow_duplicates bool) bool {\n\tfor i := 0; i < len(emitter.tag_directives); i++ {\n\t\tif bytes.Equal(value.handle, emitter.tag_directives[i].handle) {\n\t\t\tif allow_duplicates {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn yaml_emitter_set_emitter_error(emitter, \"duplicate %TAG directive\")\n\t\t}\n\t}\n\n\t// [Go] Do we actually need to copy this given garbage collection\n\t// and the lack of deallocating destructors?\n\ttag_copy := yaml_tag_directive_t{\n\t\thandle: make([]byte, len(value.handle)),\n\t\tprefix: make([]byte, len(value.prefix)),\n\t}\n\tcopy(tag_copy.handle, value.handle)\n\tcopy(tag_copy.prefix, value.prefix)\n\temitter.tag_directives = append(emitter.tag_directives, tag_copy)\n\treturn true\n}\n\n// Increase the indentation level.\nfunc yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool) bool {\n\temitter.indents = append(emitter.indents, emitter.indent)\n\tif emitter.indent < 0 {\n\t\tif flow {\n\t\t\temitter.indent = emitter.best_indent\n\t\t} else {\n\t\t\temitter.indent = 0\n\t\t}\n\t} else if !indentless {\n\t\temitter.indent += emitter.best_indent\n\t}\n\treturn true\n}\n\n// State dispatcher.\nfunc yaml_emitter_state_machine(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tswitch emitter.state {\n\tdefault:\n\tcase yaml_EMIT_STREAM_START_STATE:\n\t\treturn yaml_emitter_emit_stream_start(emitter, event)\n\n\tcase yaml_EMIT_FIRST_DOCUMENT_START_STATE:\n\t\treturn yaml_emitter_emit_document_start(emitter, event, true)\n\n\tcase yaml_EMIT_DOCUMENT_START_STATE:\n\t\treturn yaml_emitter_emit_document_start(emitter, event, false)\n\n\tcase yaml_EMIT_DOCUMENT_CONTENT_STATE:\n\t\treturn yaml_emitter_emit_document_content(emitter, event)\n\n\tcase yaml_EMIT_DOCUMENT_END_STATE:\n\t\treturn yaml_emitter_emit_document_end(emitter, event)\n\n\tcase yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE:\n\t\treturn yaml_emitter_emit_flow_sequence_item(emitter, event, true)\n\n\tcase yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE:\n\t\treturn yaml_emitter_emit_flow_sequence_item(emitter, event, false)\n\n\tcase yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE:\n\t\treturn yaml_emitter_emit_flow_mapping_key(emitter, event, true)\n\n\tcase yaml_EMIT_FLOW_MAPPING_KEY_STATE:\n\t\treturn yaml_emitter_emit_flow_mapping_key(emitter, event, false)\n\n\tcase yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE:\n\t\treturn yaml_emitter_emit_flow_mapping_value(emitter, event, true)\n\n\tcase yaml_EMIT_FLOW_MAPPING_VALUE_STATE:\n\t\treturn yaml_emitter_emit_flow_mapping_value(emitter, event, false)\n\n\tcase yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE:\n\t\treturn yaml_emitter_emit_block_sequence_item(emitter, event, true)\n\n\tcase yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE:\n\t\treturn yaml_emitter_emit_block_sequence_item(emitter, event, false)\n\n\tcase yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE:\n\t\treturn yaml_emitter_emit_block_mapping_key(emitter, event, true)\n\n\tcase yaml_EMIT_BLOCK_MAPPING_KEY_STATE:\n\t\treturn yaml_emitter_emit_block_mapping_key(emitter, event, false)\n\n\tcase yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE:\n\t\treturn yaml_emitter_emit_block_mapping_value(emitter, event, true)\n\n\tcase yaml_EMIT_BLOCK_MAPPING_VALUE_STATE:\n\t\treturn yaml_emitter_emit_block_mapping_value(emitter, event, false)\n\n\tcase yaml_EMIT_END_STATE:\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"expected nothing after STREAM-END\")\n\t}\n\tpanic(\"invalid emitter state\")\n}\n\n// Expect STREAM-START.\nfunc yaml_emitter_emit_stream_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif event.typ != yaml_STREAM_START_EVENT {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"expected STREAM-START\")\n\t}\n\tif emitter.encoding == yaml_ANY_ENCODING {\n\t\temitter.encoding = event.encoding\n\t\tif emitter.encoding == yaml_ANY_ENCODING {\n\t\t\temitter.encoding = yaml_UTF8_ENCODING\n\t\t}\n\t}\n\tif emitter.best_indent < 2 || emitter.best_indent > 9 {\n\t\temitter.best_indent = 2\n\t}\n\tif emitter.best_width >= 0 && emitter.best_width <= emitter.best_indent*2 {\n\t\temitter.best_width = 80\n\t}\n\tif emitter.best_width < 0 {\n\t\temitter.best_width = 1<<31 - 1\n\t}\n\tif emitter.line_break == yaml_ANY_BREAK {\n\t\temitter.line_break = yaml_LN_BREAK\n\t}\n\n\temitter.indent = -1\n\temitter.line = 0\n\temitter.column = 0\n\temitter.whitespace = true\n\temitter.indention = true\n\n\tif emitter.encoding != yaml_UTF8_ENCODING {\n\t\tif !yaml_emitter_write_bom(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\temitter.state = yaml_EMIT_FIRST_DOCUMENT_START_STATE\n\treturn true\n}\n\n// Expect DOCUMENT-START or STREAM-END.\nfunc yaml_emitter_emit_document_start(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {\n\n\tif event.typ == yaml_DOCUMENT_START_EVENT {\n\n\t\tif event.version_directive != nil {\n\t\t\tif !yaml_emitter_analyze_version_directive(emitter, event.version_directive) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tfor i := 0; i < len(event.tag_directives); i++ {\n\t\t\ttag_directive := &event.tag_directives[i]\n\t\t\tif !yaml_emitter_analyze_tag_directive(emitter, tag_directive) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_append_tag_directive(emitter, tag_directive, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tfor i := 0; i < len(default_tag_directives); i++ {\n\t\t\ttag_directive := &default_tag_directives[i]\n\t\t\tif !yaml_emitter_append_tag_directive(emitter, tag_directive, true) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\timplicit := event.implicit\n\t\tif !first || emitter.canonical {\n\t\t\timplicit = false\n\t\t}\n\n\t\tif emitter.open_ended && (event.version_directive != nil || len(event.tag_directives) > 0) {\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"...\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tif event.version_directive != nil {\n\t\t\timplicit = false\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"%YAML\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"1.1\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tif len(event.tag_directives) > 0 {\n\t\t\timplicit = false\n\t\t\tfor i := 0; i < len(event.tag_directives); i++ {\n\t\t\t\ttag_directive := &event.tag_directives[i]\n\t\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"%TAG\"), true, false, false) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif !yaml_emitter_write_tag_handle(emitter, tag_directive.handle) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif !yaml_emitter_write_tag_content(emitter, tag_directive.prefix, true) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif yaml_emitter_check_empty_document(emitter) {\n\t\t\timplicit = false\n\t\t}\n\t\tif !implicit {\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"---\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif emitter.canonical {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\temitter.state = yaml_EMIT_DOCUMENT_CONTENT_STATE\n\t\treturn true\n\t}\n\n\tif event.typ == yaml_STREAM_END_EVENT {\n\t\tif emitter.open_ended {\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"...\"), true, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_flush(emitter) {\n\t\t\treturn false\n\t\t}\n\t\temitter.state = yaml_EMIT_END_STATE\n\t\treturn true\n\t}\n\n\treturn yaml_emitter_set_emitter_error(emitter, \"expected DOCUMENT-START or STREAM-END\")\n}\n\n// Expect the root node.\nfunc yaml_emitter_emit_document_content(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\temitter.states = append(emitter.states, yaml_EMIT_DOCUMENT_END_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, true, false, false, false)\n}\n\n// Expect DOCUMENT-END.\nfunc yaml_emitter_emit_document_end(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif event.typ != yaml_DOCUMENT_END_EVENT {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"expected DOCUMENT-END\")\n\t}\n\tif !yaml_emitter_write_indent(emitter) {\n\t\treturn false\n\t}\n\tif !event.implicit {\n\t\t// [Go] Allocate the slice elsewhere.\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"...\"), true, false, false) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif !yaml_emitter_flush(emitter) {\n\t\treturn false\n\t}\n\temitter.state = yaml_EMIT_DOCUMENT_START_STATE\n\temitter.tag_directives = emitter.tag_directives[:0]\n\treturn true\n}\n\n// Expect a flow item node.\nfunc yaml_emitter_emit_flow_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{'['}, true, true, false) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_increase_indent(emitter, true, false) {\n\t\t\treturn false\n\t\t}\n\t\temitter.flow_level++\n\t}\n\n\tif event.typ == yaml_SEQUENCE_END_EVENT {\n\t\temitter.flow_level--\n\t\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\t\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\t\tif emitter.canonical && !first {\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{']'}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t\temitter.state = emitter.states[len(emitter.states)-1]\n\t\temitter.states = emitter.states[:len(emitter.states)-1]\n\n\t\treturn true\n\t}\n\n\tif !first {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif emitter.canonical || emitter.column > emitter.best_width {\n\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, true, false, false)\n}\n\n// Expect a flow key node.\nfunc yaml_emitter_emit_flow_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{'{'}, true, true, false) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_increase_indent(emitter, true, false) {\n\t\t\treturn false\n\t\t}\n\t\temitter.flow_level++\n\t}\n\n\tif event.typ == yaml_MAPPING_END_EVENT {\n\t\temitter.flow_level--\n\t\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\t\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\t\tif emitter.canonical && !first {\n\t\t\tif !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{'}'}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t\temitter.state = emitter.states[len(emitter.states)-1]\n\t\temitter.states = emitter.states[:len(emitter.states)-1]\n\t\treturn true\n\t}\n\n\tif !first {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif emitter.canonical || emitter.column > emitter.best_width {\n\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif !emitter.canonical && yaml_emitter_check_simple_key(emitter) {\n\t\temitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE)\n\t\treturn yaml_emitter_emit_node(emitter, event, false, false, true, true)\n\t}\n\tif !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, false) {\n\t\treturn false\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_VALUE_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, false, true, false)\n}\n\n// Expect a flow value node.\nfunc yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool {\n\tif simple {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tif emitter.canonical || emitter.column > emitter.best_width {\n\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_KEY_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, false, true, false)\n}\n\n// Expect a block item node.\nfunc yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\tif !yaml_emitter_increase_indent(emitter, false, emitter.mapping_context && !emitter.indention) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif event.typ == yaml_SEQUENCE_END_EVENT {\n\t\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\t\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\t\temitter.state = emitter.states[len(emitter.states)-1]\n\t\temitter.states = emitter.states[:len(emitter.states)-1]\n\t\treturn true\n\t}\n\tif !yaml_emitter_write_indent(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_write_indicator(emitter, []byte{'-'}, true, false, true) {\n\t\treturn false\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, true, false, false)\n}\n\n// Expect a block key node.\nfunc yaml_emitter_emit_block_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\tif !yaml_emitter_increase_indent(emitter, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif event.typ == yaml_MAPPING_END_EVENT {\n\t\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\t\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\t\temitter.state = emitter.states[len(emitter.states)-1]\n\t\temitter.states = emitter.states[:len(emitter.states)-1]\n\t\treturn true\n\t}\n\tif !yaml_emitter_write_indent(emitter) {\n\t\treturn false\n\t}\n\tif yaml_emitter_check_simple_key(emitter) {\n\t\temitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE)\n\t\treturn yaml_emitter_emit_node(emitter, event, false, false, true, true)\n\t}\n\tif !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, true) {\n\t\treturn false\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_VALUE_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, false, true, false)\n}\n\n// Expect a block value node.\nfunc yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool {\n\tif simple {\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, true) {\n\t\t\treturn false\n\t\t}\n\t}\n\temitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_KEY_STATE)\n\treturn yaml_emitter_emit_node(emitter, event, false, false, true, false)\n}\n\n// Expect a node.\nfunc yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t,\n\troot bool, sequence bool, mapping bool, simple_key bool) bool {\n\n\temitter.root_context = root\n\temitter.sequence_context = sequence\n\temitter.mapping_context = mapping\n\temitter.simple_key_context = simple_key\n\n\tswitch event.typ {\n\tcase yaml_ALIAS_EVENT:\n\t\treturn yaml_emitter_emit_alias(emitter, event)\n\tcase yaml_SCALAR_EVENT:\n\t\treturn yaml_emitter_emit_scalar(emitter, event)\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\treturn yaml_emitter_emit_sequence_start(emitter, event)\n\tcase yaml_MAPPING_START_EVENT:\n\t\treturn yaml_emitter_emit_mapping_start(emitter, event)\n\tdefault:\n\t\treturn yaml_emitter_set_emitter_error(emitter,\n\t\t\t\"expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS\")\n\t}\n}\n\n// Expect ALIAS.\nfunc yaml_emitter_emit_alias(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif !yaml_emitter_process_anchor(emitter) {\n\t\treturn false\n\t}\n\temitter.state = emitter.states[len(emitter.states)-1]\n\temitter.states = emitter.states[:len(emitter.states)-1]\n\treturn true\n}\n\n// Expect SCALAR.\nfunc yaml_emitter_emit_scalar(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif !yaml_emitter_select_scalar_style(emitter, event) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_anchor(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_tag(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_increase_indent(emitter, true, false) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_scalar(emitter) {\n\t\treturn false\n\t}\n\temitter.indent = emitter.indents[len(emitter.indents)-1]\n\temitter.indents = emitter.indents[:len(emitter.indents)-1]\n\temitter.state = emitter.states[len(emitter.states)-1]\n\temitter.states = emitter.states[:len(emitter.states)-1]\n\treturn true\n}\n\n// Expect SEQUENCE-START.\nfunc yaml_emitter_emit_sequence_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif !yaml_emitter_process_anchor(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_tag(emitter) {\n\t\treturn false\n\t}\n\tif emitter.flow_level > 0 || emitter.canonical || event.sequence_style() == yaml_FLOW_SEQUENCE_STYLE ||\n\t\tyaml_emitter_check_empty_sequence(emitter) {\n\t\temitter.state = yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE\n\t} else {\n\t\temitter.state = yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE\n\t}\n\treturn true\n}\n\n// Expect MAPPING-START.\nfunc yaml_emitter_emit_mapping_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\tif !yaml_emitter_process_anchor(emitter) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_process_tag(emitter) {\n\t\treturn false\n\t}\n\tif emitter.flow_level > 0 || emitter.canonical || event.mapping_style() == yaml_FLOW_MAPPING_STYLE ||\n\t\tyaml_emitter_check_empty_mapping(emitter) {\n\t\temitter.state = yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE\n\t} else {\n\t\temitter.state = yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE\n\t}\n\treturn true\n}\n\n// Check if the document content is an empty scalar.\nfunc yaml_emitter_check_empty_document(emitter *yaml_emitter_t) bool {\n\treturn false // [Go] Huh?\n}\n\n// Check if the next events represent an empty sequence.\nfunc yaml_emitter_check_empty_sequence(emitter *yaml_emitter_t) bool {\n\tif len(emitter.events)-emitter.events_head < 2 {\n\t\treturn false\n\t}\n\treturn emitter.events[emitter.events_head].typ == yaml_SEQUENCE_START_EVENT &&\n\t\temitter.events[emitter.events_head+1].typ == yaml_SEQUENCE_END_EVENT\n}\n\n// Check if the next events represent an empty mapping.\nfunc yaml_emitter_check_empty_mapping(emitter *yaml_emitter_t) bool {\n\tif len(emitter.events)-emitter.events_head < 2 {\n\t\treturn false\n\t}\n\treturn emitter.events[emitter.events_head].typ == yaml_MAPPING_START_EVENT &&\n\t\temitter.events[emitter.events_head+1].typ == yaml_MAPPING_END_EVENT\n}\n\n// Check if the next node can be expressed as a simple key.\nfunc yaml_emitter_check_simple_key(emitter *yaml_emitter_t) bool {\n\tlength := 0\n\tswitch emitter.events[emitter.events_head].typ {\n\tcase yaml_ALIAS_EVENT:\n\t\tlength += len(emitter.anchor_data.anchor)\n\tcase yaml_SCALAR_EVENT:\n\t\tif emitter.scalar_data.multiline {\n\t\t\treturn false\n\t\t}\n\t\tlength += len(emitter.anchor_data.anchor) +\n\t\t\tlen(emitter.tag_data.handle) +\n\t\t\tlen(emitter.tag_data.suffix) +\n\t\t\tlen(emitter.scalar_data.value)\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\tif !yaml_emitter_check_empty_sequence(emitter) {\n\t\t\treturn false\n\t\t}\n\t\tlength += len(emitter.anchor_data.anchor) +\n\t\t\tlen(emitter.tag_data.handle) +\n\t\t\tlen(emitter.tag_data.suffix)\n\tcase yaml_MAPPING_START_EVENT:\n\t\tif !yaml_emitter_check_empty_mapping(emitter) {\n\t\t\treturn false\n\t\t}\n\t\tlength += len(emitter.anchor_data.anchor) +\n\t\t\tlen(emitter.tag_data.handle) +\n\t\t\tlen(emitter.tag_data.suffix)\n\tdefault:\n\t\treturn false\n\t}\n\treturn length <= 128\n}\n\n// Determine an acceptable scalar style.\nfunc yaml_emitter_select_scalar_style(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\n\tno_tag := len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0\n\tif no_tag && !event.implicit && !event.quoted_implicit {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"neither tag nor implicit flags are specified\")\n\t}\n\n\tstyle := event.scalar_style()\n\tif style == yaml_ANY_SCALAR_STYLE {\n\t\tstyle = yaml_PLAIN_SCALAR_STYLE\n\t}\n\tif emitter.canonical {\n\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t}\n\tif emitter.simple_key_context && emitter.scalar_data.multiline {\n\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t}\n\n\tif style == yaml_PLAIN_SCALAR_STYLE {\n\t\tif emitter.flow_level > 0 && !emitter.scalar_data.flow_plain_allowed ||\n\t\t\temitter.flow_level == 0 && !emitter.scalar_data.block_plain_allowed {\n\t\t\tstyle = yaml_SINGLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t\tif len(emitter.scalar_data.value) == 0 && (emitter.flow_level > 0 || emitter.simple_key_context) {\n\t\t\tstyle = yaml_SINGLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t\tif no_tag && !event.implicit {\n\t\t\tstyle = yaml_SINGLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t}\n\tif style == yaml_SINGLE_QUOTED_SCALAR_STYLE {\n\t\tif !emitter.scalar_data.single_quoted_allowed {\n\t\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t}\n\tif style == yaml_LITERAL_SCALAR_STYLE || style == yaml_FOLDED_SCALAR_STYLE {\n\t\tif !emitter.scalar_data.block_allowed || emitter.flow_level > 0 || emitter.simple_key_context {\n\t\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t\t}\n\t}\n\n\tif no_tag && !event.quoted_implicit && style != yaml_PLAIN_SCALAR_STYLE {\n\t\temitter.tag_data.handle = []byte{'!'}\n\t}\n\temitter.scalar_data.style = style\n\treturn true\n}\n\n// Write an achor.\nfunc yaml_emitter_process_anchor(emitter *yaml_emitter_t) bool {\n\tif emitter.anchor_data.anchor == nil {\n\t\treturn true\n\t}\n\tc := []byte{'&'}\n\tif emitter.anchor_data.alias {\n\t\tc[0] = '*'\n\t}\n\tif !yaml_emitter_write_indicator(emitter, c, true, false, false) {\n\t\treturn false\n\t}\n\treturn yaml_emitter_write_anchor(emitter, emitter.anchor_data.anchor)\n}\n\n// Write a tag.\nfunc yaml_emitter_process_tag(emitter *yaml_emitter_t) bool {\n\tif len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 {\n\t\treturn true\n\t}\n\tif len(emitter.tag_data.handle) > 0 {\n\t\tif !yaml_emitter_write_tag_handle(emitter, emitter.tag_data.handle) {\n\t\t\treturn false\n\t\t}\n\t\tif len(emitter.tag_data.suffix) > 0 {\n\t\t\tif !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// [Go] Allocate these slices elsewhere.\n\t\tif !yaml_emitter_write_indicator(emitter, []byte(\"!<\"), true, false, false) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) {\n\t\t\treturn false\n\t\t}\n\t\tif !yaml_emitter_write_indicator(emitter, []byte{'>'}, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Write a scalar.\nfunc yaml_emitter_process_scalar(emitter *yaml_emitter_t) bool {\n\tswitch emitter.scalar_data.style {\n\tcase yaml_PLAIN_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_plain_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context)\n\n\tcase yaml_SINGLE_QUOTED_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_single_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context)\n\n\tcase yaml_DOUBLE_QUOTED_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_double_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context)\n\n\tcase yaml_LITERAL_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_literal_scalar(emitter, emitter.scalar_data.value)\n\n\tcase yaml_FOLDED_SCALAR_STYLE:\n\t\treturn yaml_emitter_write_folded_scalar(emitter, emitter.scalar_data.value)\n\t}\n\tpanic(\"unknown scalar style\")\n}\n\n// Check if a %YAML directive is valid.\nfunc yaml_emitter_analyze_version_directive(emitter *yaml_emitter_t, version_directive *yaml_version_directive_t) bool {\n\tif version_directive.major != 1 || version_directive.minor != 1 {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"incompatible %YAML directive\")\n\t}\n\treturn true\n}\n\n// Check if a %TAG directive is valid.\nfunc yaml_emitter_analyze_tag_directive(emitter *yaml_emitter_t, tag_directive *yaml_tag_directive_t) bool {\n\thandle := tag_directive.handle\n\tprefix := tag_directive.prefix\n\tif len(handle) == 0 {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"tag handle must not be empty\")\n\t}\n\tif handle[0] != '!' {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"tag handle must start with '!'\")\n\t}\n\tif handle[len(handle)-1] != '!' {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"tag handle must end with '!'\")\n\t}\n\tfor i := 1; i < len(handle)-1; i += width(handle[i]) {\n\t\tif !is_alpha(handle, i) {\n\t\t\treturn yaml_emitter_set_emitter_error(emitter, \"tag handle must contain alphanumerical characters only\")\n\t\t}\n\t}\n\tif len(prefix) == 0 {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"tag prefix must not be empty\")\n\t}\n\treturn true\n}\n\n// Check if an anchor is valid.\nfunc yaml_emitter_analyze_anchor(emitter *yaml_emitter_t, anchor []byte, alias bool) bool {\n\tif len(anchor) == 0 {\n\t\tproblem := \"anchor value must not be empty\"\n\t\tif alias {\n\t\t\tproblem = \"alias value must not be empty\"\n\t\t}\n\t\treturn yaml_emitter_set_emitter_error(emitter, problem)\n\t}\n\tfor i := 0; i < len(anchor); i += width(anchor[i]) {\n\t\tif !is_alpha(anchor, i) {\n\t\t\tproblem := \"anchor value must contain alphanumerical characters only\"\n\t\t\tif alias {\n\t\t\t\tproblem = \"alias value must contain alphanumerical characters only\"\n\t\t\t}\n\t\t\treturn yaml_emitter_set_emitter_error(emitter, problem)\n\t\t}\n\t}\n\temitter.anchor_data.anchor = anchor\n\temitter.anchor_data.alias = alias\n\treturn true\n}\n\n// Check if a tag is valid.\nfunc yaml_emitter_analyze_tag(emitter *yaml_emitter_t, tag []byte) bool {\n\tif len(tag) == 0 {\n\t\treturn yaml_emitter_set_emitter_error(emitter, \"tag value must not be empty\")\n\t}\n\tfor i := 0; i < len(emitter.tag_directives); i++ {\n\t\ttag_directive := &emitter.tag_directives[i]\n\t\tif bytes.HasPrefix(tag, tag_directive.prefix) {\n\t\t\temitter.tag_data.handle = tag_directive.handle\n\t\t\temitter.tag_data.suffix = tag[len(tag_directive.prefix):]\n\t\t\treturn true\n\t\t}\n\t}\n\temitter.tag_data.suffix = tag\n\treturn true\n}\n\n// Check if a scalar is valid.\nfunc yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool {\n\tvar (\n\t\tblock_indicators   = false\n\t\tflow_indicators    = false\n\t\tline_breaks        = false\n\t\tspecial_characters = false\n\n\t\tleading_space  = false\n\t\tleading_break  = false\n\t\ttrailing_space = false\n\t\ttrailing_break = false\n\t\tbreak_space    = false\n\t\tspace_break    = false\n\n\t\tpreceded_by_whitespace = false\n\t\tfollowed_by_whitespace = false\n\t\tprevious_space         = false\n\t\tprevious_break         = false\n\t)\n\n\temitter.scalar_data.value = value\n\n\tif len(value) == 0 {\n\t\temitter.scalar_data.multiline = false\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = true\n\t\temitter.scalar_data.single_quoted_allowed = true\n\t\temitter.scalar_data.block_allowed = false\n\t\treturn true\n\t}\n\n\tif len(value) >= 3 && ((value[0] == '-' && value[1] == '-' && value[2] == '-') || (value[0] == '.' && value[1] == '.' && value[2] == '.')) {\n\t\tblock_indicators = true\n\t\tflow_indicators = true\n\t}\n\n\tpreceded_by_whitespace = true\n\tfor i, w := 0, 0; i < len(value); i += w {\n\t\tw = width(value[i])\n\t\tfollowed_by_whitespace = i+w >= len(value) || is_blank(value, i+w)\n\n\t\tif i == 0 {\n\t\t\tswitch value[i] {\n\t\t\tcase '#', ',', '[', ']', '{', '}', '&', '*', '!', '|', '>', '\\'', '\"', '%', '@', '`':\n\t\t\t\tflow_indicators = true\n\t\t\t\tblock_indicators = true\n\t\t\tcase '?', ':':\n\t\t\t\tflow_indicators = true\n\t\t\t\tif followed_by_whitespace {\n\t\t\t\t\tblock_indicators = true\n\t\t\t\t}\n\t\t\tcase '-':\n\t\t\t\tif followed_by_whitespace {\n\t\t\t\t\tflow_indicators = true\n\t\t\t\t\tblock_indicators = true\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tswitch value[i] {\n\t\t\tcase ',', '?', '[', ']', '{', '}':\n\t\t\t\tflow_indicators = true\n\t\t\tcase ':':\n\t\t\t\tflow_indicators = true\n\t\t\t\tif followed_by_whitespace {\n\t\t\t\t\tblock_indicators = true\n\t\t\t\t}\n\t\t\tcase '#':\n\t\t\t\tif preceded_by_whitespace {\n\t\t\t\t\tflow_indicators = true\n\t\t\t\t\tblock_indicators = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif !is_printable(value, i) || !is_ascii(value, i) && !emitter.unicode {\n\t\t\tspecial_characters = true\n\t\t}\n\t\tif is_space(value, i) {\n\t\t\tif i == 0 {\n\t\t\t\tleading_space = true\n\t\t\t}\n\t\t\tif i+width(value[i]) == len(value) {\n\t\t\t\ttrailing_space = true\n\t\t\t}\n\t\t\tif previous_break {\n\t\t\t\tbreak_space = true\n\t\t\t}\n\t\t\tprevious_space = true\n\t\t\tprevious_break = false\n\t\t} else if is_break(value, i) {\n\t\t\tline_breaks = true\n\t\t\tif i == 0 {\n\t\t\t\tleading_break = true\n\t\t\t}\n\t\t\tif i+width(value[i]) == len(value) {\n\t\t\t\ttrailing_break = true\n\t\t\t}\n\t\t\tif previous_space {\n\t\t\t\tspace_break = true\n\t\t\t}\n\t\t\tprevious_space = false\n\t\t\tprevious_break = true\n\t\t} else {\n\t\t\tprevious_space = false\n\t\t\tprevious_break = false\n\t\t}\n\n\t\t// [Go]: Why 'z'? Couldn't be the end of the string as that's the loop condition.\n\t\tpreceded_by_whitespace = is_blankz(value, i)\n\t}\n\n\temitter.scalar_data.multiline = line_breaks\n\temitter.scalar_data.flow_plain_allowed = true\n\temitter.scalar_data.block_plain_allowed = true\n\temitter.scalar_data.single_quoted_allowed = true\n\temitter.scalar_data.block_allowed = true\n\n\tif leading_space || leading_break || trailing_space || trailing_break {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = false\n\t}\n\tif trailing_space {\n\t\temitter.scalar_data.block_allowed = false\n\t}\n\tif break_space {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = false\n\t\temitter.scalar_data.single_quoted_allowed = false\n\t}\n\tif space_break || special_characters {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = false\n\t\temitter.scalar_data.single_quoted_allowed = false\n\t\temitter.scalar_data.block_allowed = false\n\t}\n\tif line_breaks {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t\temitter.scalar_data.block_plain_allowed = false\n\t}\n\tif flow_indicators {\n\t\temitter.scalar_data.flow_plain_allowed = false\n\t}\n\tif block_indicators {\n\t\temitter.scalar_data.block_plain_allowed = false\n\t}\n\treturn true\n}\n\n// Check if the event data is valid.\nfunc yaml_emitter_analyze_event(emitter *yaml_emitter_t, event *yaml_event_t) bool {\n\n\temitter.anchor_data.anchor = nil\n\temitter.tag_data.handle = nil\n\temitter.tag_data.suffix = nil\n\temitter.scalar_data.value = nil\n\n\tswitch event.typ {\n\tcase yaml_ALIAS_EVENT:\n\t\tif !yaml_emitter_analyze_anchor(emitter, event.anchor, true) {\n\t\t\treturn false\n\t\t}\n\n\tcase yaml_SCALAR_EVENT:\n\t\tif len(event.anchor) > 0 {\n\t\t\tif !yaml_emitter_analyze_anchor(emitter, event.anchor, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif len(event.tag) > 0 && (emitter.canonical || (!event.implicit && !event.quoted_implicit)) {\n\t\t\tif !yaml_emitter_analyze_tag(emitter, event.tag) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif !yaml_emitter_analyze_scalar(emitter, event.value) {\n\t\t\treturn false\n\t\t}\n\n\tcase yaml_SEQUENCE_START_EVENT:\n\t\tif len(event.anchor) > 0 {\n\t\t\tif !yaml_emitter_analyze_anchor(emitter, event.anchor, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif len(event.tag) > 0 && (emitter.canonical || !event.implicit) {\n\t\t\tif !yaml_emitter_analyze_tag(emitter, event.tag) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\tcase yaml_MAPPING_START_EVENT:\n\t\tif len(event.anchor) > 0 {\n\t\t\tif !yaml_emitter_analyze_anchor(emitter, event.anchor, false) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif len(event.tag) > 0 && (emitter.canonical || !event.implicit) {\n\t\t\tif !yaml_emitter_analyze_tag(emitter, event.tag) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\n// Write the BOM character.\nfunc yaml_emitter_write_bom(emitter *yaml_emitter_t) bool {\n\tif !flush(emitter) {\n\t\treturn false\n\t}\n\tpos := emitter.buffer_pos\n\temitter.buffer[pos+0] = '\\xEF'\n\temitter.buffer[pos+1] = '\\xBB'\n\temitter.buffer[pos+2] = '\\xBF'\n\temitter.buffer_pos += 3\n\treturn true\n}\n\nfunc yaml_emitter_write_indent(emitter *yaml_emitter_t) bool {\n\tindent := emitter.indent\n\tif indent < 0 {\n\t\tindent = 0\n\t}\n\tif !emitter.indention || emitter.column > indent || (emitter.column == indent && !emitter.whitespace) {\n\t\tif !put_break(emitter) {\n\t\t\treturn false\n\t\t}\n\t}\n\tfor emitter.column < indent {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\temitter.whitespace = true\n\temitter.indention = true\n\treturn true\n}\n\nfunc yaml_emitter_write_indicator(emitter *yaml_emitter_t, indicator []byte, need_whitespace, is_whitespace, is_indention bool) bool {\n\tif need_whitespace && !emitter.whitespace {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\tif !write_all(emitter, indicator) {\n\t\treturn false\n\t}\n\temitter.whitespace = is_whitespace\n\temitter.indention = (emitter.indention && is_indention)\n\temitter.open_ended = false\n\treturn true\n}\n\nfunc yaml_emitter_write_anchor(emitter *yaml_emitter_t, value []byte) bool {\n\tif !write_all(emitter, value) {\n\t\treturn false\n\t}\n\temitter.whitespace = false\n\temitter.indention = false\n\treturn true\n}\n\nfunc yaml_emitter_write_tag_handle(emitter *yaml_emitter_t, value []byte) bool {\n\tif !emitter.whitespace {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\tif !write_all(emitter, value) {\n\t\treturn false\n\t}\n\temitter.whitespace = false\n\temitter.indention = false\n\treturn true\n}\n\nfunc yaml_emitter_write_tag_content(emitter *yaml_emitter_t, value []byte, need_whitespace bool) bool {\n\tif need_whitespace && !emitter.whitespace {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\tfor i := 0; i < len(value); {\n\t\tvar must_write bool\n\t\tswitch value[i] {\n\t\tcase ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '_', '.', '~', '*', '\\'', '(', ')', '[', ']':\n\t\t\tmust_write = true\n\t\tdefault:\n\t\t\tmust_write = is_alpha(value, i)\n\t\t}\n\t\tif must_write {\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\tw := width(value[i])\n\t\t\tfor k := 0; k < w; k++ {\n\t\t\t\toctet := value[i]\n\t\t\t\ti++\n\t\t\t\tif !put(emitter, '%') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\tc := octet >> 4\n\t\t\t\tif c < 10 {\n\t\t\t\t\tc += '0'\n\t\t\t\t} else {\n\t\t\t\t\tc += 'A' - 10\n\t\t\t\t}\n\t\t\t\tif !put(emitter, c) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\tc = octet & 0x0f\n\t\t\t\tif c < 10 {\n\t\t\t\t\tc += '0'\n\t\t\t\t} else {\n\t\t\t\t\tc += 'A' - 10\n\t\t\t\t}\n\t\t\t\tif !put(emitter, c) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\temitter.whitespace = false\n\temitter.indention = false\n\treturn true\n}\n\nfunc yaml_emitter_write_plain_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool {\n\tif !emitter.whitespace {\n\t\tif !put(emitter, ' ') {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tspaces := false\n\tbreaks := false\n\tfor i := 0; i < len(value); {\n\t\tif is_space(value, i) {\n\t\t\tif allow_breaks && !spaces && emitter.column > emitter.best_width && !is_space(value, i+1) {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\ti += width(value[i])\n\t\t\t} else {\n\t\t\t\tif !write(emitter, value, &i) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tspaces = true\n\t\t} else if is_break(value, i) {\n\t\t\tif !breaks && value[i] == '\\n' {\n\t\t\t\tif !put_break(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write_break(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = true\n\t\t\tbreaks = true\n\t\t} else {\n\t\t\tif breaks {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = false\n\t\t\tspaces = false\n\t\t\tbreaks = false\n\t\t}\n\t}\n\n\temitter.whitespace = false\n\temitter.indention = false\n\tif emitter.root_context {\n\t\temitter.open_ended = true\n\t}\n\n\treturn true\n}\n\nfunc yaml_emitter_write_single_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool {\n\n\tif !yaml_emitter_write_indicator(emitter, []byte{'\\''}, true, false, false) {\n\t\treturn false\n\t}\n\n\tspaces := false\n\tbreaks := false\n\tfor i := 0; i < len(value); {\n\t\tif is_space(value, i) {\n\t\t\tif allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 && !is_space(value, i+1) {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\ti += width(value[i])\n\t\t\t} else {\n\t\t\t\tif !write(emitter, value, &i) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tspaces = true\n\t\t} else if is_break(value, i) {\n\t\t\tif !breaks && value[i] == '\\n' {\n\t\t\t\tif !put_break(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write_break(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = true\n\t\t\tbreaks = true\n\t\t} else {\n\t\t\tif breaks {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif value[i] == '\\'' {\n\t\t\t\tif !put(emitter, '\\'') {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = false\n\t\t\tspaces = false\n\t\t\tbreaks = false\n\t\t}\n\t}\n\tif !yaml_emitter_write_indicator(emitter, []byte{'\\''}, false, false, false) {\n\t\treturn false\n\t}\n\temitter.whitespace = false\n\temitter.indention = false\n\treturn true\n}\n\nfunc yaml_emitter_write_double_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool {\n\tspaces := false\n\tif !yaml_emitter_write_indicator(emitter, []byte{'\"'}, true, false, false) {\n\t\treturn false\n\t}\n\n\tfor i := 0; i < len(value); {\n\t\tif !is_printable(value, i) || (!emitter.unicode && !is_ascii(value, i)) ||\n\t\t\tis_bom(value, i) || is_break(value, i) ||\n\t\t\tvalue[i] == '\"' || value[i] == '\\\\' {\n\n\t\t\toctet := value[i]\n\n\t\t\tvar w int\n\t\t\tvar v rune\n\t\t\tswitch {\n\t\t\tcase octet&0x80 == 0x00:\n\t\t\t\tw, v = 1, rune(octet&0x7F)\n\t\t\tcase octet&0xE0 == 0xC0:\n\t\t\t\tw, v = 2, rune(octet&0x1F)\n\t\t\tcase octet&0xF0 == 0xE0:\n\t\t\t\tw, v = 3, rune(octet&0x0F)\n\t\t\tcase octet&0xF8 == 0xF0:\n\t\t\t\tw, v = 4, rune(octet&0x07)\n\t\t\t}\n\t\t\tfor k := 1; k < w; k++ {\n\t\t\t\toctet = value[i+k]\n\t\t\t\tv = (v << 6) + (rune(octet) & 0x3F)\n\t\t\t}\n\t\t\ti += w\n\n\t\t\tif !put(emitter, '\\\\') {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tvar ok bool\n\t\t\tswitch v {\n\t\t\tcase 0x00:\n\t\t\t\tok = put(emitter, '0')\n\t\t\tcase 0x07:\n\t\t\t\tok = put(emitter, 'a')\n\t\t\tcase 0x08:\n\t\t\t\tok = put(emitter, 'b')\n\t\t\tcase 0x09:\n\t\t\t\tok = put(emitter, 't')\n\t\t\tcase 0x0A:\n\t\t\t\tok = put(emitter, 'n')\n\t\t\tcase 0x0b:\n\t\t\t\tok = put(emitter, 'v')\n\t\t\tcase 0x0c:\n\t\t\t\tok = put(emitter, 'f')\n\t\t\tcase 0x0d:\n\t\t\t\tok = put(emitter, 'r')\n\t\t\tcase 0x1b:\n\t\t\t\tok = put(emitter, 'e')\n\t\t\tcase 0x22:\n\t\t\t\tok = put(emitter, '\"')\n\t\t\tcase 0x5c:\n\t\t\t\tok = put(emitter, '\\\\')\n\t\t\tcase 0x85:\n\t\t\t\tok = put(emitter, 'N')\n\t\t\tcase 0xA0:\n\t\t\t\tok = put(emitter, '_')\n\t\t\tcase 0x2028:\n\t\t\t\tok = put(emitter, 'L')\n\t\t\tcase 0x2029:\n\t\t\t\tok = put(emitter, 'P')\n\t\t\tdefault:\n\t\t\t\tif v <= 0xFF {\n\t\t\t\t\tok = put(emitter, 'x')\n\t\t\t\t\tw = 2\n\t\t\t\t} else if v <= 0xFFFF {\n\t\t\t\t\tok = put(emitter, 'u')\n\t\t\t\t\tw = 4\n\t\t\t\t} else {\n\t\t\t\t\tok = put(emitter, 'U')\n\t\t\t\t\tw = 8\n\t\t\t\t}\n\t\t\t\tfor k := (w - 1) * 4; ok && k >= 0; k -= 4 {\n\t\t\t\t\tdigit := byte((v >> uint(k)) & 0x0F)\n\t\t\t\t\tif digit < 10 {\n\t\t\t\t\t\tok = put(emitter, digit+'0')\n\t\t\t\t\t} else {\n\t\t\t\t\t\tok = put(emitter, digit+'A'-10)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !ok {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tspaces = false\n\t\t} else if is_space(value, i) {\n\t\t\tif allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tif is_space(value, i+1) {\n\t\t\t\t\tif !put(emitter, '\\\\') {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti += width(value[i])\n\t\t\t} else if !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tspaces = true\n\t\t} else {\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tspaces = false\n\t\t}\n\t}\n\tif !yaml_emitter_write_indicator(emitter, []byte{'\"'}, false, false, false) {\n\t\treturn false\n\t}\n\temitter.whitespace = false\n\temitter.indention = false\n\treturn true\n}\n\nfunc yaml_emitter_write_block_scalar_hints(emitter *yaml_emitter_t, value []byte) bool {\n\tif is_space(value, 0) || is_break(value, 0) {\n\t\tindent_hint := []byte{'0' + byte(emitter.best_indent)}\n\t\tif !yaml_emitter_write_indicator(emitter, indent_hint, false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\temitter.open_ended = false\n\n\tvar chomp_hint [1]byte\n\tif len(value) == 0 {\n\t\tchomp_hint[0] = '-'\n\t} else {\n\t\ti := len(value) - 1\n\t\tfor value[i]&0xC0 == 0x80 {\n\t\t\ti--\n\t\t}\n\t\tif !is_break(value, i) {\n\t\t\tchomp_hint[0] = '-'\n\t\t} else if i == 0 {\n\t\t\tchomp_hint[0] = '+'\n\t\t\temitter.open_ended = true\n\t\t} else {\n\t\t\ti--\n\t\t\tfor value[i]&0xC0 == 0x80 {\n\t\t\t\ti--\n\t\t\t}\n\t\t\tif is_break(value, i) {\n\t\t\t\tchomp_hint[0] = '+'\n\t\t\t\temitter.open_ended = true\n\t\t\t}\n\t\t}\n\t}\n\tif chomp_hint[0] != 0 {\n\t\tif !yaml_emitter_write_indicator(emitter, chomp_hint[:], false, false, false) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []byte) bool {\n\tif !yaml_emitter_write_indicator(emitter, []byte{'|'}, true, false, false) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_write_block_scalar_hints(emitter, value) {\n\t\treturn false\n\t}\n\tif !put_break(emitter) {\n\t\treturn false\n\t}\n\temitter.indention = true\n\temitter.whitespace = true\n\tbreaks := true\n\tfor i := 0; i < len(value); {\n\t\tif is_break(value, i) {\n\t\t\tif !write_break(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = true\n\t\t\tbreaks = true\n\t\t} else {\n\t\t\tif breaks {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = false\n\t\t\tbreaks = false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []byte) bool {\n\tif !yaml_emitter_write_indicator(emitter, []byte{'>'}, true, false, false) {\n\t\treturn false\n\t}\n\tif !yaml_emitter_write_block_scalar_hints(emitter, value) {\n\t\treturn false\n\t}\n\n\tif !put_break(emitter) {\n\t\treturn false\n\t}\n\temitter.indention = true\n\temitter.whitespace = true\n\n\tbreaks := true\n\tleading_spaces := true\n\tfor i := 0; i < len(value); {\n\t\tif is_break(value, i) {\n\t\t\tif !breaks && !leading_spaces && value[i] == '\\n' {\n\t\t\t\tk := 0\n\t\t\t\tfor is_break(value, k) {\n\t\t\t\t\tk += width(value[k])\n\t\t\t\t}\n\t\t\t\tif !is_blankz(value, k) {\n\t\t\t\t\tif !put_break(emitter) {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !write_break(emitter, value, &i) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\temitter.indention = true\n\t\t\tbreaks = true\n\t\t} else {\n\t\t\tif breaks {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tleading_spaces = is_blank(value, i)\n\t\t\t}\n\t\t\tif !breaks && is_space(value, i) && !is_space(value, i+1) && emitter.column > emitter.best_width {\n\t\t\t\tif !yaml_emitter_write_indent(emitter) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\ti += width(value[i])\n\t\t\t} else {\n\t\t\t\tif !write(emitter, value, &i) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\temitter.indention = false\n\t\t\tbreaks = false\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/encode.go",
    "content": "package yaml\n\nimport (\n\t\"encoding\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\ntype encoder struct {\n\temitter yaml_emitter_t\n\tevent   yaml_event_t\n\tout     []byte\n\tflow    bool\n}\n\nfunc newEncoder() (e *encoder) {\n\te = &encoder{}\n\te.must(yaml_emitter_initialize(&e.emitter))\n\tyaml_emitter_set_output_string(&e.emitter, &e.out)\n\tyaml_emitter_set_unicode(&e.emitter, true)\n\te.must(yaml_stream_start_event_initialize(&e.event, yaml_UTF8_ENCODING))\n\te.emit()\n\te.must(yaml_document_start_event_initialize(&e.event, nil, nil, true))\n\te.emit()\n\treturn e\n}\n\nfunc (e *encoder) finish() {\n\te.must(yaml_document_end_event_initialize(&e.event, true))\n\te.emit()\n\te.emitter.open_ended = false\n\te.must(yaml_stream_end_event_initialize(&e.event))\n\te.emit()\n}\n\nfunc (e *encoder) destroy() {\n\tyaml_emitter_delete(&e.emitter)\n}\n\nfunc (e *encoder) emit() {\n\t// This will internally delete the e.event value.\n\tif !yaml_emitter_emit(&e.emitter, &e.event) && e.event.typ != yaml_DOCUMENT_END_EVENT && e.event.typ != yaml_STREAM_END_EVENT {\n\t\te.must(false)\n\t}\n}\n\nfunc (e *encoder) must(ok bool) {\n\tif !ok {\n\t\tmsg := e.emitter.problem\n\t\tif msg == \"\" {\n\t\t\tmsg = \"unknown problem generating YAML content\"\n\t\t}\n\t\tfailf(\"%s\", msg)\n\t}\n}\n\nfunc (e *encoder) marshal(tag string, in reflect.Value) {\n\tif !in.IsValid() {\n\t\te.nilv()\n\t\treturn\n\t}\n\tiface := in.Interface()\n\tif m, ok := iface.(Marshaler); ok {\n\t\tv, err := m.MarshalYAML()\n\t\tif err != nil {\n\t\t\tfail(err)\n\t\t}\n\t\tif v == nil {\n\t\t\te.nilv()\n\t\t\treturn\n\t\t}\n\t\tin = reflect.ValueOf(v)\n\t} else if m, ok := iface.(encoding.TextMarshaler); ok {\n\t\ttext, err := m.MarshalText()\n\t\tif err != nil {\n\t\t\tfail(err)\n\t\t}\n\t\tin = reflect.ValueOf(string(text))\n\t}\n\tswitch in.Kind() {\n\tcase reflect.Interface:\n\t\tif in.IsNil() {\n\t\t\te.nilv()\n\t\t} else {\n\t\t\te.marshal(tag, in.Elem())\n\t\t}\n\tcase reflect.Map:\n\t\te.mapv(tag, in)\n\tcase reflect.Ptr:\n\t\tif in.IsNil() {\n\t\t\te.nilv()\n\t\t} else {\n\t\t\te.marshal(tag, in.Elem())\n\t\t}\n\tcase reflect.Struct:\n\t\te.structv(tag, in)\n\tcase reflect.Slice:\n\t\tif in.Type().Elem() == mapItemType {\n\t\t\te.itemsv(tag, in)\n\t\t} else {\n\t\t\te.slicev(tag, in)\n\t\t}\n\tcase reflect.String:\n\t\te.stringv(tag, in)\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tif in.Type() == durationType {\n\t\t\te.stringv(tag, reflect.ValueOf(iface.(time.Duration).String()))\n\t\t} else {\n\t\t\te.intv(tag, in)\n\t\t}\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\te.uintv(tag, in)\n\tcase reflect.Float32, reflect.Float64:\n\t\te.floatv(tag, in)\n\tcase reflect.Bool:\n\t\te.boolv(tag, in)\n\tdefault:\n\t\tpanic(\"cannot marshal type: \" + in.Type().String())\n\t}\n}\n\nfunc (e *encoder) mapv(tag string, in reflect.Value) {\n\te.mappingv(tag, func() {\n\t\tkeys := keyList(in.MapKeys())\n\t\tsort.Sort(keys)\n\t\tfor _, k := range keys {\n\t\t\te.marshal(\"\", k)\n\t\t\te.marshal(\"\", in.MapIndex(k))\n\t\t}\n\t})\n}\n\nfunc (e *encoder) itemsv(tag string, in reflect.Value) {\n\te.mappingv(tag, func() {\n\t\tslice := in.Convert(reflect.TypeOf([]MapItem{})).Interface().([]MapItem)\n\t\tfor _, item := range slice {\n\t\t\te.marshal(\"\", reflect.ValueOf(item.Key))\n\t\t\te.marshal(\"\", reflect.ValueOf(item.Value))\n\t\t}\n\t})\n}\n\nfunc (e *encoder) structv(tag string, in reflect.Value) {\n\tsinfo, err := getStructInfo(in.Type())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\te.mappingv(tag, func() {\n\t\tfor _, info := range sinfo.FieldsList {\n\t\t\tvar value reflect.Value\n\t\t\tif info.Inline == nil {\n\t\t\t\tvalue = in.Field(info.Num)\n\t\t\t} else {\n\t\t\t\tvalue = in.FieldByIndex(info.Inline)\n\t\t\t}\n\t\t\tif info.OmitEmpty && isZero(value) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\te.marshal(\"\", reflect.ValueOf(info.Key))\n\t\t\te.flow = info.Flow\n\t\t\te.marshal(\"\", value)\n\t\t}\n\t\tif sinfo.InlineMap >= 0 {\n\t\t\tm := in.Field(sinfo.InlineMap)\n\t\t\tif m.Len() > 0 {\n\t\t\t\te.flow = false\n\t\t\t\tkeys := keyList(m.MapKeys())\n\t\t\t\tsort.Sort(keys)\n\t\t\t\tfor _, k := range keys {\n\t\t\t\t\tif _, found := sinfo.FieldsMap[k.String()]; found {\n\t\t\t\t\t\tpanic(fmt.Sprintf(\"Can't have key %q in inlined map; conflicts with struct field\", k.String()))\n\t\t\t\t\t}\n\t\t\t\t\te.marshal(\"\", k)\n\t\t\t\t\te.flow = false\n\t\t\t\t\te.marshal(\"\", m.MapIndex(k))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n}\n\nfunc (e *encoder) mappingv(tag string, f func()) {\n\timplicit := tag == \"\"\n\tstyle := yaml_BLOCK_MAPPING_STYLE\n\tif e.flow {\n\t\te.flow = false\n\t\tstyle = yaml_FLOW_MAPPING_STYLE\n\t}\n\te.must(yaml_mapping_start_event_initialize(&e.event, nil, []byte(tag), implicit, style))\n\te.emit()\n\tf()\n\te.must(yaml_mapping_end_event_initialize(&e.event))\n\te.emit()\n}\n\nfunc (e *encoder) slicev(tag string, in reflect.Value) {\n\timplicit := tag == \"\"\n\tstyle := yaml_BLOCK_SEQUENCE_STYLE\n\tif e.flow {\n\t\te.flow = false\n\t\tstyle = yaml_FLOW_SEQUENCE_STYLE\n\t}\n\te.must(yaml_sequence_start_event_initialize(&e.event, nil, []byte(tag), implicit, style))\n\te.emit()\n\tn := in.Len()\n\tfor i := 0; i < n; i++ {\n\t\te.marshal(\"\", in.Index(i))\n\t}\n\te.must(yaml_sequence_end_event_initialize(&e.event))\n\te.emit()\n}\n\n// isBase60 returns whether s is in base 60 notation as defined in YAML 1.1.\n//\n// The base 60 float notation in YAML 1.1 is a terrible idea and is unsupported\n// in YAML 1.2 and by this package, but these should be marshalled quoted for\n// the time being for compatibility with other parsers.\nfunc isBase60Float(s string) (result bool) {\n\t// Fast path.\n\tif s == \"\" {\n\t\treturn false\n\t}\n\tc := s[0]\n\tif !(c == '+' || c == '-' || c >= '0' && c <= '9') || strings.IndexByte(s, ':') < 0 {\n\t\treturn false\n\t}\n\t// Do the full match.\n\treturn base60float.MatchString(s)\n}\n\n// From http://yaml.org/type/float.html, except the regular expression there\n// is bogus. In practice parsers do not enforce the \"\\.[0-9_]*\" suffix.\nvar base60float = regexp.MustCompile(`^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+(?:\\.[0-9_]*)?$`)\n\nfunc (e *encoder) stringv(tag string, in reflect.Value) {\n\tvar style yaml_scalar_style_t\n\ts := in.String()\n\trtag, rs := resolve(\"\", s)\n\tif rtag == yaml_BINARY_TAG {\n\t\tif tag == \"\" || tag == yaml_STR_TAG {\n\t\t\ttag = rtag\n\t\t\ts = rs.(string)\n\t\t} else if tag == yaml_BINARY_TAG {\n\t\t\tfailf(\"explicitly tagged !!binary data must be base64-encoded\")\n\t\t} else {\n\t\t\tfailf(\"cannot marshal invalid UTF-8 data as %s\", shortTag(tag))\n\t\t}\n\t}\n\tif tag == \"\" && (rtag != yaml_STR_TAG || isBase60Float(s)) {\n\t\tstyle = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t} else if strings.Contains(s, \"\\n\") {\n\t\tstyle = yaml_LITERAL_SCALAR_STYLE\n\t} else {\n\t\tstyle = yaml_PLAIN_SCALAR_STYLE\n\t}\n\te.emitScalar(s, \"\", tag, style)\n}\n\nfunc (e *encoder) boolv(tag string, in reflect.Value) {\n\tvar s string\n\tif in.Bool() {\n\t\ts = \"true\"\n\t} else {\n\t\ts = \"false\"\n\t}\n\te.emitScalar(s, \"\", tag, yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *encoder) intv(tag string, in reflect.Value) {\n\ts := strconv.FormatInt(in.Int(), 10)\n\te.emitScalar(s, \"\", tag, yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *encoder) uintv(tag string, in reflect.Value) {\n\ts := strconv.FormatUint(in.Uint(), 10)\n\te.emitScalar(s, \"\", tag, yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *encoder) floatv(tag string, in reflect.Value) {\n\t// FIXME: Handle 64 bits here.\n\ts := strconv.FormatFloat(float64(in.Float()), 'g', -1, 32)\n\tswitch s {\n\tcase \"+Inf\":\n\t\ts = \".inf\"\n\tcase \"-Inf\":\n\t\ts = \"-.inf\"\n\tcase \"NaN\":\n\t\ts = \".nan\"\n\t}\n\te.emitScalar(s, \"\", tag, yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *encoder) nilv() {\n\te.emitScalar(\"null\", \"\", \"\", yaml_PLAIN_SCALAR_STYLE)\n}\n\nfunc (e *encoder) emitScalar(value, anchor, tag string, style yaml_scalar_style_t) {\n\timplicit := tag == \"\"\n\te.must(yaml_scalar_event_initialize(&e.event, []byte(anchor), []byte(tag), []byte(value), implicit, implicit, style))\n\te.emit()\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/parserc.go",
    "content": "package yaml\n\nimport (\n\t\"bytes\"\n)\n\n// The parser implements the following grammar:\n//\n// stream               ::= STREAM-START implicit_document? explicit_document* STREAM-END\n// implicit_document    ::= block_node DOCUMENT-END*\n// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n// block_node_or_indentless_sequence    ::=\n//                          ALIAS\n//                          | properties (block_content | indentless_block_sequence)?\n//                          | block_content\n//                          | indentless_block_sequence\n// block_node           ::= ALIAS\n//                          | properties block_content?\n//                          | block_content\n// flow_node            ::= ALIAS\n//                          | properties flow_content?\n//                          | flow_content\n// properties           ::= TAG ANCHOR? | ANCHOR TAG?\n// block_content        ::= block_collection | flow_collection | SCALAR\n// flow_content         ::= flow_collection | SCALAR\n// block_collection     ::= block_sequence | block_mapping\n// flow_collection      ::= flow_sequence | flow_mapping\n// block_sequence       ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END\n// indentless_sequence  ::= (BLOCK-ENTRY block_node?)+\n// block_mapping        ::= BLOCK-MAPPING_START\n//                          ((KEY block_node_or_indentless_sequence?)?\n//                          (VALUE block_node_or_indentless_sequence?)?)*\n//                          BLOCK-END\n// flow_sequence        ::= FLOW-SEQUENCE-START\n//                          (flow_sequence_entry FLOW-ENTRY)*\n//                          flow_sequence_entry?\n//                          FLOW-SEQUENCE-END\n// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n// flow_mapping         ::= FLOW-MAPPING-START\n//                          (flow_mapping_entry FLOW-ENTRY)*\n//                          flow_mapping_entry?\n//                          FLOW-MAPPING-END\n// flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n\n// Peek the next token in the token queue.\nfunc peek_token(parser *yaml_parser_t) *yaml_token_t {\n\tif parser.token_available || yaml_parser_fetch_more_tokens(parser) {\n\t\treturn &parser.tokens[parser.tokens_head]\n\t}\n\treturn nil\n}\n\n// Remove the next token from the queue (must be called after peek_token).\nfunc skip_token(parser *yaml_parser_t) {\n\tparser.token_available = false\n\tparser.tokens_parsed++\n\tparser.stream_end_produced = parser.tokens[parser.tokens_head].typ == yaml_STREAM_END_TOKEN\n\tparser.tokens_head++\n}\n\n// Get the next event.\nfunc yaml_parser_parse(parser *yaml_parser_t, event *yaml_event_t) bool {\n\t// Erase the event object.\n\t*event = yaml_event_t{}\n\n\t// No events after the end of the stream or error.\n\tif parser.stream_end_produced || parser.error != yaml_NO_ERROR || parser.state == yaml_PARSE_END_STATE {\n\t\treturn true\n\t}\n\n\t// Generate the next event.\n\treturn yaml_parser_state_machine(parser, event)\n}\n\n// Set parser error.\nfunc yaml_parser_set_parser_error(parser *yaml_parser_t, problem string, problem_mark yaml_mark_t) bool {\n\tparser.error = yaml_PARSER_ERROR\n\tparser.problem = problem\n\tparser.problem_mark = problem_mark\n\treturn false\n}\n\nfunc yaml_parser_set_parser_error_context(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string, problem_mark yaml_mark_t) bool {\n\tparser.error = yaml_PARSER_ERROR\n\tparser.context = context\n\tparser.context_mark = context_mark\n\tparser.problem = problem\n\tparser.problem_mark = problem_mark\n\treturn false\n}\n\n// State dispatcher.\nfunc yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool {\n\t//trace(\"yaml_parser_state_machine\", \"state:\", parser.state.String())\n\n\tswitch parser.state {\n\tcase yaml_PARSE_STREAM_START_STATE:\n\t\treturn yaml_parser_parse_stream_start(parser, event)\n\n\tcase yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE:\n\t\treturn yaml_parser_parse_document_start(parser, event, true)\n\n\tcase yaml_PARSE_DOCUMENT_START_STATE:\n\t\treturn yaml_parser_parse_document_start(parser, event, false)\n\n\tcase yaml_PARSE_DOCUMENT_CONTENT_STATE:\n\t\treturn yaml_parser_parse_document_content(parser, event)\n\n\tcase yaml_PARSE_DOCUMENT_END_STATE:\n\t\treturn yaml_parser_parse_document_end(parser, event)\n\n\tcase yaml_PARSE_BLOCK_NODE_STATE:\n\t\treturn yaml_parser_parse_node(parser, event, true, false)\n\n\tcase yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE:\n\t\treturn yaml_parser_parse_node(parser, event, true, true)\n\n\tcase yaml_PARSE_FLOW_NODE_STATE:\n\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\n\tcase yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE:\n\t\treturn yaml_parser_parse_block_sequence_entry(parser, event, true)\n\n\tcase yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE:\n\t\treturn yaml_parser_parse_block_sequence_entry(parser, event, false)\n\n\tcase yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE:\n\t\treturn yaml_parser_parse_indentless_sequence_entry(parser, event)\n\n\tcase yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE:\n\t\treturn yaml_parser_parse_block_mapping_key(parser, event, true)\n\n\tcase yaml_PARSE_BLOCK_MAPPING_KEY_STATE:\n\t\treturn yaml_parser_parse_block_mapping_key(parser, event, false)\n\n\tcase yaml_PARSE_BLOCK_MAPPING_VALUE_STATE:\n\t\treturn yaml_parser_parse_block_mapping_value(parser, event)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry(parser, event, true)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry(parser, event, false)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry_mapping_key(parser, event)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry_mapping_value(parser, event)\n\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE:\n\t\treturn yaml_parser_parse_flow_sequence_entry_mapping_end(parser, event)\n\n\tcase yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE:\n\t\treturn yaml_parser_parse_flow_mapping_key(parser, event, true)\n\n\tcase yaml_PARSE_FLOW_MAPPING_KEY_STATE:\n\t\treturn yaml_parser_parse_flow_mapping_key(parser, event, false)\n\n\tcase yaml_PARSE_FLOW_MAPPING_VALUE_STATE:\n\t\treturn yaml_parser_parse_flow_mapping_value(parser, event, false)\n\n\tcase yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE:\n\t\treturn yaml_parser_parse_flow_mapping_value(parser, event, true)\n\n\tdefault:\n\t\tpanic(\"invalid parser state\")\n\t}\n}\n\n// Parse the production:\n// stream   ::= STREAM-START implicit_document? explicit_document* STREAM-END\n//              ************\nfunc yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif token.typ != yaml_STREAM_START_TOKEN {\n\t\treturn yaml_parser_set_parser_error(parser, \"did not find expected <stream-start>\", token.start_mark)\n\t}\n\tparser.state = yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_STREAM_START_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.end_mark,\n\t\tencoding:   token.encoding,\n\t}\n\tskip_token(parser)\n\treturn true\n}\n\n// Parse the productions:\n// implicit_document    ::= block_node DOCUMENT-END*\n//                          *\n// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n//                          *************************\nfunc yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t, implicit bool) bool {\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\t// Parse extra document end indicators.\n\tif !implicit {\n\t\tfor token.typ == yaml_DOCUMENT_END_TOKEN {\n\t\t\tskip_token(parser)\n\t\t\ttoken = peek_token(parser)\n\t\t\tif token == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\tif implicit && token.typ != yaml_VERSION_DIRECTIVE_TOKEN &&\n\t\ttoken.typ != yaml_TAG_DIRECTIVE_TOKEN &&\n\t\ttoken.typ != yaml_DOCUMENT_START_TOKEN &&\n\t\ttoken.typ != yaml_STREAM_END_TOKEN {\n\t\t// Parse an implicit document.\n\t\tif !yaml_parser_process_directives(parser, nil, nil) {\n\t\t\treturn false\n\t\t}\n\t\tparser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE)\n\t\tparser.state = yaml_PARSE_BLOCK_NODE_STATE\n\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_DOCUMENT_START_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t}\n\n\t} else if token.typ != yaml_STREAM_END_TOKEN {\n\t\t// Parse an explicit document.\n\t\tvar version_directive *yaml_version_directive_t\n\t\tvar tag_directives []yaml_tag_directive_t\n\t\tstart_mark := token.start_mark\n\t\tif !yaml_parser_process_directives(parser, &version_directive, &tag_directives) {\n\t\t\treturn false\n\t\t}\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_DOCUMENT_START_TOKEN {\n\t\t\tyaml_parser_set_parser_error(parser,\n\t\t\t\t\"did not find expected <document start>\", token.start_mark)\n\t\t\treturn false\n\t\t}\n\t\tparser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE)\n\t\tparser.state = yaml_PARSE_DOCUMENT_CONTENT_STATE\n\t\tend_mark := token.end_mark\n\n\t\t*event = yaml_event_t{\n\t\t\ttyp:               yaml_DOCUMENT_START_EVENT,\n\t\t\tstart_mark:        start_mark,\n\t\t\tend_mark:          end_mark,\n\t\t\tversion_directive: version_directive,\n\t\t\ttag_directives:    tag_directives,\n\t\t\timplicit:          false,\n\t\t}\n\t\tskip_token(parser)\n\n\t} else {\n\t\t// Parse the stream end.\n\t\tparser.state = yaml_PARSE_END_STATE\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_STREAM_END_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t}\n\t\tskip_token(parser)\n\t}\n\n\treturn true\n}\n\n// Parse the productions:\n// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n//                                                    ***********\n//\nfunc yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif token.typ == yaml_VERSION_DIRECTIVE_TOKEN ||\n\t\ttoken.typ == yaml_TAG_DIRECTIVE_TOKEN ||\n\t\ttoken.typ == yaml_DOCUMENT_START_TOKEN ||\n\t\ttoken.typ == yaml_DOCUMENT_END_TOKEN ||\n\t\ttoken.typ == yaml_STREAM_END_TOKEN {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\t\treturn yaml_parser_process_empty_scalar(parser, event,\n\t\t\ttoken.start_mark)\n\t}\n\treturn yaml_parser_parse_node(parser, event, true, false)\n}\n\n// Parse the productions:\n// implicit_document    ::= block_node DOCUMENT-END*\n//                                     *************\n// explicit_document    ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*\n//\nfunc yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tstart_mark := token.start_mark\n\tend_mark := token.start_mark\n\n\timplicit := true\n\tif token.typ == yaml_DOCUMENT_END_TOKEN {\n\t\tend_mark = token.end_mark\n\t\tskip_token(parser)\n\t\timplicit = false\n\t}\n\n\tparser.tag_directives = parser.tag_directives[:0]\n\n\tparser.state = yaml_PARSE_DOCUMENT_START_STATE\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_DOCUMENT_END_EVENT,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\timplicit:   implicit,\n\t}\n\treturn true\n}\n\n// Parse the productions:\n// block_node_or_indentless_sequence    ::=\n//                          ALIAS\n//                          *****\n//                          | properties (block_content | indentless_block_sequence)?\n//                            **********  *\n//                          | block_content | indentless_block_sequence\n//                            *\n// block_node           ::= ALIAS\n//                          *****\n//                          | properties block_content?\n//                            ********** *\n//                          | block_content\n//                            *\n// flow_node            ::= ALIAS\n//                          *****\n//                          | properties flow_content?\n//                            ********** *\n//                          | flow_content\n//                            *\n// properties           ::= TAG ANCHOR? | ANCHOR TAG?\n//                          *************************\n// block_content        ::= block_collection | flow_collection | SCALAR\n//                                                               ******\n// flow_content         ::= flow_collection | SCALAR\n//                                            ******\nfunc yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, indentless_sequence bool) bool {\n\t//defer trace(\"yaml_parser_parse_node\", \"block:\", block, \"indentless_sequence:\", indentless_sequence)()\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.typ == yaml_ALIAS_TOKEN {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_ALIAS_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t\tanchor:     token.value,\n\t\t}\n\t\tskip_token(parser)\n\t\treturn true\n\t}\n\n\tstart_mark := token.start_mark\n\tend_mark := token.start_mark\n\n\tvar tag_token bool\n\tvar tag_handle, tag_suffix, anchor []byte\n\tvar tag_mark yaml_mark_t\n\tif token.typ == yaml_ANCHOR_TOKEN {\n\t\tanchor = token.value\n\t\tstart_mark = token.start_mark\n\t\tend_mark = token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ == yaml_TAG_TOKEN {\n\t\t\ttag_token = true\n\t\t\ttag_handle = token.value\n\t\t\ttag_suffix = token.suffix\n\t\t\ttag_mark = token.start_mark\n\t\t\tend_mark = token.end_mark\n\t\t\tskip_token(parser)\n\t\t\ttoken = peek_token(parser)\n\t\t\tif token == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t} else if token.typ == yaml_TAG_TOKEN {\n\t\ttag_token = true\n\t\ttag_handle = token.value\n\t\ttag_suffix = token.suffix\n\t\tstart_mark = token.start_mark\n\t\ttag_mark = token.start_mark\n\t\tend_mark = token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ == yaml_ANCHOR_TOKEN {\n\t\t\tanchor = token.value\n\t\t\tend_mark = token.end_mark\n\t\t\tskip_token(parser)\n\t\t\ttoken = peek_token(parser)\n\t\t\tif token == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\tvar tag []byte\n\tif tag_token {\n\t\tif len(tag_handle) == 0 {\n\t\t\ttag = tag_suffix\n\t\t\ttag_suffix = nil\n\t\t} else {\n\t\t\tfor i := range parser.tag_directives {\n\t\t\t\tif bytes.Equal(parser.tag_directives[i].handle, tag_handle) {\n\t\t\t\t\ttag = append([]byte(nil), parser.tag_directives[i].prefix...)\n\t\t\t\t\ttag = append(tag, tag_suffix...)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif len(tag) == 0 {\n\t\t\t\tyaml_parser_set_parser_error_context(parser,\n\t\t\t\t\t\"while parsing a node\", start_mark,\n\t\t\t\t\t\"found undefined tag handle\", tag_mark)\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\timplicit := len(tag) == 0\n\tif indentless_sequence && token.typ == yaml_BLOCK_ENTRY_TOKEN {\n\t\tend_mark = token.end_mark\n\t\tparser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_SEQUENCE_START_EVENT,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tanchor:     anchor,\n\t\t\ttag:        tag,\n\t\t\timplicit:   implicit,\n\t\t\tstyle:      yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE),\n\t\t}\n\t\treturn true\n\t}\n\tif token.typ == yaml_SCALAR_TOKEN {\n\t\tvar plain_implicit, quoted_implicit bool\n\t\tend_mark = token.end_mark\n\t\tif (len(tag) == 0 && token.style == yaml_PLAIN_SCALAR_STYLE) || (len(tag) == 1 && tag[0] == '!') {\n\t\t\tplain_implicit = true\n\t\t} else if len(tag) == 0 {\n\t\t\tquoted_implicit = true\n\t\t}\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\n\t\t*event = yaml_event_t{\n\t\t\ttyp:             yaml_SCALAR_EVENT,\n\t\t\tstart_mark:      start_mark,\n\t\t\tend_mark:        end_mark,\n\t\t\tanchor:          anchor,\n\t\t\ttag:             tag,\n\t\t\tvalue:           token.value,\n\t\t\timplicit:        plain_implicit,\n\t\t\tquoted_implicit: quoted_implicit,\n\t\t\tstyle:           yaml_style_t(token.style),\n\t\t}\n\t\tskip_token(parser)\n\t\treturn true\n\t}\n\tif token.typ == yaml_FLOW_SEQUENCE_START_TOKEN {\n\t\t// [Go] Some of the events below can be merged as they differ only on style.\n\t\tend_mark = token.end_mark\n\t\tparser.state = yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_SEQUENCE_START_EVENT,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tanchor:     anchor,\n\t\t\ttag:        tag,\n\t\t\timplicit:   implicit,\n\t\t\tstyle:      yaml_style_t(yaml_FLOW_SEQUENCE_STYLE),\n\t\t}\n\t\treturn true\n\t}\n\tif token.typ == yaml_FLOW_MAPPING_START_TOKEN {\n\t\tend_mark = token.end_mark\n\t\tparser.state = yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_MAPPING_START_EVENT,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tanchor:     anchor,\n\t\t\ttag:        tag,\n\t\t\timplicit:   implicit,\n\t\t\tstyle:      yaml_style_t(yaml_FLOW_MAPPING_STYLE),\n\t\t}\n\t\treturn true\n\t}\n\tif block && token.typ == yaml_BLOCK_SEQUENCE_START_TOKEN {\n\t\tend_mark = token.end_mark\n\t\tparser.state = yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_SEQUENCE_START_EVENT,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tanchor:     anchor,\n\t\t\ttag:        tag,\n\t\t\timplicit:   implicit,\n\t\t\tstyle:      yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE),\n\t\t}\n\t\treturn true\n\t}\n\tif block && token.typ == yaml_BLOCK_MAPPING_START_TOKEN {\n\t\tend_mark = token.end_mark\n\t\tparser.state = yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_MAPPING_START_EVENT,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tanchor:     anchor,\n\t\t\ttag:        tag,\n\t\t\timplicit:   implicit,\n\t\t\tstyle:      yaml_style_t(yaml_BLOCK_MAPPING_STYLE),\n\t\t}\n\t\treturn true\n\t}\n\tif len(anchor) > 0 || len(tag) > 0 {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\n\t\t*event = yaml_event_t{\n\t\t\ttyp:             yaml_SCALAR_EVENT,\n\t\t\tstart_mark:      start_mark,\n\t\t\tend_mark:        end_mark,\n\t\t\tanchor:          anchor,\n\t\t\ttag:             tag,\n\t\t\timplicit:        implicit,\n\t\t\tquoted_implicit: false,\n\t\t\tstyle:           yaml_style_t(yaml_PLAIN_SCALAR_STYLE),\n\t\t}\n\t\treturn true\n\t}\n\n\tcontext := \"while parsing a flow node\"\n\tif block {\n\t\tcontext = \"while parsing a block node\"\n\t}\n\tyaml_parser_set_parser_error_context(parser, context, start_mark,\n\t\t\"did not find expected node content\", token.start_mark)\n\treturn false\n}\n\n// Parse the productions:\n// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END\n//                    ********************  *********** *             *********\n//\nfunc yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\ttoken := peek_token(parser)\n\t\tparser.marks = append(parser.marks, token.start_mark)\n\t\tskip_token(parser)\n\t}\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.typ == yaml_BLOCK_ENTRY_TOKEN {\n\t\tmark := token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_BLOCK_ENTRY_TOKEN && token.typ != yaml_BLOCK_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, true, false)\n\t\t} else {\n\t\t\tparser.state = yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE\n\t\t\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n\t\t}\n\t}\n\tif token.typ == yaml_BLOCK_END_TOKEN {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_SEQUENCE_END_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t}\n\n\t\tskip_token(parser)\n\t\treturn true\n\t}\n\n\tcontext_mark := parser.marks[len(parser.marks)-1]\n\tparser.marks = parser.marks[:len(parser.marks)-1]\n\treturn yaml_parser_set_parser_error_context(parser,\n\t\t\"while parsing a block collection\", context_mark,\n\t\t\"did not find expected '-' indicator\", token.start_mark)\n}\n\n// Parse the productions:\n// indentless_sequence  ::= (BLOCK-ENTRY block_node?)+\n//                           *********** *\nfunc yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.typ == yaml_BLOCK_ENTRY_TOKEN {\n\t\tmark := token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_BLOCK_ENTRY_TOKEN &&\n\t\t\ttoken.typ != yaml_KEY_TOKEN &&\n\t\t\ttoken.typ != yaml_VALUE_TOKEN &&\n\t\t\ttoken.typ != yaml_BLOCK_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, true, false)\n\t\t}\n\t\tparser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE\n\t\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n\t}\n\tparser.state = parser.states[len(parser.states)-1]\n\tparser.states = parser.states[:len(parser.states)-1]\n\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_SEQUENCE_END_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.start_mark, // [Go] Shouldn't this be token.end_mark?\n\t}\n\treturn true\n}\n\n// Parse the productions:\n// block_mapping        ::= BLOCK-MAPPING_START\n//                          *******************\n//                          ((KEY block_node_or_indentless_sequence?)?\n//                            *** *\n//                          (VALUE block_node_or_indentless_sequence?)?)*\n//\n//                          BLOCK-END\n//                          *********\n//\nfunc yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\ttoken := peek_token(parser)\n\t\tparser.marks = append(parser.marks, token.start_mark)\n\t\tskip_token(parser)\n\t}\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.typ == yaml_KEY_TOKEN {\n\t\tmark := token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_KEY_TOKEN &&\n\t\t\ttoken.typ != yaml_VALUE_TOKEN &&\n\t\t\ttoken.typ != yaml_BLOCK_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_VALUE_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, true, true)\n\t\t} else {\n\t\t\tparser.state = yaml_PARSE_BLOCK_MAPPING_VALUE_STATE\n\t\t\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n\t\t}\n\t} else if token.typ == yaml_BLOCK_END_TOKEN {\n\t\tparser.state = parser.states[len(parser.states)-1]\n\t\tparser.states = parser.states[:len(parser.states)-1]\n\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\t\t*event = yaml_event_t{\n\t\t\ttyp:        yaml_MAPPING_END_EVENT,\n\t\t\tstart_mark: token.start_mark,\n\t\t\tend_mark:   token.end_mark,\n\t\t}\n\t\tskip_token(parser)\n\t\treturn true\n\t}\n\n\tcontext_mark := parser.marks[len(parser.marks)-1]\n\tparser.marks = parser.marks[:len(parser.marks)-1]\n\treturn yaml_parser_set_parser_error_context(parser,\n\t\t\"while parsing a block mapping\", context_mark,\n\t\t\"did not find expected key\", token.start_mark)\n}\n\n// Parse the productions:\n// block_mapping        ::= BLOCK-MAPPING_START\n//\n//                          ((KEY block_node_or_indentless_sequence?)?\n//\n//                          (VALUE block_node_or_indentless_sequence?)?)*\n//                           ***** *\n//                          BLOCK-END\n//\n//\nfunc yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif token.typ == yaml_VALUE_TOKEN {\n\t\tmark := token.end_mark\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_KEY_TOKEN &&\n\t\t\ttoken.typ != yaml_VALUE_TOKEN &&\n\t\t\ttoken.typ != yaml_BLOCK_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_KEY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, true, true)\n\t\t}\n\t\tparser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE\n\t\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n\t}\n\tparser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE\n\treturn yaml_parser_process_empty_scalar(parser, event, token.start_mark)\n}\n\n// Parse the productions:\n// flow_sequence        ::= FLOW-SEQUENCE-START\n//                          *******************\n//                          (flow_sequence_entry FLOW-ENTRY)*\n//                           *                   **********\n//                          flow_sequence_entry?\n//                          *\n//                          FLOW-SEQUENCE-END\n//                          *****************\n// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n//                          *\n//\nfunc yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\ttoken := peek_token(parser)\n\t\tparser.marks = append(parser.marks, token.start_mark)\n\t\tskip_token(parser)\n\t}\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {\n\t\tif !first {\n\t\t\tif token.typ == yaml_FLOW_ENTRY_TOKEN {\n\t\t\t\tskip_token(parser)\n\t\t\t\ttoken = peek_token(parser)\n\t\t\t\tif token == nil {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcontext_mark := parser.marks[len(parser.marks)-1]\n\t\t\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\t\t\t\treturn yaml_parser_set_parser_error_context(parser,\n\t\t\t\t\t\"while parsing a flow sequence\", context_mark,\n\t\t\t\t\t\"did not find expected ',' or ']'\", token.start_mark)\n\t\t\t}\n\t\t}\n\n\t\tif token.typ == yaml_KEY_TOKEN {\n\t\t\tparser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE\n\t\t\t*event = yaml_event_t{\n\t\t\t\ttyp:        yaml_MAPPING_START_EVENT,\n\t\t\t\tstart_mark: token.start_mark,\n\t\t\t\tend_mark:   token.end_mark,\n\t\t\t\timplicit:   true,\n\t\t\t\tstyle:      yaml_style_t(yaml_FLOW_MAPPING_STYLE),\n\t\t\t}\n\t\t\tskip_token(parser)\n\t\t\treturn true\n\t\t} else if token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t}\n\t}\n\n\tparser.state = parser.states[len(parser.states)-1]\n\tparser.states = parser.states[:len(parser.states)-1]\n\tparser.marks = parser.marks[:len(parser.marks)-1]\n\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_SEQUENCE_END_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.end_mark,\n\t}\n\n\tskip_token(parser)\n\treturn true\n}\n\n//\n// Parse the productions:\n// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n//                                      *** *\n//\nfunc yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif token.typ != yaml_VALUE_TOKEN &&\n\t\ttoken.typ != yaml_FLOW_ENTRY_TOKEN &&\n\t\ttoken.typ != yaml_FLOW_SEQUENCE_END_TOKEN {\n\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE)\n\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t}\n\tmark := token.end_mark\n\tskip_token(parser)\n\tparser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE\n\treturn yaml_parser_process_empty_scalar(parser, event, mark)\n}\n\n// Parse the productions:\n// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n//                                                      ***** *\n//\nfunc yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif token.typ == yaml_VALUE_TOKEN {\n\t\tskip_token(parser)\n\t\ttoken := peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_SEQUENCE_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t}\n\t}\n\tparser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE\n\treturn yaml_parser_process_empty_scalar(parser, event, token.start_mark)\n}\n\n// Parse the productions:\n// flow_sequence_entry  ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n//                                                                      *\n//\nfunc yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, event *yaml_event_t) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tparser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_MAPPING_END_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.start_mark, // [Go] Shouldn't this be end_mark?\n\t}\n\treturn true\n}\n\n// Parse the productions:\n// flow_mapping         ::= FLOW-MAPPING-START\n//                          ******************\n//                          (flow_mapping_entry FLOW-ENTRY)*\n//                           *                  **********\n//                          flow_mapping_entry?\n//                          ******************\n//                          FLOW-MAPPING-END\n//                          ****************\n// flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n//                          *           *** *\n//\nfunc yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {\n\tif first {\n\t\ttoken := peek_token(parser)\n\t\tparser.marks = append(parser.marks, token.start_mark)\n\t\tskip_token(parser)\n\t}\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tif token.typ != yaml_FLOW_MAPPING_END_TOKEN {\n\t\tif !first {\n\t\t\tif token.typ == yaml_FLOW_ENTRY_TOKEN {\n\t\t\t\tskip_token(parser)\n\t\t\t\ttoken = peek_token(parser)\n\t\t\t\tif token == nil {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcontext_mark := parser.marks[len(parser.marks)-1]\n\t\t\t\tparser.marks = parser.marks[:len(parser.marks)-1]\n\t\t\t\treturn yaml_parser_set_parser_error_context(parser,\n\t\t\t\t\t\"while parsing a flow mapping\", context_mark,\n\t\t\t\t\t\"did not find expected ',' or '}'\", token.start_mark)\n\t\t\t}\n\t\t}\n\n\t\tif token.typ == yaml_KEY_TOKEN {\n\t\t\tskip_token(parser)\n\t\t\ttoken = peek_token(parser)\n\t\t\tif token == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif token.typ != yaml_VALUE_TOKEN &&\n\t\t\t\ttoken.typ != yaml_FLOW_ENTRY_TOKEN &&\n\t\t\t\ttoken.typ != yaml_FLOW_MAPPING_END_TOKEN {\n\t\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_VALUE_STATE)\n\t\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t\t} else {\n\t\t\t\tparser.state = yaml_PARSE_FLOW_MAPPING_VALUE_STATE\n\t\t\t\treturn yaml_parser_process_empty_scalar(parser, event, token.start_mark)\n\t\t\t}\n\t\t} else if token.typ != yaml_FLOW_MAPPING_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t}\n\t}\n\n\tparser.state = parser.states[len(parser.states)-1]\n\tparser.states = parser.states[:len(parser.states)-1]\n\tparser.marks = parser.marks[:len(parser.marks)-1]\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_MAPPING_END_EVENT,\n\t\tstart_mark: token.start_mark,\n\t\tend_mark:   token.end_mark,\n\t}\n\tskip_token(parser)\n\treturn true\n}\n\n// Parse the productions:\n// flow_mapping_entry   ::= flow_node | KEY flow_node? (VALUE flow_node?)?\n//                                   *                  ***** *\n//\nfunc yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t, event *yaml_event_t, empty bool) bool {\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\tif empty {\n\t\tparser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE\n\t\treturn yaml_parser_process_empty_scalar(parser, event, token.start_mark)\n\t}\n\tif token.typ == yaml_VALUE_TOKEN {\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t\tif token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_MAPPING_END_TOKEN {\n\t\t\tparser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_KEY_STATE)\n\t\t\treturn yaml_parser_parse_node(parser, event, false, false)\n\t\t}\n\t}\n\tparser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE\n\treturn yaml_parser_process_empty_scalar(parser, event, token.start_mark)\n}\n\n// Generate an empty scalar event.\nfunc yaml_parser_process_empty_scalar(parser *yaml_parser_t, event *yaml_event_t, mark yaml_mark_t) bool {\n\t*event = yaml_event_t{\n\t\ttyp:        yaml_SCALAR_EVENT,\n\t\tstart_mark: mark,\n\t\tend_mark:   mark,\n\t\tvalue:      nil, // Empty\n\t\timplicit:   true,\n\t\tstyle:      yaml_style_t(yaml_PLAIN_SCALAR_STYLE),\n\t}\n\treturn true\n}\n\nvar default_tag_directives = []yaml_tag_directive_t{\n\t{[]byte(\"!\"), []byte(\"!\")},\n\t{[]byte(\"!!\"), []byte(\"tag:yaml.org,2002:\")},\n}\n\n// Parse directives.\nfunc yaml_parser_process_directives(parser *yaml_parser_t,\n\tversion_directive_ref **yaml_version_directive_t,\n\ttag_directives_ref *[]yaml_tag_directive_t) bool {\n\n\tvar version_directive *yaml_version_directive_t\n\tvar tag_directives []yaml_tag_directive_t\n\n\ttoken := peek_token(parser)\n\tif token == nil {\n\t\treturn false\n\t}\n\n\tfor token.typ == yaml_VERSION_DIRECTIVE_TOKEN || token.typ == yaml_TAG_DIRECTIVE_TOKEN {\n\t\tif token.typ == yaml_VERSION_DIRECTIVE_TOKEN {\n\t\t\tif version_directive != nil {\n\t\t\t\tyaml_parser_set_parser_error(parser,\n\t\t\t\t\t\"found duplicate %YAML directive\", token.start_mark)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif token.major != 1 || token.minor != 1 {\n\t\t\t\tyaml_parser_set_parser_error(parser,\n\t\t\t\t\t\"found incompatible YAML document\", token.start_mark)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tversion_directive = &yaml_version_directive_t{\n\t\t\t\tmajor: token.major,\n\t\t\t\tminor: token.minor,\n\t\t\t}\n\t\t} else if token.typ == yaml_TAG_DIRECTIVE_TOKEN {\n\t\t\tvalue := yaml_tag_directive_t{\n\t\t\t\thandle: token.value,\n\t\t\t\tprefix: token.prefix,\n\t\t\t}\n\t\t\tif !yaml_parser_append_tag_directive(parser, value, false, token.start_mark) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\ttag_directives = append(tag_directives, value)\n\t\t}\n\n\t\tskip_token(parser)\n\t\ttoken = peek_token(parser)\n\t\tif token == nil {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tfor i := range default_tag_directives {\n\t\tif !yaml_parser_append_tag_directive(parser, default_tag_directives[i], true, token.start_mark) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif version_directive_ref != nil {\n\t\t*version_directive_ref = version_directive\n\t}\n\tif tag_directives_ref != nil {\n\t\t*tag_directives_ref = tag_directives\n\t}\n\treturn true\n}\n\n// Append a tag directive to the directives stack.\nfunc yaml_parser_append_tag_directive(parser *yaml_parser_t, value yaml_tag_directive_t, allow_duplicates bool, mark yaml_mark_t) bool {\n\tfor i := range parser.tag_directives {\n\t\tif bytes.Equal(value.handle, parser.tag_directives[i].handle) {\n\t\t\tif allow_duplicates {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn yaml_parser_set_parser_error(parser, \"found duplicate %TAG directive\", mark)\n\t\t}\n\t}\n\n\t// [Go] I suspect the copy is unnecessary. This was likely done\n\t// because there was no way to track ownership of the data.\n\tvalue_copy := yaml_tag_directive_t{\n\t\thandle: make([]byte, len(value.handle)),\n\t\tprefix: make([]byte, len(value.prefix)),\n\t}\n\tcopy(value_copy.handle, value.handle)\n\tcopy(value_copy.prefix, value.prefix)\n\tparser.tag_directives = append(parser.tag_directives, value_copy)\n\treturn true\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/readerc.go",
    "content": "package yaml\n\nimport (\n\t\"io\"\n)\n\n// Set the reader error and return 0.\nfunc yaml_parser_set_reader_error(parser *yaml_parser_t, problem string, offset int, value int) bool {\n\tparser.error = yaml_READER_ERROR\n\tparser.problem = problem\n\tparser.problem_offset = offset\n\tparser.problem_value = value\n\treturn false\n}\n\n// Byte order marks.\nconst (\n\tbom_UTF8    = \"\\xef\\xbb\\xbf\"\n\tbom_UTF16LE = \"\\xff\\xfe\"\n\tbom_UTF16BE = \"\\xfe\\xff\"\n)\n\n// Determine the input stream encoding by checking the BOM symbol. If no BOM is\n// found, the UTF-8 encoding is assumed. Return 1 on success, 0 on failure.\nfunc yaml_parser_determine_encoding(parser *yaml_parser_t) bool {\n\t// Ensure that we had enough bytes in the raw buffer.\n\tfor !parser.eof && len(parser.raw_buffer)-parser.raw_buffer_pos < 3 {\n\t\tif !yaml_parser_update_raw_buffer(parser) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Determine the encoding.\n\tbuf := parser.raw_buffer\n\tpos := parser.raw_buffer_pos\n\tavail := len(buf) - pos\n\tif avail >= 2 && buf[pos] == bom_UTF16LE[0] && buf[pos+1] == bom_UTF16LE[1] {\n\t\tparser.encoding = yaml_UTF16LE_ENCODING\n\t\tparser.raw_buffer_pos += 2\n\t\tparser.offset += 2\n\t} else if avail >= 2 && buf[pos] == bom_UTF16BE[0] && buf[pos+1] == bom_UTF16BE[1] {\n\t\tparser.encoding = yaml_UTF16BE_ENCODING\n\t\tparser.raw_buffer_pos += 2\n\t\tparser.offset += 2\n\t} else if avail >= 3 && buf[pos] == bom_UTF8[0] && buf[pos+1] == bom_UTF8[1] && buf[pos+2] == bom_UTF8[2] {\n\t\tparser.encoding = yaml_UTF8_ENCODING\n\t\tparser.raw_buffer_pos += 3\n\t\tparser.offset += 3\n\t} else {\n\t\tparser.encoding = yaml_UTF8_ENCODING\n\t}\n\treturn true\n}\n\n// Update the raw buffer.\nfunc yaml_parser_update_raw_buffer(parser *yaml_parser_t) bool {\n\tsize_read := 0\n\n\t// Return if the raw buffer is full.\n\tif parser.raw_buffer_pos == 0 && len(parser.raw_buffer) == cap(parser.raw_buffer) {\n\t\treturn true\n\t}\n\n\t// Return on EOF.\n\tif parser.eof {\n\t\treturn true\n\t}\n\n\t// Move the remaining bytes in the raw buffer to the beginning.\n\tif parser.raw_buffer_pos > 0 && parser.raw_buffer_pos < len(parser.raw_buffer) {\n\t\tcopy(parser.raw_buffer, parser.raw_buffer[parser.raw_buffer_pos:])\n\t}\n\tparser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)-parser.raw_buffer_pos]\n\tparser.raw_buffer_pos = 0\n\n\t// Call the read handler to fill the buffer.\n\tsize_read, err := parser.read_handler(parser, parser.raw_buffer[len(parser.raw_buffer):cap(parser.raw_buffer)])\n\tparser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)+size_read]\n\tif err == io.EOF {\n\t\tparser.eof = true\n\t} else if err != nil {\n\t\treturn yaml_parser_set_reader_error(parser, \"input error: \"+err.Error(), parser.offset, -1)\n\t}\n\treturn true\n}\n\n// Ensure that the buffer contains at least `length` characters.\n// Return true on success, false on failure.\n//\n// The length is supposed to be significantly less that the buffer size.\nfunc yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool {\n\tif parser.read_handler == nil {\n\t\tpanic(\"read handler must be set\")\n\t}\n\n\t// If the EOF flag is set and the raw buffer is empty, do nothing.\n\tif parser.eof && parser.raw_buffer_pos == len(parser.raw_buffer) {\n\t\treturn true\n\t}\n\n\t// Return if the buffer contains enough characters.\n\tif parser.unread >= length {\n\t\treturn true\n\t}\n\n\t// Determine the input encoding if it is not known yet.\n\tif parser.encoding == yaml_ANY_ENCODING {\n\t\tif !yaml_parser_determine_encoding(parser) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Move the unread characters to the beginning of the buffer.\n\tbuffer_len := len(parser.buffer)\n\tif parser.buffer_pos > 0 && parser.buffer_pos < buffer_len {\n\t\tcopy(parser.buffer, parser.buffer[parser.buffer_pos:])\n\t\tbuffer_len -= parser.buffer_pos\n\t\tparser.buffer_pos = 0\n\t} else if parser.buffer_pos == buffer_len {\n\t\tbuffer_len = 0\n\t\tparser.buffer_pos = 0\n\t}\n\n\t// Open the whole buffer for writing, and cut it before returning.\n\tparser.buffer = parser.buffer[:cap(parser.buffer)]\n\n\t// Fill the buffer until it has enough characters.\n\tfirst := true\n\tfor parser.unread < length {\n\n\t\t// Fill the raw buffer if necessary.\n\t\tif !first || parser.raw_buffer_pos == len(parser.raw_buffer) {\n\t\t\tif !yaml_parser_update_raw_buffer(parser) {\n\t\t\t\tparser.buffer = parser.buffer[:buffer_len]\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tfirst = false\n\n\t\t// Decode the raw buffer.\n\tinner:\n\t\tfor parser.raw_buffer_pos != len(parser.raw_buffer) {\n\t\t\tvar value rune\n\t\t\tvar width int\n\n\t\t\traw_unread := len(parser.raw_buffer) - parser.raw_buffer_pos\n\n\t\t\t// Decode the next character.\n\t\t\tswitch parser.encoding {\n\t\t\tcase yaml_UTF8_ENCODING:\n\t\t\t\t// Decode a UTF-8 character.  Check RFC 3629\n\t\t\t\t// (http://www.ietf.org/rfc/rfc3629.txt) for more details.\n\t\t\t\t//\n\t\t\t\t// The following table (taken from the RFC) is used for\n\t\t\t\t// decoding.\n\t\t\t\t//\n\t\t\t\t//    Char. number range |        UTF-8 octet sequence\n\t\t\t\t//      (hexadecimal)    |              (binary)\n\t\t\t\t//   --------------------+------------------------------------\n\t\t\t\t//   0000 0000-0000 007F | 0xxxxxxx\n\t\t\t\t//   0000 0080-0000 07FF | 110xxxxx 10xxxxxx\n\t\t\t\t//   0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx\n\t\t\t\t//   0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n\t\t\t\t//\n\t\t\t\t// Additionally, the characters in the range 0xD800-0xDFFF\n\t\t\t\t// are prohibited as they are reserved for use with UTF-16\n\t\t\t\t// surrogate pairs.\n\n\t\t\t\t// Determine the length of the UTF-8 sequence.\n\t\t\t\toctet := parser.raw_buffer[parser.raw_buffer_pos]\n\t\t\t\tswitch {\n\t\t\t\tcase octet&0x80 == 0x00:\n\t\t\t\t\twidth = 1\n\t\t\t\tcase octet&0xE0 == 0xC0:\n\t\t\t\t\twidth = 2\n\t\t\t\tcase octet&0xF0 == 0xE0:\n\t\t\t\t\twidth = 3\n\t\t\t\tcase octet&0xF8 == 0xF0:\n\t\t\t\t\twidth = 4\n\t\t\t\tdefault:\n\t\t\t\t\t// The leading octet is invalid.\n\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\"invalid leading UTF-8 octet\",\n\t\t\t\t\t\tparser.offset, int(octet))\n\t\t\t\t}\n\n\t\t\t\t// Check if the raw buffer contains an incomplete character.\n\t\t\t\tif width > raw_unread {\n\t\t\t\t\tif parser.eof {\n\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\"incomplete UTF-8 octet sequence\",\n\t\t\t\t\t\t\tparser.offset, -1)\n\t\t\t\t\t}\n\t\t\t\t\tbreak inner\n\t\t\t\t}\n\n\t\t\t\t// Decode the leading octet.\n\t\t\t\tswitch {\n\t\t\t\tcase octet&0x80 == 0x00:\n\t\t\t\t\tvalue = rune(octet & 0x7F)\n\t\t\t\tcase octet&0xE0 == 0xC0:\n\t\t\t\t\tvalue = rune(octet & 0x1F)\n\t\t\t\tcase octet&0xF0 == 0xE0:\n\t\t\t\t\tvalue = rune(octet & 0x0F)\n\t\t\t\tcase octet&0xF8 == 0xF0:\n\t\t\t\t\tvalue = rune(octet & 0x07)\n\t\t\t\tdefault:\n\t\t\t\t\tvalue = 0\n\t\t\t\t}\n\n\t\t\t\t// Check and decode the trailing octets.\n\t\t\t\tfor k := 1; k < width; k++ {\n\t\t\t\t\toctet = parser.raw_buffer[parser.raw_buffer_pos+k]\n\n\t\t\t\t\t// Check if the octet is valid.\n\t\t\t\t\tif (octet & 0xC0) != 0x80 {\n\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\"invalid trailing UTF-8 octet\",\n\t\t\t\t\t\t\tparser.offset+k, int(octet))\n\t\t\t\t\t}\n\n\t\t\t\t\t// Decode the octet.\n\t\t\t\t\tvalue = (value << 6) + rune(octet&0x3F)\n\t\t\t\t}\n\n\t\t\t\t// Check the length of the sequence against the value.\n\t\t\t\tswitch {\n\t\t\t\tcase width == 1:\n\t\t\t\tcase width == 2 && value >= 0x80:\n\t\t\t\tcase width == 3 && value >= 0x800:\n\t\t\t\tcase width == 4 && value >= 0x10000:\n\t\t\t\tdefault:\n\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\"invalid length of a UTF-8 sequence\",\n\t\t\t\t\t\tparser.offset, -1)\n\t\t\t\t}\n\n\t\t\t\t// Check the range of the value.\n\t\t\t\tif value >= 0xD800 && value <= 0xDFFF || value > 0x10FFFF {\n\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\"invalid Unicode character\",\n\t\t\t\t\t\tparser.offset, int(value))\n\t\t\t\t}\n\n\t\t\tcase yaml_UTF16LE_ENCODING, yaml_UTF16BE_ENCODING:\n\t\t\t\tvar low, high int\n\t\t\t\tif parser.encoding == yaml_UTF16LE_ENCODING {\n\t\t\t\t\tlow, high = 0, 1\n\t\t\t\t} else {\n\t\t\t\t\tlow, high = 1, 0\n\t\t\t\t}\n\n\t\t\t\t// The UTF-16 encoding is not as simple as one might\n\t\t\t\t// naively think.  Check RFC 2781\n\t\t\t\t// (http://www.ietf.org/rfc/rfc2781.txt).\n\t\t\t\t//\n\t\t\t\t// Normally, two subsequent bytes describe a Unicode\n\t\t\t\t// character.  However a special technique (called a\n\t\t\t\t// surrogate pair) is used for specifying character\n\t\t\t\t// values larger than 0xFFFF.\n\t\t\t\t//\n\t\t\t\t// A surrogate pair consists of two pseudo-characters:\n\t\t\t\t//      high surrogate area (0xD800-0xDBFF)\n\t\t\t\t//      low surrogate area (0xDC00-0xDFFF)\n\t\t\t\t//\n\t\t\t\t// The following formulas are used for decoding\n\t\t\t\t// and encoding characters using surrogate pairs:\n\t\t\t\t//\n\t\t\t\t//  U  = U' + 0x10000   (0x01 00 00 <= U <= 0x10 FF FF)\n\t\t\t\t//  U' = yyyyyyyyyyxxxxxxxxxx   (0 <= U' <= 0x0F FF FF)\n\t\t\t\t//  W1 = 110110yyyyyyyyyy\n\t\t\t\t//  W2 = 110111xxxxxxxxxx\n\t\t\t\t//\n\t\t\t\t// where U is the character value, W1 is the high surrogate\n\t\t\t\t// area, W2 is the low surrogate area.\n\n\t\t\t\t// Check for incomplete UTF-16 character.\n\t\t\t\tif raw_unread < 2 {\n\t\t\t\t\tif parser.eof {\n\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\"incomplete UTF-16 character\",\n\t\t\t\t\t\t\tparser.offset, -1)\n\t\t\t\t\t}\n\t\t\t\t\tbreak inner\n\t\t\t\t}\n\n\t\t\t\t// Get the character.\n\t\t\t\tvalue = rune(parser.raw_buffer[parser.raw_buffer_pos+low]) +\n\t\t\t\t\t(rune(parser.raw_buffer[parser.raw_buffer_pos+high]) << 8)\n\n\t\t\t\t// Check for unexpected low surrogate area.\n\t\t\t\tif value&0xFC00 == 0xDC00 {\n\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\"unexpected low surrogate area\",\n\t\t\t\t\t\tparser.offset, int(value))\n\t\t\t\t}\n\n\t\t\t\t// Check for a high surrogate area.\n\t\t\t\tif value&0xFC00 == 0xD800 {\n\t\t\t\t\twidth = 4\n\n\t\t\t\t\t// Check for incomplete surrogate pair.\n\t\t\t\t\tif raw_unread < 4 {\n\t\t\t\t\t\tif parser.eof {\n\t\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\t\"incomplete UTF-16 surrogate pair\",\n\t\t\t\t\t\t\t\tparser.offset, -1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak inner\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get the next character.\n\t\t\t\t\tvalue2 := rune(parser.raw_buffer[parser.raw_buffer_pos+low+2]) +\n\t\t\t\t\t\t(rune(parser.raw_buffer[parser.raw_buffer_pos+high+2]) << 8)\n\n\t\t\t\t\t// Check for a low surrogate area.\n\t\t\t\t\tif value2&0xFC00 != 0xDC00 {\n\t\t\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\t\t\"expected low surrogate area\",\n\t\t\t\t\t\t\tparser.offset+2, int(value2))\n\t\t\t\t\t}\n\n\t\t\t\t\t// Generate the value of the surrogate pair.\n\t\t\t\t\tvalue = 0x10000 + ((value & 0x3FF) << 10) + (value2 & 0x3FF)\n\t\t\t\t} else {\n\t\t\t\t\twidth = 2\n\t\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\tpanic(\"impossible\")\n\t\t\t}\n\n\t\t\t// Check if the character is in the allowed range:\n\t\t\t//      #x9 | #xA | #xD | [#x20-#x7E]               (8 bit)\n\t\t\t//      | #x85 | [#xA0-#xD7FF] | [#xE000-#xFFFD]    (16 bit)\n\t\t\t//      | [#x10000-#x10FFFF]                        (32 bit)\n\t\t\tswitch {\n\t\t\tcase value == 0x09:\n\t\t\tcase value == 0x0A:\n\t\t\tcase value == 0x0D:\n\t\t\tcase value >= 0x20 && value <= 0x7E:\n\t\t\tcase value == 0x85:\n\t\t\tcase value >= 0xA0 && value <= 0xD7FF:\n\t\t\tcase value >= 0xE000 && value <= 0xFFFD:\n\t\t\tcase value >= 0x10000 && value <= 0x10FFFF:\n\t\t\tdefault:\n\t\t\t\treturn yaml_parser_set_reader_error(parser,\n\t\t\t\t\t\"control characters are not allowed\",\n\t\t\t\t\tparser.offset, int(value))\n\t\t\t}\n\n\t\t\t// Move the raw pointers.\n\t\t\tparser.raw_buffer_pos += width\n\t\t\tparser.offset += width\n\n\t\t\t// Finally put the character into the buffer.\n\t\t\tif value <= 0x7F {\n\t\t\t\t// 0000 0000-0000 007F . 0xxxxxxx\n\t\t\t\tparser.buffer[buffer_len+0] = byte(value)\n\t\t\t\tbuffer_len += 1\n\t\t\t} else if value <= 0x7FF {\n\t\t\t\t// 0000 0080-0000 07FF . 110xxxxx 10xxxxxx\n\t\t\t\tparser.buffer[buffer_len+0] = byte(0xC0 + (value >> 6))\n\t\t\t\tparser.buffer[buffer_len+1] = byte(0x80 + (value & 0x3F))\n\t\t\t\tbuffer_len += 2\n\t\t\t} else if value <= 0xFFFF {\n\t\t\t\t// 0000 0800-0000 FFFF . 1110xxxx 10xxxxxx 10xxxxxx\n\t\t\t\tparser.buffer[buffer_len+0] = byte(0xE0 + (value >> 12))\n\t\t\t\tparser.buffer[buffer_len+1] = byte(0x80 + ((value >> 6) & 0x3F))\n\t\t\t\tparser.buffer[buffer_len+2] = byte(0x80 + (value & 0x3F))\n\t\t\t\tbuffer_len += 3\n\t\t\t} else {\n\t\t\t\t// 0001 0000-0010 FFFF . 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n\t\t\t\tparser.buffer[buffer_len+0] = byte(0xF0 + (value >> 18))\n\t\t\t\tparser.buffer[buffer_len+1] = byte(0x80 + ((value >> 12) & 0x3F))\n\t\t\t\tparser.buffer[buffer_len+2] = byte(0x80 + ((value >> 6) & 0x3F))\n\t\t\t\tparser.buffer[buffer_len+3] = byte(0x80 + (value & 0x3F))\n\t\t\t\tbuffer_len += 4\n\t\t\t}\n\n\t\t\tparser.unread++\n\t\t}\n\n\t\t// On EOF, put NUL into the buffer and return.\n\t\tif parser.eof {\n\t\t\tparser.buffer[buffer_len] = 0\n\t\t\tbuffer_len++\n\t\t\tparser.unread++\n\t\t\tbreak\n\t\t}\n\t}\n\tparser.buffer = parser.buffer[:buffer_len]\n\treturn true\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/resolve.go",
    "content": "package yaml\n\nimport (\n\t\"encoding/base64\"\n\t\"math\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\ntype resolveMapItem struct {\n\tvalue interface{}\n\ttag   string\n}\n\nvar resolveTable = make([]byte, 256)\nvar resolveMap = make(map[string]resolveMapItem)\n\nfunc init() {\n\tt := resolveTable\n\tt[int('+')] = 'S' // Sign\n\tt[int('-')] = 'S'\n\tfor _, c := range \"0123456789\" {\n\t\tt[int(c)] = 'D' // Digit\n\t}\n\tfor _, c := range \"yYnNtTfFoO~\" {\n\t\tt[int(c)] = 'M' // In map\n\t}\n\tt[int('.')] = '.' // Float (potentially in map)\n\n\tvar resolveMapList = []struct {\n\t\tv   interface{}\n\t\ttag string\n\t\tl   []string\n\t}{\n\t\t{true, yaml_BOOL_TAG, []string{\"y\", \"Y\", \"yes\", \"Yes\", \"YES\"}},\n\t\t{true, yaml_BOOL_TAG, []string{\"true\", \"True\", \"TRUE\"}},\n\t\t{true, yaml_BOOL_TAG, []string{\"on\", \"On\", \"ON\"}},\n\t\t{false, yaml_BOOL_TAG, []string{\"n\", \"N\", \"no\", \"No\", \"NO\"}},\n\t\t{false, yaml_BOOL_TAG, []string{\"false\", \"False\", \"FALSE\"}},\n\t\t{false, yaml_BOOL_TAG, []string{\"off\", \"Off\", \"OFF\"}},\n\t\t{nil, yaml_NULL_TAG, []string{\"\", \"~\", \"null\", \"Null\", \"NULL\"}},\n\t\t{math.NaN(), yaml_FLOAT_TAG, []string{\".nan\", \".NaN\", \".NAN\"}},\n\t\t{math.Inf(+1), yaml_FLOAT_TAG, []string{\".inf\", \".Inf\", \".INF\"}},\n\t\t{math.Inf(+1), yaml_FLOAT_TAG, []string{\"+.inf\", \"+.Inf\", \"+.INF\"}},\n\t\t{math.Inf(-1), yaml_FLOAT_TAG, []string{\"-.inf\", \"-.Inf\", \"-.INF\"}},\n\t\t{\"<<\", yaml_MERGE_TAG, []string{\"<<\"}},\n\t}\n\n\tm := resolveMap\n\tfor _, item := range resolveMapList {\n\t\tfor _, s := range item.l {\n\t\t\tm[s] = resolveMapItem{item.v, item.tag}\n\t\t}\n\t}\n}\n\nconst longTagPrefix = \"tag:yaml.org,2002:\"\n\nfunc shortTag(tag string) string {\n\t// TODO This can easily be made faster and produce less garbage.\n\tif strings.HasPrefix(tag, longTagPrefix) {\n\t\treturn \"!!\" + tag[len(longTagPrefix):]\n\t}\n\treturn tag\n}\n\nfunc longTag(tag string) string {\n\tif strings.HasPrefix(tag, \"!!\") {\n\t\treturn longTagPrefix + tag[2:]\n\t}\n\treturn tag\n}\n\nfunc resolvableTag(tag string) bool {\n\tswitch tag {\n\tcase \"\", yaml_STR_TAG, yaml_BOOL_TAG, yaml_INT_TAG, yaml_FLOAT_TAG, yaml_NULL_TAG:\n\t\treturn true\n\t}\n\treturn false\n}\n\nvar yamlStyleFloat = regexp.MustCompile(`^[-+]?[0-9]*\\.?[0-9]+([eE][-+][0-9]+)?$`)\n\nfunc resolve(tag string, in string) (rtag string, out interface{}) {\n\tif !resolvableTag(tag) {\n\t\treturn tag, in\n\t}\n\n\tdefer func() {\n\t\tswitch tag {\n\t\tcase \"\", rtag, yaml_STR_TAG, yaml_BINARY_TAG:\n\t\t\treturn\n\t\t}\n\t\tfailf(\"cannot decode %s `%s` as a %s\", shortTag(rtag), in, shortTag(tag))\n\t}()\n\n\t// Any data is accepted as a !!str or !!binary.\n\t// Otherwise, the prefix is enough of a hint about what it might be.\n\thint := byte('N')\n\tif in != \"\" {\n\t\thint = resolveTable[in[0]]\n\t}\n\tif hint != 0 && tag != yaml_STR_TAG && tag != yaml_BINARY_TAG {\n\t\t// Handle things we can lookup in a map.\n\t\tif item, ok := resolveMap[in]; ok {\n\t\t\treturn item.tag, item.value\n\t\t}\n\n\t\t// Base 60 floats are a bad idea, were dropped in YAML 1.2, and\n\t\t// are purposefully unsupported here. They're still quoted on\n\t\t// the way out for compatibility with other parser, though.\n\n\t\tswitch hint {\n\t\tcase 'M':\n\t\t\t// We've already checked the map above.\n\n\t\tcase '.':\n\t\t\t// Not in the map, so maybe a normal float.\n\t\t\tfloatv, err := strconv.ParseFloat(in, 64)\n\t\t\tif err == nil {\n\t\t\t\treturn yaml_FLOAT_TAG, floatv\n\t\t\t}\n\n\t\tcase 'D', 'S':\n\t\t\t// Int, float, or timestamp.\n\t\t\tplain := strings.Replace(in, \"_\", \"\", -1)\n\t\t\tintv, err := strconv.ParseInt(plain, 0, 64)\n\t\t\tif err == nil {\n\t\t\t\tif intv == int64(int(intv)) {\n\t\t\t\t\treturn yaml_INT_TAG, int(intv)\n\t\t\t\t} else {\n\t\t\t\t\treturn yaml_INT_TAG, intv\n\t\t\t\t}\n\t\t\t}\n\t\t\tuintv, err := strconv.ParseUint(plain, 0, 64)\n\t\t\tif err == nil {\n\t\t\t\treturn yaml_INT_TAG, uintv\n\t\t\t}\n\t\t\tif yamlStyleFloat.MatchString(plain) {\n\t\t\t\tfloatv, err := strconv.ParseFloat(plain, 64)\n\t\t\t\tif err == nil {\n\t\t\t\t\treturn yaml_FLOAT_TAG, floatv\n\t\t\t\t}\n\t\t\t}\n\t\t\tif strings.HasPrefix(plain, \"0b\") {\n\t\t\t\tintv, err := strconv.ParseInt(plain[2:], 2, 64)\n\t\t\t\tif err == nil {\n\t\t\t\t\tif intv == int64(int(intv)) {\n\t\t\t\t\t\treturn yaml_INT_TAG, int(intv)\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn yaml_INT_TAG, intv\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tuintv, err := strconv.ParseUint(plain[2:], 2, 64)\n\t\t\t\tif err == nil {\n\t\t\t\t\treturn yaml_INT_TAG, uintv\n\t\t\t\t}\n\t\t\t} else if strings.HasPrefix(plain, \"-0b\") {\n\t\t\t\tintv, err := strconv.ParseInt(plain[3:], 2, 64)\n\t\t\t\tif err == nil {\n\t\t\t\t\tif intv == int64(int(intv)) {\n\t\t\t\t\t\treturn yaml_INT_TAG, -int(intv)\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn yaml_INT_TAG, -intv\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// XXX Handle timestamps here.\n\n\t\tdefault:\n\t\t\tpanic(\"resolveTable item not yet handled: \" + string(rune(hint)) + \" (with \" + in + \")\")\n\t\t}\n\t}\n\tif tag == yaml_BINARY_TAG {\n\t\treturn yaml_BINARY_TAG, in\n\t}\n\tif utf8.ValidString(in) {\n\t\treturn yaml_STR_TAG, in\n\t}\n\treturn yaml_BINARY_TAG, encodeBase64(in)\n}\n\n// encodeBase64 encodes s as base64 that is broken up into multiple lines\n// as appropriate for the resulting length.\nfunc encodeBase64(s string) string {\n\tconst lineLen = 70\n\tencLen := base64.StdEncoding.EncodedLen(len(s))\n\tlines := encLen/lineLen + 1\n\tbuf := make([]byte, encLen*2+lines)\n\tin := buf[0:encLen]\n\tout := buf[encLen:]\n\tbase64.StdEncoding.Encode(in, []byte(s))\n\tk := 0\n\tfor i := 0; i < len(in); i += lineLen {\n\t\tj := i + lineLen\n\t\tif j > len(in) {\n\t\t\tj = len(in)\n\t\t}\n\t\tk += copy(out[k:], in[i:j])\n\t\tif lines > 1 {\n\t\t\tout[k] = '\\n'\n\t\t\tk++\n\t\t}\n\t}\n\treturn string(out[:k])\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/scannerc.go",
    "content": "package yaml\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n)\n\n// Introduction\n// ************\n//\n// The following notes assume that you are familiar with the YAML specification\n// (http://yaml.org/spec/1.2/spec.html).  We mostly follow it, although in\n// some cases we are less restrictive that it requires.\n//\n// The process of transforming a YAML stream into a sequence of events is\n// divided on two steps: Scanning and Parsing.\n//\n// The Scanner transforms the input stream into a sequence of tokens, while the\n// parser transform the sequence of tokens produced by the Scanner into a\n// sequence of parsing events.\n//\n// The Scanner is rather clever and complicated. The Parser, on the contrary,\n// is a straightforward implementation of a recursive-descendant parser (or,\n// LL(1) parser, as it is usually called).\n//\n// Actually there are two issues of Scanning that might be called \"clever\", the\n// rest is quite straightforward.  The issues are \"block collection start\" and\n// \"simple keys\".  Both issues are explained below in details.\n//\n// Here the Scanning step is explained and implemented.  We start with the list\n// of all the tokens produced by the Scanner together with short descriptions.\n//\n// Now, tokens:\n//\n//      STREAM-START(encoding)          # The stream start.\n//      STREAM-END                      # The stream end.\n//      VERSION-DIRECTIVE(major,minor)  # The '%YAML' directive.\n//      TAG-DIRECTIVE(handle,prefix)    # The '%TAG' directive.\n//      DOCUMENT-START                  # '---'\n//      DOCUMENT-END                    # '...'\n//      BLOCK-SEQUENCE-START            # Indentation increase denoting a block\n//      BLOCK-MAPPING-START             # sequence or a block mapping.\n//      BLOCK-END                       # Indentation decrease.\n//      FLOW-SEQUENCE-START             # '['\n//      FLOW-SEQUENCE-END               # ']'\n//      BLOCK-SEQUENCE-START            # '{'\n//      BLOCK-SEQUENCE-END              # '}'\n//      BLOCK-ENTRY                     # '-'\n//      FLOW-ENTRY                      # ','\n//      KEY                             # '?' or nothing (simple keys).\n//      VALUE                           # ':'\n//      ALIAS(anchor)                   # '*anchor'\n//      ANCHOR(anchor)                  # '&anchor'\n//      TAG(handle,suffix)              # '!handle!suffix'\n//      SCALAR(value,style)             # A scalar.\n//\n// The following two tokens are \"virtual\" tokens denoting the beginning and the\n// end of the stream:\n//\n//      STREAM-START(encoding)\n//      STREAM-END\n//\n// We pass the information about the input stream encoding with the\n// STREAM-START token.\n//\n// The next two tokens are responsible for tags:\n//\n//      VERSION-DIRECTIVE(major,minor)\n//      TAG-DIRECTIVE(handle,prefix)\n//\n// Example:\n//\n//      %YAML   1.1\n//      %TAG    !   !foo\n//      %TAG    !yaml!  tag:yaml.org,2002:\n//      ---\n//\n// The correspoding sequence of tokens:\n//\n//      STREAM-START(utf-8)\n//      VERSION-DIRECTIVE(1,1)\n//      TAG-DIRECTIVE(\"!\",\"!foo\")\n//      TAG-DIRECTIVE(\"!yaml\",\"tag:yaml.org,2002:\")\n//      DOCUMENT-START\n//      STREAM-END\n//\n// Note that the VERSION-DIRECTIVE and TAG-DIRECTIVE tokens occupy a whole\n// line.\n//\n// The document start and end indicators are represented by:\n//\n//      DOCUMENT-START\n//      DOCUMENT-END\n//\n// Note that if a YAML stream contains an implicit document (without '---'\n// and '...' indicators), no DOCUMENT-START and DOCUMENT-END tokens will be\n// produced.\n//\n// In the following examples, we present whole documents together with the\n// produced tokens.\n//\n//      1. An implicit document:\n//\n//          'a scalar'\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          SCALAR(\"a scalar\",single-quoted)\n//          STREAM-END\n//\n//      2. An explicit document:\n//\n//          ---\n//          'a scalar'\n//          ...\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          DOCUMENT-START\n//          SCALAR(\"a scalar\",single-quoted)\n//          DOCUMENT-END\n//          STREAM-END\n//\n//      3. Several documents in a stream:\n//\n//          'a scalar'\n//          ---\n//          'another scalar'\n//          ---\n//          'yet another scalar'\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          SCALAR(\"a scalar\",single-quoted)\n//          DOCUMENT-START\n//          SCALAR(\"another scalar\",single-quoted)\n//          DOCUMENT-START\n//          SCALAR(\"yet another scalar\",single-quoted)\n//          STREAM-END\n//\n// We have already introduced the SCALAR token above.  The following tokens are\n// used to describe aliases, anchors, tag, and scalars:\n//\n//      ALIAS(anchor)\n//      ANCHOR(anchor)\n//      TAG(handle,suffix)\n//      SCALAR(value,style)\n//\n// The following series of examples illustrate the usage of these tokens:\n//\n//      1. A recursive sequence:\n//\n//          &A [ *A ]\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          ANCHOR(\"A\")\n//          FLOW-SEQUENCE-START\n//          ALIAS(\"A\")\n//          FLOW-SEQUENCE-END\n//          STREAM-END\n//\n//      2. A tagged scalar:\n//\n//          !!float \"3.14\"  # A good approximation.\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          TAG(\"!!\",\"float\")\n//          SCALAR(\"3.14\",double-quoted)\n//          STREAM-END\n//\n//      3. Various scalar styles:\n//\n//          --- # Implicit empty plain scalars do not produce tokens.\n//          --- a plain scalar\n//          --- 'a single-quoted scalar'\n//          --- \"a double-quoted scalar\"\n//          --- |-\n//            a literal scalar\n//          --- >-\n//            a folded\n//            scalar\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          DOCUMENT-START\n//          DOCUMENT-START\n//          SCALAR(\"a plain scalar\",plain)\n//          DOCUMENT-START\n//          SCALAR(\"a single-quoted scalar\",single-quoted)\n//          DOCUMENT-START\n//          SCALAR(\"a double-quoted scalar\",double-quoted)\n//          DOCUMENT-START\n//          SCALAR(\"a literal scalar\",literal)\n//          DOCUMENT-START\n//          SCALAR(\"a folded scalar\",folded)\n//          STREAM-END\n//\n// Now it's time to review collection-related tokens. We will start with\n// flow collections:\n//\n//      FLOW-SEQUENCE-START\n//      FLOW-SEQUENCE-END\n//      FLOW-MAPPING-START\n//      FLOW-MAPPING-END\n//      FLOW-ENTRY\n//      KEY\n//      VALUE\n//\n// The tokens FLOW-SEQUENCE-START, FLOW-SEQUENCE-END, FLOW-MAPPING-START, and\n// FLOW-MAPPING-END represent the indicators '[', ']', '{', and '}'\n// correspondingly.  FLOW-ENTRY represent the ',' indicator.  Finally the\n// indicators '?' and ':', which are used for denoting mapping keys and values,\n// are represented by the KEY and VALUE tokens.\n//\n// The following examples show flow collections:\n//\n//      1. A flow sequence:\n//\n//          [item 1, item 2, item 3]\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          FLOW-SEQUENCE-START\n//          SCALAR(\"item 1\",plain)\n//          FLOW-ENTRY\n//          SCALAR(\"item 2\",plain)\n//          FLOW-ENTRY\n//          SCALAR(\"item 3\",plain)\n//          FLOW-SEQUENCE-END\n//          STREAM-END\n//\n//      2. A flow mapping:\n//\n//          {\n//              a simple key: a value,  # Note that the KEY token is produced.\n//              ? a complex key: another value,\n//          }\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          FLOW-MAPPING-START\n//          KEY\n//          SCALAR(\"a simple key\",plain)\n//          VALUE\n//          SCALAR(\"a value\",plain)\n//          FLOW-ENTRY\n//          KEY\n//          SCALAR(\"a complex key\",plain)\n//          VALUE\n//          SCALAR(\"another value\",plain)\n//          FLOW-ENTRY\n//          FLOW-MAPPING-END\n//          STREAM-END\n//\n// A simple key is a key which is not denoted by the '?' indicator.  Note that\n// the Scanner still produce the KEY token whenever it encounters a simple key.\n//\n// For scanning block collections, the following tokens are used (note that we\n// repeat KEY and VALUE here):\n//\n//      BLOCK-SEQUENCE-START\n//      BLOCK-MAPPING-START\n//      BLOCK-END\n//      BLOCK-ENTRY\n//      KEY\n//      VALUE\n//\n// The tokens BLOCK-SEQUENCE-START and BLOCK-MAPPING-START denote indentation\n// increase that precedes a block collection (cf. the INDENT token in Python).\n// The token BLOCK-END denote indentation decrease that ends a block collection\n// (cf. the DEDENT token in Python).  However YAML has some syntax pecularities\n// that makes detections of these tokens more complex.\n//\n// The tokens BLOCK-ENTRY, KEY, and VALUE are used to represent the indicators\n// '-', '?', and ':' correspondingly.\n//\n// The following examples show how the tokens BLOCK-SEQUENCE-START,\n// BLOCK-MAPPING-START, and BLOCK-END are emitted by the Scanner:\n//\n//      1. Block sequences:\n//\n//          - item 1\n//          - item 2\n//          -\n//            - item 3.1\n//            - item 3.2\n//          -\n//            key 1: value 1\n//            key 2: value 2\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          BLOCK-SEQUENCE-START\n//          BLOCK-ENTRY\n//          SCALAR(\"item 1\",plain)\n//          BLOCK-ENTRY\n//          SCALAR(\"item 2\",plain)\n//          BLOCK-ENTRY\n//          BLOCK-SEQUENCE-START\n//          BLOCK-ENTRY\n//          SCALAR(\"item 3.1\",plain)\n//          BLOCK-ENTRY\n//          SCALAR(\"item 3.2\",plain)\n//          BLOCK-END\n//          BLOCK-ENTRY\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"key 1\",plain)\n//          VALUE\n//          SCALAR(\"value 1\",plain)\n//          KEY\n//          SCALAR(\"key 2\",plain)\n//          VALUE\n//          SCALAR(\"value 2\",plain)\n//          BLOCK-END\n//          BLOCK-END\n//          STREAM-END\n//\n//      2. Block mappings:\n//\n//          a simple key: a value   # The KEY token is produced here.\n//          ? a complex key\n//          : another value\n//          a mapping:\n//            key 1: value 1\n//            key 2: value 2\n//          a sequence:\n//            - item 1\n//            - item 2\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"a simple key\",plain)\n//          VALUE\n//          SCALAR(\"a value\",plain)\n//          KEY\n//          SCALAR(\"a complex key\",plain)\n//          VALUE\n//          SCALAR(\"another value\",plain)\n//          KEY\n//          SCALAR(\"a mapping\",plain)\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"key 1\",plain)\n//          VALUE\n//          SCALAR(\"value 1\",plain)\n//          KEY\n//          SCALAR(\"key 2\",plain)\n//          VALUE\n//          SCALAR(\"value 2\",plain)\n//          BLOCK-END\n//          KEY\n//          SCALAR(\"a sequence\",plain)\n//          VALUE\n//          BLOCK-SEQUENCE-START\n//          BLOCK-ENTRY\n//          SCALAR(\"item 1\",plain)\n//          BLOCK-ENTRY\n//          SCALAR(\"item 2\",plain)\n//          BLOCK-END\n//          BLOCK-END\n//          STREAM-END\n//\n// YAML does not always require to start a new block collection from a new\n// line.  If the current line contains only '-', '?', and ':' indicators, a new\n// block collection may start at the current line.  The following examples\n// illustrate this case:\n//\n//      1. Collections in a sequence:\n//\n//          - - item 1\n//            - item 2\n//          - key 1: value 1\n//            key 2: value 2\n//          - ? complex key\n//            : complex value\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          BLOCK-SEQUENCE-START\n//          BLOCK-ENTRY\n//          BLOCK-SEQUENCE-START\n//          BLOCK-ENTRY\n//          SCALAR(\"item 1\",plain)\n//          BLOCK-ENTRY\n//          SCALAR(\"item 2\",plain)\n//          BLOCK-END\n//          BLOCK-ENTRY\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"key 1\",plain)\n//          VALUE\n//          SCALAR(\"value 1\",plain)\n//          KEY\n//          SCALAR(\"key 2\",plain)\n//          VALUE\n//          SCALAR(\"value 2\",plain)\n//          BLOCK-END\n//          BLOCK-ENTRY\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"complex key\")\n//          VALUE\n//          SCALAR(\"complex value\")\n//          BLOCK-END\n//          BLOCK-END\n//          STREAM-END\n//\n//      2. Collections in a mapping:\n//\n//          ? a sequence\n//          : - item 1\n//            - item 2\n//          ? a mapping\n//          : key 1: value 1\n//            key 2: value 2\n//\n//      Tokens:\n//\n//          STREAM-START(utf-8)\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"a sequence\",plain)\n//          VALUE\n//          BLOCK-SEQUENCE-START\n//          BLOCK-ENTRY\n//          SCALAR(\"item 1\",plain)\n//          BLOCK-ENTRY\n//          SCALAR(\"item 2\",plain)\n//          BLOCK-END\n//          KEY\n//          SCALAR(\"a mapping\",plain)\n//          VALUE\n//          BLOCK-MAPPING-START\n//          KEY\n//          SCALAR(\"key 1\",plain)\n//          VALUE\n//          SCALAR(\"value 1\",plain)\n//          KEY\n//          SCALAR(\"key 2\",plain)\n//          VALUE\n//          SCALAR(\"value 2\",plain)\n//          BLOCK-END\n//          BLOCK-END\n//          STREAM-END\n//\n// YAML also permits non-indented sequences if they are included into a block\n// mapping.  In this case, the token BLOCK-SEQUENCE-START is not produced:\n//\n//      key:\n//      - item 1    # BLOCK-SEQUENCE-START is NOT produced here.\n//      - item 2\n//\n// Tokens:\n//\n//      STREAM-START(utf-8)\n//      BLOCK-MAPPING-START\n//      KEY\n//      SCALAR(\"key\",plain)\n//      VALUE\n//      BLOCK-ENTRY\n//      SCALAR(\"item 1\",plain)\n//      BLOCK-ENTRY\n//      SCALAR(\"item 2\",plain)\n//      BLOCK-END\n//\n\n// Ensure that the buffer contains the required number of characters.\n// Return true on success, false on failure (reader error or memory error).\nfunc cache(parser *yaml_parser_t, length int) bool {\n\t// [Go] This was inlined: !cache(A, B) -> unread < B && !update(A, B)\n\treturn parser.unread >= length || yaml_parser_update_buffer(parser, length)\n}\n\n// Advance the buffer pointer.\nfunc skip(parser *yaml_parser_t) {\n\tparser.mark.index++\n\tparser.mark.column++\n\tparser.unread--\n\tparser.buffer_pos += width(parser.buffer[parser.buffer_pos])\n}\n\nfunc skip_line(parser *yaml_parser_t) {\n\tif is_crlf(parser.buffer, parser.buffer_pos) {\n\t\tparser.mark.index += 2\n\t\tparser.mark.column = 0\n\t\tparser.mark.line++\n\t\tparser.unread -= 2\n\t\tparser.buffer_pos += 2\n\t} else if is_break(parser.buffer, parser.buffer_pos) {\n\t\tparser.mark.index++\n\t\tparser.mark.column = 0\n\t\tparser.mark.line++\n\t\tparser.unread--\n\t\tparser.buffer_pos += width(parser.buffer[parser.buffer_pos])\n\t}\n}\n\n// Copy a character to a string buffer and advance pointers.\nfunc read(parser *yaml_parser_t, s []byte) []byte {\n\tw := width(parser.buffer[parser.buffer_pos])\n\tif w == 0 {\n\t\tpanic(\"invalid character sequence\")\n\t}\n\tif len(s) == 0 {\n\t\ts = make([]byte, 0, 32)\n\t}\n\tif w == 1 && len(s)+w <= cap(s) {\n\t\ts = s[:len(s)+1]\n\t\ts[len(s)-1] = parser.buffer[parser.buffer_pos]\n\t\tparser.buffer_pos++\n\t} else {\n\t\ts = append(s, parser.buffer[parser.buffer_pos:parser.buffer_pos+w]...)\n\t\tparser.buffer_pos += w\n\t}\n\tparser.mark.index++\n\tparser.mark.column++\n\tparser.unread--\n\treturn s\n}\n\n// Copy a line break character to a string buffer and advance pointers.\nfunc read_line(parser *yaml_parser_t, s []byte) []byte {\n\tbuf := parser.buffer\n\tpos := parser.buffer_pos\n\tswitch {\n\tcase buf[pos] == '\\r' && buf[pos+1] == '\\n':\n\t\t// CR LF . LF\n\t\ts = append(s, '\\n')\n\t\tparser.buffer_pos += 2\n\t\tparser.mark.index++\n\t\tparser.unread--\n\tcase buf[pos] == '\\r' || buf[pos] == '\\n':\n\t\t// CR|LF . LF\n\t\ts = append(s, '\\n')\n\t\tparser.buffer_pos += 1\n\tcase buf[pos] == '\\xC2' && buf[pos+1] == '\\x85':\n\t\t// NEL . LF\n\t\ts = append(s, '\\n')\n\t\tparser.buffer_pos += 2\n\tcase buf[pos] == '\\xE2' && buf[pos+1] == '\\x80' && (buf[pos+2] == '\\xA8' || buf[pos+2] == '\\xA9'):\n\t\t// LS|PS . LS|PS\n\t\ts = append(s, buf[parser.buffer_pos:pos+3]...)\n\t\tparser.buffer_pos += 3\n\tdefault:\n\t\treturn s\n\t}\n\tparser.mark.index++\n\tparser.mark.column = 0\n\tparser.mark.line++\n\tparser.unread--\n\treturn s\n}\n\n// Get the next token.\nfunc yaml_parser_scan(parser *yaml_parser_t, token *yaml_token_t) bool {\n\t// Erase the token object.\n\t*token = yaml_token_t{} // [Go] Is this necessary?\n\n\t// No tokens after STREAM-END or error.\n\tif parser.stream_end_produced || parser.error != yaml_NO_ERROR {\n\t\treturn true\n\t}\n\n\t// Ensure that the tokens queue contains enough tokens.\n\tif !parser.token_available {\n\t\tif !yaml_parser_fetch_more_tokens(parser) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Fetch the next token from the queue.\n\t*token = parser.tokens[parser.tokens_head]\n\tparser.tokens_head++\n\tparser.tokens_parsed++\n\tparser.token_available = false\n\n\tif token.typ == yaml_STREAM_END_TOKEN {\n\t\tparser.stream_end_produced = true\n\t}\n\treturn true\n}\n\n// Set the scanner error and return false.\nfunc yaml_parser_set_scanner_error(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string) bool {\n\tparser.error = yaml_SCANNER_ERROR\n\tparser.context = context\n\tparser.context_mark = context_mark\n\tparser.problem = problem\n\tparser.problem_mark = parser.mark\n\treturn false\n}\n\nfunc yaml_parser_set_scanner_tag_error(parser *yaml_parser_t, directive bool, context_mark yaml_mark_t, problem string) bool {\n\tcontext := \"while parsing a tag\"\n\tif directive {\n\t\tcontext = \"while parsing a %TAG directive\"\n\t}\n\treturn yaml_parser_set_scanner_error(parser, context, context_mark, problem)\n}\n\nfunc trace(args ...interface{}) func() {\n\tpargs := append([]interface{}{\"+++\"}, args...)\n\tfmt.Println(pargs...)\n\tpargs = append([]interface{}{\"---\"}, args...)\n\treturn func() { fmt.Println(pargs...) }\n}\n\n// Ensure that the tokens queue contains at least one token which can be\n// returned to the Parser.\nfunc yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool {\n\t// While we need more tokens to fetch, do it.\n\tfor {\n\t\t// Check if we really need to fetch more tokens.\n\t\tneed_more_tokens := false\n\n\t\tif parser.tokens_head == len(parser.tokens) {\n\t\t\t// Queue is empty.\n\t\t\tneed_more_tokens = true\n\t\t} else {\n\t\t\t// Check if any potential simple key may occupy the head position.\n\t\t\tif !yaml_parser_stale_simple_keys(parser) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tfor i := range parser.simple_keys {\n\t\t\t\tsimple_key := &parser.simple_keys[i]\n\t\t\t\tif simple_key.possible && simple_key.token_number == parser.tokens_parsed {\n\t\t\t\t\tneed_more_tokens = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// We are finished.\n\t\tif !need_more_tokens {\n\t\t\tbreak\n\t\t}\n\t\t// Fetch the next token.\n\t\tif !yaml_parser_fetch_next_token(parser) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tparser.token_available = true\n\treturn true\n}\n\n// The dispatcher for token fetchers.\nfunc yaml_parser_fetch_next_token(parser *yaml_parser_t) bool {\n\t// Ensure that the buffer is initialized.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\t// Check if we just started scanning.  Fetch STREAM-START then.\n\tif !parser.stream_start_produced {\n\t\treturn yaml_parser_fetch_stream_start(parser)\n\t}\n\n\t// Eat whitespaces and comments until we reach the next token.\n\tif !yaml_parser_scan_to_next_token(parser) {\n\t\treturn false\n\t}\n\n\t// Remove obsolete potential simple keys.\n\tif !yaml_parser_stale_simple_keys(parser) {\n\t\treturn false\n\t}\n\n\t// Check the indentation level against the current column.\n\tif !yaml_parser_unroll_indent(parser, parser.mark.column) {\n\t\treturn false\n\t}\n\n\t// Ensure that the buffer contains at least 4 characters.  4 is the length\n\t// of the longest indicators ('--- ' and '... ').\n\tif parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) {\n\t\treturn false\n\t}\n\n\t// Is it the end of the stream?\n\tif is_z(parser.buffer, parser.buffer_pos) {\n\t\treturn yaml_parser_fetch_stream_end(parser)\n\t}\n\n\t// Is it a directive?\n\tif parser.mark.column == 0 && parser.buffer[parser.buffer_pos] == '%' {\n\t\treturn yaml_parser_fetch_directive(parser)\n\t}\n\n\tbuf := parser.buffer\n\tpos := parser.buffer_pos\n\n\t// Is it the document start indicator?\n\tif parser.mark.column == 0 && buf[pos] == '-' && buf[pos+1] == '-' && buf[pos+2] == '-' && is_blankz(buf, pos+3) {\n\t\treturn yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_START_TOKEN)\n\t}\n\n\t// Is it the document end indicator?\n\tif parser.mark.column == 0 && buf[pos] == '.' && buf[pos+1] == '.' && buf[pos+2] == '.' && is_blankz(buf, pos+3) {\n\t\treturn yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_END_TOKEN)\n\t}\n\n\t// Is it the flow sequence start indicator?\n\tif buf[pos] == '[' {\n\t\treturn yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_SEQUENCE_START_TOKEN)\n\t}\n\n\t// Is it the flow mapping start indicator?\n\tif parser.buffer[parser.buffer_pos] == '{' {\n\t\treturn yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_MAPPING_START_TOKEN)\n\t}\n\n\t// Is it the flow sequence end indicator?\n\tif parser.buffer[parser.buffer_pos] == ']' {\n\t\treturn yaml_parser_fetch_flow_collection_end(parser,\n\t\t\tyaml_FLOW_SEQUENCE_END_TOKEN)\n\t}\n\n\t// Is it the flow mapping end indicator?\n\tif parser.buffer[parser.buffer_pos] == '}' {\n\t\treturn yaml_parser_fetch_flow_collection_end(parser,\n\t\t\tyaml_FLOW_MAPPING_END_TOKEN)\n\t}\n\n\t// Is it the flow entry indicator?\n\tif parser.buffer[parser.buffer_pos] == ',' {\n\t\treturn yaml_parser_fetch_flow_entry(parser)\n\t}\n\n\t// Is it the block entry indicator?\n\tif parser.buffer[parser.buffer_pos] == '-' && is_blankz(parser.buffer, parser.buffer_pos+1) {\n\t\treturn yaml_parser_fetch_block_entry(parser)\n\t}\n\n\t// Is it the key indicator?\n\tif parser.buffer[parser.buffer_pos] == '?' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) {\n\t\treturn yaml_parser_fetch_key(parser)\n\t}\n\n\t// Is it the value indicator?\n\tif parser.buffer[parser.buffer_pos] == ':' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) {\n\t\treturn yaml_parser_fetch_value(parser)\n\t}\n\n\t// Is it an alias?\n\tif parser.buffer[parser.buffer_pos] == '*' {\n\t\treturn yaml_parser_fetch_anchor(parser, yaml_ALIAS_TOKEN)\n\t}\n\n\t// Is it an anchor?\n\tif parser.buffer[parser.buffer_pos] == '&' {\n\t\treturn yaml_parser_fetch_anchor(parser, yaml_ANCHOR_TOKEN)\n\t}\n\n\t// Is it a tag?\n\tif parser.buffer[parser.buffer_pos] == '!' {\n\t\treturn yaml_parser_fetch_tag(parser)\n\t}\n\n\t// Is it a literal scalar?\n\tif parser.buffer[parser.buffer_pos] == '|' && parser.flow_level == 0 {\n\t\treturn yaml_parser_fetch_block_scalar(parser, true)\n\t}\n\n\t// Is it a folded scalar?\n\tif parser.buffer[parser.buffer_pos] == '>' && parser.flow_level == 0 {\n\t\treturn yaml_parser_fetch_block_scalar(parser, false)\n\t}\n\n\t// Is it a single-quoted scalar?\n\tif parser.buffer[parser.buffer_pos] == '\\'' {\n\t\treturn yaml_parser_fetch_flow_scalar(parser, true)\n\t}\n\n\t// Is it a double-quoted scalar?\n\tif parser.buffer[parser.buffer_pos] == '\"' {\n\t\treturn yaml_parser_fetch_flow_scalar(parser, false)\n\t}\n\n\t// Is it a plain scalar?\n\t//\n\t// A plain scalar may start with any non-blank characters except\n\t//\n\t//      '-', '?', ':', ',', '[', ']', '{', '}',\n\t//      '#', '&', '*', '!', '|', '>', '\\'', '\\\"',\n\t//      '%', '@', '`'.\n\t//\n\t// In the block context (and, for the '-' indicator, in the flow context\n\t// too), it may also start with the characters\n\t//\n\t//      '-', '?', ':'\n\t//\n\t// if it is followed by a non-space character.\n\t//\n\t// The last rule is more restrictive than the specification requires.\n\t// [Go] Make this logic more reasonable.\n\t//switch parser.buffer[parser.buffer_pos] {\n\t//case '-', '?', ':', ',', '?', '-', ',', ':', ']', '[', '}', '{', '&', '#', '!', '*', '>', '|', '\"', '\\'', '@', '%', '-', '`':\n\t//}\n\tif !(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '-' ||\n\t\tparser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':' ||\n\t\tparser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '[' ||\n\t\tparser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' ||\n\t\tparser.buffer[parser.buffer_pos] == '}' || parser.buffer[parser.buffer_pos] == '#' ||\n\t\tparser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '*' ||\n\t\tparser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '|' ||\n\t\tparser.buffer[parser.buffer_pos] == '>' || parser.buffer[parser.buffer_pos] == '\\'' ||\n\t\tparser.buffer[parser.buffer_pos] == '\"' || parser.buffer[parser.buffer_pos] == '%' ||\n\t\tparser.buffer[parser.buffer_pos] == '@' || parser.buffer[parser.buffer_pos] == '`') ||\n\t\t(parser.buffer[parser.buffer_pos] == '-' && !is_blank(parser.buffer, parser.buffer_pos+1)) ||\n\t\t(parser.flow_level == 0 &&\n\t\t\t(parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':') &&\n\t\t\t!is_blankz(parser.buffer, parser.buffer_pos+1)) {\n\t\treturn yaml_parser_fetch_plain_scalar(parser)\n\t}\n\n\t// If we don't determine the token type so far, it is an error.\n\treturn yaml_parser_set_scanner_error(parser,\n\t\t\"while scanning for the next token\", parser.mark,\n\t\t\"found character that cannot start any token\")\n}\n\n// Check the list of potential simple keys and remove the positions that\n// cannot contain simple keys anymore.\nfunc yaml_parser_stale_simple_keys(parser *yaml_parser_t) bool {\n\t// Check for a potential simple key for each flow level.\n\tfor i := range parser.simple_keys {\n\t\tsimple_key := &parser.simple_keys[i]\n\n\t\t// The specification requires that a simple key\n\t\t//\n\t\t//  - is limited to a single line,\n\t\t//  - is shorter than 1024 characters.\n\t\tif simple_key.possible && (simple_key.mark.line < parser.mark.line || simple_key.mark.index+1024 < parser.mark.index) {\n\n\t\t\t// Check if the potential simple key to be removed is required.\n\t\t\tif simple_key.required {\n\t\t\t\treturn yaml_parser_set_scanner_error(parser,\n\t\t\t\t\t\"while scanning a simple key\", simple_key.mark,\n\t\t\t\t\t\"could not find expected ':'\")\n\t\t\t}\n\t\t\tsimple_key.possible = false\n\t\t}\n\t}\n\treturn true\n}\n\n// Check if a simple key may start at the current position and add it if\n// needed.\nfunc yaml_parser_save_simple_key(parser *yaml_parser_t) bool {\n\t// A simple key is required at the current position if the scanner is in\n\t// the block context and the current column coincides with the indentation\n\t// level.\n\n\trequired := parser.flow_level == 0 && parser.indent == parser.mark.column\n\n\t// A simple key is required only when it is the first token in the current\n\t// line.  Therefore it is always allowed.  But we add a check anyway.\n\tif required && !parser.simple_key_allowed {\n\t\tpanic(\"should not happen\")\n\t}\n\n\t//\n\t// If the current position may start a simple key, save it.\n\t//\n\tif parser.simple_key_allowed {\n\t\tsimple_key := yaml_simple_key_t{\n\t\t\tpossible:     true,\n\t\t\trequired:     required,\n\t\t\ttoken_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head),\n\t\t}\n\t\tsimple_key.mark = parser.mark\n\n\t\tif !yaml_parser_remove_simple_key(parser) {\n\t\t\treturn false\n\t\t}\n\t\tparser.simple_keys[len(parser.simple_keys)-1] = simple_key\n\t}\n\treturn true\n}\n\n// Remove a potential simple key at the current flow level.\nfunc yaml_parser_remove_simple_key(parser *yaml_parser_t) bool {\n\ti := len(parser.simple_keys) - 1\n\tif parser.simple_keys[i].possible {\n\t\t// If the key is required, it is an error.\n\t\tif parser.simple_keys[i].required {\n\t\t\treturn yaml_parser_set_scanner_error(parser,\n\t\t\t\t\"while scanning a simple key\", parser.simple_keys[i].mark,\n\t\t\t\t\"could not find expected ':'\")\n\t\t}\n\t}\n\t// Remove the key from the stack.\n\tparser.simple_keys[i].possible = false\n\treturn true\n}\n\n// Increase the flow level and resize the simple key list if needed.\nfunc yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {\n\t// Reset the simple key on the next level.\n\tparser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})\n\n\t// Increase the flow level.\n\tparser.flow_level++\n\treturn true\n}\n\n// Decrease the flow level.\nfunc yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool {\n\tif parser.flow_level > 0 {\n\t\tparser.flow_level--\n\t\tparser.simple_keys = parser.simple_keys[:len(parser.simple_keys)-1]\n\t}\n\treturn true\n}\n\n// Push the current indentation level to the stack and set the new level\n// the current column is greater than the indentation level.  In this case,\n// append or insert the specified token into the token queue.\nfunc yaml_parser_roll_indent(parser *yaml_parser_t, column, number int, typ yaml_token_type_t, mark yaml_mark_t) bool {\n\t// In the flow context, do nothing.\n\tif parser.flow_level > 0 {\n\t\treturn true\n\t}\n\n\tif parser.indent < column {\n\t\t// Push the current indentation level to the stack and set the new\n\t\t// indentation level.\n\t\tparser.indents = append(parser.indents, parser.indent)\n\t\tparser.indent = column\n\n\t\t// Create a token and insert it into the queue.\n\t\ttoken := yaml_token_t{\n\t\t\ttyp:        typ,\n\t\t\tstart_mark: mark,\n\t\t\tend_mark:   mark,\n\t\t}\n\t\tif number > -1 {\n\t\t\tnumber -= parser.tokens_parsed\n\t\t}\n\t\tyaml_insert_token(parser, number, &token)\n\t}\n\treturn true\n}\n\n// Pop indentation levels from the indents stack until the current level\n// becomes less or equal to the column.  For each indentation level, append\n// the BLOCK-END token.\nfunc yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool {\n\t// In the flow context, do nothing.\n\tif parser.flow_level > 0 {\n\t\treturn true\n\t}\n\n\t// Loop through the indentation levels in the stack.\n\tfor parser.indent > column {\n\t\t// Create a token and append it to the queue.\n\t\ttoken := yaml_token_t{\n\t\t\ttyp:        yaml_BLOCK_END_TOKEN,\n\t\t\tstart_mark: parser.mark,\n\t\t\tend_mark:   parser.mark,\n\t\t}\n\t\tyaml_insert_token(parser, -1, &token)\n\n\t\t// Pop the indentation level.\n\t\tparser.indent = parser.indents[len(parser.indents)-1]\n\t\tparser.indents = parser.indents[:len(parser.indents)-1]\n\t}\n\treturn true\n}\n\n// Initialize the scanner and produce the STREAM-START token.\nfunc yaml_parser_fetch_stream_start(parser *yaml_parser_t) bool {\n\n\t// Set the initial indentation.\n\tparser.indent = -1\n\n\t// Initialize the simple key stack.\n\tparser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})\n\n\t// A simple key is allowed at the beginning of the stream.\n\tparser.simple_key_allowed = true\n\n\t// We have started.\n\tparser.stream_start_produced = true\n\n\t// Create the STREAM-START token and append it to the queue.\n\ttoken := yaml_token_t{\n\t\ttyp:        yaml_STREAM_START_TOKEN,\n\t\tstart_mark: parser.mark,\n\t\tend_mark:   parser.mark,\n\t\tencoding:   parser.encoding,\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the STREAM-END token and shut down the scanner.\nfunc yaml_parser_fetch_stream_end(parser *yaml_parser_t) bool {\n\n\t// Force new line.\n\tif parser.mark.column != 0 {\n\t\tparser.mark.column = 0\n\t\tparser.mark.line++\n\t}\n\n\t// Reset the indentation level.\n\tif !yaml_parser_unroll_indent(parser, -1) {\n\t\treturn false\n\t}\n\n\t// Reset simple keys.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\tparser.simple_key_allowed = false\n\n\t// Create the STREAM-END token and append it to the queue.\n\ttoken := yaml_token_t{\n\t\ttyp:        yaml_STREAM_END_TOKEN,\n\t\tstart_mark: parser.mark,\n\t\tend_mark:   parser.mark,\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token.\nfunc yaml_parser_fetch_directive(parser *yaml_parser_t) bool {\n\t// Reset the indentation level.\n\tif !yaml_parser_unroll_indent(parser, -1) {\n\t\treturn false\n\t}\n\n\t// Reset simple keys.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\tparser.simple_key_allowed = false\n\n\t// Create the YAML-DIRECTIVE or TAG-DIRECTIVE token.\n\ttoken := yaml_token_t{}\n\tif !yaml_parser_scan_directive(parser, &token) {\n\t\treturn false\n\t}\n\t// Append the token to the queue.\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the DOCUMENT-START or DOCUMENT-END token.\nfunc yaml_parser_fetch_document_indicator(parser *yaml_parser_t, typ yaml_token_type_t) bool {\n\t// Reset the indentation level.\n\tif !yaml_parser_unroll_indent(parser, -1) {\n\t\treturn false\n\t}\n\n\t// Reset simple keys.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\tparser.simple_key_allowed = false\n\n\t// Consume the token.\n\tstart_mark := parser.mark\n\n\tskip(parser)\n\tskip(parser)\n\tskip(parser)\n\n\tend_mark := parser.mark\n\n\t// Create the DOCUMENT-START or DOCUMENT-END token.\n\ttoken := yaml_token_t{\n\t\ttyp:        typ,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\t// Append the token to the queue.\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token.\nfunc yaml_parser_fetch_flow_collection_start(parser *yaml_parser_t, typ yaml_token_type_t) bool {\n\t// The indicators '[' and '{' may start a simple key.\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// Increase the flow level.\n\tif !yaml_parser_increase_flow_level(parser) {\n\t\treturn false\n\t}\n\n\t// A simple key may follow the indicators '[' and '{'.\n\tparser.simple_key_allowed = true\n\n\t// Consume the token.\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create the FLOW-SEQUENCE-START of FLOW-MAPPING-START token.\n\ttoken := yaml_token_t{\n\t\ttyp:        typ,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\t// Append the token to the queue.\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token.\nfunc yaml_parser_fetch_flow_collection_end(parser *yaml_parser_t, typ yaml_token_type_t) bool {\n\t// Reset any potential simple key on the current flow level.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// Decrease the flow level.\n\tif !yaml_parser_decrease_flow_level(parser) {\n\t\treturn false\n\t}\n\n\t// No simple keys after the indicators ']' and '}'.\n\tparser.simple_key_allowed = false\n\n\t// Consume the token.\n\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create the FLOW-SEQUENCE-END of FLOW-MAPPING-END token.\n\ttoken := yaml_token_t{\n\t\ttyp:        typ,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\t// Append the token to the queue.\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the FLOW-ENTRY token.\nfunc yaml_parser_fetch_flow_entry(parser *yaml_parser_t) bool {\n\t// Reset any potential simple keys on the current flow level.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// Simple keys are allowed after ','.\n\tparser.simple_key_allowed = true\n\n\t// Consume the token.\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create the FLOW-ENTRY token and append it to the queue.\n\ttoken := yaml_token_t{\n\t\ttyp:        yaml_FLOW_ENTRY_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the BLOCK-ENTRY token.\nfunc yaml_parser_fetch_block_entry(parser *yaml_parser_t) bool {\n\t// Check if the scanner is in the block context.\n\tif parser.flow_level == 0 {\n\t\t// Check if we are allowed to start a new entry.\n\t\tif !parser.simple_key_allowed {\n\t\t\treturn yaml_parser_set_scanner_error(parser, \"\", parser.mark,\n\t\t\t\t\"block sequence entries are not allowed in this context\")\n\t\t}\n\t\t// Add the BLOCK-SEQUENCE-START token if needed.\n\t\tif !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_SEQUENCE_START_TOKEN, parser.mark) {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\t// It is an error for the '-' indicator to occur in the flow context,\n\t\t// but we let the Parser detect and report about it because the Parser\n\t\t// is able to point to the context.\n\t}\n\n\t// Reset any potential simple keys on the current flow level.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// Simple keys are allowed after '-'.\n\tparser.simple_key_allowed = true\n\n\t// Consume the token.\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create the BLOCK-ENTRY token and append it to the queue.\n\ttoken := yaml_token_t{\n\t\ttyp:        yaml_BLOCK_ENTRY_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the KEY token.\nfunc yaml_parser_fetch_key(parser *yaml_parser_t) bool {\n\n\t// In the block context, additional checks are required.\n\tif parser.flow_level == 0 {\n\t\t// Check if we are allowed to start a new key (not nessesary simple).\n\t\tif !parser.simple_key_allowed {\n\t\t\treturn yaml_parser_set_scanner_error(parser, \"\", parser.mark,\n\t\t\t\t\"mapping keys are not allowed in this context\")\n\t\t}\n\t\t// Add the BLOCK-MAPPING-START token if needed.\n\t\tif !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Reset any potential simple keys on the current flow level.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// Simple keys are allowed after '?' in the block context.\n\tparser.simple_key_allowed = parser.flow_level == 0\n\n\t// Consume the token.\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create the KEY token and append it to the queue.\n\ttoken := yaml_token_t{\n\t\ttyp:        yaml_KEY_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the VALUE token.\nfunc yaml_parser_fetch_value(parser *yaml_parser_t) bool {\n\n\tsimple_key := &parser.simple_keys[len(parser.simple_keys)-1]\n\n\t// Have we found a simple key?\n\tif simple_key.possible {\n\t\t// Create the KEY token and insert it into the queue.\n\t\ttoken := yaml_token_t{\n\t\t\ttyp:        yaml_KEY_TOKEN,\n\t\t\tstart_mark: simple_key.mark,\n\t\t\tend_mark:   simple_key.mark,\n\t\t}\n\t\tyaml_insert_token(parser, simple_key.token_number-parser.tokens_parsed, &token)\n\n\t\t// In the block context, we may need to add the BLOCK-MAPPING-START token.\n\t\tif !yaml_parser_roll_indent(parser, simple_key.mark.column,\n\t\t\tsimple_key.token_number,\n\t\t\tyaml_BLOCK_MAPPING_START_TOKEN, simple_key.mark) {\n\t\t\treturn false\n\t\t}\n\n\t\t// Remove the simple key.\n\t\tsimple_key.possible = false\n\n\t\t// A simple key cannot follow another simple key.\n\t\tparser.simple_key_allowed = false\n\n\t} else {\n\t\t// The ':' indicator follows a complex key.\n\n\t\t// In the block context, extra checks are required.\n\t\tif parser.flow_level == 0 {\n\n\t\t\t// Check if we are allowed to start a complex value.\n\t\t\tif !parser.simple_key_allowed {\n\t\t\t\treturn yaml_parser_set_scanner_error(parser, \"\", parser.mark,\n\t\t\t\t\t\"mapping values are not allowed in this context\")\n\t\t\t}\n\n\t\t\t// Add the BLOCK-MAPPING-START token if needed.\n\t\t\tif !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Simple keys after ':' are allowed in the block context.\n\t\tparser.simple_key_allowed = parser.flow_level == 0\n\t}\n\n\t// Consume the token.\n\tstart_mark := parser.mark\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create the VALUE token and append it to the queue.\n\ttoken := yaml_token_t{\n\t\ttyp:        yaml_VALUE_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the ALIAS or ANCHOR token.\nfunc yaml_parser_fetch_anchor(parser *yaml_parser_t, typ yaml_token_type_t) bool {\n\t// An anchor or an alias could be a simple key.\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// A simple key cannot follow an anchor or an alias.\n\tparser.simple_key_allowed = false\n\n\t// Create the ALIAS or ANCHOR token and append it to the queue.\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_anchor(parser, &token, typ) {\n\t\treturn false\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the TAG token.\nfunc yaml_parser_fetch_tag(parser *yaml_parser_t) bool {\n\t// A tag could be a simple key.\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// A simple key cannot follow a tag.\n\tparser.simple_key_allowed = false\n\n\t// Create the TAG token and append it to the queue.\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_tag(parser, &token) {\n\t\treturn false\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens.\nfunc yaml_parser_fetch_block_scalar(parser *yaml_parser_t, literal bool) bool {\n\t// Remove any potential simple keys.\n\tif !yaml_parser_remove_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// A simple key may follow a block scalar.\n\tparser.simple_key_allowed = true\n\n\t// Create the SCALAR token and append it to the queue.\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_block_scalar(parser, &token, literal) {\n\t\treturn false\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens.\nfunc yaml_parser_fetch_flow_scalar(parser *yaml_parser_t, single bool) bool {\n\t// A plain scalar could be a simple key.\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// A simple key cannot follow a flow scalar.\n\tparser.simple_key_allowed = false\n\n\t// Create the SCALAR token and append it to the queue.\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_flow_scalar(parser, &token, single) {\n\t\treturn false\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Produce the SCALAR(...,plain) token.\nfunc yaml_parser_fetch_plain_scalar(parser *yaml_parser_t) bool {\n\t// A plain scalar could be a simple key.\n\tif !yaml_parser_save_simple_key(parser) {\n\t\treturn false\n\t}\n\n\t// A simple key cannot follow a flow scalar.\n\tparser.simple_key_allowed = false\n\n\t// Create the SCALAR token and append it to the queue.\n\tvar token yaml_token_t\n\tif !yaml_parser_scan_plain_scalar(parser, &token) {\n\t\treturn false\n\t}\n\tyaml_insert_token(parser, -1, &token)\n\treturn true\n}\n\n// Eat whitespaces and comments until the next token is found.\nfunc yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool {\n\n\t// Until the next token is not found.\n\tfor {\n\t\t// Allow the BOM mark to start a line.\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t\tif parser.mark.column == 0 && is_bom(parser.buffer, parser.buffer_pos) {\n\t\t\tskip(parser)\n\t\t}\n\n\t\t// Eat whitespaces.\n\t\t// Tabs are allowed:\n\t\t//  - in the flow context\n\t\t//  - in the block context, but not at the beginning of the line or\n\t\t//  after '-', '?', or ':' (complex value).\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tfor parser.buffer[parser.buffer_pos] == ' ' || ((parser.flow_level > 0 || !parser.simple_key_allowed) && parser.buffer[parser.buffer_pos] == '\\t') {\n\t\t\tskip(parser)\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Eat a comment until a line break.\n\t\tif parser.buffer[parser.buffer_pos] == '#' {\n\t\t\tfor !is_breakz(parser.buffer, parser.buffer_pos) {\n\t\t\t\tskip(parser)\n\t\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If it is a line break, eat it.\n\t\tif is_break(parser.buffer, parser.buffer_pos) {\n\t\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tskip_line(parser)\n\n\t\t\t// In the block context, a new line may start a simple key.\n\t\t\tif parser.flow_level == 0 {\n\t\t\t\tparser.simple_key_allowed = true\n\t\t\t}\n\t\t} else {\n\t\t\tbreak // We have found a token.\n\t\t}\n\t}\n\n\treturn true\n}\n\n// Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token.\n//\n// Scope:\n//      %YAML    1.1    # a comment \\n\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n//      %TAG    !yaml!  tag:yaml.org,2002:  \\n\n//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n//\nfunc yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool {\n\t// Eat '%'.\n\tstart_mark := parser.mark\n\tskip(parser)\n\n\t// Scan the directive name.\n\tvar name []byte\n\tif !yaml_parser_scan_directive_name(parser, start_mark, &name) {\n\t\treturn false\n\t}\n\n\t// Is it a YAML directive?\n\tif bytes.Equal(name, []byte(\"YAML\")) {\n\t\t// Scan the VERSION directive value.\n\t\tvar major, minor int8\n\t\tif !yaml_parser_scan_version_directive_value(parser, start_mark, &major, &minor) {\n\t\t\treturn false\n\t\t}\n\t\tend_mark := parser.mark\n\n\t\t// Create a VERSION-DIRECTIVE token.\n\t\t*token = yaml_token_t{\n\t\t\ttyp:        yaml_VERSION_DIRECTIVE_TOKEN,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tmajor:      major,\n\t\t\tminor:      minor,\n\t\t}\n\n\t\t// Is it a TAG directive?\n\t} else if bytes.Equal(name, []byte(\"TAG\")) {\n\t\t// Scan the TAG directive value.\n\t\tvar handle, prefix []byte\n\t\tif !yaml_parser_scan_tag_directive_value(parser, start_mark, &handle, &prefix) {\n\t\t\treturn false\n\t\t}\n\t\tend_mark := parser.mark\n\n\t\t// Create a TAG-DIRECTIVE token.\n\t\t*token = yaml_token_t{\n\t\t\ttyp:        yaml_TAG_DIRECTIVE_TOKEN,\n\t\t\tstart_mark: start_mark,\n\t\t\tend_mark:   end_mark,\n\t\t\tvalue:      handle,\n\t\t\tprefix:     prefix,\n\t\t}\n\n\t\t// Unknown directive.\n\t} else {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a directive\",\n\t\t\tstart_mark, \"found unknown directive name\")\n\t\treturn false\n\t}\n\n\t// Eat the rest of the line including any comments.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\tfor is_blank(parser.buffer, parser.buffer_pos) {\n\t\tskip(parser)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif parser.buffer[parser.buffer_pos] == '#' {\n\t\tfor !is_breakz(parser.buffer, parser.buffer_pos) {\n\t\t\tskip(parser)\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check if we are at the end of the line.\n\tif !is_breakz(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a directive\",\n\t\t\tstart_mark, \"did not find expected comment or line break\")\n\t\treturn false\n\t}\n\n\t// Eat a line break.\n\tif is_break(parser.buffer, parser.buffer_pos) {\n\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\treturn false\n\t\t}\n\t\tskip_line(parser)\n\t}\n\n\treturn true\n}\n\n// Scan the directive name.\n//\n// Scope:\n//      %YAML   1.1     # a comment \\n\n//       ^^^^\n//      %TAG    !yaml!  tag:yaml.org,2002:  \\n\n//       ^^^\n//\nfunc yaml_parser_scan_directive_name(parser *yaml_parser_t, start_mark yaml_mark_t, name *[]byte) bool {\n\t// Consume the directive name.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\tvar s []byte\n\tfor is_alpha(parser.buffer, parser.buffer_pos) {\n\t\ts = read(parser, s)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Check if the name is empty.\n\tif len(s) == 0 {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a directive\",\n\t\t\tstart_mark, \"could not find expected directive name\")\n\t\treturn false\n\t}\n\n\t// Check for an blank character after the name.\n\tif !is_blankz(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a directive\",\n\t\t\tstart_mark, \"found unexpected non-alphabetical character\")\n\t\treturn false\n\t}\n\t*name = s\n\treturn true\n}\n\n// Scan the value of VERSION-DIRECTIVE.\n//\n// Scope:\n//      %YAML   1.1     # a comment \\n\n//           ^^^^^^\nfunc yaml_parser_scan_version_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, major, minor *int8) bool {\n\t// Eat whitespaces.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tfor is_blank(parser.buffer, parser.buffer_pos) {\n\t\tskip(parser)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Consume the major version number.\n\tif !yaml_parser_scan_version_directive_number(parser, start_mark, major) {\n\t\treturn false\n\t}\n\n\t// Eat '.'.\n\tif parser.buffer[parser.buffer_pos] != '.' {\n\t\treturn yaml_parser_set_scanner_error(parser, \"while scanning a %YAML directive\",\n\t\t\tstart_mark, \"did not find expected digit or '.' character\")\n\t}\n\n\tskip(parser)\n\n\t// Consume the minor version number.\n\tif !yaml_parser_scan_version_directive_number(parser, start_mark, minor) {\n\t\treturn false\n\t}\n\treturn true\n}\n\nconst max_number_length = 2\n\n// Scan the version number of VERSION-DIRECTIVE.\n//\n// Scope:\n//      %YAML   1.1     # a comment \\n\n//              ^\n//      %YAML   1.1     # a comment \\n\n//                ^\nfunc yaml_parser_scan_version_directive_number(parser *yaml_parser_t, start_mark yaml_mark_t, number *int8) bool {\n\n\t// Repeat while the next character is digit.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tvar value, length int8\n\tfor is_digit(parser.buffer, parser.buffer_pos) {\n\t\t// Check if the number is too long.\n\t\tlength++\n\t\tif length > max_number_length {\n\t\t\treturn yaml_parser_set_scanner_error(parser, \"while scanning a %YAML directive\",\n\t\t\t\tstart_mark, \"found extremely long version number\")\n\t\t}\n\t\tvalue = value*10 + int8(as_digit(parser.buffer, parser.buffer_pos))\n\t\tskip(parser)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Check if the number was present.\n\tif length == 0 {\n\t\treturn yaml_parser_set_scanner_error(parser, \"while scanning a %YAML directive\",\n\t\t\tstart_mark, \"did not find expected version number\")\n\t}\n\t*number = value\n\treturn true\n}\n\n// Scan the value of a TAG-DIRECTIVE token.\n//\n// Scope:\n//      %TAG    !yaml!  tag:yaml.org,2002:  \\n\n//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n//\nfunc yaml_parser_scan_tag_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, handle, prefix *[]byte) bool {\n\tvar handle_value, prefix_value []byte\n\n\t// Eat whitespaces.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\tfor is_blank(parser.buffer, parser.buffer_pos) {\n\t\tskip(parser)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Scan a handle.\n\tif !yaml_parser_scan_tag_handle(parser, true, start_mark, &handle_value) {\n\t\treturn false\n\t}\n\n\t// Expect a whitespace.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tif !is_blank(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a %TAG directive\",\n\t\t\tstart_mark, \"did not find expected whitespace\")\n\t\treturn false\n\t}\n\n\t// Eat whitespaces.\n\tfor is_blank(parser.buffer, parser.buffer_pos) {\n\t\tskip(parser)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Scan a prefix.\n\tif !yaml_parser_scan_tag_uri(parser, true, nil, start_mark, &prefix_value) {\n\t\treturn false\n\t}\n\n\t// Expect a whitespace or line break.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tif !is_blankz(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a %TAG directive\",\n\t\t\tstart_mark, \"did not find expected whitespace or line break\")\n\t\treturn false\n\t}\n\n\t*handle = handle_value\n\t*prefix = prefix_value\n\treturn true\n}\n\nfunc yaml_parser_scan_anchor(parser *yaml_parser_t, token *yaml_token_t, typ yaml_token_type_t) bool {\n\tvar s []byte\n\n\t// Eat the indicator character.\n\tstart_mark := parser.mark\n\tskip(parser)\n\n\t// Consume the value.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\tfor is_alpha(parser.buffer, parser.buffer_pos) {\n\t\ts = read(parser, s)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tend_mark := parser.mark\n\n\t/*\n\t * Check if length of the anchor is greater than 0 and it is followed by\n\t * a whitespace character or one of the indicators:\n\t *\n\t *      '?', ':', ',', ']', '}', '%', '@', '`'.\n\t */\n\n\tif len(s) == 0 ||\n\t\t!(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '?' ||\n\t\t\tparser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == ',' ||\n\t\t\tparser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '}' ||\n\t\t\tparser.buffer[parser.buffer_pos] == '%' || parser.buffer[parser.buffer_pos] == '@' ||\n\t\t\tparser.buffer[parser.buffer_pos] == '`') {\n\t\tcontext := \"while scanning an alias\"\n\t\tif typ == yaml_ANCHOR_TOKEN {\n\t\t\tcontext = \"while scanning an anchor\"\n\t\t}\n\t\tyaml_parser_set_scanner_error(parser, context, start_mark,\n\t\t\t\"did not find expected alphabetic or numeric character\")\n\t\treturn false\n\t}\n\n\t// Create a token.\n\t*token = yaml_token_t{\n\t\ttyp:        typ,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      s,\n\t}\n\n\treturn true\n}\n\n/*\n * Scan a TAG token.\n */\n\nfunc yaml_parser_scan_tag(parser *yaml_parser_t, token *yaml_token_t) bool {\n\tvar handle, suffix []byte\n\n\tstart_mark := parser.mark\n\n\t// Check if the tag is in the canonical form.\n\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\treturn false\n\t}\n\n\tif parser.buffer[parser.buffer_pos+1] == '<' {\n\t\t// Keep the handle as ''\n\n\t\t// Eat '!<'\n\t\tskip(parser)\n\t\tskip(parser)\n\n\t\t// Consume the tag value.\n\t\tif !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) {\n\t\t\treturn false\n\t\t}\n\n\t\t// Check for '>' and eat it.\n\t\tif parser.buffer[parser.buffer_pos] != '>' {\n\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a tag\",\n\t\t\t\tstart_mark, \"did not find the expected '>'\")\n\t\t\treturn false\n\t\t}\n\n\t\tskip(parser)\n\t} else {\n\t\t// The tag has either the '!suffix' or the '!handle!suffix' form.\n\n\t\t// First, try to scan a handle.\n\t\tif !yaml_parser_scan_tag_handle(parser, false, start_mark, &handle) {\n\t\t\treturn false\n\t\t}\n\n\t\t// Check if it is, indeed, handle.\n\t\tif handle[0] == '!' && len(handle) > 1 && handle[len(handle)-1] == '!' {\n\t\t\t// Scan the suffix now.\n\t\t\tif !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\t// It wasn't a handle after all.  Scan the rest of the tag.\n\t\t\tif !yaml_parser_scan_tag_uri(parser, false, handle, start_mark, &suffix) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t// Set the handle to '!'.\n\t\t\thandle = []byte{'!'}\n\n\t\t\t// A special case: the '!' tag.  Set the handle to '' and the\n\t\t\t// suffix to '!'.\n\t\t\tif len(suffix) == 0 {\n\t\t\t\thandle, suffix = suffix, handle\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check the character which ends the tag.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tif !is_blankz(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a tag\",\n\t\t\tstart_mark, \"did not find expected whitespace or line break\")\n\t\treturn false\n\t}\n\n\tend_mark := parser.mark\n\n\t// Create a token.\n\t*token = yaml_token_t{\n\t\ttyp:        yaml_TAG_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      handle,\n\t\tsuffix:     suffix,\n\t}\n\treturn true\n}\n\n// Scan a tag handle.\nfunc yaml_parser_scan_tag_handle(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, handle *[]byte) bool {\n\t// Check the initial '!' character.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tif parser.buffer[parser.buffer_pos] != '!' {\n\t\tyaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\tstart_mark, \"did not find expected '!'\")\n\t\treturn false\n\t}\n\n\tvar s []byte\n\n\t// Copy the '!' character.\n\ts = read(parser, s)\n\n\t// Copy all subsequent alphabetical and numerical characters.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tfor is_alpha(parser.buffer, parser.buffer_pos) {\n\t\ts = read(parser, s)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Check if the trailing character is '!' and copy it.\n\tif parser.buffer[parser.buffer_pos] == '!' {\n\t\ts = read(parser, s)\n\t} else {\n\t\t// It's either the '!' tag or not really a tag handle.  If it's a %TAG\n\t\t// directive, it's an error.  If it's a tag token, it must be a part of URI.\n\t\tif directive && string(s) != \"!\" {\n\t\t\tyaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\t\tstart_mark, \"did not find expected '!'\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\t*handle = s\n\treturn true\n}\n\n// Scan a tag.\nfunc yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool, head []byte, start_mark yaml_mark_t, uri *[]byte) bool {\n\t//size_t length = head ? strlen((char *)head) : 0\n\tvar s []byte\n\thasTag := len(head) > 0\n\n\t// Copy the head if needed.\n\t//\n\t// Note that we don't copy the leading '!' character.\n\tif len(head) > 1 {\n\t\ts = append(s, head[1:]...)\n\t}\n\n\t// Scan the tag.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\t// The set of characters that may appear in URI is as follows:\n\t//\n\t//      '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&',\n\t//      '=', '+', '$', ',', '.', '!', '~', '*', '\\'', '(', ')', '[', ']',\n\t//      '%'.\n\t// [Go] Convert this into more reasonable logic.\n\tfor is_alpha(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == ';' ||\n\t\tparser.buffer[parser.buffer_pos] == '/' || parser.buffer[parser.buffer_pos] == '?' ||\n\t\tparser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == '@' ||\n\t\tparser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '=' ||\n\t\tparser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '$' ||\n\t\tparser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '.' ||\n\t\tparser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '~' ||\n\t\tparser.buffer[parser.buffer_pos] == '*' || parser.buffer[parser.buffer_pos] == '\\'' ||\n\t\tparser.buffer[parser.buffer_pos] == '(' || parser.buffer[parser.buffer_pos] == ')' ||\n\t\tparser.buffer[parser.buffer_pos] == '[' || parser.buffer[parser.buffer_pos] == ']' ||\n\t\tparser.buffer[parser.buffer_pos] == '%' {\n\t\t// Check if it is a URI-escape sequence.\n\t\tif parser.buffer[parser.buffer_pos] == '%' {\n\t\t\tif !yaml_parser_scan_uri_escapes(parser, directive, start_mark, &s) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\ts = read(parser, s)\n\t\t}\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t\thasTag = true\n\t}\n\n\tif !hasTag {\n\t\tyaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\tstart_mark, \"did not find expected tag URI\")\n\t\treturn false\n\t}\n\t*uri = s\n\treturn true\n}\n\n// Decode an URI-escape sequence corresponding to a single UTF-8 character.\nfunc yaml_parser_scan_uri_escapes(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, s *[]byte) bool {\n\n\t// Decode the required number of characters.\n\tw := 1024\n\tfor w > 0 {\n\t\t// Check for a URI-escaped octet.\n\t\tif parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) {\n\t\t\treturn false\n\t\t}\n\n\t\tif !(parser.buffer[parser.buffer_pos] == '%' &&\n\t\t\tis_hex(parser.buffer, parser.buffer_pos+1) &&\n\t\t\tis_hex(parser.buffer, parser.buffer_pos+2)) {\n\t\t\treturn yaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\t\tstart_mark, \"did not find URI escaped octet\")\n\t\t}\n\n\t\t// Get the octet.\n\t\toctet := byte((as_hex(parser.buffer, parser.buffer_pos+1) << 4) + as_hex(parser.buffer, parser.buffer_pos+2))\n\n\t\t// If it is the leading octet, determine the length of the UTF-8 sequence.\n\t\tif w == 1024 {\n\t\t\tw = width(octet)\n\t\t\tif w == 0 {\n\t\t\t\treturn yaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\t\t\tstart_mark, \"found an incorrect leading UTF-8 octet\")\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if the trailing octet is correct.\n\t\t\tif octet&0xC0 != 0x80 {\n\t\t\t\treturn yaml_parser_set_scanner_tag_error(parser, directive,\n\t\t\t\t\tstart_mark, \"found an incorrect trailing UTF-8 octet\")\n\t\t\t}\n\t\t}\n\n\t\t// Copy the octet and move the pointers.\n\t\t*s = append(*s, octet)\n\t\tskip(parser)\n\t\tskip(parser)\n\t\tskip(parser)\n\t\tw--\n\t}\n\treturn true\n}\n\n// Scan a block scalar.\nfunc yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, literal bool) bool {\n\t// Eat the indicator '|' or '>'.\n\tstart_mark := parser.mark\n\tskip(parser)\n\n\t// Scan the additional block scalar indicators.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\n\t// Check for a chomping indicator.\n\tvar chomping, increment int\n\tif parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' {\n\t\t// Set the chomping method and eat the indicator.\n\t\tif parser.buffer[parser.buffer_pos] == '+' {\n\t\t\tchomping = +1\n\t\t} else {\n\t\t\tchomping = -1\n\t\t}\n\t\tskip(parser)\n\n\t\t// Check for an indentation indicator.\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t\tif is_digit(parser.buffer, parser.buffer_pos) {\n\t\t\t// Check that the indentation is greater than 0.\n\t\t\tif parser.buffer[parser.buffer_pos] == '0' {\n\t\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a block scalar\",\n\t\t\t\t\tstart_mark, \"found an indentation indicator equal to 0\")\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t// Get the indentation level and eat the indicator.\n\t\t\tincrement = as_digit(parser.buffer, parser.buffer_pos)\n\t\t\tskip(parser)\n\t\t}\n\n\t} else if is_digit(parser.buffer, parser.buffer_pos) {\n\t\t// Do the same as above, but in the opposite order.\n\n\t\tif parser.buffer[parser.buffer_pos] == '0' {\n\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a block scalar\",\n\t\t\t\tstart_mark, \"found an indentation indicator equal to 0\")\n\t\t\treturn false\n\t\t}\n\t\tincrement = as_digit(parser.buffer, parser.buffer_pos)\n\t\tskip(parser)\n\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t\tif parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' {\n\t\t\tif parser.buffer[parser.buffer_pos] == '+' {\n\t\t\t\tchomping = +1\n\t\t\t} else {\n\t\t\t\tchomping = -1\n\t\t\t}\n\t\t\tskip(parser)\n\t\t}\n\t}\n\n\t// Eat whitespaces and comments to the end of the line.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tfor is_blank(parser.buffer, parser.buffer_pos) {\n\t\tskip(parser)\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif parser.buffer[parser.buffer_pos] == '#' {\n\t\tfor !is_breakz(parser.buffer, parser.buffer_pos) {\n\t\t\tskip(parser)\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check if we are at the end of the line.\n\tif !is_breakz(parser.buffer, parser.buffer_pos) {\n\t\tyaml_parser_set_scanner_error(parser, \"while scanning a block scalar\",\n\t\t\tstart_mark, \"did not find expected comment or line break\")\n\t\treturn false\n\t}\n\n\t// Eat a line break.\n\tif is_break(parser.buffer, parser.buffer_pos) {\n\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\treturn false\n\t\t}\n\t\tskip_line(parser)\n\t}\n\n\tend_mark := parser.mark\n\n\t// Set the indentation level if it was specified.\n\tvar indent int\n\tif increment > 0 {\n\t\tif parser.indent >= 0 {\n\t\t\tindent = parser.indent + increment\n\t\t} else {\n\t\t\tindent = increment\n\t\t}\n\t}\n\n\t// Scan the leading line breaks and determine the indentation level if needed.\n\tvar s, leading_break, trailing_breaks []byte\n\tif !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) {\n\t\treturn false\n\t}\n\n\t// Scan the block scalar content.\n\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\treturn false\n\t}\n\tvar leading_blank, trailing_blank bool\n\tfor parser.mark.column == indent && !is_z(parser.buffer, parser.buffer_pos) {\n\t\t// We are at the beginning of a non-empty line.\n\n\t\t// Is it a trailing whitespace?\n\t\ttrailing_blank = is_blank(parser.buffer, parser.buffer_pos)\n\n\t\t// Check if we need to fold the leading line break.\n\t\tif !literal && !leading_blank && !trailing_blank && len(leading_break) > 0 && leading_break[0] == '\\n' {\n\t\t\t// Do we need to join the lines by space?\n\t\t\tif len(trailing_breaks) == 0 {\n\t\t\t\ts = append(s, ' ')\n\t\t\t}\n\t\t} else {\n\t\t\ts = append(s, leading_break...)\n\t\t}\n\t\tleading_break = leading_break[:0]\n\n\t\t// Append the remaining line breaks.\n\t\ts = append(s, trailing_breaks...)\n\t\ttrailing_breaks = trailing_breaks[:0]\n\n\t\t// Is it a leading whitespace?\n\t\tleading_blank = is_blank(parser.buffer, parser.buffer_pos)\n\n\t\t// Consume the current line.\n\t\tfor !is_breakz(parser.buffer, parser.buffer_pos) {\n\t\t\ts = read(parser, s)\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Consume the line break.\n\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\treturn false\n\t\t}\n\n\t\tleading_break = read_line(parser, leading_break)\n\n\t\t// Eat the following indentation spaces and line breaks.\n\t\tif !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Chomp the tail.\n\tif chomping != -1 {\n\t\ts = append(s, leading_break...)\n\t}\n\tif chomping == 1 {\n\t\ts = append(s, trailing_breaks...)\n\t}\n\n\t// Create a token.\n\t*token = yaml_token_t{\n\t\ttyp:        yaml_SCALAR_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      s,\n\t\tstyle:      yaml_LITERAL_SCALAR_STYLE,\n\t}\n\tif !literal {\n\t\ttoken.style = yaml_FOLDED_SCALAR_STYLE\n\t}\n\treturn true\n}\n\n// Scan indentation spaces and line breaks for a block scalar.  Determine the\n// indentation level if needed.\nfunc yaml_parser_scan_block_scalar_breaks(parser *yaml_parser_t, indent *int, breaks *[]byte, start_mark yaml_mark_t, end_mark *yaml_mark_t) bool {\n\t*end_mark = parser.mark\n\n\t// Eat the indentation spaces and line breaks.\n\tmax_indent := 0\n\tfor {\n\t\t// Eat the indentation spaces.\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\t\tfor (*indent == 0 || parser.mark.column < *indent) && is_space(parser.buffer, parser.buffer_pos) {\n\t\t\tskip(parser)\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tif parser.mark.column > max_indent {\n\t\t\tmax_indent = parser.mark.column\n\t\t}\n\n\t\t// Check for a tab character messing the indentation.\n\t\tif (*indent == 0 || parser.mark.column < *indent) && is_tab(parser.buffer, parser.buffer_pos) {\n\t\t\treturn yaml_parser_set_scanner_error(parser, \"while scanning a block scalar\",\n\t\t\t\tstart_mark, \"found a tab character where an indentation space is expected\")\n\t\t}\n\n\t\t// Have we found a non-empty line?\n\t\tif !is_break(parser.buffer, parser.buffer_pos) {\n\t\t\tbreak\n\t\t}\n\n\t\t// Consume the line break.\n\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\treturn false\n\t\t}\n\t\t// [Go] Should really be returning breaks instead.\n\t\t*breaks = read_line(parser, *breaks)\n\t\t*end_mark = parser.mark\n\t}\n\n\t// Determine the indentation level if needed.\n\tif *indent == 0 {\n\t\t*indent = max_indent\n\t\tif *indent < parser.indent+1 {\n\t\t\t*indent = parser.indent + 1\n\t\t}\n\t\tif *indent < 1 {\n\t\t\t*indent = 1\n\t\t}\n\t}\n\treturn true\n}\n\n// Scan a quoted scalar.\nfunc yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, single bool) bool {\n\t// Eat the left quote.\n\tstart_mark := parser.mark\n\tskip(parser)\n\n\t// Consume the content of the quoted scalar.\n\tvar s, leading_break, trailing_breaks, whitespaces []byte\n\tfor {\n\t\t// Check that there are no document indicators at the beginning of the line.\n\t\tif parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) {\n\t\t\treturn false\n\t\t}\n\n\t\tif parser.mark.column == 0 &&\n\t\t\t((parser.buffer[parser.buffer_pos+0] == '-' &&\n\t\t\t\tparser.buffer[parser.buffer_pos+1] == '-' &&\n\t\t\t\tparser.buffer[parser.buffer_pos+2] == '-') ||\n\t\t\t\t(parser.buffer[parser.buffer_pos+0] == '.' &&\n\t\t\t\t\tparser.buffer[parser.buffer_pos+1] == '.' &&\n\t\t\t\t\tparser.buffer[parser.buffer_pos+2] == '.')) &&\n\t\t\tis_blankz(parser.buffer, parser.buffer_pos+3) {\n\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a quoted scalar\",\n\t\t\t\tstart_mark, \"found unexpected document indicator\")\n\t\t\treturn false\n\t\t}\n\n\t\t// Check for EOF.\n\t\tif is_z(parser.buffer, parser.buffer_pos) {\n\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a quoted scalar\",\n\t\t\t\tstart_mark, \"found unexpected end of stream\")\n\t\t\treturn false\n\t\t}\n\n\t\t// Consume non-blank characters.\n\t\tleading_blanks := false\n\t\tfor !is_blankz(parser.buffer, parser.buffer_pos) {\n\t\t\tif single && parser.buffer[parser.buffer_pos] == '\\'' && parser.buffer[parser.buffer_pos+1] == '\\'' {\n\t\t\t\t// Is is an escaped single quote.\n\t\t\t\ts = append(s, '\\'')\n\t\t\t\tskip(parser)\n\t\t\t\tskip(parser)\n\n\t\t\t} else if single && parser.buffer[parser.buffer_pos] == '\\'' {\n\t\t\t\t// It is a right single quote.\n\t\t\t\tbreak\n\t\t\t} else if !single && parser.buffer[parser.buffer_pos] == '\"' {\n\t\t\t\t// It is a right double quote.\n\t\t\t\tbreak\n\n\t\t\t} else if !single && parser.buffer[parser.buffer_pos] == '\\\\' && is_break(parser.buffer, parser.buffer_pos+1) {\n\t\t\t\t// It is an escaped line break.\n\t\t\t\tif parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tskip(parser)\n\t\t\t\tskip_line(parser)\n\t\t\t\tleading_blanks = true\n\t\t\t\tbreak\n\n\t\t\t} else if !single && parser.buffer[parser.buffer_pos] == '\\\\' {\n\t\t\t\t// It is an escape sequence.\n\t\t\t\tcode_length := 0\n\n\t\t\t\t// Check the escape character.\n\t\t\t\tswitch parser.buffer[parser.buffer_pos+1] {\n\t\t\t\tcase '0':\n\t\t\t\t\ts = append(s, 0)\n\t\t\t\tcase 'a':\n\t\t\t\t\ts = append(s, '\\x07')\n\t\t\t\tcase 'b':\n\t\t\t\t\ts = append(s, '\\x08')\n\t\t\t\tcase 't', '\\t':\n\t\t\t\t\ts = append(s, '\\x09')\n\t\t\t\tcase 'n':\n\t\t\t\t\ts = append(s, '\\x0A')\n\t\t\t\tcase 'v':\n\t\t\t\t\ts = append(s, '\\x0B')\n\t\t\t\tcase 'f':\n\t\t\t\t\ts = append(s, '\\x0C')\n\t\t\t\tcase 'r':\n\t\t\t\t\ts = append(s, '\\x0D')\n\t\t\t\tcase 'e':\n\t\t\t\t\ts = append(s, '\\x1B')\n\t\t\t\tcase ' ':\n\t\t\t\t\ts = append(s, '\\x20')\n\t\t\t\tcase '\"':\n\t\t\t\t\ts = append(s, '\"')\n\t\t\t\tcase '\\'':\n\t\t\t\t\ts = append(s, '\\'')\n\t\t\t\tcase '\\\\':\n\t\t\t\t\ts = append(s, '\\\\')\n\t\t\t\tcase 'N': // NEL (#x85)\n\t\t\t\t\ts = append(s, '\\xC2')\n\t\t\t\t\ts = append(s, '\\x85')\n\t\t\t\tcase '_': // #xA0\n\t\t\t\t\ts = append(s, '\\xC2')\n\t\t\t\t\ts = append(s, '\\xA0')\n\t\t\t\tcase 'L': // LS (#x2028)\n\t\t\t\t\ts = append(s, '\\xE2')\n\t\t\t\t\ts = append(s, '\\x80')\n\t\t\t\t\ts = append(s, '\\xA8')\n\t\t\t\tcase 'P': // PS (#x2029)\n\t\t\t\t\ts = append(s, '\\xE2')\n\t\t\t\t\ts = append(s, '\\x80')\n\t\t\t\t\ts = append(s, '\\xA9')\n\t\t\t\tcase 'x':\n\t\t\t\t\tcode_length = 2\n\t\t\t\tcase 'u':\n\t\t\t\t\tcode_length = 4\n\t\t\t\tcase 'U':\n\t\t\t\t\tcode_length = 8\n\t\t\t\tdefault:\n\t\t\t\t\tyaml_parser_set_scanner_error(parser, \"while parsing a quoted scalar\",\n\t\t\t\t\t\tstart_mark, \"found unknown escape character\")\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\tskip(parser)\n\t\t\t\tskip(parser)\n\n\t\t\t\t// Consume an arbitrary escape code.\n\t\t\t\tif code_length > 0 {\n\t\t\t\t\tvar value int\n\n\t\t\t\t\t// Scan the character value.\n\t\t\t\t\tif parser.unread < code_length && !yaml_parser_update_buffer(parser, code_length) {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t\tfor k := 0; k < code_length; k++ {\n\t\t\t\t\t\tif !is_hex(parser.buffer, parser.buffer_pos+k) {\n\t\t\t\t\t\t\tyaml_parser_set_scanner_error(parser, \"while parsing a quoted scalar\",\n\t\t\t\t\t\t\t\tstart_mark, \"did not find expected hexdecimal number\")\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue = (value << 4) + as_hex(parser.buffer, parser.buffer_pos+k)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check the value and write the character.\n\t\t\t\t\tif (value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF {\n\t\t\t\t\t\tyaml_parser_set_scanner_error(parser, \"while parsing a quoted scalar\",\n\t\t\t\t\t\t\tstart_mark, \"found invalid Unicode character escape code\")\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t\tif value <= 0x7F {\n\t\t\t\t\t\ts = append(s, byte(value))\n\t\t\t\t\t} else if value <= 0x7FF {\n\t\t\t\t\t\ts = append(s, byte(0xC0+(value>>6)))\n\t\t\t\t\t\ts = append(s, byte(0x80+(value&0x3F)))\n\t\t\t\t\t} else if value <= 0xFFFF {\n\t\t\t\t\t\ts = append(s, byte(0xE0+(value>>12)))\n\t\t\t\t\t\ts = append(s, byte(0x80+((value>>6)&0x3F)))\n\t\t\t\t\t\ts = append(s, byte(0x80+(value&0x3F)))\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts = append(s, byte(0xF0+(value>>18)))\n\t\t\t\t\t\ts = append(s, byte(0x80+((value>>12)&0x3F)))\n\t\t\t\t\t\ts = append(s, byte(0x80+((value>>6)&0x3F)))\n\t\t\t\t\t\ts = append(s, byte(0x80+(value&0x3F)))\n\t\t\t\t\t}\n\n\t\t\t\t\t// Advance the pointer.\n\t\t\t\t\tfor k := 0; k < code_length; k++ {\n\t\t\t\t\t\tskip(parser)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// It is a non-escaped non-blank character.\n\t\t\t\ts = read(parser, s)\n\t\t\t}\n\t\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Check if we are at the end of the scalar.\n\t\tif single {\n\t\t\tif parser.buffer[parser.buffer_pos] == '\\'' {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif parser.buffer[parser.buffer_pos] == '\"' {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// Consume blank characters.\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tfor is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) {\n\t\t\tif is_blank(parser.buffer, parser.buffer_pos) {\n\t\t\t\t// Consume a space or a tab character.\n\t\t\t\tif !leading_blanks {\n\t\t\t\t\twhitespaces = read(parser, whitespaces)\n\t\t\t\t} else {\n\t\t\t\t\tskip(parser)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\t// Check if it is a first line break.\n\t\t\t\tif !leading_blanks {\n\t\t\t\t\twhitespaces = whitespaces[:0]\n\t\t\t\t\tleading_break = read_line(parser, leading_break)\n\t\t\t\t\tleading_blanks = true\n\t\t\t\t} else {\n\t\t\t\t\ttrailing_breaks = read_line(parser, trailing_breaks)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Join the whitespaces or fold line breaks.\n\t\tif leading_blanks {\n\t\t\t// Do we need to fold line breaks?\n\t\t\tif len(leading_break) > 0 && leading_break[0] == '\\n' {\n\t\t\t\tif len(trailing_breaks) == 0 {\n\t\t\t\t\ts = append(s, ' ')\n\t\t\t\t} else {\n\t\t\t\t\ts = append(s, trailing_breaks...)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ts = append(s, leading_break...)\n\t\t\t\ts = append(s, trailing_breaks...)\n\t\t\t}\n\t\t\ttrailing_breaks = trailing_breaks[:0]\n\t\t\tleading_break = leading_break[:0]\n\t\t} else {\n\t\t\ts = append(s, whitespaces...)\n\t\t\twhitespaces = whitespaces[:0]\n\t\t}\n\t}\n\n\t// Eat the right quote.\n\tskip(parser)\n\tend_mark := parser.mark\n\n\t// Create a token.\n\t*token = yaml_token_t{\n\t\ttyp:        yaml_SCALAR_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      s,\n\t\tstyle:      yaml_SINGLE_QUOTED_SCALAR_STYLE,\n\t}\n\tif !single {\n\t\ttoken.style = yaml_DOUBLE_QUOTED_SCALAR_STYLE\n\t}\n\treturn true\n}\n\n// Scan a plain scalar.\nfunc yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) bool {\n\n\tvar s, leading_break, trailing_breaks, whitespaces []byte\n\tvar leading_blanks bool\n\tvar indent = parser.indent + 1\n\n\tstart_mark := parser.mark\n\tend_mark := parser.mark\n\n\t// Consume the content of the plain scalar.\n\tfor {\n\t\t// Check for a document indicator.\n\t\tif parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) {\n\t\t\treturn false\n\t\t}\n\t\tif parser.mark.column == 0 &&\n\t\t\t((parser.buffer[parser.buffer_pos+0] == '-' &&\n\t\t\t\tparser.buffer[parser.buffer_pos+1] == '-' &&\n\t\t\t\tparser.buffer[parser.buffer_pos+2] == '-') ||\n\t\t\t\t(parser.buffer[parser.buffer_pos+0] == '.' &&\n\t\t\t\t\tparser.buffer[parser.buffer_pos+1] == '.' &&\n\t\t\t\t\tparser.buffer[parser.buffer_pos+2] == '.')) &&\n\t\t\tis_blankz(parser.buffer, parser.buffer_pos+3) {\n\t\t\tbreak\n\t\t}\n\n\t\t// Check for a comment.\n\t\tif parser.buffer[parser.buffer_pos] == '#' {\n\t\t\tbreak\n\t\t}\n\n\t\t// Consume non-blank characters.\n\t\tfor !is_blankz(parser.buffer, parser.buffer_pos) {\n\n\t\t\t// Check for 'x:x' in the flow context. TODO: Fix the test \"spec-08-13\".\n\t\t\tif parser.flow_level > 0 &&\n\t\t\t\tparser.buffer[parser.buffer_pos] == ':' &&\n\t\t\t\t!is_blankz(parser.buffer, parser.buffer_pos+1) {\n\t\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a plain scalar\",\n\t\t\t\t\tstart_mark, \"found unexpected ':'\")\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t// Check for indicators that may end a plain scalar.\n\t\t\tif (parser.buffer[parser.buffer_pos] == ':' && is_blankz(parser.buffer, parser.buffer_pos+1)) ||\n\t\t\t\t(parser.flow_level > 0 &&\n\t\t\t\t\t(parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == ':' ||\n\t\t\t\t\t\tparser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == '[' ||\n\t\t\t\t\t\tparser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' ||\n\t\t\t\t\t\tparser.buffer[parser.buffer_pos] == '}')) {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// Check if we need to join whitespaces and breaks.\n\t\t\tif leading_blanks || len(whitespaces) > 0 {\n\t\t\t\tif leading_blanks {\n\t\t\t\t\t// Do we need to fold line breaks?\n\t\t\t\t\tif leading_break[0] == '\\n' {\n\t\t\t\t\t\tif len(trailing_breaks) == 0 {\n\t\t\t\t\t\t\ts = append(s, ' ')\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts = append(s, trailing_breaks...)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts = append(s, leading_break...)\n\t\t\t\t\t\ts = append(s, trailing_breaks...)\n\t\t\t\t\t}\n\t\t\t\t\ttrailing_breaks = trailing_breaks[:0]\n\t\t\t\t\tleading_break = leading_break[:0]\n\t\t\t\t\tleading_blanks = false\n\t\t\t\t} else {\n\t\t\t\t\ts = append(s, whitespaces...)\n\t\t\t\t\twhitespaces = whitespaces[:0]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Copy the character.\n\t\t\ts = read(parser, s)\n\n\t\t\tend_mark = parser.mark\n\t\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Is it the end?\n\t\tif !(is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos)) {\n\t\t\tbreak\n\t\t}\n\n\t\t// Consume blank characters.\n\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\treturn false\n\t\t}\n\n\t\tfor is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) {\n\t\t\tif is_blank(parser.buffer, parser.buffer_pos) {\n\n\t\t\t\t// Check for tab character that abuse indentation.\n\t\t\t\tif leading_blanks && parser.mark.column < indent && is_tab(parser.buffer, parser.buffer_pos) {\n\t\t\t\t\tyaml_parser_set_scanner_error(parser, \"while scanning a plain scalar\",\n\t\t\t\t\t\tstart_mark, \"found a tab character that violate indentation\")\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\t// Consume a space or a tab character.\n\t\t\t\tif !leading_blanks {\n\t\t\t\t\twhitespaces = read(parser, whitespaces)\n\t\t\t\t} else {\n\t\t\t\t\tskip(parser)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\t// Check if it is a first line break.\n\t\t\t\tif !leading_blanks {\n\t\t\t\t\twhitespaces = whitespaces[:0]\n\t\t\t\t\tleading_break = read_line(parser, leading_break)\n\t\t\t\t\tleading_blanks = true\n\t\t\t\t} else {\n\t\t\t\t\ttrailing_breaks = read_line(parser, trailing_breaks)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// Check indentation level.\n\t\tif parser.flow_level == 0 && parser.mark.column < indent {\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Create a token.\n\t*token = yaml_token_t{\n\t\ttyp:        yaml_SCALAR_TOKEN,\n\t\tstart_mark: start_mark,\n\t\tend_mark:   end_mark,\n\t\tvalue:      s,\n\t\tstyle:      yaml_PLAIN_SCALAR_STYLE,\n\t}\n\n\t// Note that we change the 'simple_key_allowed' flag.\n\tif leading_blanks {\n\t\tparser.simple_key_allowed = true\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/sorter.go",
    "content": "package yaml\n\nimport (\n\t\"reflect\"\n\t\"unicode\"\n)\n\ntype keyList []reflect.Value\n\nfunc (l keyList) Len() int      { return len(l) }\nfunc (l keyList) Swap(i, j int) { l[i], l[j] = l[j], l[i] }\nfunc (l keyList) Less(i, j int) bool {\n\ta := l[i]\n\tb := l[j]\n\tak := a.Kind()\n\tbk := b.Kind()\n\tfor (ak == reflect.Interface || ak == reflect.Ptr) && !a.IsNil() {\n\t\ta = a.Elem()\n\t\tak = a.Kind()\n\t}\n\tfor (bk == reflect.Interface || bk == reflect.Ptr) && !b.IsNil() {\n\t\tb = b.Elem()\n\t\tbk = b.Kind()\n\t}\n\taf, aok := keyFloat(a)\n\tbf, bok := keyFloat(b)\n\tif aok && bok {\n\t\tif af != bf {\n\t\t\treturn af < bf\n\t\t}\n\t\tif ak != bk {\n\t\t\treturn ak < bk\n\t\t}\n\t\treturn numLess(a, b)\n\t}\n\tif ak != reflect.String || bk != reflect.String {\n\t\treturn ak < bk\n\t}\n\tar, br := []rune(a.String()), []rune(b.String())\n\tfor i := 0; i < len(ar) && i < len(br); i++ {\n\t\tif ar[i] == br[i] {\n\t\t\tcontinue\n\t\t}\n\t\tal := unicode.IsLetter(ar[i])\n\t\tbl := unicode.IsLetter(br[i])\n\t\tif al && bl {\n\t\t\treturn ar[i] < br[i]\n\t\t}\n\t\tif al || bl {\n\t\t\treturn bl\n\t\t}\n\t\tvar ai, bi int\n\t\tvar an, bn int64\n\t\tfor ai = i; ai < len(ar) && unicode.IsDigit(ar[ai]); ai++ {\n\t\t\tan = an*10 + int64(ar[ai]-'0')\n\t\t}\n\t\tfor bi = i; bi < len(br) && unicode.IsDigit(br[bi]); bi++ {\n\t\t\tbn = bn*10 + int64(br[bi]-'0')\n\t\t}\n\t\tif an != bn {\n\t\t\treturn an < bn\n\t\t}\n\t\tif ai != bi {\n\t\t\treturn ai < bi\n\t\t}\n\t\treturn ar[i] < br[i]\n\t}\n\treturn len(ar) < len(br)\n}\n\n// keyFloat returns a float value for v if it is a number/bool\n// and whether it is a number/bool or not.\nfunc keyFloat(v reflect.Value) (f float64, ok bool) {\n\tswitch v.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn float64(v.Int()), true\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v.Float(), true\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn float64(v.Uint()), true\n\tcase reflect.Bool:\n\t\tif v.Bool() {\n\t\t\treturn 1, true\n\t\t}\n\t\treturn 0, true\n\t}\n\treturn 0, false\n}\n\n// numLess returns whether a < b.\n// a and b must necessarily have the same kind.\nfunc numLess(a, b reflect.Value) bool {\n\tswitch a.Kind() {\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn a.Int() < b.Int()\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn a.Float() < b.Float()\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn a.Uint() < b.Uint()\n\tcase reflect.Bool:\n\t\treturn !a.Bool() && b.Bool()\n\t}\n\tpanic(\"not a number\")\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/writerc.go",
    "content": "package yaml\n\n// Set the writer error and return false.\nfunc yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool {\n\temitter.error = yaml_WRITER_ERROR\n\temitter.problem = problem\n\treturn false\n}\n\n// Flush the output buffer.\nfunc yaml_emitter_flush(emitter *yaml_emitter_t) bool {\n\tif emitter.write_handler == nil {\n\t\tpanic(\"write handler not set\")\n\t}\n\n\t// Check if the buffer is empty.\n\tif emitter.buffer_pos == 0 {\n\t\treturn true\n\t}\n\n\t// If the output encoding is UTF-8, we don't need to recode the buffer.\n\tif emitter.encoding == yaml_UTF8_ENCODING {\n\t\tif err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil {\n\t\t\treturn yaml_emitter_set_writer_error(emitter, \"write error: \"+err.Error())\n\t\t}\n\t\temitter.buffer_pos = 0\n\t\treturn true\n\t}\n\n\t// Recode the buffer into the raw buffer.\n\tvar low, high int\n\tif emitter.encoding == yaml_UTF16LE_ENCODING {\n\t\tlow, high = 0, 1\n\t} else {\n\t\thigh, low = 1, 0\n\t}\n\n\tpos := 0\n\tfor pos < emitter.buffer_pos {\n\t\t// See the \"reader.c\" code for more details on UTF-8 encoding.  Note\n\t\t// that we assume that the buffer contains a valid UTF-8 sequence.\n\n\t\t// Read the next UTF-8 character.\n\t\toctet := emitter.buffer[pos]\n\n\t\tvar w int\n\t\tvar value rune\n\t\tswitch {\n\t\tcase octet&0x80 == 0x00:\n\t\t\tw, value = 1, rune(octet&0x7F)\n\t\tcase octet&0xE0 == 0xC0:\n\t\t\tw, value = 2, rune(octet&0x1F)\n\t\tcase octet&0xF0 == 0xE0:\n\t\t\tw, value = 3, rune(octet&0x0F)\n\t\tcase octet&0xF8 == 0xF0:\n\t\t\tw, value = 4, rune(octet&0x07)\n\t\t}\n\t\tfor k := 1; k < w; k++ {\n\t\t\toctet = emitter.buffer[pos+k]\n\t\t\tvalue = (value << 6) + (rune(octet) & 0x3F)\n\t\t}\n\t\tpos += w\n\n\t\t// Write the character.\n\t\tif value < 0x10000 {\n\t\t\tvar b [2]byte\n\t\t\tb[high] = byte(value >> 8)\n\t\t\tb[low] = byte(value & 0xFF)\n\t\t\temitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1])\n\t\t} else {\n\t\t\t// Write the character using a surrogate pair (check \"reader.c\").\n\t\t\tvar b [4]byte\n\t\t\tvalue -= 0x10000\n\t\t\tb[high] = byte(0xD8 + (value >> 18))\n\t\t\tb[low] = byte((value >> 10) & 0xFF)\n\t\t\tb[high+2] = byte(0xDC + ((value >> 8) & 0xFF))\n\t\t\tb[low+2] = byte(value & 0xFF)\n\t\t\temitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1], b[2], b[3])\n\t\t}\n\t}\n\n\t// Write the raw buffer.\n\tif err := emitter.write_handler(emitter, emitter.raw_buffer); err != nil {\n\t\treturn yaml_emitter_set_writer_error(emitter, \"write error: \"+err.Error())\n\t}\n\temitter.buffer_pos = 0\n\temitter.raw_buffer = emitter.raw_buffer[:0]\n\treturn true\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/yaml.go",
    "content": "// Package yaml implements YAML support for the Go language.\n//\n// Source code and other details for the project are available at GitHub:\n//\n//   https://github.com/go-yaml/yaml\n//\npackage yaml\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strings\"\n\t\"sync\"\n)\n\n// MapSlice encodes and decodes as a YAML map.\n// The order of keys is preserved when encoding and decoding.\ntype MapSlice []MapItem\n\n// MapItem is an item in a MapSlice.\ntype MapItem struct {\n\tKey, Value interface{}\n}\n\n// The Unmarshaler interface may be implemented by types to customize their\n// behavior when being unmarshaled from a YAML document. The UnmarshalYAML\n// method receives a function that may be called to unmarshal the original\n// YAML value into a field or variable. It is safe to call the unmarshal\n// function parameter more than once if necessary.\ntype Unmarshaler interface {\n\tUnmarshalYAML(unmarshal func(interface{}) error) error\n}\n\n// The Marshaler interface may be implemented by types to customize their\n// behavior when being marshaled into a YAML document. The returned value\n// is marshaled in place of the original value implementing Marshaler.\n//\n// If an error is returned by MarshalYAML, the marshaling procedure stops\n// and returns with the provided error.\ntype Marshaler interface {\n\tMarshalYAML() (interface{}, error)\n}\n\n// Unmarshal decodes the first document found within the in byte slice\n// and assigns decoded values into the out value.\n//\n// Maps and pointers (to a struct, string, int, etc) are accepted as out\n// values. If an internal pointer within a struct is not initialized,\n// the yaml package will initialize it if necessary for unmarshalling\n// the provided data. The out parameter must not be nil.\n//\n// The type of the decoded values should be compatible with the respective\n// values in out. If one or more values cannot be decoded due to a type\n// mismatches, decoding continues partially until the end of the YAML\n// content, and a *yaml.TypeError is returned with details for all\n// missed values.\n//\n// Struct fields are only unmarshalled if they are exported (have an\n// upper case first letter), and are unmarshalled using the field name\n// lowercased as the default key. Custom keys may be defined via the\n// \"yaml\" name in the field tag: the content preceding the first comma\n// is used as the key, and the following comma-separated options are\n// used to tweak the marshalling process (see Marshal).\n// Conflicting names result in a runtime error.\n//\n// For example:\n//\n//     type T struct {\n//         F int `yaml:\"a,omitempty\"`\n//         B int\n//     }\n//     var t T\n//     yaml.Unmarshal([]byte(\"a: 1\\nb: 2\"), &t)\n//\n// See the documentation of Marshal for the format of tags and a list of\n// supported tag options.\n//\nfunc Unmarshal(in []byte, out interface{}) (err error) {\n\treturn unmarshal(in, out, false)\n}\n\n// UnmarshalStrict is like Unmarshal except that any fields that are found\n// in the data that do not have corresponding struct members will result in\n// an error.\nfunc UnmarshalStrict(in []byte, out interface{}) (err error) {\n\treturn unmarshal(in, out, true)\n}\n\nfunc unmarshal(in []byte, out interface{}, strict bool) (err error) {\n\tdefer handleErr(&err)\n\td := newDecoder(strict)\n\tp := newParser(in)\n\tdefer p.destroy()\n\tnode := p.parse()\n\tif node != nil {\n\t\tv := reflect.ValueOf(out)\n\t\tif v.Kind() == reflect.Ptr && !v.IsNil() {\n\t\t\tv = v.Elem()\n\t\t}\n\t\td.unmarshal(node, v)\n\t}\n\tif len(d.terrors) > 0 {\n\t\treturn &TypeError{d.terrors}\n\t}\n\treturn nil\n}\n\n// Marshal serializes the value provided into a YAML document. The structure\n// of the generated document will reflect the structure of the value itself.\n// Maps and pointers (to struct, string, int, etc) are accepted as the in value.\n//\n// Struct fields are only unmarshalled if they are exported (have an upper case\n// first letter), and are unmarshalled using the field name lowercased as the\n// default key. Custom keys may be defined via the \"yaml\" name in the field\n// tag: the content preceding the first comma is used as the key, and the\n// following comma-separated options are used to tweak the marshalling process.\n// Conflicting names result in a runtime error.\n//\n// The field tag format accepted is:\n//\n//     `(...) yaml:\"[<key>][,<flag1>[,<flag2>]]\" (...)`\n//\n// The following flags are currently supported:\n//\n//     omitempty    Only include the field if it's not set to the zero\n//                  value for the type or to empty slices or maps.\n//                  Does not apply to zero valued structs.\n//\n//     flow         Marshal using a flow style (useful for structs,\n//                  sequences and maps).\n//\n//     inline       Inline the field, which must be a struct or a map,\n//                  causing all of its fields or keys to be processed as if\n//                  they were part of the outer struct. For maps, keys must\n//                  not conflict with the yaml keys of other struct fields.\n//\n// In addition, if the key is \"-\", the field is ignored.\n//\n// For example:\n//\n//     type T struct {\n//         F int `yaml:\"a,omitempty\"`\n//         B int\n//     }\n//     yaml.Marshal(&T{B: 2}) // Returns \"b: 2\\n\"\n//     yaml.Marshal(&T{F: 1}} // Returns \"a: 1\\nb: 0\\n\"\n//\nfunc Marshal(in interface{}) (out []byte, err error) {\n\tdefer handleErr(&err)\n\te := newEncoder()\n\tdefer e.destroy()\n\te.marshal(\"\", reflect.ValueOf(in))\n\te.finish()\n\tout = e.out\n\treturn\n}\n\nfunc handleErr(err *error) {\n\tif v := recover(); v != nil {\n\t\tif e, ok := v.(yamlError); ok {\n\t\t\t*err = e.err\n\t\t} else {\n\t\t\tpanic(v)\n\t\t}\n\t}\n}\n\ntype yamlError struct {\n\terr error\n}\n\nfunc fail(err error) {\n\tpanic(yamlError{err})\n}\n\nfunc failf(format string, args ...interface{}) {\n\tpanic(yamlError{fmt.Errorf(\"yaml: \"+format, args...)})\n}\n\n// A TypeError is returned by Unmarshal when one or more fields in\n// the YAML document cannot be properly decoded into the requested\n// types. When this error is returned, the value is still\n// unmarshaled partially.\ntype TypeError struct {\n\tErrors []string\n}\n\nfunc (e *TypeError) Error() string {\n\treturn fmt.Sprintf(\"yaml: unmarshal errors:\\n  %s\", strings.Join(e.Errors, \"\\n  \"))\n}\n\n// --------------------------------------------------------------------------\n// Maintain a mapping of keys to structure field indexes\n\n// The code in this section was copied from mgo/bson.\n\n// structInfo holds details for the serialization of fields of\n// a given struct.\ntype structInfo struct {\n\tFieldsMap  map[string]fieldInfo\n\tFieldsList []fieldInfo\n\n\t// InlineMap is the number of the field in the struct that\n\t// contains an ,inline map, or -1 if there's none.\n\tInlineMap int\n}\n\ntype fieldInfo struct {\n\tKey       string\n\tNum       int\n\tOmitEmpty bool\n\tFlow      bool\n\n\t// Inline holds the field index if the field is part of an inlined struct.\n\tInline []int\n}\n\nvar structMap = make(map[reflect.Type]*structInfo)\nvar fieldMapMutex sync.RWMutex\n\nfunc getStructInfo(st reflect.Type) (*structInfo, error) {\n\tfieldMapMutex.RLock()\n\tsinfo, found := structMap[st]\n\tfieldMapMutex.RUnlock()\n\tif found {\n\t\treturn sinfo, nil\n\t}\n\n\tn := st.NumField()\n\tfieldsMap := make(map[string]fieldInfo)\n\tfieldsList := make([]fieldInfo, 0, n)\n\tinlineMap := -1\n\tfor i := 0; i != n; i++ {\n\t\tfield := st.Field(i)\n\t\tif field.PkgPath != \"\" && !field.Anonymous {\n\t\t\tcontinue // Private field\n\t\t}\n\n\t\tinfo := fieldInfo{Num: i}\n\n\t\ttag := field.Tag.Get(\"yaml\")\n\t\tif tag == \"\" && strings.Index(string(field.Tag), \":\") < 0 {\n\t\t\ttag = string(field.Tag)\n\t\t}\n\t\tif tag == \"-\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tinline := false\n\t\tfields := strings.Split(tag, \",\")\n\t\tif len(fields) > 1 {\n\t\t\tfor _, flag := range fields[1:] {\n\t\t\t\tswitch flag {\n\t\t\t\tcase \"omitempty\":\n\t\t\t\t\tinfo.OmitEmpty = true\n\t\t\t\tcase \"flow\":\n\t\t\t\t\tinfo.Flow = true\n\t\t\t\tcase \"inline\":\n\t\t\t\t\tinline = true\n\t\t\t\tdefault:\n\t\t\t\t\treturn nil, errors.New(fmt.Sprintf(\"Unsupported flag %q in tag %q of type %s\", flag, tag, st))\n\t\t\t\t}\n\t\t\t}\n\t\t\ttag = fields[0]\n\t\t}\n\n\t\tif inline {\n\t\t\tswitch field.Type.Kind() {\n\t\t\tcase reflect.Map:\n\t\t\t\tif inlineMap >= 0 {\n\t\t\t\t\treturn nil, errors.New(\"Multiple ,inline maps in struct \" + st.String())\n\t\t\t\t}\n\t\t\t\tif field.Type.Key() != reflect.TypeOf(\"\") {\n\t\t\t\t\treturn nil, errors.New(\"Option ,inline needs a map with string keys in struct \" + st.String())\n\t\t\t\t}\n\t\t\t\tinlineMap = info.Num\n\t\t\tcase reflect.Struct:\n\t\t\t\tsinfo, err := getStructInfo(field.Type)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tfor _, finfo := range sinfo.FieldsList {\n\t\t\t\t\tif _, found := fieldsMap[finfo.Key]; found {\n\t\t\t\t\t\tmsg := \"Duplicated key '\" + finfo.Key + \"' in struct \" + st.String()\n\t\t\t\t\t\treturn nil, errors.New(msg)\n\t\t\t\t\t}\n\t\t\t\t\tif finfo.Inline == nil {\n\t\t\t\t\t\tfinfo.Inline = []int{i, finfo.Num}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfinfo.Inline = append([]int{i}, finfo.Inline...)\n\t\t\t\t\t}\n\t\t\t\t\tfieldsMap[finfo.Key] = finfo\n\t\t\t\t\tfieldsList = append(fieldsList, finfo)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\t//return nil, errors.New(\"Option ,inline needs a struct value or map field\")\n\t\t\t\treturn nil, errors.New(\"Option ,inline needs a struct value field\")\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif tag != \"\" {\n\t\t\tinfo.Key = tag\n\t\t} else {\n\t\t\tinfo.Key = strings.ToLower(field.Name)\n\t\t}\n\n\t\tif _, found = fieldsMap[info.Key]; found {\n\t\t\tmsg := \"Duplicated key '\" + info.Key + \"' in struct \" + st.String()\n\t\t\treturn nil, errors.New(msg)\n\t\t}\n\n\t\tfieldsList = append(fieldsList, info)\n\t\tfieldsMap[info.Key] = info\n\t}\n\n\tsinfo = &structInfo{fieldsMap, fieldsList, inlineMap}\n\n\tfieldMapMutex.Lock()\n\tstructMap[st] = sinfo\n\tfieldMapMutex.Unlock()\n\treturn sinfo, nil\n}\n\nfunc isZero(v reflect.Value) bool {\n\tswitch v.Kind() {\n\tcase reflect.String:\n\t\treturn len(v.String()) == 0\n\tcase reflect.Interface, reflect.Ptr:\n\t\treturn v.IsNil()\n\tcase reflect.Slice:\n\t\treturn v.Len() == 0\n\tcase reflect.Map:\n\t\treturn v.Len() == 0\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn v.Int() == 0\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v.Float() == 0\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn v.Uint() == 0\n\tcase reflect.Bool:\n\t\treturn !v.Bool()\n\tcase reflect.Struct:\n\t\tvt := v.Type()\n\t\tfor i := v.NumField() - 1; i >= 0; i-- {\n\t\t\tif vt.Field(i).PkgPath != \"\" {\n\t\t\t\tcontinue // Private field\n\t\t\t}\n\t\t\tif !isZero(v.Field(i)) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/yamlh.go",
    "content": "package yaml\n\nimport (\n\t\"io\"\n)\n\n// The version directive data.\ntype yaml_version_directive_t struct {\n\tmajor int8 // The major version number.\n\tminor int8 // The minor version number.\n}\n\n// The tag directive data.\ntype yaml_tag_directive_t struct {\n\thandle []byte // The tag handle.\n\tprefix []byte // The tag prefix.\n}\n\ntype yaml_encoding_t int\n\n// The stream encoding.\nconst (\n\t// Let the parser choose the encoding.\n\tyaml_ANY_ENCODING yaml_encoding_t = iota\n\n\tyaml_UTF8_ENCODING    // The default UTF-8 encoding.\n\tyaml_UTF16LE_ENCODING // The UTF-16-LE encoding with BOM.\n\tyaml_UTF16BE_ENCODING // The UTF-16-BE encoding with BOM.\n)\n\ntype yaml_break_t int\n\n// Line break types.\nconst (\n\t// Let the parser choose the break type.\n\tyaml_ANY_BREAK yaml_break_t = iota\n\n\tyaml_CR_BREAK   // Use CR for line breaks (Mac style).\n\tyaml_LN_BREAK   // Use LN for line breaks (Unix style).\n\tyaml_CRLN_BREAK // Use CR LN for line breaks (DOS style).\n)\n\ntype yaml_error_type_t int\n\n// Many bad things could happen with the parser and emitter.\nconst (\n\t// No error is produced.\n\tyaml_NO_ERROR yaml_error_type_t = iota\n\n\tyaml_MEMORY_ERROR   // Cannot allocate or reallocate a block of memory.\n\tyaml_READER_ERROR   // Cannot read or decode the input stream.\n\tyaml_SCANNER_ERROR  // Cannot scan the input stream.\n\tyaml_PARSER_ERROR   // Cannot parse the input stream.\n\tyaml_COMPOSER_ERROR // Cannot compose a YAML document.\n\tyaml_WRITER_ERROR   // Cannot write to the output stream.\n\tyaml_EMITTER_ERROR  // Cannot emit a YAML stream.\n)\n\n// The pointer position.\ntype yaml_mark_t struct {\n\tindex  int // The position index.\n\tline   int // The position line.\n\tcolumn int // The position column.\n}\n\n// Node Styles\n\ntype yaml_style_t int8\n\ntype yaml_scalar_style_t yaml_style_t\n\n// Scalar styles.\nconst (\n\t// Let the emitter choose the style.\n\tyaml_ANY_SCALAR_STYLE yaml_scalar_style_t = iota\n\n\tyaml_PLAIN_SCALAR_STYLE         // The plain scalar style.\n\tyaml_SINGLE_QUOTED_SCALAR_STYLE // The single-quoted scalar style.\n\tyaml_DOUBLE_QUOTED_SCALAR_STYLE // The double-quoted scalar style.\n\tyaml_LITERAL_SCALAR_STYLE       // The literal scalar style.\n\tyaml_FOLDED_SCALAR_STYLE        // The folded scalar style.\n)\n\ntype yaml_sequence_style_t yaml_style_t\n\n// Sequence styles.\nconst (\n\t// Let the emitter choose the style.\n\tyaml_ANY_SEQUENCE_STYLE yaml_sequence_style_t = iota\n\n\tyaml_BLOCK_SEQUENCE_STYLE // The block sequence style.\n\tyaml_FLOW_SEQUENCE_STYLE  // The flow sequence style.\n)\n\ntype yaml_mapping_style_t yaml_style_t\n\n// Mapping styles.\nconst (\n\t// Let the emitter choose the style.\n\tyaml_ANY_MAPPING_STYLE yaml_mapping_style_t = iota\n\n\tyaml_BLOCK_MAPPING_STYLE // The block mapping style.\n\tyaml_FLOW_MAPPING_STYLE  // The flow mapping style.\n)\n\n// Tokens\n\ntype yaml_token_type_t int\n\n// Token types.\nconst (\n\t// An empty token.\n\tyaml_NO_TOKEN yaml_token_type_t = iota\n\n\tyaml_STREAM_START_TOKEN // A STREAM-START token.\n\tyaml_STREAM_END_TOKEN   // A STREAM-END token.\n\n\tyaml_VERSION_DIRECTIVE_TOKEN // A VERSION-DIRECTIVE token.\n\tyaml_TAG_DIRECTIVE_TOKEN     // A TAG-DIRECTIVE token.\n\tyaml_DOCUMENT_START_TOKEN    // A DOCUMENT-START token.\n\tyaml_DOCUMENT_END_TOKEN      // A DOCUMENT-END token.\n\n\tyaml_BLOCK_SEQUENCE_START_TOKEN // A BLOCK-SEQUENCE-START token.\n\tyaml_BLOCK_MAPPING_START_TOKEN  // A BLOCK-SEQUENCE-END token.\n\tyaml_BLOCK_END_TOKEN            // A BLOCK-END token.\n\n\tyaml_FLOW_SEQUENCE_START_TOKEN // A FLOW-SEQUENCE-START token.\n\tyaml_FLOW_SEQUENCE_END_TOKEN   // A FLOW-SEQUENCE-END token.\n\tyaml_FLOW_MAPPING_START_TOKEN  // A FLOW-MAPPING-START token.\n\tyaml_FLOW_MAPPING_END_TOKEN    // A FLOW-MAPPING-END token.\n\n\tyaml_BLOCK_ENTRY_TOKEN // A BLOCK-ENTRY token.\n\tyaml_FLOW_ENTRY_TOKEN  // A FLOW-ENTRY token.\n\tyaml_KEY_TOKEN         // A KEY token.\n\tyaml_VALUE_TOKEN       // A VALUE token.\n\n\tyaml_ALIAS_TOKEN  // An ALIAS token.\n\tyaml_ANCHOR_TOKEN // An ANCHOR token.\n\tyaml_TAG_TOKEN    // A TAG token.\n\tyaml_SCALAR_TOKEN // A SCALAR token.\n)\n\nfunc (tt yaml_token_type_t) String() string {\n\tswitch tt {\n\tcase yaml_NO_TOKEN:\n\t\treturn \"yaml_NO_TOKEN\"\n\tcase yaml_STREAM_START_TOKEN:\n\t\treturn \"yaml_STREAM_START_TOKEN\"\n\tcase yaml_STREAM_END_TOKEN:\n\t\treturn \"yaml_STREAM_END_TOKEN\"\n\tcase yaml_VERSION_DIRECTIVE_TOKEN:\n\t\treturn \"yaml_VERSION_DIRECTIVE_TOKEN\"\n\tcase yaml_TAG_DIRECTIVE_TOKEN:\n\t\treturn \"yaml_TAG_DIRECTIVE_TOKEN\"\n\tcase yaml_DOCUMENT_START_TOKEN:\n\t\treturn \"yaml_DOCUMENT_START_TOKEN\"\n\tcase yaml_DOCUMENT_END_TOKEN:\n\t\treturn \"yaml_DOCUMENT_END_TOKEN\"\n\tcase yaml_BLOCK_SEQUENCE_START_TOKEN:\n\t\treturn \"yaml_BLOCK_SEQUENCE_START_TOKEN\"\n\tcase yaml_BLOCK_MAPPING_START_TOKEN:\n\t\treturn \"yaml_BLOCK_MAPPING_START_TOKEN\"\n\tcase yaml_BLOCK_END_TOKEN:\n\t\treturn \"yaml_BLOCK_END_TOKEN\"\n\tcase yaml_FLOW_SEQUENCE_START_TOKEN:\n\t\treturn \"yaml_FLOW_SEQUENCE_START_TOKEN\"\n\tcase yaml_FLOW_SEQUENCE_END_TOKEN:\n\t\treturn \"yaml_FLOW_SEQUENCE_END_TOKEN\"\n\tcase yaml_FLOW_MAPPING_START_TOKEN:\n\t\treturn \"yaml_FLOW_MAPPING_START_TOKEN\"\n\tcase yaml_FLOW_MAPPING_END_TOKEN:\n\t\treturn \"yaml_FLOW_MAPPING_END_TOKEN\"\n\tcase yaml_BLOCK_ENTRY_TOKEN:\n\t\treturn \"yaml_BLOCK_ENTRY_TOKEN\"\n\tcase yaml_FLOW_ENTRY_TOKEN:\n\t\treturn \"yaml_FLOW_ENTRY_TOKEN\"\n\tcase yaml_KEY_TOKEN:\n\t\treturn \"yaml_KEY_TOKEN\"\n\tcase yaml_VALUE_TOKEN:\n\t\treturn \"yaml_VALUE_TOKEN\"\n\tcase yaml_ALIAS_TOKEN:\n\t\treturn \"yaml_ALIAS_TOKEN\"\n\tcase yaml_ANCHOR_TOKEN:\n\t\treturn \"yaml_ANCHOR_TOKEN\"\n\tcase yaml_TAG_TOKEN:\n\t\treturn \"yaml_TAG_TOKEN\"\n\tcase yaml_SCALAR_TOKEN:\n\t\treturn \"yaml_SCALAR_TOKEN\"\n\t}\n\treturn \"<unknown token>\"\n}\n\n// The token structure.\ntype yaml_token_t struct {\n\t// The token type.\n\ttyp yaml_token_type_t\n\n\t// The start/end of the token.\n\tstart_mark, end_mark yaml_mark_t\n\n\t// The stream encoding (for yaml_STREAM_START_TOKEN).\n\tencoding yaml_encoding_t\n\n\t// The alias/anchor/scalar value or tag/tag directive handle\n\t// (for yaml_ALIAS_TOKEN, yaml_ANCHOR_TOKEN, yaml_SCALAR_TOKEN, yaml_TAG_TOKEN, yaml_TAG_DIRECTIVE_TOKEN).\n\tvalue []byte\n\n\t// The tag suffix (for yaml_TAG_TOKEN).\n\tsuffix []byte\n\n\t// The tag directive prefix (for yaml_TAG_DIRECTIVE_TOKEN).\n\tprefix []byte\n\n\t// The scalar style (for yaml_SCALAR_TOKEN).\n\tstyle yaml_scalar_style_t\n\n\t// The version directive major/minor (for yaml_VERSION_DIRECTIVE_TOKEN).\n\tmajor, minor int8\n}\n\n// Events\n\ntype yaml_event_type_t int8\n\n// Event types.\nconst (\n\t// An empty event.\n\tyaml_NO_EVENT yaml_event_type_t = iota\n\n\tyaml_STREAM_START_EVENT   // A STREAM-START event.\n\tyaml_STREAM_END_EVENT     // A STREAM-END event.\n\tyaml_DOCUMENT_START_EVENT // A DOCUMENT-START event.\n\tyaml_DOCUMENT_END_EVENT   // A DOCUMENT-END event.\n\tyaml_ALIAS_EVENT          // An ALIAS event.\n\tyaml_SCALAR_EVENT         // A SCALAR event.\n\tyaml_SEQUENCE_START_EVENT // A SEQUENCE-START event.\n\tyaml_SEQUENCE_END_EVENT   // A SEQUENCE-END event.\n\tyaml_MAPPING_START_EVENT  // A MAPPING-START event.\n\tyaml_MAPPING_END_EVENT    // A MAPPING-END event.\n)\n\n// The event structure.\ntype yaml_event_t struct {\n\n\t// The event type.\n\ttyp yaml_event_type_t\n\n\t// The start and end of the event.\n\tstart_mark, end_mark yaml_mark_t\n\n\t// The document encoding (for yaml_STREAM_START_EVENT).\n\tencoding yaml_encoding_t\n\n\t// The version directive (for yaml_DOCUMENT_START_EVENT).\n\tversion_directive *yaml_version_directive_t\n\n\t// The list of tag directives (for yaml_DOCUMENT_START_EVENT).\n\ttag_directives []yaml_tag_directive_t\n\n\t// The anchor (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_ALIAS_EVENT).\n\tanchor []byte\n\n\t// The tag (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT).\n\ttag []byte\n\n\t// The scalar value (for yaml_SCALAR_EVENT).\n\tvalue []byte\n\n\t// Is the document start/end indicator implicit, or the tag optional?\n\t// (for yaml_DOCUMENT_START_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_SCALAR_EVENT).\n\timplicit bool\n\n\t// Is the tag optional for any non-plain style? (for yaml_SCALAR_EVENT).\n\tquoted_implicit bool\n\n\t// The style (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT).\n\tstyle yaml_style_t\n}\n\nfunc (e *yaml_event_t) scalar_style() yaml_scalar_style_t     { return yaml_scalar_style_t(e.style) }\nfunc (e *yaml_event_t) sequence_style() yaml_sequence_style_t { return yaml_sequence_style_t(e.style) }\nfunc (e *yaml_event_t) mapping_style() yaml_mapping_style_t   { return yaml_mapping_style_t(e.style) }\n\n// Nodes\n\nconst (\n\tyaml_NULL_TAG      = \"tag:yaml.org,2002:null\"      // The tag !!null with the only possible value: null.\n\tyaml_BOOL_TAG      = \"tag:yaml.org,2002:bool\"      // The tag !!bool with the values: true and false.\n\tyaml_STR_TAG       = \"tag:yaml.org,2002:str\"       // The tag !!str for string values.\n\tyaml_INT_TAG       = \"tag:yaml.org,2002:int\"       // The tag !!int for integer values.\n\tyaml_FLOAT_TAG     = \"tag:yaml.org,2002:float\"     // The tag !!float for float values.\n\tyaml_TIMESTAMP_TAG = \"tag:yaml.org,2002:timestamp\" // The tag !!timestamp for date and time values.\n\n\tyaml_SEQ_TAG = \"tag:yaml.org,2002:seq\" // The tag !!seq is used to denote sequences.\n\tyaml_MAP_TAG = \"tag:yaml.org,2002:map\" // The tag !!map is used to denote mapping.\n\n\t// Not in original libyaml.\n\tyaml_BINARY_TAG = \"tag:yaml.org,2002:binary\"\n\tyaml_MERGE_TAG  = \"tag:yaml.org,2002:merge\"\n\n\tyaml_DEFAULT_SCALAR_TAG   = yaml_STR_TAG // The default scalar tag is !!str.\n\tyaml_DEFAULT_SEQUENCE_TAG = yaml_SEQ_TAG // The default sequence tag is !!seq.\n\tyaml_DEFAULT_MAPPING_TAG  = yaml_MAP_TAG // The default mapping tag is !!map.\n)\n\ntype yaml_node_type_t int\n\n// Node types.\nconst (\n\t// An empty node.\n\tyaml_NO_NODE yaml_node_type_t = iota\n\n\tyaml_SCALAR_NODE   // A scalar node.\n\tyaml_SEQUENCE_NODE // A sequence node.\n\tyaml_MAPPING_NODE  // A mapping node.\n)\n\n// An element of a sequence node.\ntype yaml_node_item_t int\n\n// An element of a mapping node.\ntype yaml_node_pair_t struct {\n\tkey   int // The key of the element.\n\tvalue int // The value of the element.\n}\n\n// The node structure.\ntype yaml_node_t struct {\n\ttyp yaml_node_type_t // The node type.\n\ttag []byte           // The node tag.\n\n\t// The node data.\n\n\t// The scalar parameters (for yaml_SCALAR_NODE).\n\tscalar struct {\n\t\tvalue  []byte              // The scalar value.\n\t\tlength int                 // The length of the scalar value.\n\t\tstyle  yaml_scalar_style_t // The scalar style.\n\t}\n\n\t// The sequence parameters (for YAML_SEQUENCE_NODE).\n\tsequence struct {\n\t\titems_data []yaml_node_item_t    // The stack of sequence items.\n\t\tstyle      yaml_sequence_style_t // The sequence style.\n\t}\n\n\t// The mapping parameters (for yaml_MAPPING_NODE).\n\tmapping struct {\n\t\tpairs_data  []yaml_node_pair_t   // The stack of mapping pairs (key, value).\n\t\tpairs_start *yaml_node_pair_t    // The beginning of the stack.\n\t\tpairs_end   *yaml_node_pair_t    // The end of the stack.\n\t\tpairs_top   *yaml_node_pair_t    // The top of the stack.\n\t\tstyle       yaml_mapping_style_t // The mapping style.\n\t}\n\n\tstart_mark yaml_mark_t // The beginning of the node.\n\tend_mark   yaml_mark_t // The end of the node.\n\n}\n\n// The document structure.\ntype yaml_document_t struct {\n\n\t// The document nodes.\n\tnodes []yaml_node_t\n\n\t// The version directive.\n\tversion_directive *yaml_version_directive_t\n\n\t// The list of tag directives.\n\ttag_directives_data  []yaml_tag_directive_t\n\ttag_directives_start int // The beginning of the tag directives list.\n\ttag_directives_end   int // The end of the tag directives list.\n\n\tstart_implicit int // Is the document start indicator implicit?\n\tend_implicit   int // Is the document end indicator implicit?\n\n\t// The start/end of the document.\n\tstart_mark, end_mark yaml_mark_t\n}\n\n// The prototype of a read handler.\n//\n// The read handler is called when the parser needs to read more bytes from the\n// source. The handler should write not more than size bytes to the buffer.\n// The number of written bytes should be set to the size_read variable.\n//\n// [in,out]   data        A pointer to an application data specified by\n//                        yaml_parser_set_input().\n// [out]      buffer      The buffer to write the data from the source.\n// [in]       size        The size of the buffer.\n// [out]      size_read   The actual number of bytes read from the source.\n//\n// On success, the handler should return 1.  If the handler failed,\n// the returned value should be 0. On EOF, the handler should set the\n// size_read to 0 and return 1.\ntype yaml_read_handler_t func(parser *yaml_parser_t, buffer []byte) (n int, err error)\n\n// This structure holds information about a potential simple key.\ntype yaml_simple_key_t struct {\n\tpossible     bool        // Is a simple key possible?\n\trequired     bool        // Is a simple key required?\n\ttoken_number int         // The number of the token.\n\tmark         yaml_mark_t // The position mark.\n}\n\n// The states of the parser.\ntype yaml_parser_state_t int\n\nconst (\n\tyaml_PARSE_STREAM_START_STATE yaml_parser_state_t = iota\n\n\tyaml_PARSE_IMPLICIT_DOCUMENT_START_STATE           // Expect the beginning of an implicit document.\n\tyaml_PARSE_DOCUMENT_START_STATE                    // Expect DOCUMENT-START.\n\tyaml_PARSE_DOCUMENT_CONTENT_STATE                  // Expect the content of a document.\n\tyaml_PARSE_DOCUMENT_END_STATE                      // Expect DOCUMENT-END.\n\tyaml_PARSE_BLOCK_NODE_STATE                        // Expect a block node.\n\tyaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE // Expect a block node or indentless sequence.\n\tyaml_PARSE_FLOW_NODE_STATE                         // Expect a flow node.\n\tyaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE        // Expect the first entry of a block sequence.\n\tyaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE              // Expect an entry of a block sequence.\n\tyaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE         // Expect an entry of an indentless sequence.\n\tyaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE           // Expect the first key of a block mapping.\n\tyaml_PARSE_BLOCK_MAPPING_KEY_STATE                 // Expect a block mapping key.\n\tyaml_PARSE_BLOCK_MAPPING_VALUE_STATE               // Expect a block mapping value.\n\tyaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE         // Expect the first entry of a flow sequence.\n\tyaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE               // Expect an entry of a flow sequence.\n\tyaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE   // Expect a key of an ordered mapping.\n\tyaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE // Expect a value of an ordered mapping.\n\tyaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE   // Expect the and of an ordered mapping entry.\n\tyaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE            // Expect the first key of a flow mapping.\n\tyaml_PARSE_FLOW_MAPPING_KEY_STATE                  // Expect a key of a flow mapping.\n\tyaml_PARSE_FLOW_MAPPING_VALUE_STATE                // Expect a value of a flow mapping.\n\tyaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE          // Expect an empty value of a flow mapping.\n\tyaml_PARSE_END_STATE                               // Expect nothing.\n)\n\nfunc (ps yaml_parser_state_t) String() string {\n\tswitch ps {\n\tcase yaml_PARSE_STREAM_START_STATE:\n\t\treturn \"yaml_PARSE_STREAM_START_STATE\"\n\tcase yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE:\n\t\treturn \"yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE\"\n\tcase yaml_PARSE_DOCUMENT_START_STATE:\n\t\treturn \"yaml_PARSE_DOCUMENT_START_STATE\"\n\tcase yaml_PARSE_DOCUMENT_CONTENT_STATE:\n\t\treturn \"yaml_PARSE_DOCUMENT_CONTENT_STATE\"\n\tcase yaml_PARSE_DOCUMENT_END_STATE:\n\t\treturn \"yaml_PARSE_DOCUMENT_END_STATE\"\n\tcase yaml_PARSE_BLOCK_NODE_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_NODE_STATE\"\n\tcase yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE\"\n\tcase yaml_PARSE_FLOW_NODE_STATE:\n\t\treturn \"yaml_PARSE_FLOW_NODE_STATE\"\n\tcase yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE\"\n\tcase yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE\"\n\tcase yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE:\n\t\treturn \"yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE\"\n\tcase yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE\"\n\tcase yaml_PARSE_BLOCK_MAPPING_KEY_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_MAPPING_KEY_STATE\"\n\tcase yaml_PARSE_BLOCK_MAPPING_VALUE_STATE:\n\t\treturn \"yaml_PARSE_BLOCK_MAPPING_VALUE_STATE\"\n\tcase yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE:\n\t\treturn \"yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE\"\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE:\n\t\treturn \"yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE\"\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE:\n\t\treturn \"yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE\"\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE:\n\t\treturn \"yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE\"\n\tcase yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE:\n\t\treturn \"yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE\"\n\tcase yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE:\n\t\treturn \"yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE\"\n\tcase yaml_PARSE_FLOW_MAPPING_KEY_STATE:\n\t\treturn \"yaml_PARSE_FLOW_MAPPING_KEY_STATE\"\n\tcase yaml_PARSE_FLOW_MAPPING_VALUE_STATE:\n\t\treturn \"yaml_PARSE_FLOW_MAPPING_VALUE_STATE\"\n\tcase yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE:\n\t\treturn \"yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE\"\n\tcase yaml_PARSE_END_STATE:\n\t\treturn \"yaml_PARSE_END_STATE\"\n\t}\n\treturn \"<unknown parser state>\"\n}\n\n// This structure holds aliases data.\ntype yaml_alias_data_t struct {\n\tanchor []byte      // The anchor.\n\tindex  int         // The node id.\n\tmark   yaml_mark_t // The anchor mark.\n}\n\n// The parser structure.\n//\n// All members are internal. Manage the structure using the\n// yaml_parser_ family of functions.\ntype yaml_parser_t struct {\n\n\t// Error handling\n\n\terror yaml_error_type_t // Error type.\n\n\tproblem string // Error description.\n\n\t// The byte about which the problem occurred.\n\tproblem_offset int\n\tproblem_value  int\n\tproblem_mark   yaml_mark_t\n\n\t// The error context.\n\tcontext      string\n\tcontext_mark yaml_mark_t\n\n\t// Reader stuff\n\n\tread_handler yaml_read_handler_t // Read handler.\n\n\tinput_file io.Reader // File input data.\n\tinput      []byte    // String input data.\n\tinput_pos  int\n\n\teof bool // EOF flag\n\n\tbuffer     []byte // The working buffer.\n\tbuffer_pos int    // The current position of the buffer.\n\n\tunread int // The number of unread characters in the buffer.\n\n\traw_buffer     []byte // The raw buffer.\n\traw_buffer_pos int    // The current position of the buffer.\n\n\tencoding yaml_encoding_t // The input encoding.\n\n\toffset int         // The offset of the current position (in bytes).\n\tmark   yaml_mark_t // The mark of the current position.\n\n\t// Scanner stuff\n\n\tstream_start_produced bool // Have we started to scan the input stream?\n\tstream_end_produced   bool // Have we reached the end of the input stream?\n\n\tflow_level int // The number of unclosed '[' and '{' indicators.\n\n\ttokens          []yaml_token_t // The tokens queue.\n\ttokens_head     int            // The head of the tokens queue.\n\ttokens_parsed   int            // The number of tokens fetched from the queue.\n\ttoken_available bool           // Does the tokens queue contain a token ready for dequeueing.\n\n\tindent  int   // The current indentation level.\n\tindents []int // The indentation levels stack.\n\n\tsimple_key_allowed bool                // May a simple key occur at the current position?\n\tsimple_keys        []yaml_simple_key_t // The stack of simple keys.\n\n\t// Parser stuff\n\n\tstate          yaml_parser_state_t    // The current parser state.\n\tstates         []yaml_parser_state_t  // The parser states stack.\n\tmarks          []yaml_mark_t          // The stack of marks.\n\ttag_directives []yaml_tag_directive_t // The list of TAG directives.\n\n\t// Dumper stuff\n\n\taliases []yaml_alias_data_t // The alias data.\n\n\tdocument *yaml_document_t // The currently parsed document.\n}\n\n// Emitter Definitions\n\n// The prototype of a write handler.\n//\n// The write handler is called when the emitter needs to flush the accumulated\n// characters to the output.  The handler should write @a size bytes of the\n// @a buffer to the output.\n//\n// @param[in,out]   data        A pointer to an application data specified by\n//                              yaml_emitter_set_output().\n// @param[in]       buffer      The buffer with bytes to be written.\n// @param[in]       size        The size of the buffer.\n//\n// @returns On success, the handler should return @c 1.  If the handler failed,\n// the returned value should be @c 0.\n//\ntype yaml_write_handler_t func(emitter *yaml_emitter_t, buffer []byte) error\n\ntype yaml_emitter_state_t int\n\n// The emitter states.\nconst (\n\t// Expect STREAM-START.\n\tyaml_EMIT_STREAM_START_STATE yaml_emitter_state_t = iota\n\n\tyaml_EMIT_FIRST_DOCUMENT_START_STATE       // Expect the first DOCUMENT-START or STREAM-END.\n\tyaml_EMIT_DOCUMENT_START_STATE             // Expect DOCUMENT-START or STREAM-END.\n\tyaml_EMIT_DOCUMENT_CONTENT_STATE           // Expect the content of a document.\n\tyaml_EMIT_DOCUMENT_END_STATE               // Expect DOCUMENT-END.\n\tyaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE   // Expect the first item of a flow sequence.\n\tyaml_EMIT_FLOW_SEQUENCE_ITEM_STATE         // Expect an item of a flow sequence.\n\tyaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE     // Expect the first key of a flow mapping.\n\tyaml_EMIT_FLOW_MAPPING_KEY_STATE           // Expect a key of a flow mapping.\n\tyaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE  // Expect a value for a simple key of a flow mapping.\n\tyaml_EMIT_FLOW_MAPPING_VALUE_STATE         // Expect a value of a flow mapping.\n\tyaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE  // Expect the first item of a block sequence.\n\tyaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE        // Expect an item of a block sequence.\n\tyaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE    // Expect the first key of a block mapping.\n\tyaml_EMIT_BLOCK_MAPPING_KEY_STATE          // Expect the key of a block mapping.\n\tyaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a block mapping.\n\tyaml_EMIT_BLOCK_MAPPING_VALUE_STATE        // Expect a value of a block mapping.\n\tyaml_EMIT_END_STATE                        // Expect nothing.\n)\n\n// The emitter structure.\n//\n// All members are internal.  Manage the structure using the @c yaml_emitter_\n// family of functions.\ntype yaml_emitter_t struct {\n\n\t// Error handling\n\n\terror   yaml_error_type_t // Error type.\n\tproblem string            // Error description.\n\n\t// Writer stuff\n\n\twrite_handler yaml_write_handler_t // Write handler.\n\n\toutput_buffer *[]byte   // String output data.\n\toutput_file   io.Writer // File output data.\n\n\tbuffer     []byte // The working buffer.\n\tbuffer_pos int    // The current position of the buffer.\n\n\traw_buffer     []byte // The raw buffer.\n\traw_buffer_pos int    // The current position of the buffer.\n\n\tencoding yaml_encoding_t // The stream encoding.\n\n\t// Emitter stuff\n\n\tcanonical   bool         // If the output is in the canonical style?\n\tbest_indent int          // The number of indentation spaces.\n\tbest_width  int          // The preferred width of the output lines.\n\tunicode     bool         // Allow unescaped non-ASCII characters?\n\tline_break  yaml_break_t // The preferred line break.\n\n\tstate  yaml_emitter_state_t   // The current emitter state.\n\tstates []yaml_emitter_state_t // The stack of states.\n\n\tevents      []yaml_event_t // The event queue.\n\tevents_head int            // The head of the event queue.\n\n\tindents []int // The stack of indentation levels.\n\n\ttag_directives []yaml_tag_directive_t // The list of tag directives.\n\n\tindent int // The current indentation level.\n\n\tflow_level int // The current flow level.\n\n\troot_context       bool // Is it the document root context?\n\tsequence_context   bool // Is it a sequence context?\n\tmapping_context    bool // Is it a mapping context?\n\tsimple_key_context bool // Is it a simple mapping key context?\n\n\tline       int  // The current line.\n\tcolumn     int  // The current column.\n\twhitespace bool // If the last character was a whitespace?\n\tindention  bool // If the last character was an indentation character (' ', '-', '?', ':')?\n\topen_ended bool // If an explicit document end is required?\n\n\t// Anchor analysis.\n\tanchor_data struct {\n\t\tanchor []byte // The anchor value.\n\t\talias  bool   // Is it an alias?\n\t}\n\n\t// Tag analysis.\n\ttag_data struct {\n\t\thandle []byte // The tag handle.\n\t\tsuffix []byte // The tag suffix.\n\t}\n\n\t// Scalar analysis.\n\tscalar_data struct {\n\t\tvalue                 []byte              // The scalar value.\n\t\tmultiline             bool                // Does the scalar contain line breaks?\n\t\tflow_plain_allowed    bool                // Can the scalar be expessed in the flow plain style?\n\t\tblock_plain_allowed   bool                // Can the scalar be expressed in the block plain style?\n\t\tsingle_quoted_allowed bool                // Can the scalar be expressed in the single quoted style?\n\t\tblock_allowed         bool                // Can the scalar be expressed in the literal or folded styles?\n\t\tstyle                 yaml_scalar_style_t // The output style.\n\t}\n\n\t// Dumper stuff\n\n\topened bool // If the stream was already opened?\n\tclosed bool // If the stream was already closed?\n\n\t// The information associated with the document nodes.\n\tanchors *struct {\n\t\treferences int  // The number of references.\n\t\tanchor     int  // The anchor id.\n\t\tserialized bool // If the node has been emitted?\n\t}\n\n\tlast_anchor_id int // The last assigned anchor id.\n\n\tdocument *yaml_document_t // The currently emitted document.\n}\n"
  },
  {
    "path": "vendor/gopkg.in/yaml.v2/yamlprivateh.go",
    "content": "package yaml\n\nconst (\n\t// The size of the input raw buffer.\n\tinput_raw_buffer_size = 512\n\n\t// The size of the input buffer.\n\t// It should be possible to decode the whole raw buffer.\n\tinput_buffer_size = input_raw_buffer_size * 3\n\n\t// The size of the output buffer.\n\toutput_buffer_size = 128\n\n\t// The size of the output raw buffer.\n\t// It should be possible to encode the whole output buffer.\n\toutput_raw_buffer_size = (output_buffer_size*2 + 2)\n\n\t// The size of other stacks and queues.\n\tinitial_stack_size  = 16\n\tinitial_queue_size  = 16\n\tinitial_string_size = 16\n)\n\n// Check if the character at the specified position is an alphabetical\n// character, a digit, '_', or '-'.\nfunc is_alpha(b []byte, i int) bool {\n\treturn b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'Z' || b[i] >= 'a' && b[i] <= 'z' || b[i] == '_' || b[i] == '-'\n}\n\n// Check if the character at the specified position is a digit.\nfunc is_digit(b []byte, i int) bool {\n\treturn b[i] >= '0' && b[i] <= '9'\n}\n\n// Get the value of a digit.\nfunc as_digit(b []byte, i int) int {\n\treturn int(b[i]) - '0'\n}\n\n// Check if the character at the specified position is a hex-digit.\nfunc is_hex(b []byte, i int) bool {\n\treturn b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'F' || b[i] >= 'a' && b[i] <= 'f'\n}\n\n// Get the value of a hex-digit.\nfunc as_hex(b []byte, i int) int {\n\tbi := b[i]\n\tif bi >= 'A' && bi <= 'F' {\n\t\treturn int(bi) - 'A' + 10\n\t}\n\tif bi >= 'a' && bi <= 'f' {\n\t\treturn int(bi) - 'a' + 10\n\t}\n\treturn int(bi) - '0'\n}\n\n// Check if the character is ASCII.\nfunc is_ascii(b []byte, i int) bool {\n\treturn b[i] <= 0x7F\n}\n\n// Check if the character at the start of the buffer can be printed unescaped.\nfunc is_printable(b []byte, i int) bool {\n\treturn ((b[i] == 0x0A) || // . == #x0A\n\t\t(b[i] >= 0x20 && b[i] <= 0x7E) || // #x20 <= . <= #x7E\n\t\t(b[i] == 0xC2 && b[i+1] >= 0xA0) || // #0xA0 <= . <= #xD7FF\n\t\t(b[i] > 0xC2 && b[i] < 0xED) ||\n\t\t(b[i] == 0xED && b[i+1] < 0xA0) ||\n\t\t(b[i] == 0xEE) ||\n\t\t(b[i] == 0xEF && // #xE000 <= . <= #xFFFD\n\t\t\t!(b[i+1] == 0xBB && b[i+2] == 0xBF) && // && . != #xFEFF\n\t\t\t!(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF))))\n}\n\n// Check if the character at the specified position is NUL.\nfunc is_z(b []byte, i int) bool {\n\treturn b[i] == 0x00\n}\n\n// Check if the beginning of the buffer is a BOM.\nfunc is_bom(b []byte, i int) bool {\n\treturn b[0] == 0xEF && b[1] == 0xBB && b[2] == 0xBF\n}\n\n// Check if the character at the specified position is space.\nfunc is_space(b []byte, i int) bool {\n\treturn b[i] == ' '\n}\n\n// Check if the character at the specified position is tab.\nfunc is_tab(b []byte, i int) bool {\n\treturn b[i] == '\\t'\n}\n\n// Check if the character at the specified position is blank (space or tab).\nfunc is_blank(b []byte, i int) bool {\n\t//return is_space(b, i) || is_tab(b, i)\n\treturn b[i] == ' ' || b[i] == '\\t'\n}\n\n// Check if the character at the specified position is a line break.\nfunc is_break(b []byte, i int) bool {\n\treturn (b[i] == '\\r' || // CR (#xD)\n\t\tb[i] == '\\n' || // LF (#xA)\n\t\tb[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9) // PS (#x2029)\n}\n\nfunc is_crlf(b []byte, i int) bool {\n\treturn b[i] == '\\r' && b[i+1] == '\\n'\n}\n\n// Check if the character is a line break or NUL.\nfunc is_breakz(b []byte, i int) bool {\n\t//return is_break(b, i) || is_z(b, i)\n\treturn (        // is_break:\n\tb[i] == '\\r' || // CR (#xD)\n\t\tb[i] == '\\n' || // LF (#xA)\n\t\tb[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)\n\t\t// is_z:\n\t\tb[i] == 0)\n}\n\n// Check if the character is a line break, space, or NUL.\nfunc is_spacez(b []byte, i int) bool {\n\t//return is_space(b, i) || is_breakz(b, i)\n\treturn ( // is_space:\n\tb[i] == ' ' ||\n\t\t// is_breakz:\n\t\tb[i] == '\\r' || // CR (#xD)\n\t\tb[i] == '\\n' || // LF (#xA)\n\t\tb[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)\n\t\tb[i] == 0)\n}\n\n// Check if the character is a line break, space, tab, or NUL.\nfunc is_blankz(b []byte, i int) bool {\n\t//return is_blank(b, i) || is_breakz(b, i)\n\treturn ( // is_blank:\n\tb[i] == ' ' || b[i] == '\\t' ||\n\t\t// is_breakz:\n\t\tb[i] == '\\r' || // CR (#xD)\n\t\tb[i] == '\\n' || // LF (#xA)\n\t\tb[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)\n\t\tb[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)\n\t\tb[i] == 0)\n}\n\n// Determine the width of the character.\nfunc width(b byte) int {\n\t// Don't replace these by a switch without first\n\t// confirming that it is being inlined.\n\tif b&0x80 == 0x00 {\n\t\treturn 1\n\t}\n\tif b&0xE0 == 0xC0 {\n\t\treturn 2\n\t}\n\tif b&0xF0 == 0xE0 {\n\t\treturn 3\n\t}\n\tif b&0xF8 == 0xF0 {\n\t\treturn 4\n\t}\n\treturn 0\n\n}\n"
  },
  {
    "path": "vendor/vendor.json",
    "content": "{\n\t\"comment\": \"\",\n\t\"ignore\": \"test\",\n\t\"package\": [\n\t\t{\n\t\t\t\"checksumSHA1\": \"cD+MATXYc1X6VHlQukvZ4VZlPYM=\",\n\t\t\t\"path\": \"github.com/Pallinder/go-randomdata\",\n\t\t\t\"revision\": \"442d37d9dbc782dbd737af9ec575d8858b79261b\",\n\t\t\t\"revisionTime\": \"2017-12-27T16:47:48Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"7DxViusFRJ7UPH0jZqYatwDrOkY=\",\n\t\t\t\"path\": \"github.com/elazarl/go-bindata-assetfs\",\n\t\t\t\"revision\": \"30f82fa23fd844bd5bb1e5f216db87fd77b5eb43\",\n\t\t\t\"revisionTime\": \"2017-02-27T21:27:28Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"V/quM7+em2ByJbWBLOsEwnY3j/Q=\",\n\t\t\t\"path\": \"github.com/mitchellh/go-homedir\",\n\t\t\t\"revision\": \"b8bc1bf767474819792c23f32d8286a45736f1c6\",\n\t\t\t\"revisionTime\": \"2016-12-03T19:45:07Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"H1Ne82yYzWRQ2DKBsmRd0Hwcl04=\",\n\t\t\t\"path\": \"github.com/urfave/cli\",\n\t\t\t\"revision\": \"75104e932ac2ddb944a6ea19d9f9f26316ff1145\",\n\t\t\t\"revisionTime\": \"2018-01-06T19:10:48Z\"\n\t\t},\n\t\t{\n\t\t\t\"checksumSHA1\": \"qOmvuDm+F+2nQQecUZBVkZrTn6Y=\",\n\t\t\t\"path\": \"gopkg.in/yaml.v2\",\n\t\t\t\"revision\": \"d670f9405373e636a5a2765eea47fac0c9bc91a4\",\n\t\t\t\"revisionTime\": \"2018-01-09T11:43:31Z\"\n\t\t}\n\t],\n\t\"rootPath\": \"github.com/donkeysharp/gocho\"\n}\n"
  }
]