Full Code of jingweno/spotctl for AI

master 6f44a3f7a7b8 cached
275 files
1.5 MB
486.4k tokens
3798 symbols
1 requests
Download .txt
Showing preview only (1,667K chars total). Download the full file or copy to clipboard to get everything.
Repository: jingweno/spotctl
Branch: master
Commit: 6f44a3f7a7b8
Files: 275
Total size: 1.5 MB

Directory structure:
gitextract_f0axi5je/

├── .gitignore
├── Formula/
│   └── spotctl.rb
├── Gopkg.toml
├── LICENSE
├── README.md
├── bin/
│   └── package
├── cmd/
│   └── spotctl/
│       ├── auth.go
│       ├── ctl.go
│       ├── main.go
│       ├── player.go
│       └── version.go
└── vendor/
    ├── github.com/
    │   ├── golang/
    │   │   └── protobuf/
    │   │       ├── .gitignore
    │   │       ├── .travis.yml
    │   │       ├── AUTHORS
    │   │       ├── CONTRIBUTORS
    │   │       ├── LICENSE
    │   │       ├── Make.protobuf
    │   │       ├── Makefile
    │   │       ├── README.md
    │   │       └── proto/
    │   │           ├── Makefile
    │   │           ├── all_test.go
    │   │           ├── any_test.go
    │   │           ├── clone.go
    │   │           ├── clone_test.go
    │   │           ├── decode.go
    │   │           ├── decode_test.go
    │   │           ├── encode.go
    │   │           ├── encode_test.go
    │   │           ├── equal.go
    │   │           ├── equal_test.go
    │   │           ├── extensions.go
    │   │           ├── extensions_test.go
    │   │           ├── lib.go
    │   │           ├── map_test.go
    │   │           ├── message_set.go
    │   │           ├── message_set_test.go
    │   │           ├── pointer_reflect.go
    │   │           ├── pointer_unsafe.go
    │   │           ├── properties.go
    │   │           ├── proto3_test.go
    │   │           ├── size2_test.go
    │   │           ├── size_test.go
    │   │           ├── text.go
    │   │           ├── text_parser.go
    │   │           ├── text_parser_test.go
    │   │           └── text_test.go
    │   ├── inconshreveable/
    │   │   └── mousetrap/
    │   │       ├── LICENSE
    │   │       ├── README.md
    │   │       ├── trap_others.go
    │   │       ├── trap_windows.go
    │   │       └── trap_windows_1.4.go
    │   ├── maruel/
    │   │   └── panicparse/
    │   │       ├── .travis.yml
    │   │       ├── Gopkg.toml
    │   │       ├── LICENSE
    │   │       ├── README.md
    │   │       ├── main.go
    │   │       └── stack/
    │   │           ├── source.go
    │   │           ├── source_test.go
    │   │           ├── stack.go
    │   │           ├── stack_test.go
    │   │           ├── ui.go
    │   │           └── ui_test.go
    │   ├── mattn/
    │   │   └── go-runewidth/
    │   │       ├── .travis.yml
    │   │       ├── LICENSE
    │   │       ├── README.mkd
    │   │       ├── runewidth.go
    │   │       ├── runewidth_js.go
    │   │       ├── runewidth_posix.go
    │   │       ├── runewidth_test.go
    │   │       └── runewidth_windows.go
    │   ├── mitchellh/
    │   │   └── go-wordwrap/
    │   │       ├── LICENSE.md
    │   │       ├── README.md
    │   │       ├── wordwrap.go
    │   │       └── wordwrap_test.go
    │   ├── nsf/
    │   │   └── termbox-go/
    │   │       ├── AUTHORS
    │   │       ├── LICENSE
    │   │       ├── README.md
    │   │       ├── api.go
    │   │       ├── api_common.go
    │   │       ├── api_windows.go
    │   │       ├── collect_terminfo.py
    │   │       ├── syscalls.go
    │   │       ├── syscalls_darwin.go
    │   │       ├── syscalls_darwin_amd64.go
    │   │       ├── syscalls_dragonfly.go
    │   │       ├── syscalls_freebsd.go
    │   │       ├── syscalls_linux.go
    │   │       ├── syscalls_netbsd.go
    │   │       ├── syscalls_openbsd.go
    │   │       ├── syscalls_windows.go
    │   │       ├── termbox.go
    │   │       ├── termbox_common.go
    │   │       ├── termbox_windows.go
    │   │       ├── terminfo.go
    │   │       └── terminfo_builtin.go
    │   ├── spf13/
    │   │   ├── cobra/
    │   │   │   ├── .gitignore
    │   │   │   ├── .mailmap
    │   │   │   ├── .travis.yml
    │   │   │   ├── LICENSE.txt
    │   │   │   ├── README.md
    │   │   │   ├── args.go
    │   │   │   ├── args_test.go
    │   │   │   ├── bash_completions.go
    │   │   │   ├── bash_completions.md
    │   │   │   ├── bash_completions_test.go
    │   │   │   ├── cobra.go
    │   │   │   ├── cobra_test.go
    │   │   │   ├── command.go
    │   │   │   ├── command_notwin.go
    │   │   │   ├── command_test.go
    │   │   │   ├── command_win.go
    │   │   │   ├── zsh_completions.go
    │   │   │   └── zsh_completions_test.go
    │   │   └── pflag/
    │   │       ├── .gitignore
    │   │       ├── .travis.yml
    │   │       ├── LICENSE
    │   │       ├── README.md
    │   │       ├── bool.go
    │   │       ├── bool_slice.go
    │   │       ├── bool_slice_test.go
    │   │       ├── bool_test.go
    │   │       ├── count.go
    │   │       ├── count_test.go
    │   │       ├── duration.go
    │   │       ├── example_test.go
    │   │       ├── export_test.go
    │   │       ├── flag.go
    │   │       ├── flag_test.go
    │   │       ├── float32.go
    │   │       ├── float64.go
    │   │       ├── golangflag.go
    │   │       ├── golangflag_test.go
    │   │       ├── int.go
    │   │       ├── int32.go
    │   │       ├── int64.go
    │   │       ├── int8.go
    │   │       ├── int_slice.go
    │   │       ├── int_slice_test.go
    │   │       ├── ip.go
    │   │       ├── ip_slice.go
    │   │       ├── ip_slice_test.go
    │   │       ├── ip_test.go
    │   │       ├── ipmask.go
    │   │       ├── ipnet.go
    │   │       ├── ipnet_test.go
    │   │       ├── string.go
    │   │       ├── string_array.go
    │   │       ├── string_array_test.go
    │   │       ├── string_slice.go
    │   │       ├── string_slice_test.go
    │   │       ├── uint.go
    │   │       ├── uint16.go
    │   │       ├── uint32.go
    │   │       ├── uint64.go
    │   │       ├── uint8.go
    │   │       ├── uint_slice.go
    │   │       └── uint_slice_test.go
    │   └── zmb3/
    │       └── spotify/
    │           ├── .travis.yml
    │           ├── LICENSE
    │           ├── README.md
    │           ├── album.go
    │           ├── album_test.go
    │           ├── artist.go
    │           ├── artist_test.go
    │           ├── audio_analysis.go
    │           ├── audio_analysis_test.go
    │           ├── audio_features.go
    │           ├── audio_features_test.go
    │           ├── auth.go
    │           ├── category.go
    │           ├── category_test.go
    │           ├── countries.go
    │           ├── cursor.go
    │           ├── full_tests.bat
    │           ├── library.go
    │           ├── library_test.go
    │           ├── page.go
    │           ├── player.go
    │           ├── player_test.go
    │           ├── playlist.go
    │           ├── playlist_test.go
    │           ├── recommendation.go
    │           ├── recommendation_test.go
    │           ├── search.go
    │           ├── search_test.go
    │           ├── spotify.go
    │           ├── spotify_test.go
    │           ├── track.go
    │           ├── track_attributes.go
    │           ├── track_test.go
    │           ├── user.go
    │           └── user_test.go
    ├── golang.org/
    │   └── x/
    │       ├── net/
    │       │   ├── .gitattributes
    │       │   ├── .gitignore
    │       │   ├── AUTHORS
    │       │   ├── CONTRIBUTING.md
    │       │   ├── CONTRIBUTORS
    │       │   ├── LICENSE
    │       │   ├── PATENTS
    │       │   ├── README.md
    │       │   ├── codereview.cfg
    │       │   └── context/
    │       │       ├── context.go
    │       │       ├── context_test.go
    │       │       ├── ctxhttp/
    │       │       │   ├── ctxhttp.go
    │       │       │   ├── ctxhttp_17_test.go
    │       │       │   ├── ctxhttp_pre17.go
    │       │       │   ├── ctxhttp_pre17_test.go
    │       │       │   └── ctxhttp_test.go
    │       │       ├── go17.go
    │       │       ├── go19.go
    │       │       ├── pre_go17.go
    │       │       ├── pre_go19.go
    │       │       └── withtimeout_test.go
    │       └── oauth2/
    │           ├── .travis.yml
    │           ├── AUTHORS
    │           ├── CONTRIBUTING.md
    │           ├── CONTRIBUTORS
    │           ├── LICENSE
    │           ├── README.md
    │           ├── client_appengine.go
    │           ├── example_test.go
    │           ├── internal/
    │           │   ├── doc.go
    │           │   ├── oauth2.go
    │           │   ├── oauth2_test.go
    │           │   ├── token.go
    │           │   ├── token_test.go
    │           │   ├── transport.go
    │           │   └── transport_test.go
    │           ├── oauth2.go
    │           ├── oauth2_test.go
    │           ├── token.go
    │           ├── token_test.go
    │           ├── transport.go
    │           └── transport_test.go
    └── google.golang.org/
        └── appengine/
            ├── .travis.yml
            ├── LICENSE
            ├── README.md
            ├── appengine.go
            ├── appengine_test.go
            ├── appengine_vm.go
            ├── errors.go
            ├── identity.go
            ├── internal/
            │   ├── api.go
            │   ├── api_classic.go
            │   ├── api_common.go
            │   ├── api_race_test.go
            │   ├── api_test.go
            │   ├── app_id.go
            │   ├── app_id_test.go
            │   ├── base/
            │   │   ├── api_base.pb.go
            │   │   └── api_base.proto
            │   ├── datastore/
            │   │   ├── datastore_v3.pb.go
            │   │   └── datastore_v3.proto
            │   ├── identity.go
            │   ├── identity_classic.go
            │   ├── identity_vm.go
            │   ├── internal.go
            │   ├── internal_vm_test.go
            │   ├── log/
            │   │   ├── log_service.pb.go
            │   │   └── log_service.proto
            │   ├── main.go
            │   ├── main_vm.go
            │   ├── metadata.go
            │   ├── net.go
            │   ├── net_test.go
            │   ├── regen.sh
            │   ├── remote_api/
            │   │   ├── remote_api.pb.go
            │   │   └── remote_api.proto
            │   ├── transaction.go
            │   └── urlfetch/
            │       ├── urlfetch_service.pb.go
            │       └── urlfetch_service.proto
            ├── namespace.go
            ├── namespace_test.go
            ├── timeout.go
            └── urlfetch/
                └── urlfetch.go

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
build
release


================================================
FILE: Formula/spotctl.rb
================================================
class Spotctl < Formula
  desc "A CLI to Spotify"
  homepage "https://github.com/jingweno/spotctl"
  version "1.0.1"
  sha256 "a0276bd0c0fb65e7b24885f17d3547276dcf9b059b9507abe51edfa5f5388f89"
  url "https://github.com/jingweno/spotctl/releases/download/v1.0.1/darwin-amd64-1.0.1.tar.gz"

  def install
    bin.install "spotctl"
  end
end


================================================
FILE: Gopkg.toml
================================================

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
#   name = "github.com/user/project"
#   version = "1.0.0"
#
# [[constraint]]
#   name = "github.com/user/project2"
#   branch = "dev"
#   source = "github.com/myfork/project2"
#
# [[override]]
#  name = "github.com/x/y"
#  version = "2.4.0"


[[constraint]]
  name = "github.com/spf13/cobra"
  branch = "master"

[[constraint]]
  branch = "master"
  name = "github.com/zmb3/spotify"

[[constraint]]
  branch = "master"
  name = "github.com/gizak/termui"


================================================
FILE: LICENSE
================================================
Copyright (c) 2018 Jingwen Owen Ou

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


================================================
FILE: README.md
================================================
# Spotctl

`spotctl` is command-line interface to control Spotify from your favorite terminal.

## Demo

One of the highlights is that `spotctl player` shows a real-time Spotify player that allows you to control it, right in your terminal!

[![asciicast](https://asciinema.org/a/154262.png)](https://asciinema.org/a/154262)

## Installation

## Homebrew

If you're on a Mac, you can install with [Homebrew](https://brew.sh/):

```
brew install https://raw.githubusercontent.com/jingweno/spotctl/master/Formula/spotctl.rb
```

## Download

You can download the latest release for your operating system [here](https://github.com/jingweno/spotctl/releases).

## Manual Installation

`spotctl` needs to connect to Spotify's API in order to control it.
To manually build it, you first need to sign up (or into) Spotify's developer site and [create an Application](https://developer.spotify.com/my-applications/#!/applications/create).
Once you've done so, you can find its Client ID and Client Secret values and run the following command:

```
SPOTIFY_CLIENT_ID=XXX SPOTIFY_CLIENT_SECRET=YYY ./bin/build
```

## Running

**Please make sure the Spotify app is opened before running any `spotctl` commands**, since it talks to the Spotify API which in turns talks to the Spotify app in your local box.
Here is a list of available commands:

```
$ spotctl -h
A command-line interface to Spotify.

Usage:
  spotctl [command]

Available Commands:
  help        Help about any command
  login       Login with your Spotify credentials
  logout      Clear your local Spotify credentials
  next        Skip to the next track
  pause       Pause Spotify playback
  play        Resume playback or play a track, album, artist or playlist by name
  player      Show the live player panel
  prev        Return to the previous track
  repeat      Toggle repeat playback mode
  shuffle     Toggle shuffle playback mode
  status      Show the current player status
  version     Show version.
  vol         Set or return volume percentage

Flags:
  -h, --help   help for spotctl

Use "spotctl [command] --help" for more information about a command.
```

## License

[MIT](https://github.com/jingweno/spotctl/blob/master/LICENSE)


================================================
FILE: bin/package
================================================
#!/bin/bash -e

version() {
  ver="$(git describe --tags HEAD 2>/dev/null || true)"

  if [ -z "$ver" ]; then
    ver="$(grep version version.go | head -1 | cut -d '"' -f2)"
    sha="$(git rev-parse --short HEAD 2>/dev/null || true)"
    [ -z "$sha" ] || ver="${ver}-g${sha}"
  fi

  echo "${ver#v}"
}

compress() {
  cd release

  for dir in */
  do
    base=$(basename "$dir")
    cp ../README.md ../LICENSE $dir

    echo "Compressing $base"

    tar -zcf "${base}.tar.gz" "$dir"
    rm -rf $dir
  done

  echo

  ls -all
}

OSARCH="darwin/amd64 linux/amd64 linux/386 windows/amd64 windows/386"

cd cmd/spotctl
echo "Packaging spotctl $(version)"

go get -u github.com/mitchellh/gox

gox -osarch="$OSARCH" \
  -ldflags "-X main.spotifyClientID=$SPOTIFY_CLIENT_ID -X main.spotifyClientSecret=$SPOTIFY_CLIENT_SECRET -X main.version=$(version)" \
  -output="../../release/{{.OS}}-{{.Arch}}-$(version)/{{.Dir}}"

echo

cd -

compress


================================================
FILE: cmd/spotctl/auth.go
================================================
package main

import (
	"crypto/rand"
	"encoding/base64"
	"fmt"
	"log"
	"net/http"
	"os"

	"github.com/spf13/cobra"
	"github.com/zmb3/spotify"
	"golang.org/x/oauth2"
)

var loginCmd = &cobra.Command{
	Use:   "login",
	Short: "Login with your Spotify credentials",
	RunE:  login,
}

var logoutCmd = &cobra.Command{
	Use:   "logout",
	Short: "Clear your local Spotify credentials",
	RunE:  login,
}

func login(cmd *cobra.Command, args []string) error {
	state, err := generateRandomString(32)
	if err != nil {
		return err
	}

	ch := make(chan *oauth2.Token)

	http.Handle("/callback", &authHandler{state: state, ch: ch, auth: auth})
	go http.ListenAndServe("localhost:10028", nil)

	url := auth.AuthURL(state)
	fmt.Println("Please log in to Spotify by visiting the following page in your browser:", url)

	tok := <-ch

	if err := saveToken(tok); err != nil {
		return err
	}

	return nil
}

func logout(cmd *cobra.Command, args []string) error {
	os.Remove(tokenPath)
	return nil
}

type authHandler struct {
	state string
	ch    chan *oauth2.Token
	auth  spotify.Authenticator
}

func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	tok, err := a.auth.Token(a.state, r)
	if err != nil {
		http.Error(w, "Couldn't get token", http.StatusForbidden)
		log.Fatal(err)
	}

	if st := r.FormValue("state"); st != a.state {
		http.NotFound(w, r)
		log.Fatalf("State mismatch: %s != %s\n", st, a.state)
	}

	fmt.Fprintf(w, "Login successfully. Please return to your terminal.")

	a.ch <- tok
}

func generateRandomBytes(n int) ([]byte, error) {
	b := make([]byte, n)
	_, err := rand.Read(b)
	if err != nil {
		return nil, err
	}

	return b, nil
}

func generateRandomString(s int) (string, error) {
	b, err := generateRandomBytes(s)
	return base64.URLEncoding.EncodeToString(b), err
}


================================================
FILE: cmd/spotctl/ctl.go
================================================
package main

import (
	"fmt"
	"strconv"
	"strings"

	"github.com/spf13/cobra"
	"github.com/zmb3/spotify"
)

var (
	playCmdFlagType string
	deviceNameFlag  string
)

var playCmd = &cobra.Command{
	Use:   "play [name]",
	Short: "Resume playback or play a track, album, artist or playlist by name",
	Long:  `Resume playback or find a track, album, artist or playlist by name and play it. The search type can be specified with --type.`,
	RunE:  play,
}

var pauseCmd = &cobra.Command{
	Use:   "pause",
	Short: "Pause Spotify playback",
	RunE:  pause,
}

var nextCmd = &cobra.Command{
	Use:   "next",
	Short: "Skip to the next track",
	RunE:  next,
}

var prevCmd = &cobra.Command{
	Use:   "prev",
	Short: "Return to the previous track",
	RunE:  prev,
}

var volCmd = &cobra.Command{
	Use:   "vol [up|down|amount]",
	Short: "Set or return volume percentage",
	Long:  `Set volume percentage to an amount between 0 and 100. If arg is up, volume is increased by 10%. If arg is down, volume is decreased by 10%. If no arg is provided, current volume percentage is returned.`,
	RunE:  vol,
}

var statusCmd = &cobra.Command{
	Use:   "status",
	Short: "Show the current player status",
	RunE:  status,
}

var shuffleCmd = &cobra.Command{
	Use:   "shuffle",
	Short: "Toggle shuffle playback mode",
	RunE:  shuffle,
}

var repeatCmd = &cobra.Command{
	Use:   "repeat",
	Short: "Toggle repeat playback mode",
	RunE:  repeat,
}

var devicesCmd = &cobra.Command{
	Use:   "devices",
	Short: "Show list of available devices",
	RunE:  devices,
}

func shuffle(cmd *cobra.Command, args []string) error {
	state, err := client.PlayerState()
	if err != nil {
		return err
	}

	return client.Shuffle(!state.ShuffleState)
}

func repeat(cmd *cobra.Command, args []string) error {
	state, err := client.PlayerState()
	if err != nil {
		return err
	}

	var repeat string
	if state.RepeatState == "off" {
		repeat = "track"
	} else if state.RepeatState == "track" {
		repeat = "context"
	} else if state.RepeatState == "context" {
		repeat = "off"
	} else {
		return fmt.Errorf("unsupported repeat state %s", state.RepeatState)
	}

	opt := &spotify.PlayOptions{
		DeviceID: findDeviceByName(deviceNameFlag),
	}
	return client.RepeatOpt(repeat, opt)
}

func play(cmd *cobra.Command, args []string) error {
	var (
		opt = &spotify.PlayOptions{}
		err error
	)

	if len(args) > 0 {
		// if args start with a spotify ID, play it directly, otherwise search for songs
		if strings.Contains(args[0], "spotify:") {
			opt = playByID(args[0]) // only play the first id
		} else {
			opt, err = searchToPlay(strings.Join(args, " "), playCmdFlagType)
			if err != nil {
				return err
			}
		}
	}

	opt.DeviceID = findDeviceByName(deviceNameFlag)

	return client.PlayOpt(opt)
}

func devices(cmd *cobra.Command, args []string) error {
	devices, err := client.PlayerDevices()
	if err != nil {
		return err
	}

	for _, device := range devices {
		active := ""
		if device.Active {
			active = "* "
		}
		fmt.Printf("%s%s - %s (volume %d%%)\n", active, device.Name, device.Type, device.Volume)
	}

	return nil
}

func vol(cmd *cobra.Command, args []string) error {
	state, err := client.PlayerState()
	if err != nil {
		return err
	}

	if len(args) == 0 {
		fmt.Printf("Current volume is %d%%.\n", state.Device.Volume)
		return nil
	}

	var currVolume int
	switch vol := args[0]; vol {
	case "up":
		currVolume = state.Device.Volume + 10
	case "down":
		currVolume = state.Device.Volume - 10
	default:
		currVolume, err = strconv.Atoi(vol)
		if err != nil {
			return err
		}
	}

	if currVolume < 0 {
		currVolume = 0
	}

	if currVolume > 100 {
		currVolume = 100
	}

	opt := &spotify.PlayOptions{
		DeviceID: findDeviceByName(deviceNameFlag),
	}
	return client.VolumeOpt(currVolume, opt)
}

func pause(cmd *cobra.Command, args []string) error {
	opt := &spotify.PlayOptions{
		DeviceID: findDeviceByName(deviceNameFlag),
	}
	return client.PauseOpt(opt)
}

func next(cmd *cobra.Command, args []string) error {
	opt := &spotify.PlayOptions{
		DeviceID: findDeviceByName(deviceNameFlag),
	}
	return client.NextOpt(opt)
}

func prev(cmd *cobra.Command, args []string) error {
	opt := &spotify.PlayOptions{
		DeviceID: findDeviceByName(deviceNameFlag),
	}
	return client.PreviousOpt(opt)
}

func status(cmd *cobra.Command, args []string) error {
	state, err := client.PlayerState()
	if err != nil {
		return err
	}

	if state.Playing && state.Item != nil {
		var artists []string
		for _, a := range state.Item.Artists {
			artists = append(artists, a.Name)
		}

		fmt.Printf("Spotify is currently playing on %s.\n", state.Device.Name)
		fmt.Printf("Artist: %s\n", strings.Join(artists, ", "))
		fmt.Printf("Album: %s\n", state.Item.Album.Name)
		fmt.Printf("Track: %s\n", state.Item.Name)
		fmt.Printf("Position: %s / %s\n", durationToStr(state.Progress), durationToStr(state.Item.Duration))
	} else {
		fmt.Println("Spotify is currently paused.")
	}

	return nil
}

// findDeviceByName finds the device by name.
// If name is empty, the first Computer device ID is returned if it's available;
// otherwise it returns the first device ID.
func findDeviceByName(name string) *spotify.ID {
	devices, err := client.PlayerDevices()
	if err != nil {
		return nil
	}

	for _, device := range devices {
		if name != "" && device.Name == name {
			return &device.ID
		} else if device.Type == "Computer" {
			return &device.ID
		}
	}

	if len(devices) > 0 {
		return &devices[0].ID
	}

	return nil
}

func playByID(id string) *spotify.PlayOptions {
	var (
		uris    []spotify.URI
		context *spotify.URI
	)

	if strings.Contains(id, "spotify:track") {
		uris = append(uris, spotify.URI(id))
	} else {
		uri := spotify.URI(id)
		context = &uri
	}

	return &spotify.PlayOptions{
		PlaybackContext: context,
		URIs:            uris,
	}
}

func searchToPlay(query, t string) (*spotify.PlayOptions, error) {
	var st spotify.SearchType
	switch t {
	case "track":
		st = spotify.SearchTypeTrack
	case "album":
		st = spotify.SearchTypeAlbum
	case "artist":
		st = spotify.SearchTypeArtist
	case "playlist":
		st = spotify.SearchTypePlaylist
	default:
		return nil, fmt.Errorf("unsupported search type %s", t)
	}

	result, err := client.Search(query, st)
	if err != nil {
		return nil, err
	}

	var opt *spotify.PlayOptions
	switch t {
	case "track":
		if result.Tracks != nil && len(result.Tracks.Tracks) > 0 {
			opt = &spotify.PlayOptions{
				URIs: []spotify.URI{result.Tracks.Tracks[0].URI},
			}
		}
	case "album":
		if result.Albums != nil && len(result.Albums.Albums) > 0 {
			opt = &spotify.PlayOptions{
				PlaybackContext: &result.Albums.Albums[0].URI,
			}
		}
	case "artist":
		if result.Artists != nil && len(result.Artists.Artists) > 0 {
			opt = &spotify.PlayOptions{
				PlaybackContext: &result.Artists.Artists[0].URI,
			}
		}
	case "playlist":
		if result.Playlists != nil && len(result.Playlists.Playlists) > 0 {
			opt = &spotify.PlayOptions{
				PlaybackContext: &result.Playlists.Playlists[0].URI,
			}
		}
	}

	return opt, nil
}


================================================
FILE: cmd/spotctl/main.go
================================================
package main

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"os/user"
	"path/filepath"

	"github.com/spf13/cobra"
	"github.com/zmb3/spotify"
	"golang.org/x/oauth2"
)

const (
	redirectURI = "http://localhost:10028/callback"
)

var (
	spotifyClientID     string
	spotifyClientSecret string
)

var (
	auth      spotify.Authenticator
	token     *oauth2.Token
	client    spotify.Client
	tokenPath string
)

var rootCmd = &cobra.Command{
	Use:               "spotctl",
	Short:             "A command-line interface to Spotify.",
	PersistentPreRun:  preRootCmd,
	PersistentPostRun: postRootCmd,
}

var versionCmd = &cobra.Command{
	Use:   "version",
	Short: "Show version.",
	Run:   ver,
}

func ver(cmd *cobra.Command, args []string) {
	fmt.Println(version)
}

func main() {
	rootCmd.AddCommand(loginCmd)
	rootCmd.AddCommand(logoutCmd)
	rootCmd.AddCommand(devicesCmd)
	rootCmd.AddCommand(playCmd)
	rootCmd.AddCommand(pauseCmd)
	rootCmd.AddCommand(nextCmd)
	rootCmd.AddCommand(prevCmd)
	rootCmd.AddCommand(volCmd)
	rootCmd.AddCommand(shuffleCmd)
	rootCmd.AddCommand(repeatCmd)
	rootCmd.AddCommand(statusCmd)
	rootCmd.AddCommand(playerCmd)
	rootCmd.AddCommand(versionCmd)

	playCmd.PersistentFlags().StringVarP(&playCmdFlagType, "type", "t", "track", "the type of [name] to play: track, album, artist or playlist.")
	playCmd.PersistentFlags().StringVarP(&deviceNameFlag, "device", "d", "", "the name of device")
	pauseCmd.PersistentFlags().StringVarP(&deviceNameFlag, "device", "d", "", "the name of device")
	nextCmd.PersistentFlags().StringVarP(&deviceNameFlag, "device", "d", "", "the name of device")
	prevCmd.PersistentFlags().StringVarP(&deviceNameFlag, "device", "d", "", "the name of device")
	volCmd.PersistentFlags().StringVarP(&deviceNameFlag, "device", "d", "", "the name of device")
	shuffleCmd.PersistentFlags().StringVarP(&deviceNameFlag, "device", "d", "", "the name of device")
	repeatCmd.PersistentFlags().StringVarP(&deviceNameFlag, "device", "d", "", "the name of device")
	playerCmd.PersistentFlags().StringVarP(&deviceNameFlag, "device", "d", "", "the name of device")

	if err := rootCmd.Execute(); err != nil {
		log.Fatal(err)
	}
}

func preRootCmd(cmd *cobra.Command, args []string) {
	usr, err := user.Current()
	if err != nil {
		log.Fatal(err)
	}

	tokenPath = filepath.Join(usr.HomeDir, ".spotctl")
	auth = spotify.NewAuthenticator(
		redirectURI,
		spotify.ScopeUserReadCurrentlyPlaying,
		spotify.ScopeUserReadPlaybackState,
		spotify.ScopeUserModifyPlaybackState,
	)
	auth.SetAuthInfo(spotifyClientID, spotifyClientSecret)

	// skip reading token if this is a login/logout command
	if cmd.Use == "login" || cmd.Use == "logout" {
		return
	}

	token, err = readToken()
	if err != nil {
		if os.IsNotExist(err) {
			if err := login(cmd, args); err != nil {
				log.Fatal(err)
			}

			// read token one more time
			token, err = readToken()
			if err != nil {
				log.Fatal(err)
			}
		} else {
			log.Fatal(err)
		}
	}

	client = auth.NewClient(token)
}

func postRootCmd(cmd *cobra.Command, args []string) {
	// skip reading token if this is a login/logout command
	if cmd.Use == "login" || cmd.Use == "logout" {
		return
	}

	tokenInUse, err := client.Token()
	if err != nil {
		log.Fatal(err)
	}

	if tokenInUse != token {
		if err := saveToken(tokenInUse); err != nil {
			log.Fatal(err)
		}
	}
}

func saveToken(tok *oauth2.Token) error {
	f, err := os.OpenFile(tokenPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
	if err != nil {
		return err
	}
	defer f.Close()

	enc := json.NewEncoder(f)
	return enc.Encode(tok)
}

func readToken() (*oauth2.Token, error) {
	content, err := ioutil.ReadFile(tokenPath)
	if err != nil {
		return nil, err
	}

	var tok oauth2.Token
	if err := json.Unmarshal(content, &tok); err != nil {
		return nil, err
	}

	return &tok, nil
}


================================================
FILE: cmd/spotctl/player.go
================================================
package main

import (
	"fmt"
	"log"
	"strings"
	"time"

	ui "github.com/gizak/termui"
	"github.com/spf13/cobra"
)

var playerCmd = &cobra.Command{
	Use:   "player",
	Short: "Show the live player panel",
	RunE:  player,
}

func player(cmd *cobra.Command, args []string) error {
	if err := ui.Init(); err != nil {
		log.Fatal(err)
	}
	defer ui.Close()

	songList := ui.NewList()
	songList.Border = false
	songList.X = 0
	songList.Y = 0
	songList.Height = 2
	songList.Width = 40

	ctlList := ui.NewList()
	ctlList.Border = false
	ctlList.X = 0
	ctlList.Y = 3
	ctlList.Height = 2
	ctlList.Width = 40

	currPosLabel := ui.NewPar("")
	currPosLabel.X = 0
	currPosLabel.Y = 6
	currPosLabel.Width = 6
	currPosLabel.Border = false

	progressGauge := ui.NewGauge()
	progressGauge.LabelAlign = ui.AlignCenter
	progressGauge.Height = 2
	progressGauge.Y = 6
	progressGauge.X = 6
	progressGauge.Width = 30
	progressGauge.Border = false
	progressGauge.Label = ""
	progressGauge.Percent = 0
	progressGauge.PaddingBottom = 1

	totalSecLabel := ui.NewPar("")
	totalSecLabel.X = 38
	totalSecLabel.Y = 6
	totalSecLabel.Width = 6
	totalSecLabel.Border = false

	volGauge := ui.NewGauge()
	volGauge.LabelAlign = ui.AlignCenter
	volGauge.Height = 2
	volGauge.Y = 8
	volGauge.X = 0
	volGauge.Width = 44
	volGauge.Border = false
	volGauge.BarColor = ui.ColorBlue
	volGauge.PaddingBottom = 1

	helpLabel := ui.NewPar("Press q - quit, p - play/pause, l/h - next/previous track, j/k - vol up/down, s - shuffle, r - repeat.")
	helpLabel.X = 0
	helpLabel.Y = 10
	helpLabel.Width = 40
	helpLabel.Height = 5
	helpLabel.Border = false
	helpLabel.WrapLength = 40

	draw := func() {
		ui.Render(
			songList,
			ctlList,
			currPosLabel,
			progressGauge,
			totalSecLabel,
			volGauge,
			helpLabel,
		)
	}

	ui.Handle("/sys/kbd/q", func(ui.Event) {
		ui.StopLoop()
	})

	ui.Handle("/sys/kbd/p", func(ui.Event) {
		state, err := client.PlayerState()
		if err != nil {
			quitAndFatal(err)
		}
		if state.Playing {
			if err := pause(pauseCmd, []string{}); err != nil {
				quitAndFatal(err)
			}
		} else {
			if err := play(playCmd, []string{}); err != nil {
				quitAndFatal(err)
			}
		}
	})

	ui.Handle("/sys/kbd/l", func(ui.Event) {
		if err := next(nextCmd, []string{}); err != nil {
			quitAndFatal(err)
		}
	})

	ui.Handle("/sys/kbd/h", func(ui.Event) {
		if err := prev(prevCmd, []string{}); err != nil {
			quitAndFatal(err)
		}
	})

	ui.Handle("/sys/kbd/j", func(ui.Event) {
		if err := vol(volCmd, []string{"up"}); err != nil {
			quitAndFatal(err)
		}
	})

	ui.Handle("/sys/kbd/k", func(ui.Event) {
		if err := vol(volCmd, []string{"down"}); err != nil {
			quitAndFatal(err)
		}
	})

	ui.Handle("/sys/kbd/s", func(ui.Event) {
		if err := shuffle(shuffleCmd, []string{}); err != nil {
			quitAndFatal(err)
		}
	})

	ui.Handle("/sys/kbd/r", func(ui.Event) {
		if err := repeat(repeatCmd, []string{}); err != nil {
			quitAndFatal(err)
		}
	})

	ui.Handle("/timer/1s", func(e ui.Event) {
		state, err := client.PlayerState()
		if err != nil {
			quitAndFatal(err)
		}

		volGauge.Percent = state.Device.Volume
		volGauge.Label = "Volume {{percent}}%"

		shuffleState := "off"
		if state.ShuffleState {
			shuffleState = "on"
		}

		ctlList.Items = []string{
			"Shuffle " + shuffleState,
			"Repeat " + state.RepeatState,
		}

		if state.Playing {
			progressGauge.Label = "Playing"
			progressGauge.BarColor = ui.ColorGreen
		} else {
			progressGauge.Label = "Paused"
			progressGauge.BarColor = ui.ColorRed
		}

		if state.Item != nil {
			var artists []string
			for _, a := range state.Item.Artists {
				artists = append(artists, a.Name)
			}
			songList.Items = []string{
				state.Item.Name,
				fmt.Sprintf("%s - %s", strings.Join(artists, ", "), state.Item.Album.Name),
			}

			currPosLabel.Text = durationToStr(state.Progress)
			totalSecLabel.Text = durationToStr(state.Item.Duration)

			progressGauge.Percent = progressPercent(state.Progress, state.Item.Duration)
		}

		draw()
	})

	ui.Loop()

	return nil
}

func quitAndFatal(err error) {
	ui.StopLoop()
	ui.Close()
	log.Fatal(err)
}

func durationToStr(d int) string {
	sec := roundToSec(d)
	minInt := int(sec / 60)
	secInt := int(sec - float64(minInt*60))
	return fmt.Sprintf("%d:%02d", minInt, secInt)
}

func roundToSec(d int) float64 {
	dur := (time.Duration(d) * time.Millisecond).Round(time.Second)
	return dur.Seconds()
}

func progressPercent(progress, total int) int {
	return int(roundToSec(progress) / roundToSec(total) * 100.0)
}


================================================
FILE: cmd/spotctl/version.go
================================================
package main

var (
	version = "1.0.1"
)


================================================
FILE: vendor/github.com/golang/protobuf/.gitignore
================================================
.DS_Store
*.[568ao]
*.ao
*.so
*.pyc
._*
.nfs.*
[568a].out
*~
*.orig
core
_obj
_test
_testmain.go
protoc-gen-go/testdata/multi/*.pb.go
_conformance/_conformance


================================================
FILE: vendor/github.com/golang/protobuf/.travis.yml
================================================
sudo: false
language: go
go:
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x

install:
  - go get -v -d -t github.com/golang/protobuf/...
  - curl -L https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip -o /tmp/protoc.zip
  - unzip /tmp/protoc.zip -d $HOME/protoc

env:
  - PATH=$HOME/protoc/bin:$PATH

script:
  - make all test


================================================
FILE: vendor/github.com/golang/protobuf/AUTHORS
================================================
# This source code refers to The Go Authors for copyright purposes.
# The master list of authors is in the main Go distribution,
# visible at http://tip.golang.org/AUTHORS.


================================================
FILE: vendor/github.com/golang/protobuf/CONTRIBUTORS
================================================
# This source code was written by the Go contributors.
# The master list of contributors is in the main Go distribution,
# visible at http://tip.golang.org/CONTRIBUTORS.


================================================
FILE: vendor/github.com/golang/protobuf/LICENSE
================================================
Go support for Protocol Buffers - Google's data interchange format

Copyright 2010 The Go Authors.  All rights reserved.
https://github.com/golang/protobuf

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

    * Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
    * Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



================================================
FILE: vendor/github.com/golang/protobuf/Make.protobuf
================================================
# Go support for Protocol Buffers - Google's data interchange format
#
# Copyright 2010 The Go Authors.  All rights reserved.
# https://github.com/golang/protobuf
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#     * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Includable Makefile to add a rule for generating .pb.go files from .proto files
# (Google protocol buffer descriptions).
# Typical use if myproto.proto is a file in package mypackage in this directory:
#
#	include $(GOROOT)/src/pkg/github.com/golang/protobuf/Make.protobuf

%.pb.go:	%.proto
	protoc --go_out=. $<



================================================
FILE: vendor/github.com/golang/protobuf/Makefile
================================================
# Go support for Protocol Buffers - Google's data interchange format
#
# Copyright 2010 The Go Authors.  All rights reserved.
# https://github.com/golang/protobuf
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#     * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


all:	install

install:
	go install ./proto ./jsonpb ./ptypes
	go install ./protoc-gen-go

test:
	go test ./proto ./jsonpb ./ptypes
	make -C protoc-gen-go/testdata test

clean:
	go clean ./...

nuke:
	go clean -i ./...

regenerate:
	make -C protoc-gen-go/descriptor regenerate
	make -C protoc-gen-go/plugin regenerate
	make -C protoc-gen-go/testdata regenerate
	make -C proto/testdata regenerate
	make -C jsonpb/jsonpb_test_proto regenerate
	make -C _conformance regenerate


================================================
FILE: vendor/github.com/golang/protobuf/README.md
================================================
# Go support for Protocol Buffers

[![Build Status](https://travis-ci.org/golang/protobuf.svg?branch=master)](https://travis-ci.org/golang/protobuf)
[![GoDoc](https://godoc.org/github.com/golang/protobuf?status.svg)](https://godoc.org/github.com/golang/protobuf)

Google's data interchange format.
Copyright 2010 The Go Authors.
https://github.com/golang/protobuf

This package and the code it generates requires at least Go 1.4.

This software implements Go bindings for protocol buffers.  For
information about protocol buffers themselves, see
	https://developers.google.com/protocol-buffers/

## Installation ##

To use this software, you must:
- Install the standard C++ implementation of protocol buffers from
	https://developers.google.com/protocol-buffers/
- Of course, install the Go compiler and tools from
	https://golang.org/
  See
	https://golang.org/doc/install
  for details or, if you are using gccgo, follow the instructions at
	https://golang.org/doc/install/gccgo
- Grab the code from the repository and install the proto package.
  The simplest way is to run `go get -u github.com/golang/protobuf/protoc-gen-go`.
  The compiler plugin, protoc-gen-go, will be installed in $GOBIN,
  defaulting to $GOPATH/bin.  It must be in your $PATH for the protocol
  compiler, protoc, to find it.

This software has two parts: a 'protocol compiler plugin' that
generates Go source files that, once compiled, can access and manage
protocol buffers; and a library that implements run-time support for
encoding (marshaling), decoding (unmarshaling), and accessing protocol
buffers.

There is support for gRPC in Go using protocol buffers.
See the note at the bottom of this file for details.

There are no insertion points in the plugin.


## Using protocol buffers with Go ##

Once the software is installed, there are two steps to using it.
First you must compile the protocol buffer definitions and then import
them, with the support library, into your program.

To compile the protocol buffer definition, run protoc with the --go_out
parameter set to the directory you want to output the Go code to.

	protoc --go_out=. *.proto

The generated files will be suffixed .pb.go.  See the Test code below
for an example using such a file.


The package comment for the proto library contains text describing
the interface provided in Go for protocol buffers. Here is an edited
version.

==========

The proto package converts data structures to and from the
wire format of protocol buffers.  It works in concert with the
Go source code generated for .proto files by the protocol compiler.

A summary of the properties of the protocol buffer interface
for a protocol buffer variable v:

  - Names are turned from camel_case to CamelCase for export.
  - There are no methods on v to set fields; just treat
  	them as structure fields.
  - There are getters that return a field's value if set,
	and return the field's default value if unset.
	The getters work even if the receiver is a nil message.
  - The zero value for a struct is its correct initialization state.
	All desired fields must be set before marshaling.
  - A Reset() method will restore a protobuf struct to its zero state.
  - Non-repeated fields are pointers to the values; nil means unset.
	That is, optional or required field int32 f becomes F *int32.
  - Repeated fields are slices.
  - Helper functions are available to aid the setting of fields.
	Helpers for getting values are superseded by the
	GetFoo methods and their use is deprecated.
		msg.Foo = proto.String("hello") // set field
  - Constants are defined to hold the default values of all fields that
	have them.  They have the form Default_StructName_FieldName.
	Because the getter methods handle defaulted values,
	direct use of these constants should be rare.
  - Enums are given type names and maps from names to values.
	Enum values are prefixed with the enum's type name. Enum types have
	a String method, and a Enum method to assist in message construction.
  - Nested groups and enums have type names prefixed with the name of
  	the surrounding message type.
  - Extensions are given descriptor names that start with E_,
	followed by an underscore-delimited list of the nested messages
	that contain it (if any) followed by the CamelCased name of the
	extension field itself.  HasExtension, ClearExtension, GetExtension
	and SetExtension are functions for manipulating extensions.
  - Oneof field sets are given a single field in their message,
	with distinguished wrapper types for each possible field value.
  - Marshal and Unmarshal are functions to encode and decode the wire format.

When the .proto file specifies `syntax="proto3"`, there are some differences:

  - Non-repeated fields of non-message type are values instead of pointers.
  - Enum types do not get an Enum method.

Consider file test.proto, containing

```proto
	syntax = "proto2";
	package example;
	
	enum FOO { X = 17; };
	
	message Test {
	  required string label = 1;
	  optional int32 type = 2 [default=77];
	  repeated int64 reps = 3;
	  optional group OptionalGroup = 4 {
	    required string RequiredField = 5;
	  }
	}
```

To create and play with a Test object from the example package,

```go
	package main

	import (
		"log"

		"github.com/golang/protobuf/proto"
		"path/to/example"
	)

	func main() {
		test := &example.Test {
			Label: proto.String("hello"),
			Type:  proto.Int32(17),
			Reps:  []int64{1, 2, 3},
			Optionalgroup: &example.Test_OptionalGroup {
				RequiredField: proto.String("good bye"),
			},
		}
		data, err := proto.Marshal(test)
		if err != nil {
			log.Fatal("marshaling error: ", err)
		}
		newTest := &example.Test{}
		err = proto.Unmarshal(data, newTest)
		if err != nil {
			log.Fatal("unmarshaling error: ", err)
		}
		// Now test and newTest contain the same data.
		if test.GetLabel() != newTest.GetLabel() {
			log.Fatalf("data mismatch %q != %q", test.GetLabel(), newTest.GetLabel())
		}
		// etc.
	}
```

## Parameters ##

To pass extra parameters to the plugin, use a comma-separated
parameter list separated from the output directory by a colon:


	protoc --go_out=plugins=grpc,import_path=mypackage:. *.proto


- `import_prefix=xxx` - a prefix that is added onto the beginning of
  all imports. Useful for things like generating protos in a
  subdirectory, or regenerating vendored protobufs in-place.
- `import_path=foo/bar` - used as the package if no input files
  declare `go_package`. If it contains slashes, everything up to the
  rightmost slash is ignored.
- `plugins=plugin1+plugin2` - specifies the list of sub-plugins to
  load. The only plugin in this repo is `grpc`.
- `Mfoo/bar.proto=quux/shme` - declares that foo/bar.proto is
  associated with Go package quux/shme.  This is subject to the
  import_prefix parameter.

## gRPC Support ##

If a proto file specifies RPC services, protoc-gen-go can be instructed to
generate code compatible with gRPC (http://www.grpc.io/). To do this, pass
the `plugins` parameter to protoc-gen-go; the usual way is to insert it into
the --go_out argument to protoc:

	protoc --go_out=plugins=grpc:. *.proto

## Compatibility ##

The library and the generated code are expected to be stable over time.
However, we reserve the right to make breaking changes without notice for the
following reasons:

- Security. A security issue in the specification or implementation may come to
  light whose resolution requires breaking compatibility. We reserve the right
  to address such security issues.
- Unspecified behavior.  There are some aspects of the Protocol Buffers
  specification that are undefined.  Programs that depend on such unspecified
  behavior may break in future releases.
- Specification errors or changes. If it becomes necessary to address an
  inconsistency, incompleteness, or change in the Protocol Buffers
  specification, resolving the issue could affect the meaning or legality of
  existing programs.  We reserve the right to address such issues, including
  updating the implementations.
- Bugs.  If the library has a bug that violates the specification, a program
  that depends on the buggy behavior may break if the bug is fixed.  We reserve
  the right to fix such bugs.
- Adding methods or fields to generated structs.  These may conflict with field
  names that already exist in a schema, causing applications to break.  When the
  code generator encounters a field in the schema that would collide with a
  generated field or method name, the code generator will append an underscore
  to the generated field or method name.
- Adding, removing, or changing methods or fields in generated structs that
  start with `XXX`.  These parts of the generated code are exported out of
  necessity, but should not be considered part of the public API.
- Adding, removing, or changing unexported symbols in generated code.

Any breaking changes outside of these will be announced 6 months in advance to
protobuf@googlegroups.com.

You should, whenever possible, use generated code created by the `protoc-gen-go`
tool built at the same commit as the `proto` package.  The `proto` package
declares package-level constants in the form `ProtoPackageIsVersionX`.
Application code and generated code may depend on one of these constants to
ensure that compilation will fail if the available version of the proto library
is too old.  Whenever we make a change to the generated code that requires newer
library support, in the same commit we will increment the version number of the
generated code and declare a new package-level constant whose name incorporates
the latest version number.  Removing a compatibility constant is considered a
breaking change and would be subject to the announcement policy stated above.

The `protoc-gen-go/generator` package exposes a plugin interface,
which is used by the gRPC code generation. This interface is not
supported and is subject to incompatible changes without notice.


================================================
FILE: vendor/github.com/golang/protobuf/proto/Makefile
================================================
# Go support for Protocol Buffers - Google's data interchange format
#
# Copyright 2010 The Go Authors.  All rights reserved.
# https://github.com/golang/protobuf
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#     * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

install:
	go install

test: install generate-test-pbs
	go test


generate-test-pbs:
	make install
	make -C testdata
	protoc --go_out=Mtestdata/test.proto=github.com/golang/protobuf/proto/testdata,Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any:. proto3_proto/proto3.proto
	make


================================================
FILE: vendor/github.com/golang/protobuf/proto/all_test.go
================================================
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2010 The Go Authors.  All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

package proto_test

import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"math"
	"math/rand"
	"reflect"
	"runtime/debug"
	"strings"
	"testing"
	"time"

	. "github.com/golang/protobuf/proto"
	. "github.com/golang/protobuf/proto/testdata"
)

var globalO *Buffer

func old() *Buffer {
	if globalO == nil {
		globalO = NewBuffer(nil)
	}
	globalO.Reset()
	return globalO
}

func equalbytes(b1, b2 []byte, t *testing.T) {
	if len(b1) != len(b2) {
		t.Errorf("wrong lengths: 2*%d != %d", len(b1), len(b2))
		return
	}
	for i := 0; i < len(b1); i++ {
		if b1[i] != b2[i] {
			t.Errorf("bad byte[%d]:%x %x: %s %s", i, b1[i], b2[i], b1, b2)
		}
	}
}

func initGoTestField() *GoTestField {
	f := new(GoTestField)
	f.Label = String("label")
	f.Type = String("type")
	return f
}

// These are all structurally equivalent but the tag numbers differ.
// (It's remarkable that required, optional, and repeated all have
// 8 letters.)
func initGoTest_RequiredGroup() *GoTest_RequiredGroup {
	return &GoTest_RequiredGroup{
		RequiredField: String("required"),
	}
}

func initGoTest_OptionalGroup() *GoTest_OptionalGroup {
	return &GoTest_OptionalGroup{
		RequiredField: String("optional"),
	}
}

func initGoTest_RepeatedGroup() *GoTest_RepeatedGroup {
	return &GoTest_RepeatedGroup{
		RequiredField: String("repeated"),
	}
}

func initGoTest(setdefaults bool) *GoTest {
	pb := new(GoTest)
	if setdefaults {
		pb.F_BoolDefaulted = Bool(Default_GoTest_F_BoolDefaulted)
		pb.F_Int32Defaulted = Int32(Default_GoTest_F_Int32Defaulted)
		pb.F_Int64Defaulted = Int64(Default_GoTest_F_Int64Defaulted)
		pb.F_Fixed32Defaulted = Uint32(Default_GoTest_F_Fixed32Defaulted)
		pb.F_Fixed64Defaulted = Uint64(Default_GoTest_F_Fixed64Defaulted)
		pb.F_Uint32Defaulted = Uint32(Default_GoTest_F_Uint32Defaulted)
		pb.F_Uint64Defaulted = Uint64(Default_GoTest_F_Uint64Defaulted)
		pb.F_FloatDefaulted = Float32(Default_GoTest_F_FloatDefaulted)
		pb.F_DoubleDefaulted = Float64(Default_GoTest_F_DoubleDefaulted)
		pb.F_StringDefaulted = String(Default_GoTest_F_StringDefaulted)
		pb.F_BytesDefaulted = Default_GoTest_F_BytesDefaulted
		pb.F_Sint32Defaulted = Int32(Default_GoTest_F_Sint32Defaulted)
		pb.F_Sint64Defaulted = Int64(Default_GoTest_F_Sint64Defaulted)
	}

	pb.Kind = GoTest_TIME.Enum()
	pb.RequiredField = initGoTestField()
	pb.F_BoolRequired = Bool(true)
	pb.F_Int32Required = Int32(3)
	pb.F_Int64Required = Int64(6)
	pb.F_Fixed32Required = Uint32(32)
	pb.F_Fixed64Required = Uint64(64)
	pb.F_Uint32Required = Uint32(3232)
	pb.F_Uint64Required = Uint64(6464)
	pb.F_FloatRequired = Float32(3232)
	pb.F_DoubleRequired = Float64(6464)
	pb.F_StringRequired = String("string")
	pb.F_BytesRequired = []byte("bytes")
	pb.F_Sint32Required = Int32(-32)
	pb.F_Sint64Required = Int64(-64)
	pb.Requiredgroup = initGoTest_RequiredGroup()

	return pb
}

func fail(msg string, b *bytes.Buffer, s string, t *testing.T) {
	data := b.Bytes()
	ld := len(data)
	ls := len(s) / 2

	fmt.Printf("fail %s ld=%d ls=%d\n", msg, ld, ls)

	// find the interesting spot - n
	n := ls
	if ld < ls {
		n = ld
	}
	j := 0
	for i := 0; i < n; i++ {
		bs := hex(s[j])*16 + hex(s[j+1])
		j += 2
		if data[i] == bs {
			continue
		}
		n = i
		break
	}
	l := n - 10
	if l < 0 {
		l = 0
	}
	h := n + 10

	// find the interesting spot - n
	fmt.Printf("is[%d]:", l)
	for i := l; i < h; i++ {
		if i >= ld {
			fmt.Printf(" --")
			continue
		}
		fmt.Printf(" %.2x", data[i])
	}
	fmt.Printf("\n")

	fmt.Printf("sb[%d]:", l)
	for i := l; i < h; i++ {
		if i >= ls {
			fmt.Printf(" --")
			continue
		}
		bs := hex(s[j])*16 + hex(s[j+1])
		j += 2
		fmt.Printf(" %.2x", bs)
	}
	fmt.Printf("\n")

	t.Fail()

	//	t.Errorf("%s: \ngood: %s\nbad: %x", msg, s, b.Bytes())
	// Print the output in a partially-decoded format; can
	// be helpful when updating the test.  It produces the output
	// that is pasted, with minor edits, into the argument to verify().
	//	data := b.Bytes()
	//	nesting := 0
	//	for b.Len() > 0 {
	//		start := len(data) - b.Len()
	//		var u uint64
	//		u, err := DecodeVarint(b)
	//		if err != nil {
	//			fmt.Printf("decode error on varint:", err)
	//			return
	//		}
	//		wire := u & 0x7
	//		tag := u >> 3
	//		switch wire {
	//		case WireVarint:
	//			v, err := DecodeVarint(b)
	//			if err != nil {
	//				fmt.Printf("decode error on varint:", err)
	//				return
	//			}
	//			fmt.Printf("\t\t\"%x\"  // field %d, encoding %d, value %d\n",
	//				data[start:len(data)-b.Len()], tag, wire, v)
	//		case WireFixed32:
	//			v, err := DecodeFixed32(b)
	//			if err != nil {
	//				fmt.Printf("decode error on fixed32:", err)
	//				return
	//			}
	//			fmt.Printf("\t\t\"%x\"  // field %d, encoding %d, value %d\n",
	//				data[start:len(data)-b.Len()], tag, wire, v)
	//		case WireFixed64:
	//			v, err := DecodeFixed64(b)
	//			if err != nil {
	//				fmt.Printf("decode error on fixed64:", err)
	//				return
	//			}
	//			fmt.Printf("\t\t\"%x\"  // field %d, encoding %d, value %d\n",
	//				data[start:len(data)-b.Len()], tag, wire, v)
	//		case WireBytes:
	//			nb, err := DecodeVarint(b)
	//			if err != nil {
	//				fmt.Printf("decode error on bytes:", err)
	//				return
	//			}
	//			after_tag := len(data) - b.Len()
	//			str := make([]byte, nb)
	//			_, err = b.Read(str)
	//			if err != nil {
	//				fmt.Printf("decode error on bytes:", err)
	//				return
	//			}
	//			fmt.Printf("\t\t\"%x\" \"%x\"  // field %d, encoding %d (FIELD)\n",
	//				data[start:after_tag], str, tag, wire)
	//		case WireStartGroup:
	//			nesting++
	//			fmt.Printf("\t\t\"%x\"\t\t// start group field %d level %d\n",
	//				data[start:len(data)-b.Len()], tag, nesting)
	//		case WireEndGroup:
	//			fmt.Printf("\t\t\"%x\"\t\t// end group field %d level %d\n",
	//				data[start:len(data)-b.Len()], tag, nesting)
	//			nesting--
	//		default:
	//			fmt.Printf("unrecognized wire type %d\n", wire)
	//			return
	//		}
	//	}
}

func hex(c uint8) uint8 {
	if '0' <= c && c <= '9' {
		return c - '0'
	}
	if 'a' <= c && c <= 'f' {
		return 10 + c - 'a'
	}
	if 'A' <= c && c <= 'F' {
		return 10 + c - 'A'
	}
	return 0
}

func equal(b []byte, s string, t *testing.T) bool {
	if 2*len(b) != len(s) {
		//		fail(fmt.Sprintf("wrong lengths: 2*%d != %d", len(b), len(s)), b, s, t)
		fmt.Printf("wrong lengths: 2*%d != %d\n", len(b), len(s))
		return false
	}
	for i, j := 0, 0; i < len(b); i, j = i+1, j+2 {
		x := hex(s[j])*16 + hex(s[j+1])
		if b[i] != x {
			//			fail(fmt.Sprintf("bad byte[%d]:%x %x", i, b[i], x), b, s, t)
			fmt.Printf("bad byte[%d]:%x %x", i, b[i], x)
			return false
		}
	}
	return true
}

func overify(t *testing.T, pb *GoTest, expected string) {
	o := old()
	err := o.Marshal(pb)
	if err != nil {
		fmt.Printf("overify marshal-1 err = %v", err)
		o.DebugPrint("", o.Bytes())
		t.Fatalf("expected = %s", expected)
	}
	if !equal(o.Bytes(), expected, t) {
		o.DebugPrint("overify neq 1", o.Bytes())
		t.Fatalf("expected = %s", expected)
	}

	// Now test Unmarshal by recreating the original buffer.
	pbd := new(GoTest)
	err = o.Unmarshal(pbd)
	if err != nil {
		t.Fatalf("overify unmarshal err = %v", err)
		o.DebugPrint("", o.Bytes())
		t.Fatalf("string = %s", expected)
	}
	o.Reset()
	err = o.Marshal(pbd)
	if err != nil {
		t.Errorf("overify marshal-2 err = %v", err)
		o.DebugPrint("", o.Bytes())
		t.Fatalf("string = %s", expected)
	}
	if !equal(o.Bytes(), expected, t) {
		o.DebugPrint("overify neq 2", o.Bytes())
		t.Fatalf("string = %s", expected)
	}
}

// Simple tests for numeric encode/decode primitives (varint, etc.)
func TestNumericPrimitives(t *testing.T) {
	for i := uint64(0); i < 1e6; i += 111 {
		o := old()
		if o.EncodeVarint(i) != nil {
			t.Error("EncodeVarint")
			break
		}
		x, e := o.DecodeVarint()
		if e != nil {
			t.Fatal("DecodeVarint")
		}
		if x != i {
			t.Fatal("varint decode fail:", i, x)
		}

		o = old()
		if o.EncodeFixed32(i) != nil {
			t.Fatal("encFixed32")
		}
		x, e = o.DecodeFixed32()
		if e != nil {
			t.Fatal("decFixed32")
		}
		if x != i {
			t.Fatal("fixed32 decode fail:", i, x)
		}

		o = old()
		if o.EncodeFixed64(i*1234567) != nil {
			t.Error("encFixed64")
			break
		}
		x, e = o.DecodeFixed64()
		if e != nil {
			t.Error("decFixed64")
			break
		}
		if x != i*1234567 {
			t.Error("fixed64 decode fail:", i*1234567, x)
			break
		}

		o = old()
		i32 := int32(i - 12345)
		if o.EncodeZigzag32(uint64(i32)) != nil {
			t.Fatal("EncodeZigzag32")
		}
		x, e = o.DecodeZigzag32()
		if e != nil {
			t.Fatal("DecodeZigzag32")
		}
		if x != uint64(uint32(i32)) {
			t.Fatal("zigzag32 decode fail:", i32, x)
		}

		o = old()
		i64 := int64(i - 12345)
		if o.EncodeZigzag64(uint64(i64)) != nil {
			t.Fatal("EncodeZigzag64")
		}
		x, e = o.DecodeZigzag64()
		if e != nil {
			t.Fatal("DecodeZigzag64")
		}
		if x != uint64(i64) {
			t.Fatal("zigzag64 decode fail:", i64, x)
		}
	}
}

// fakeMarshaler is a simple struct implementing Marshaler and Message interfaces.
type fakeMarshaler struct {
	b   []byte
	err error
}

func (f *fakeMarshaler) Marshal() ([]byte, error) { return f.b, f.err }
func (f *fakeMarshaler) String() string           { return fmt.Sprintf("Bytes: %v Error: %v", f.b, f.err) }
func (f *fakeMarshaler) ProtoMessage()            {}
func (f *fakeMarshaler) Reset()                   {}

type msgWithFakeMarshaler struct {
	M *fakeMarshaler `protobuf:"bytes,1,opt,name=fake"`
}

func (m *msgWithFakeMarshaler) String() string { return CompactTextString(m) }
func (m *msgWithFakeMarshaler) ProtoMessage()  {}
func (m *msgWithFakeMarshaler) Reset()         {}

// Simple tests for proto messages that implement the Marshaler interface.
func TestMarshalerEncoding(t *testing.T) {
	tests := []struct {
		name    string
		m       Message
		want    []byte
		errType reflect.Type
	}{
		{
			name: "Marshaler that fails",
			m: &fakeMarshaler{
				err: errors.New("some marshal err"),
				b:   []byte{5, 6, 7},
			},
			// Since the Marshal method returned bytes, they should be written to the
			// buffer.  (For efficiency, we assume that Marshal implementations are
			// always correct w.r.t. RequiredNotSetError and output.)
			want:    []byte{5, 6, 7},
			errType: reflect.TypeOf(errors.New("some marshal err")),
		},
		{
			name: "Marshaler that fails with RequiredNotSetError",
			m: &msgWithFakeMarshaler{
				M: &fakeMarshaler{
					err: &RequiredNotSetError{},
					b:   []byte{5, 6, 7},
				},
			},
			// Since there's an error that can be continued after,
			// the buffer should be written.
			want: []byte{
				10, 3, // for &msgWithFakeMarshaler
				5, 6, 7, // for &fakeMarshaler
			},
			errType: reflect.TypeOf(&RequiredNotSetError{}),
		},
		{
			name: "Marshaler that succeeds",
			m: &fakeMarshaler{
				b: []byte{0, 1, 2, 3, 4, 127, 255},
			},
			want: []byte{0, 1, 2, 3, 4, 127, 255},
		},
	}
	for _, test := range tests {
		b := NewBuffer(nil)
		err := b.Marshal(test.m)
		if reflect.TypeOf(err) != test.errType {
			t.Errorf("%s: got err %T(%v) wanted %T", test.name, err, err, test.errType)
		}
		if !reflect.DeepEqual(test.want, b.Bytes()) {
			t.Errorf("%s: got bytes %v wanted %v", test.name, b.Bytes(), test.want)
		}
		if size := Size(test.m); size != len(b.Bytes()) {
			t.Errorf("%s: Size(_) = %v, but marshaled to %v bytes", test.name, size, len(b.Bytes()))
		}

		m, mErr := Marshal(test.m)
		if !bytes.Equal(b.Bytes(), m) {
			t.Errorf("%s: Marshal returned %v, but (*Buffer).Marshal wrote %v", test.name, m, b.Bytes())
		}
		if !reflect.DeepEqual(err, mErr) {
			t.Errorf("%s: Marshal err = %q, but (*Buffer).Marshal returned %q",
				test.name, fmt.Sprint(mErr), fmt.Sprint(err))
		}
	}
}

// Simple tests for bytes
func TestBytesPrimitives(t *testing.T) {
	o := old()
	bytes := []byte{'n', 'o', 'w', ' ', 'i', 's', ' ', 't', 'h', 'e', ' ', 't', 'i', 'm', 'e'}
	if o.EncodeRawBytes(bytes) != nil {
		t.Error("EncodeRawBytes")
	}
	decb, e := o.DecodeRawBytes(false)
	if e != nil {
		t.Error("DecodeRawBytes")
	}
	equalbytes(bytes, decb, t)
}

// Simple tests for strings
func TestStringPrimitives(t *testing.T) {
	o := old()
	s := "now is the time"
	if o.EncodeStringBytes(s) != nil {
		t.Error("enc_string")
	}
	decs, e := o.DecodeStringBytes()
	if e != nil {
		t.Error("dec_string")
	}
	if s != decs {
		t.Error("string encode/decode fail:", s, decs)
	}
}

// Do we catch the "required bit not set" case?
func TestRequiredBit(t *testing.T) {
	o := old()
	pb := new(GoTest)
	err := o.Marshal(pb)
	if err == nil {
		t.Error("did not catch missing required fields")
	} else if strings.Index(err.Error(), "Kind") < 0 {
		t.Error("wrong error type:", err)
	}
}

// Check that all fields are nil.
// Clearly silly, and a residue from a more interesting test with an earlier,
// different initialization property, but it once caught a compiler bug so
// it lives.
func checkInitialized(pb *GoTest, t *testing.T) {
	if pb.F_BoolDefaulted != nil {
		t.Error("New or Reset did not set boolean:", *pb.F_BoolDefaulted)
	}
	if pb.F_Int32Defaulted != nil {
		t.Error("New or Reset did not set int32:", *pb.F_Int32Defaulted)
	}
	if pb.F_Int64Defaulted != nil {
		t.Error("New or Reset did not set int64:", *pb.F_Int64Defaulted)
	}
	if pb.F_Fixed32Defaulted != nil {
		t.Error("New or Reset did not set fixed32:", *pb.F_Fixed32Defaulted)
	}
	if pb.F_Fixed64Defaulted != nil {
		t.Error("New or Reset did not set fixed64:", *pb.F_Fixed64Defaulted)
	}
	if pb.F_Uint32Defaulted != nil {
		t.Error("New or Reset did not set uint32:", *pb.F_Uint32Defaulted)
	}
	if pb.F_Uint64Defaulted != nil {
		t.Error("New or Reset did not set uint64:", *pb.F_Uint64Defaulted)
	}
	if pb.F_FloatDefaulted != nil {
		t.Error("New or Reset did not set float:", *pb.F_FloatDefaulted)
	}
	if pb.F_DoubleDefaulted != nil {
		t.Error("New or Reset did not set double:", *pb.F_DoubleDefaulted)
	}
	if pb.F_StringDefaulted != nil {
		t.Error("New or Reset did not set string:", *pb.F_StringDefaulted)
	}
	if pb.F_BytesDefaulted != nil {
		t.Error("New or Reset did not set bytes:", string(pb.F_BytesDefaulted))
	}
	if pb.F_Sint32Defaulted != nil {
		t.Error("New or Reset did not set int32:", *pb.F_Sint32Defaulted)
	}
	if pb.F_Sint64Defaulted != nil {
		t.Error("New or Reset did not set int64:", *pb.F_Sint64Defaulted)
	}
}

// Does Reset() reset?
func TestReset(t *testing.T) {
	pb := initGoTest(true)
	// muck with some values
	pb.F_BoolDefaulted = Bool(false)
	pb.F_Int32Defaulted = Int32(237)
	pb.F_Int64Defaulted = Int64(12346)
	pb.F_Fixed32Defaulted = Uint32(32000)
	pb.F_Fixed64Defaulted = Uint64(666)
	pb.F_Uint32Defaulted = Uint32(323232)
	pb.F_Uint64Defaulted = nil
	pb.F_FloatDefaulted = nil
	pb.F_DoubleDefaulted = Float64(0)
	pb.F_StringDefaulted = String("gotcha")
	pb.F_BytesDefaulted = []byte("asdfasdf")
	pb.F_Sint32Defaulted = Int32(123)
	pb.F_Sint64Defaulted = Int64(789)
	pb.Reset()
	checkInitialized(pb, t)
}

// All required fields set, no defaults provided.
func TestEncodeDecode1(t *testing.T) {
	pb := initGoTest(false)
	overify(t, pb,
		"0807"+ // field 1, encoding 0, value 7
			"220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField)
			"5001"+ // field 10, encoding 0, value 1
			"5803"+ // field 11, encoding 0, value 3
			"6006"+ // field 12, encoding 0, value 6
			"6d20000000"+ // field 13, encoding 5, value 0x20
			"714000000000000000"+ // field 14, encoding 1, value 0x40
			"78a019"+ // field 15, encoding 0, value 0xca0 = 3232
			"8001c032"+ // field 16, encoding 0, value 0x1940 = 6464
			"8d0100004a45"+ // field 17, encoding 5, value 3232.0
			"9101000000000040b940"+ // field 18, encoding 1, value 6464.0
			"9a0106"+"737472696e67"+ // field 19, encoding 2, string "string"
			"b304"+ // field 70, encoding 3, start group
			"ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required"
			"b404"+ // field 70, encoding 4, end group
			"aa0605"+"6279746573"+ // field 101, encoding 2, string "bytes"
			"b0063f"+ // field 102, encoding 0, 0x3f zigzag32
			"b8067f") // field 103, encoding 0, 0x7f zigzag64
}

// All required fields set, defaults provided.
func TestEncodeDecode2(t *testing.T) {
	pb := initGoTest(true)
	overify(t, pb,
		"0807"+ // field 1, encoding 0, value 7
			"220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField)
			"5001"+ // field 10, encoding 0, value 1
			"5803"+ // field 11, encoding 0, value 3
			"6006"+ // field 12, encoding 0, value 6
			"6d20000000"+ // field 13, encoding 5, value 32
			"714000000000000000"+ // field 14, encoding 1, value 64
			"78a019"+ // field 15, encoding 0, value 3232
			"8001c032"+ // field 16, encoding 0, value 6464
			"8d0100004a45"+ // field 17, encoding 5, value 3232.0
			"9101000000000040b940"+ // field 18, encoding 1, value 6464.0
			"9a0106"+"737472696e67"+ // field 19, encoding 2 string "string"
			"c00201"+ // field 40, encoding 0, value 1
			"c80220"+ // field 41, encoding 0, value 32
			"d00240"+ // field 42, encoding 0, value 64
			"dd0240010000"+ // field 43, encoding 5, value 320
			"e1028002000000000000"+ // field 44, encoding 1, value 640
			"e8028019"+ // field 45, encoding 0, value 3200
			"f0028032"+ // field 46, encoding 0, value 6400
			"fd02e0659948"+ // field 47, encoding 5, value 314159.0
			"81030000000050971041"+ // field 48, encoding 1, value 271828.0
			"8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n"
			"b304"+ // start group field 70 level 1
			"ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required"
			"b404"+ // end group field 70 level 1
			"aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes"
			"b0063f"+ // field 102, encoding 0, 0x3f zigzag32
			"b8067f"+ // field 103, encoding 0, 0x7f zigzag64
			"8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose"
			"90193f"+ // field 402, encoding 0, value 63
			"98197f") // field 403, encoding 0, value 127

}

// All default fields set to their default value by hand
func TestEncodeDecode3(t *testing.T) {
	pb := initGoTest(false)
	pb.F_BoolDefaulted = Bool(true)
	pb.F_Int32Defaulted = Int32(32)
	pb.F_Int64Defaulted = Int64(64)
	pb.F_Fixed32Defaulted = Uint32(320)
	pb.F_Fixed64Defaulted = Uint64(640)
	pb.F_Uint32Defaulted = Uint32(3200)
	pb.F_Uint64Defaulted = Uint64(6400)
	pb.F_FloatDefaulted = Float32(314159)
	pb.F_DoubleDefaulted = Float64(271828)
	pb.F_StringDefaulted = String("hello, \"world!\"\n")
	pb.F_BytesDefaulted = []byte("Bignose")
	pb.F_Sint32Defaulted = Int32(-32)
	pb.F_Sint64Defaulted = Int64(-64)

	overify(t, pb,
		"0807"+ // field 1, encoding 0, value 7
			"220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField)
			"5001"+ // field 10, encoding 0, value 1
			"5803"+ // field 11, encoding 0, value 3
			"6006"+ // field 12, encoding 0, value 6
			"6d20000000"+ // field 13, encoding 5, value 32
			"714000000000000000"+ // field 14, encoding 1, value 64
			"78a019"+ // field 15, encoding 0, value 3232
			"8001c032"+ // field 16, encoding 0, value 6464
			"8d0100004a45"+ // field 17, encoding 5, value 3232.0
			"9101000000000040b940"+ // field 18, encoding 1, value 6464.0
			"9a0106"+"737472696e67"+ // field 19, encoding 2 string "string"
			"c00201"+ // field 40, encoding 0, value 1
			"c80220"+ // field 41, encoding 0, value 32
			"d00240"+ // field 42, encoding 0, value 64
			"dd0240010000"+ // field 43, encoding 5, value 320
			"e1028002000000000000"+ // field 44, encoding 1, value 640
			"e8028019"+ // field 45, encoding 0, value 3200
			"f0028032"+ // field 46, encoding 0, value 6400
			"fd02e0659948"+ // field 47, encoding 5, value 314159.0
			"81030000000050971041"+ // field 48, encoding 1, value 271828.0
			"8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n"
			"b304"+ // start group field 70 level 1
			"ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required"
			"b404"+ // end group field 70 level 1
			"aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes"
			"b0063f"+ // field 102, encoding 0, 0x3f zigzag32
			"b8067f"+ // field 103, encoding 0, 0x7f zigzag64
			"8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose"
			"90193f"+ // field 402, encoding 0, value 63
			"98197f") // field 403, encoding 0, value 127

}

// All required fields set, defaults provided, all non-defaulted optional fields have values.
func TestEncodeDecode4(t *testing.T) {
	pb := initGoTest(true)
	pb.Table = String("hello")
	pb.Param = Int32(7)
	pb.OptionalField = initGoTestField()
	pb.F_BoolOptional = Bool(true)
	pb.F_Int32Optional = Int32(32)
	pb.F_Int64Optional = Int64(64)
	pb.F_Fixed32Optional = Uint32(3232)
	pb.F_Fixed64Optional = Uint64(6464)
	pb.F_Uint32Optional = Uint32(323232)
	pb.F_Uint64Optional = Uint64(646464)
	pb.F_FloatOptional = Float32(32.)
	pb.F_DoubleOptional = Float64(64.)
	pb.F_StringOptional = String("hello")
	pb.F_BytesOptional = []byte("Bignose")
	pb.F_Sint32Optional = Int32(-32)
	pb.F_Sint64Optional = Int64(-64)
	pb.Optionalgroup = initGoTest_OptionalGroup()

	overify(t, pb,
		"0807"+ // field 1, encoding 0, value 7
			"1205"+"68656c6c6f"+ // field 2, encoding 2, string "hello"
			"1807"+ // field 3, encoding 0, value 7
			"220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField)
			"320d"+"0a056c6162656c120474797065"+ // field 6, encoding 2 (GoTestField)
			"5001"+ // field 10, encoding 0, value 1
			"5803"+ // field 11, encoding 0, value 3
			"6006"+ // field 12, encoding 0, value 6
			"6d20000000"+ // field 13, encoding 5, value 32
			"714000000000000000"+ // field 14, encoding 1, value 64
			"78a019"+ // field 15, encoding 0, value 3232
			"8001c032"+ // field 16, encoding 0, value 6464
			"8d0100004a45"+ // field 17, encoding 5, value 3232.0
			"9101000000000040b940"+ // field 18, encoding 1, value 6464.0
			"9a0106"+"737472696e67"+ // field 19, encoding 2 string "string"
			"f00101"+ // field 30, encoding 0, value 1
			"f80120"+ // field 31, encoding 0, value 32
			"800240"+ // field 32, encoding 0, value 64
			"8d02a00c0000"+ // field 33, encoding 5, value 3232
			"91024019000000000000"+ // field 34, encoding 1, value 6464
			"9802a0dd13"+ // field 35, encoding 0, value 323232
			"a002c0ba27"+ // field 36, encoding 0, value 646464
			"ad0200000042"+ // field 37, encoding 5, value 32.0
			"b1020000000000005040"+ // field 38, encoding 1, value 64.0
			"ba0205"+"68656c6c6f"+ // field 39, encoding 2, string "hello"
			"c00201"+ // field 40, encoding 0, value 1
			"c80220"+ // field 41, encoding 0, value 32
			"d00240"+ // field 42, encoding 0, value 64
			"dd0240010000"+ // field 43, encoding 5, value 320
			"e1028002000000000000"+ // field 44, encoding 1, value 640
			"e8028019"+ // field 45, encoding 0, value 3200
			"f0028032"+ // field 46, encoding 0, value 6400
			"fd02e0659948"+ // field 47, encoding 5, value 314159.0
			"81030000000050971041"+ // field 48, encoding 1, value 271828.0
			"8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n"
			"b304"+ // start group field 70 level 1
			"ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required"
			"b404"+ // end group field 70 level 1
			"d305"+ // start group field 90 level 1
			"da0508"+"6f7074696f6e616c"+ // field 91, encoding 2, string "optional"
			"d405"+ // end group field 90 level 1
			"aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes"
			"b0063f"+ // field 102, encoding 0, 0x3f zigzag32
			"b8067f"+ // field 103, encoding 0, 0x7f zigzag64
			"ea1207"+"4269676e6f7365"+ // field 301, encoding 2, string "Bignose"
			"f0123f"+ // field 302, encoding 0, value 63
			"f8127f"+ // field 303, encoding 0, value 127
			"8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose"
			"90193f"+ // field 402, encoding 0, value 63
			"98197f") // field 403, encoding 0, value 127

}

// All required fields set, defaults provided, all repeated fields given two values.
func TestEncodeDecode5(t *testing.T) {
	pb := initGoTest(true)
	pb.RepeatedField = []*GoTestField{initGoTestField(), initGoTestField()}
	pb.F_BoolRepeated = []bool{false, true}
	pb.F_Int32Repeated = []int32{32, 33}
	pb.F_Int64Repeated = []int64{64, 65}
	pb.F_Fixed32Repeated = []uint32{3232, 3333}
	pb.F_Fixed64Repeated = []uint64{6464, 6565}
	pb.F_Uint32Repeated = []uint32{323232, 333333}
	pb.F_Uint64Repeated = []uint64{646464, 656565}
	pb.F_FloatRepeated = []float32{32., 33.}
	pb.F_DoubleRepeated = []float64{64., 65.}
	pb.F_StringRepeated = []string{"hello", "sailor"}
	pb.F_BytesRepeated = [][]byte{[]byte("big"), []byte("nose")}
	pb.F_Sint32Repeated = []int32{32, -32}
	pb.F_Sint64Repeated = []int64{64, -64}
	pb.Repeatedgroup = []*GoTest_RepeatedGroup{initGoTest_RepeatedGroup(), initGoTest_RepeatedGroup()}

	overify(t, pb,
		"0807"+ // field 1, encoding 0, value 7
			"220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField)
			"2a0d"+"0a056c6162656c120474797065"+ // field 5, encoding 2 (GoTestField)
			"2a0d"+"0a056c6162656c120474797065"+ // field 5, encoding 2 (GoTestField)
			"5001"+ // field 10, encoding 0, value 1
			"5803"+ // field 11, encoding 0, value 3
			"6006"+ // field 12, encoding 0, value 6
			"6d20000000"+ // field 13, encoding 5, value 32
			"714000000000000000"+ // field 14, encoding 1, value 64
			"78a019"+ // field 15, encoding 0, value 3232
			"8001c032"+ // field 16, encoding 0, value 6464
			"8d0100004a45"+ // field 17, encoding 5, value 3232.0
			"9101000000000040b940"+ // field 18, encoding 1, value 6464.0
			"9a0106"+"737472696e67"+ // field 19, encoding 2 string "string"
			"a00100"+ // field 20, encoding 0, value 0
			"a00101"+ // field 20, encoding 0, value 1
			"a80120"+ // field 21, encoding 0, value 32
			"a80121"+ // field 21, encoding 0, value 33
			"b00140"+ // field 22, encoding 0, value 64
			"b00141"+ // field 22, encoding 0, value 65
			"bd01a00c0000"+ // field 23, encoding 5, value 3232
			"bd01050d0000"+ // field 23, encoding 5, value 3333
			"c1014019000000000000"+ // field 24, encoding 1, value 6464
			"c101a519000000000000"+ // field 24, encoding 1, value 6565
			"c801a0dd13"+ // field 25, encoding 0, value 323232
			"c80195ac14"+ // field 25, encoding 0, value 333333
			"d001c0ba27"+ // field 26, encoding 0, value 646464
			"d001b58928"+ // field 26, encoding 0, value 656565
			"dd0100000042"+ // field 27, encoding 5, value 32.0
			"dd0100000442"+ // field 27, encoding 5, value 33.0
			"e1010000000000005040"+ // field 28, encoding 1, value 64.0
			"e1010000000000405040"+ // field 28, encoding 1, value 65.0
			"ea0105"+"68656c6c6f"+ // field 29, encoding 2, string "hello"
			"ea0106"+"7361696c6f72"+ // field 29, encoding 2, string "sailor"
			"c00201"+ // field 40, encoding 0, value 1
			"c80220"+ // field 41, encoding 0, value 32
			"d00240"+ // field 42, encoding 0, value 64
			"dd0240010000"+ // field 43, encoding 5, value 320
			"e1028002000000000000"+ // field 44, encoding 1, value 640
			"e8028019"+ // field 45, encoding 0, value 3200
			"f0028032"+ // field 46, encoding 0, value 6400
			"fd02e0659948"+ // field 47, encoding 5, value 314159.0
			"81030000000050971041"+ // field 48, encoding 1, value 271828.0
			"8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n"
			"b304"+ // start group field 70 level 1
			"ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required"
			"b404"+ // end group field 70 level 1
			"8305"+ // start group field 80 level 1
			"8a0508"+"7265706561746564"+ // field 81, encoding 2, string "repeated"
			"8405"+ // end group field 80 level 1
			"8305"+ // start group field 80 level 1
			"8a0508"+"7265706561746564"+ // field 81, encoding 2, string "repeated"
			"8405"+ // end group field 80 level 1
			"aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes"
			"b0063f"+ // field 102, encoding 0, 0x3f zigzag32
			"b8067f"+ // field 103, encoding 0, 0x7f zigzag64
			"ca0c03"+"626967"+ // field 201, encoding 2, string "big"
			"ca0c04"+"6e6f7365"+ // field 201, encoding 2, string "nose"
			"d00c40"+ // field 202, encoding 0, value 32
			"d00c3f"+ // field 202, encoding 0, value -32
			"d80c8001"+ // field 203, encoding 0, value 64
			"d80c7f"+ // field 203, encoding 0, value -64
			"8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose"
			"90193f"+ // field 402, encoding 0, value 63
			"98197f") // field 403, encoding 0, value 127

}

// All required fields set, all packed repeated fields given two values.
func TestEncodeDecode6(t *testing.T) {
	pb := initGoTest(false)
	pb.F_BoolRepeatedPacked = []bool{false, true}
	pb.F_Int32RepeatedPacked = []int32{32, 33}
	pb.F_Int64RepeatedPacked = []int64{64, 65}
	pb.F_Fixed32RepeatedPacked = []uint32{3232, 3333}
	pb.F_Fixed64RepeatedPacked = []uint64{6464, 6565}
	pb.F_Uint32RepeatedPacked = []uint32{323232, 333333}
	pb.F_Uint64RepeatedPacked = []uint64{646464, 656565}
	pb.F_FloatRepeatedPacked = []float32{32., 33.}
	pb.F_DoubleRepeatedPacked = []float64{64., 65.}
	pb.F_Sint32RepeatedPacked = []int32{32, -32}
	pb.F_Sint64RepeatedPacked = []int64{64, -64}

	overify(t, pb,
		"0807"+ // field 1, encoding 0, value 7
			"220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField)
			"5001"+ // field 10, encoding 0, value 1
			"5803"+ // field 11, encoding 0, value 3
			"6006"+ // field 12, encoding 0, value 6
			"6d20000000"+ // field 13, encoding 5, value 32
			"714000000000000000"+ // field 14, encoding 1, value 64
			"78a019"+ // field 15, encoding 0, value 3232
			"8001c032"+ // field 16, encoding 0, value 6464
			"8d0100004a45"+ // field 17, encoding 5, value 3232.0
			"9101000000000040b940"+ // field 18, encoding 1, value 6464.0
			"9a0106"+"737472696e67"+ // field 19, encoding 2 string "string"
			"9203020001"+ // field 50, encoding 2, 2 bytes, value 0, value 1
			"9a03022021"+ // field 51, encoding 2, 2 bytes, value 32, value 33
			"a203024041"+ // field 52, encoding 2, 2 bytes, value 64, value 65
			"aa0308"+ // field 53, encoding 2, 8 bytes
			"a00c0000050d0000"+ // value 3232, value 3333
			"b20310"+ // field 54, encoding 2, 16 bytes
			"4019000000000000a519000000000000"+ // value 6464, value 6565
			"ba0306"+ // field 55, encoding 2, 6 bytes
			"a0dd1395ac14"+ // value 323232, value 333333
			"c20306"+ // field 56, encoding 2, 6 bytes
			"c0ba27b58928"+ // value 646464, value 656565
			"ca0308"+ // field 57, encoding 2, 8 bytes
			"0000004200000442"+ // value 32.0, value 33.0
			"d20310"+ // field 58, encoding 2, 16 bytes
			"00000000000050400000000000405040"+ // value 64.0, value 65.0
			"b304"+ // start group field 70 level 1
			"ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required"
			"b404"+ // end group field 70 level 1
			"aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes"
			"b0063f"+ // field 102, encoding 0, 0x3f zigzag32
			"b8067f"+ // field 103, encoding 0, 0x7f zigzag64
			"b21f02"+ // field 502, encoding 2, 2 bytes
			"403f"+ // value 32, value -32
			"ba1f03"+ // field 503, encoding 2, 3 bytes
			"80017f") // value 64, value -64
}

// Test that we can encode empty bytes fields.
func TestEncodeDecodeBytes1(t *testing.T) {
	pb := initGoTest(false)

	// Create our bytes
	pb.F_BytesRequired = []byte{}
	pb.F_BytesRepeated = [][]byte{{}}
	pb.F_BytesOptional = []byte{}

	d, err := Marshal(pb)
	if err != nil {
		t.Error(err)
	}

	pbd := new(GoTest)
	if err := Unmarshal(d, pbd); err != nil {
		t.Error(err)
	}

	if pbd.F_BytesRequired == nil || len(pbd.F_BytesRequired) != 0 {
		t.Error("required empty bytes field is incorrect")
	}
	if pbd.F_BytesRepeated == nil || len(pbd.F_BytesRepeated) == 1 && pbd.F_BytesRepeated[0] == nil {
		t.Error("repeated empty bytes field is incorrect")
	}
	if pbd.F_BytesOptional == nil || len(pbd.F_BytesOptional) != 0 {
		t.Error("optional empty bytes field is incorrect")
	}
}

// Test that we encode nil-valued fields of a repeated bytes field correctly.
// Since entries in a repeated field cannot be nil, nil must mean empty value.
func TestEncodeDecodeBytes2(t *testing.T) {
	pb := initGoTest(false)

	// Create our bytes
	pb.F_BytesRepeated = [][]byte{nil}

	d, err := Marshal(pb)
	if err != nil {
		t.Error(err)
	}

	pbd := new(GoTest)
	if err := Unmarshal(d, pbd); err != nil {
		t.Error(err)
	}

	if len(pbd.F_BytesRepeated) != 1 || pbd.F_BytesRepeated[0] == nil {
		t.Error("Unexpected value for repeated bytes field")
	}
}

// All required fields set, defaults provided, all repeated fields given two values.
func TestSkippingUnrecognizedFields(t *testing.T) {
	o := old()
	pb := initGoTestField()

	// Marshal it normally.
	o.Marshal(pb)

	// Now new a GoSkipTest record.
	skip := &GoSkipTest{
		SkipInt32:   Int32(32),
		SkipFixed32: Uint32(3232),
		SkipFixed64: Uint64(6464),
		SkipString:  String("skipper"),
		Skipgroup: &GoSkipTest_SkipGroup{
			GroupInt32:  Int32(75),
			GroupString: String("wxyz"),
		},
	}

	// Marshal it into same buffer.
	o.Marshal(skip)

	pbd := new(GoTestField)
	o.Unmarshal(pbd)

	// The __unrecognized field should be a marshaling of GoSkipTest
	skipd := new(GoSkipTest)

	o.SetBuf(pbd.XXX_unrecognized)
	o.Unmarshal(skipd)

	if *skipd.SkipInt32 != *skip.SkipInt32 {
		t.Error("skip int32", skipd.SkipInt32)
	}
	if *skipd.SkipFixed32 != *skip.SkipFixed32 {
		t.Error("skip fixed32", skipd.SkipFixed32)
	}
	if *skipd.SkipFixed64 != *skip.SkipFixed64 {
		t.Error("skip fixed64", skipd.SkipFixed64)
	}
	if *skipd.SkipString != *skip.SkipString {
		t.Error("skip string", *skipd.SkipString)
	}
	if *skipd.Skipgroup.GroupInt32 != *skip.Skipgroup.GroupInt32 {
		t.Error("skip group int32", skipd.Skipgroup.GroupInt32)
	}
	if *skipd.Skipgroup.GroupString != *skip.Skipgroup.GroupString {
		t.Error("skip group string", *skipd.Skipgroup.GroupString)
	}
}

// Check that unrecognized fields of a submessage are preserved.
func TestSubmessageUnrecognizedFields(t *testing.T) {
	nm := &NewMessage{
		Nested: &NewMessage_Nested{
			Name:      String("Nigel"),
			FoodGroup: String("carbs"),
		},
	}
	b, err := Marshal(nm)
	if err != nil {
		t.Fatalf("Marshal of NewMessage: %v", err)
	}

	// Unmarshal into an OldMessage.
	om := new(OldMessage)
	if err := Unmarshal(b, om); err != nil {
		t.Fatalf("Unmarshal to OldMessage: %v", err)
	}
	exp := &OldMessage{
		Nested: &OldMessage_Nested{
			Name: String("Nigel"),
			// normal protocol buffer users should not do this
			XXX_unrecognized: []byte("\x12\x05carbs"),
		},
	}
	if !Equal(om, exp) {
		t.Errorf("om = %v, want %v", om, exp)
	}

	// Clone the OldMessage.
	om = Clone(om).(*OldMessage)
	if !Equal(om, exp) {
		t.Errorf("Clone(om) = %v, want %v", om, exp)
	}

	// Marshal the OldMessage, then unmarshal it into an empty NewMessage.
	if b, err = Marshal(om); err != nil {
		t.Fatalf("Marshal of OldMessage: %v", err)
	}
	t.Logf("Marshal(%v) -> %q", om, b)
	nm2 := new(NewMessage)
	if err := Unmarshal(b, nm2); err != nil {
		t.Fatalf("Unmarshal to NewMessage: %v", err)
	}
	if !Equal(nm, nm2) {
		t.Errorf("NewMessage round-trip: %v => %v", nm, nm2)
	}
}

// Check that an int32 field can be upgraded to an int64 field.
func TestNegativeInt32(t *testing.T) {
	om := &OldMessage{
		Num: Int32(-1),
	}
	b, err := Marshal(om)
	if err != nil {
		t.Fatalf("Marshal of OldMessage: %v", err)
	}

	// Check the size. It should be 11 bytes;
	// 1 for the field/wire type, and 10 for the negative number.
	if len(b) != 11 {
		t.Errorf("%v marshaled as %q, wanted 11 bytes", om, b)
	}

	// Unmarshal into a NewMessage.
	nm := new(NewMessage)
	if err := Unmarshal(b, nm); err != nil {
		t.Fatalf("Unmarshal to NewMessage: %v", err)
	}
	want := &NewMessage{
		Num: Int64(-1),
	}
	if !Equal(nm, want) {
		t.Errorf("nm = %v, want %v", nm, want)
	}
}

// Check that we can grow an array (repeated field) to have many elements.
// This test doesn't depend only on our encoding; for variety, it makes sure
// we create, encode, and decode the correct contents explicitly.  It's therefore
// a bit messier.
// This test also uses (and hence tests) the Marshal/Unmarshal functions
// instead of the methods.
func TestBigRepeated(t *testing.T) {
	pb := initGoTest(true)

	// Create the arrays
	const N = 50 // Internally the library starts much smaller.
	pb.Repeatedgroup = make([]*GoTest_RepeatedGroup, N)
	pb.F_Sint64Repeated = make([]int64, N)
	pb.F_Sint32Repeated = make([]int32, N)
	pb.F_BytesRepeated = make([][]byte, N)
	pb.F_StringRepeated = make([]string, N)
	pb.F_DoubleRepeated = make([]float64, N)
	pb.F_FloatRepeated = make([]float32, N)
	pb.F_Uint64Repeated = make([]uint64, N)
	pb.F_Uint32Repeated = make([]uint32, N)
	pb.F_Fixed64Repeated = make([]uint64, N)
	pb.F_Fixed32Repeated = make([]uint32, N)
	pb.F_Int64Repeated = make([]int64, N)
	pb.F_Int32Repeated = make([]int32, N)
	pb.F_BoolRepeated = make([]bool, N)
	pb.RepeatedField = make([]*GoTestField, N)

	// Fill in the arrays with checkable values.
	igtf := initGoTestField()
	igtrg := initGoTest_RepeatedGroup()
	for i := 0; i < N; i++ {
		pb.Repeatedgroup[i] = igtrg
		pb.F_Sint64Repeated[i] = int64(i)
		pb.F_Sint32Repeated[i] = int32(i)
		s := fmt.Sprint(i)
		pb.F_BytesRepeated[i] = []byte(s)
		pb.F_StringRepeated[i] = s
		pb.F_DoubleRepeated[i] = float64(i)
		pb.F_FloatRepeated[i] = float32(i)
		pb.F_Uint64Repeated[i] = uint64(i)
		pb.F_Uint32Repeated[i] = uint32(i)
		pb.F_Fixed64Repeated[i] = uint64(i)
		pb.F_Fixed32Repeated[i] = uint32(i)
		pb.F_Int64Repeated[i] = int64(i)
		pb.F_Int32Repeated[i] = int32(i)
		pb.F_BoolRepeated[i] = i%2 == 0
		pb.RepeatedField[i] = igtf
	}

	// Marshal.
	buf, _ := Marshal(pb)

	// Now test Unmarshal by recreating the original buffer.
	pbd := new(GoTest)
	Unmarshal(buf, pbd)

	// Check the checkable values
	for i := uint64(0); i < N; i++ {
		if pbd.Repeatedgroup[i] == nil { // TODO: more checking?
			t.Error("pbd.Repeatedgroup bad")
		}
		var x uint64
		x = uint64(pbd.F_Sint64Repeated[i])
		if x != i {
			t.Error("pbd.F_Sint64Repeated bad", x, i)
		}
		x = uint64(pbd.F_Sint32Repeated[i])
		if x != i {
			t.Error("pbd.F_Sint32Repeated bad", x, i)
		}
		s := fmt.Sprint(i)
		equalbytes(pbd.F_BytesRepeated[i], []byte(s), t)
		if pbd.F_StringRepeated[i] != s {
			t.Error("pbd.F_Sint32Repeated bad", pbd.F_StringRepeated[i], i)
		}
		x = uint64(pbd.F_DoubleRepeated[i])
		if x != i {
			t.Error("pbd.F_DoubleRepeated bad", x, i)
		}
		x = uint64(pbd.F_FloatRepeated[i])
		if x != i {
			t.Error("pbd.F_FloatRepeated bad", x, i)
		}
		x = pbd.F_Uint64Repeated[i]
		if x != i {
			t.Error("pbd.F_Uint64Repeated bad", x, i)
		}
		x = uint64(pbd.F_Uint32Repeated[i])
		if x != i {
			t.Error("pbd.F_Uint32Repeated bad", x, i)
		}
		x = pbd.F_Fixed64Repeated[i]
		if x != i {
			t.Error("pbd.F_Fixed64Repeated bad", x, i)
		}
		x = uint64(pbd.F_Fixed32Repeated[i])
		if x != i {
			t.Error("pbd.F_Fixed32Repeated bad", x, i)
		}
		x = uint64(pbd.F_Int64Repeated[i])
		if x != i {
			t.Error("pbd.F_Int64Repeated bad", x, i)
		}
		x = uint64(pbd.F_Int32Repeated[i])
		if x != i {
			t.Error("pbd.F_Int32Repeated bad", x, i)
		}
		if pbd.F_BoolRepeated[i] != (i%2 == 0) {
			t.Error("pbd.F_BoolRepeated bad", x, i)
		}
		if pbd.RepeatedField[i] == nil { // TODO: more checking?
			t.Error("pbd.RepeatedField bad")
		}
	}
}

// Verify we give a useful message when decoding to the wrong structure type.
func TestTypeMismatch(t *testing.T) {
	pb1 := initGoTest(true)

	// Marshal
	o := old()
	o.Marshal(pb1)

	// Now Unmarshal it to the wrong type.
	pb2 := initGoTestField()
	err := o.Unmarshal(pb2)
	if err == nil {
		t.Error("expected error, got no error")
	} else if !strings.Contains(err.Error(), "bad wiretype") {
		t.Error("expected bad wiretype error, got", err)
	}
}

func encodeDecode(t *testing.T, in, out Message, msg string) {
	buf, err := Marshal(in)
	if err != nil {
		t.Fatalf("failed marshaling %v: %v", msg, err)
	}
	if err := Unmarshal(buf, out); err != nil {
		t.Fatalf("failed unmarshaling %v: %v", msg, err)
	}
}

func TestPackedNonPackedDecoderSwitching(t *testing.T) {
	np, p := new(NonPackedTest), new(PackedTest)

	// non-packed -> packed
	np.A = []int32{0, 1, 1, 2, 3, 5}
	encodeDecode(t, np, p, "non-packed -> packed")
	if !reflect.DeepEqual(np.A, p.B) {
		t.Errorf("failed non-packed -> packed; np.A=%+v, p.B=%+v", np.A, p.B)
	}

	// packed -> non-packed
	np.Reset()
	p.B = []int32{3, 1, 4, 1, 5, 9}
	encodeDecode(t, p, np, "packed -> non-packed")
	if !reflect.DeepEqual(p.B, np.A) {
		t.Errorf("failed packed -> non-packed; p.B=%+v, np.A=%+v", p.B, np.A)
	}
}

func TestProto1RepeatedGroup(t *testing.T) {
	pb := &MessageList{
		Message: []*MessageList_Message{
			{
				Name:  String("blah"),
				Count: Int32(7),
			},
			// NOTE: pb.Message[1] is a nil
			nil,
		},
	}

	o := old()
	err := o.Marshal(pb)
	if err == nil || !strings.Contains(err.Error(), "repeated field Message has nil") {
		t.Fatalf("unexpected or no error when marshaling: %v", err)
	}
}

// Test that enums work.  Checks for a bug introduced by making enums
// named types instead of int32: newInt32FromUint64 would crash with
// a type mismatch in reflect.PointTo.
func TestEnum(t *testing.T) {
	pb := new(GoEnum)
	pb.Foo = FOO_FOO1.Enum()
	o := old()
	if err := o.Marshal(pb); err != nil {
		t.Fatal("error encoding enum:", err)
	}
	pb1 := new(GoEnum)
	if err := o.Unmarshal(pb1); err != nil {
		t.Fatal("error decoding enum:", err)
	}
	if *pb1.Foo != FOO_FOO1 {
		t.Error("expected 7 but got ", *pb1.Foo)
	}
}

// Enum types have String methods. Check that enum fields can be printed.
// We don't care what the value actually is, just as long as it doesn't crash.
func TestPrintingNilEnumFields(t *testing.T) {
	pb := new(GoEnum)
	_ = fmt.Sprintf("%+v", pb)
}

// Verify that absent required fields cause Marshal/Unmarshal to return errors.
func TestRequiredFieldEnforcement(t *testing.T) {
	pb := new(GoTestField)
	_, err := Marshal(pb)
	if err == nil {
		t.Error("marshal: expected error, got nil")
	} else if _, ok := err.(*RequiredNotSetError); !ok || !strings.Contains(err.Error(), "Label") {
		t.Errorf("marshal: bad error type: %v", err)
	}

	// A slightly sneaky, yet valid, proto. It encodes the same required field twice,
	// so simply counting the required fields is insufficient.
	// field 1, encoding 2, value "hi"
	buf := []byte("\x0A\x02hi\x0A\x02hi")
	err = Unmarshal(buf, pb)
	if err == nil {
		t.Error("unmarshal: expected error, got nil")
	} else if _, ok := err.(*RequiredNotSetError); !ok || !strings.Contains(err.Error(), "{Unknown}") {
		t.Errorf("unmarshal: bad error type: %v", err)
	}
}

// Verify that absent required fields in groups cause Marshal/Unmarshal to return errors.
func TestRequiredFieldEnforcementGroups(t *testing.T) {
	pb := &GoTestRequiredGroupField{Group: &GoTestRequiredGroupField_Group{}}
	if _, err := Marshal(pb); err == nil {
		t.Error("marshal: expected error, got nil")
	} else if _, ok := err.(*RequiredNotSetError); !ok || !strings.Contains(err.Error(), "Group.Field") {
		t.Errorf("marshal: bad error type: %v", err)
	}

	buf := []byte{11, 12}
	if err := Unmarshal(buf, pb); err == nil {
		t.Error("unmarshal: expected error, got nil")
	} else if _, ok := err.(*RequiredNotSetError); !ok || !strings.Contains(err.Error(), "Group.{Unknown}") {
		t.Errorf("unmarshal: bad error type: %v", err)
	}
}

func TestTypedNilMarshal(t *testing.T) {
	// A typed nil should return ErrNil and not crash.
	{
		var m *GoEnum
		if _, err := Marshal(m); err != ErrNil {
			t.Errorf("Marshal(%#v): got %v, want ErrNil", m, err)
		}
	}

	{
		m := &Communique{Union: &Communique_Msg{nil}}
		if _, err := Marshal(m); err == nil || err == ErrNil {
			t.Errorf("Marshal(%#v): got %v, want errOneofHasNil", m, err)
		}
	}
}

// A type that implements the Marshaler interface, but is not nillable.
type nonNillableInt uint64

func (nni nonNillableInt) Marshal() ([]byte, error) {
	return EncodeVarint(uint64(nni)), nil
}

type NNIMessage struct {
	nni nonNillableInt
}

func (*NNIMessage) Reset()         {}
func (*NNIMessage) String() string { return "" }
func (*NNIMessage) ProtoMessage()  {}

// A type that implements the Marshaler interface and is nillable.
type nillableMessage struct {
	x uint64
}

func (nm *nillableMessage) Marshal() ([]byte, error) {
	return EncodeVarint(nm.x), nil
}

type NMMessage struct {
	nm *nillableMessage
}

func (*NMMessage) Reset()         {}
func (*NMMessage) String() string { return "" }
func (*NMMessage) ProtoMessage()  {}

// Verify a type that uses the Marshaler interface, but has a nil pointer.
func TestNilMarshaler(t *testing.T) {
	// Try a struct with a Marshaler field that is nil.
	// It should be directly marshable.
	nmm := new(NMMessage)
	if _, err := Marshal(nmm); err != nil {
		t.Error("unexpected error marshaling nmm: ", err)
	}

	// Try a struct with a Marshaler field that is not nillable.
	nnim := new(NNIMessage)
	nnim.nni = 7
	var _ Marshaler = nnim.nni // verify it is truly a Marshaler
	if _, err := Marshal(nnim); err != nil {
		t.Error("unexpected error marshaling nnim: ", err)
	}
}

func TestAllSetDefaults(t *testing.T) {
	// Exercise SetDefaults with all scalar field types.
	m := &Defaults{
		// NaN != NaN, so override that here.
		F_Nan: Float32(1.7),
	}
	expected := &Defaults{
		F_Bool:    Bool(true),
		F_Int32:   Int32(32),
		F_Int64:   Int64(64),
		F_Fixed32: Uint32(320),
		F_Fixed64: Uint64(640),
		F_Uint32:  Uint32(3200),
		F_Uint64:  Uint64(6400),
		F_Float:   Float32(314159),
		F_Double:  Float64(271828),
		F_String:  String(`hello, "world!"` + "\n"),
		F_Bytes:   []byte("Bignose"),
		F_Sint32:  Int32(-32),
		F_Sint64:  Int64(-64),
		F_Enum:    Defaults_GREEN.Enum(),
		F_Pinf:    Float32(float32(math.Inf(1))),
		F_Ninf:    Float32(float32(math.Inf(-1))),
		F_Nan:     Float32(1.7),
		StrZero:   String(""),
	}
	SetDefaults(m)
	if !Equal(m, expected) {
		t.Errorf("SetDefaults failed\n got %v\nwant %v", m, expected)
	}
}

func TestSetDefaultsWithSetField(t *testing.T) {
	// Check that a set value is not overridden.
	m := &Defaults{
		F_Int32: Int32(12),
	}
	SetDefaults(m)
	if v := m.GetF_Int32(); v != 12 {
		t.Errorf("m.FInt32 = %v, want 12", v)
	}
}

func TestSetDefaultsWithSubMessage(t *testing.T) {
	m := &OtherMessage{
		Key: Int64(123),
		Inner: &InnerMessage{
			Host: String("gopher"),
		},
	}
	expected := &OtherMessage{
		Key: Int64(123),
		Inner: &InnerMessage{
			Host: String("gopher"),
			Port: Int32(4000),
		},
	}
	SetDefaults(m)
	if !Equal(m, expected) {
		t.Errorf("\n got %v\nwant %v", m, expected)
	}
}

func TestSetDefaultsWithRepeatedSubMessage(t *testing.T) {
	m := &MyMessage{
		RepInner: []*InnerMessage{{}},
	}
	expected := &MyMessage{
		RepInner: []*InnerMessage{{
			Port: Int32(4000),
		}},
	}
	SetDefaults(m)
	if !Equal(m, expected) {
		t.Errorf("\n got %v\nwant %v", m, expected)
	}
}

func TestSetDefaultWithRepeatedNonMessage(t *testing.T) {
	m := &MyMessage{
		Pet: []string{"turtle", "wombat"},
	}
	expected := Clone(m)
	SetDefaults(m)
	if !Equal(m, expected) {
		t.Errorf("\n got %v\nwant %v", m, expected)
	}
}

func TestMaximumTagNumber(t *testing.T) {
	m := &MaxTag{
		LastField: String("natural goat essence"),
	}
	buf, err := Marshal(m)
	if err != nil {
		t.Fatalf("proto.Marshal failed: %v", err)
	}
	m2 := new(MaxTag)
	if err := Unmarshal(buf, m2); err != nil {
		t.Fatalf("proto.Unmarshal failed: %v", err)
	}
	if got, want := m2.GetLastField(), *m.LastField; got != want {
		t.Errorf("got %q, want %q", got, want)
	}
}

func TestJSON(t *testing.T) {
	m := &MyMessage{
		Count: Int32(4),
		Pet:   []string{"bunny", "kitty"},
		Inner: &InnerMessage{
			Host: String("cauchy"),
		},
		Bikeshed: MyMessage_GREEN.Enum(),
	}
	const expected = `{"count":4,"pet":["bunny","kitty"],"inner":{"host":"cauchy"},"bikeshed":1}`

	b, err := json.Marshal(m)
	if err != nil {
		t.Fatalf("json.Marshal failed: %v", err)
	}
	s := string(b)
	if s != expected {
		t.Errorf("got  %s\nwant %s", s, expected)
	}

	received := new(MyMessage)
	if err := json.Unmarshal(b, received); err != nil {
		t.Fatalf("json.Unmarshal failed: %v", err)
	}
	if !Equal(received, m) {
		t.Fatalf("got %s, want %s", received, m)
	}

	// Test unmarshalling of JSON with symbolic enum name.
	const old = `{"count":4,"pet":["bunny","kitty"],"inner":{"host":"cauchy"},"bikeshed":"GREEN"}`
	received.Reset()
	if err := json.Unmarshal([]byte(old), received); err != nil {
		t.Fatalf("json.Unmarshal failed: %v", err)
	}
	if !Equal(received, m) {
		t.Fatalf("got %s, want %s", received, m)
	}
}

func TestBadWireType(t *testing.T) {
	b := []byte{7<<3 | 6} // field 7, wire type 6
	pb := new(OtherMessage)
	if err := Unmarshal(b, pb); err == nil {
		t.Errorf("Unmarshal did not fail")
	} else if !strings.Contains(err.Error(), "unknown wire type") {
		t.Errorf("wrong error: %v", err)
	}
}

func TestBytesWithInvalidLength(t *testing.T) {
	// If a byte sequence has an invalid (negative) length, Unmarshal should not panic.
	b := []byte{2<<3 | WireBytes, 0xff, 0xff, 0xff, 0xff, 0xff, 0}
	Unmarshal(b, new(MyMessage))
}

func TestLengthOverflow(t *testing.T) {
	// Overflowing a length should not panic.
	b := []byte{2<<3 | WireBytes, 1, 1, 3<<3 | WireBytes, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01}
	Unmarshal(b, new(MyMessage))
}

func TestVarintOverflow(t *testing.T) {
	// Overflowing a 64-bit length should not be allowed.
	b := []byte{1<<3 | WireVarint, 0x01, 3<<3 | WireBytes, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x01}
	if err := Unmarshal(b, new(MyMessage)); err == nil {
		t.Fatalf("Overflowed uint64 length without error")
	}
}

func TestUnmarshalFuzz(t *testing.T) {
	const N = 1000
	seed := time.Now().UnixNano()
	t.Logf("RNG seed is %d", seed)
	rng := rand.New(rand.NewSource(seed))
	buf := make([]byte, 20)
	for i := 0; i < N; i++ {
		for j := range buf {
			buf[j] = byte(rng.Intn(256))
		}
		fuzzUnmarshal(t, buf)
	}
}

func TestMergeMessages(t *testing.T) {
	pb := &MessageList{Message: []*MessageList_Message{{Name: String("x"), Count: Int32(1)}}}
	data, err := Marshal(pb)
	if err != nil {
		t.Fatalf("Marshal: %v", err)
	}

	pb1 := new(MessageList)
	if err := Unmarshal(data, pb1); err != nil {
		t.Fatalf("first Unmarshal: %v", err)
	}
	if err := Unmarshal(data, pb1); err != nil {
		t.Fatalf("second Unmarshal: %v", err)
	}
	if len(pb1.Message) != 1 {
		t.Errorf("two Unmarshals produced %d Messages, want 1", len(pb1.Message))
	}

	pb2 := new(MessageList)
	if err := UnmarshalMerge(data, pb2); err != nil {
		t.Fatalf("first UnmarshalMerge: %v", err)
	}
	if err := UnmarshalMerge(data, pb2); err != nil {
		t.Fatalf("second UnmarshalMerge: %v", err)
	}
	if len(pb2.Message) != 2 {
		t.Errorf("two UnmarshalMerges produced %d Messages, want 2", len(pb2.Message))
	}
}

func TestExtensionMarshalOrder(t *testing.T) {
	m := &MyMessage{Count: Int(123)}
	if err := SetExtension(m, E_Ext_More, &Ext{Data: String("alpha")}); err != nil {
		t.Fatalf("SetExtension: %v", err)
	}
	if err := SetExtension(m, E_Ext_Text, String("aleph")); err != nil {
		t.Fatalf("SetExtension: %v", err)
	}
	if err := SetExtension(m, E_Ext_Number, Int32(1)); err != nil {
		t.Fatalf("SetExtension: %v", err)
	}

	// Serialize m several times, and check we get the same bytes each time.
	var orig []byte
	for i := 0; i < 100; i++ {
		b, err := Marshal(m)
		if err != nil {
			t.Fatalf("Marshal: %v", err)
		}
		if i == 0 {
			orig = b
			continue
		}
		if !bytes.Equal(b, orig) {
			t.Errorf("Bytes differ on attempt #%d", i)
		}
	}
}

// Many extensions, because small maps might not iterate differently on each iteration.
var exts = []*ExtensionDesc{
	E_X201,
	E_X202,
	E_X203,
	E_X204,
	E_X205,
	E_X206,
	E_X207,
	E_X208,
	E_X209,
	E_X210,
	E_X211,
	E_X212,
	E_X213,
	E_X214,
	E_X215,
	E_X216,
	E_X217,
	E_X218,
	E_X219,
	E_X220,
	E_X221,
	E_X222,
	E_X223,
	E_X224,
	E_X225,
	E_X226,
	E_X227,
	E_X228,
	E_X229,
	E_X230,
	E_X231,
	E_X232,
	E_X233,
	E_X234,
	E_X235,
	E_X236,
	E_X237,
	E_X238,
	E_X239,
	E_X240,
	E_X241,
	E_X242,
	E_X243,
	E_X244,
	E_X245,
	E_X246,
	E_X247,
	E_X248,
	E_X249,
	E_X250,
}

func TestMessageSetMarshalOrder(t *testing.T) {
	m := &MyMessageSet{}
	for _, x := range exts {
		if err := SetExtension(m, x, &Empty{}); err != nil {
			t.Fatalf("SetExtension: %v", err)
		}
	}

	buf, err := Marshal(m)
	if err != nil {
		t.Fatalf("Marshal: %v", err)
	}

	// Serialize m several times, and check we get the same bytes each time.
	for i := 0; i < 10; i++ {
		b1, err := Marshal(m)
		if err != nil {
			t.Fatalf("Marshal: %v", err)
		}
		if !bytes.Equal(b1, buf) {
			t.Errorf("Bytes differ on re-Marshal #%d", i)
		}

		m2 := &MyMessageSet{}
		if err := Unmarshal(buf, m2); err != nil {
			t.Errorf("Unmarshal: %v", err)
		}
		b2, err := Marshal(m2)
		if err != nil {
			t.Errorf("re-Marshal: %v", err)
		}
		if !bytes.Equal(b2, buf) {
			t.Errorf("Bytes differ on round-trip #%d", i)
		}
	}
}

func TestUnmarshalMergesMessages(t *testing.T) {
	// If a nested message occurs twice in the input,
	// the fields should be merged when decoding.
	a := &OtherMessage{
		Key: Int64(123),
		Inner: &InnerMessage{
			Host: String("polhode"),
			Port: Int32(1234),
		},
	}
	aData, err := Marshal(a)
	if err != nil {
		t.Fatalf("Marshal(a): %v", err)
	}
	b := &OtherMessage{
		Weight: Float32(1.2),
		Inner: &InnerMessage{
			Host:      String("herpolhode"),
			Connected: Bool(true),
		},
	}
	bData, err := Marshal(b)
	if err != nil {
		t.Fatalf("Marshal(b): %v", err)
	}
	want := &OtherMessage{
		Key:    Int64(123),
		Weight: Float32(1.2),
		Inner: &InnerMessage{
			Host:      String("herpolhode"),
			Port:      Int32(1234),
			Connected: Bool(true),
		},
	}
	got := new(OtherMessage)
	if err := Unmarshal(append(aData, bData...), got); err != nil {
		t.Fatalf("Unmarshal: %v", err)
	}
	if !Equal(got, want) {
		t.Errorf("\n got %v\nwant %v", got, want)
	}
}

func TestEncodingSizes(t *testing.T) {
	tests := []struct {
		m Message
		n int
	}{
		{&Defaults{F_Int32: Int32(math.MaxInt32)}, 6},
		{&Defaults{F_Int32: Int32(math.MinInt32)}, 11},
		{&Defaults{F_Uint32: Uint32(uint32(math.MaxInt32) + 1)}, 6},
		{&Defaults{F_Uint32: Uint32(math.MaxUint32)}, 6},
	}
	for _, test := range tests {
		b, err := Marshal(test.m)
		if err != nil {
			t.Errorf("Marshal(%v): %v", test.m, err)
			continue
		}
		if len(b) != test.n {
			t.Errorf("Marshal(%v) yielded %d bytes, want %d bytes", test.m, len(b), test.n)
		}
	}
}

func TestRequiredNotSetError(t *testing.T) {
	pb := initGoTest(false)
	pb.RequiredField.Label = nil
	pb.F_Int32Required = nil
	pb.F_Int64Required = nil

	expected := "0807" + // field 1, encoding 0, value 7
		"2206" + "120474797065" + // field 4, encoding 2 (GoTestField)
		"5001" + // field 10, encoding 0, value 1
		"6d20000000" + // field 13, encoding 5, value 0x20
		"714000000000000000" + // field 14, encoding 1, value 0x40
		"78a019" + // field 15, encoding 0, value 0xca0 = 3232
		"8001c032" + // field 16, encoding 0, value 0x1940 = 6464
		"8d0100004a45" + // field 17, encoding 5, value 3232.0
		"9101000000000040b940" + // field 18, encoding 1, value 6464.0
		"9a0106" + "737472696e67" + // field 19, encoding 2, string "string"
		"b304" + // field 70, encoding 3, start group
		"ba0408" + "7265717569726564" + // field 71, encoding 2, string "required"
		"b404" + // field 70, encoding 4, end group
		"aa0605" + "6279746573" + // field 101, encoding 2, string "bytes"
		"b0063f" + // field 102, encoding 0, 0x3f zigzag32
		"b8067f" // field 103, encoding 0, 0x7f zigzag64

	o := old()
	bytes, err := Marshal(pb)
	if _, ok := err.(*RequiredNotSetError); !ok {
		fmt.Printf("marshal-1 err = %v, want *RequiredNotSetError", err)
		o.DebugPrint("", bytes)
		t.Fatalf("expected = %s", expected)
	}
	if strings.Index(err.Error(), "RequiredField.Label") < 0 {
		t.Errorf("marshal-1 wrong err msg: %v", err)
	}
	if !equal(bytes, expected, t) {
		o.DebugPrint("neq 1", bytes)
		t.Fatalf("expected = %s", expected)
	}

	// Now test Unmarshal by recreating the original buffer.
	pbd := new(GoTest)
	err = Unmarshal(bytes, pbd)
	if _, ok := err.(*RequiredNotSetError); !ok {
		t.Fatalf("unmarshal err = %v, want *RequiredNotSetError", err)
		o.DebugPrint("", bytes)
		t.Fatalf("string = %s", expected)
	}
	if strings.Index(err.Error(), "RequiredField.{Unknown}") < 0 {
		t.Errorf("unmarshal wrong err msg: %v", err)
	}
	bytes, err = Marshal(pbd)
	if _, ok := err.(*RequiredNotSetError); !ok {
		t.Errorf("marshal-2 err = %v, want *RequiredNotSetError", err)
		o.DebugPrint("", bytes)
		t.Fatalf("string = %s", expected)
	}
	if strings.Index(err.Error(), "RequiredField.Label") < 0 {
		t.Errorf("marshal-2 wrong err msg: %v", err)
	}
	if !equal(bytes, expected, t) {
		o.DebugPrint("neq 2", bytes)
		t.Fatalf("string = %s", expected)
	}
}

func fuzzUnmarshal(t *testing.T, data []byte) {
	defer func() {
		if e := recover(); e != nil {
			t.Errorf("These bytes caused a panic: %+v", data)
			t.Logf("Stack:\n%s", debug.Stack())
			t.FailNow()
		}
	}()

	pb := new(MyMessage)
	Unmarshal(data, pb)
}

func TestMapFieldMarshal(t *testing.T) {
	m := &MessageWithMap{
		NameMapping: map[int32]string{
			1: "Rob",
			4: "Ian",
			8: "Dave",
		},
	}
	b, err := Marshal(m)
	if err != nil {
		t.Fatalf("Marshal: %v", err)
	}

	// b should be the concatenation of these three byte sequences in some order.
	parts := []string{
		"\n\a\b\x01\x12\x03Rob",
		"\n\a\b\x04\x12\x03Ian",
		"\n\b\b\x08\x12\x04Dave",
	}
	ok := false
	for i := range parts {
		for j := range parts {
			if j == i {
				continue
			}
			for k := range parts {
				if k == i || k == j {
					continue
				}
				try := parts[i] + parts[j] + parts[k]
				if bytes.Equal(b, []byte(try)) {
					ok = true
					break
				}
			}
		}
	}
	if !ok {
		t.Fatalf("Incorrect Marshal output.\n got %q\nwant %q (or a permutation of that)", b, parts[0]+parts[1]+parts[2])
	}
	t.Logf("FYI b: %q", b)

	(new(Buffer)).DebugPrint("Dump of b", b)
}

func TestMapFieldRoundTrips(t *testing.T) {
	m := &MessageWithMap{
		NameMapping: map[int32]string{
			1: "Rob",
			4: "Ian",
			8: "Dave",
		},
		MsgMapping: map[int64]*FloatingPoint{
			0x7001: &FloatingPoint{F: Float64(2.0)},
		},
		ByteMapping: map[bool][]byte{
			false: []byte("that's not right!"),
			true:  []byte("aye, 'tis true!"),
		},
	}
	b, err := Marshal(m)
	if err != nil {
		t.Fatalf("Marshal: %v", err)
	}
	t.Logf("FYI b: %q", b)
	m2 := new(MessageWithMap)
	if err := Unmarshal(b, m2); err != nil {
		t.Fatalf("Unmarshal: %v", err)
	}
	for _, pair := range [][2]interface{}{
		{m.NameMapping, m2.NameMapping},
		{m.MsgMapping, m2.MsgMapping},
		{m.ByteMapping, m2.ByteMapping},
	} {
		if !reflect.DeepEqual(pair[0], pair[1]) {
			t.Errorf("Map did not survive a round trip.\ninitial: %v\n  final: %v", pair[0], pair[1])
		}
	}
}

func TestMapFieldWithNil(t *testing.T) {
	m1 := &MessageWithMap{
		MsgMapping: map[int64]*FloatingPoint{
			1: nil,
		},
	}
	b, err := Marshal(m1)
	if err != nil {
		t.Fatalf("Marshal: %v", err)
	}
	m2 := new(MessageWithMap)
	if err := Unmarshal(b, m2); err != nil {
		t.Fatalf("Unmarshal: %v, got these bytes: %v", err, b)
	}
	if v, ok := m2.MsgMapping[1]; !ok {
		t.Error("msg_mapping[1] not present")
	} else if v != nil {
		t.Errorf("msg_mapping[1] not nil: %v", v)
	}
}

func TestMapFieldWithNilBytes(t *testing.T) {
	m1 := &MessageWithMap{
		ByteMapping: map[bool][]byte{
			false: []byte{},
			true:  nil,
		},
	}
	n := Size(m1)
	b, err := Marshal(m1)
	if err != nil {
		t.Fatalf("Marshal: %v", err)
	}
	if n != len(b) {
		t.Errorf("Size(m1) = %d; want len(Marshal(m1)) = %d", n, len(b))
	}
	m2 := new(MessageWithMap)
	if err := Unmarshal(b, m2); err != nil {
		t.Fatalf("Unmarshal: %v, got these bytes: %v", err, b)
	}
	if v, ok := m2.ByteMapping[false]; !ok {
		t.Error("byte_mapping[false] not present")
	} else if len(v) != 0 {
		t.Errorf("byte_mapping[false] not empty: %#v", v)
	}
	if v, ok := m2.ByteMapping[true]; !ok {
		t.Error("byte_mapping[true] not present")
	} else if len(v) != 0 {
		t.Errorf("byte_mapping[true] not empty: %#v", v)
	}
}

func TestDecodeMapFieldMissingKey(t *testing.T) {
	b := []byte{
		0x0A, 0x03, // message, tag 1 (name_mapping), of length 3 bytes
		// no key
		0x12, 0x01, 0x6D, // string value of length 1 byte, value "m"
	}
	got := &MessageWithMap{}
	err := Unmarshal(b, got)
	if err != nil {
		t.Fatalf("failed to marshal map with missing key: %v", err)
	}
	want := &MessageWithMap{NameMapping: map[int32]string{0: "m"}}
	if !Equal(got, want) {
		t.Errorf("Unmarshaled map with no key was not as expected. got: %v, want %v", got, want)
	}
}

func TestDecodeMapFieldMissingValue(t *testing.T) {
	b := []byte{
		0x0A, 0x02, // message, tag 1 (name_mapping), of length 2 bytes
		0x08, 0x01, // varint key, value 1
		// no value
	}
	got := &MessageWithMap{}
	err := Unmarshal(b, got)
	if err != nil {
		t.Fatalf("failed to marshal map with missing value: %v", err)
	}
	want := &MessageWithMap{NameMapping: map[int32]string{1: ""}}
	if !Equal(got, want) {
		t.Errorf("Unmarshaled map with no value was not as expected. got: %v, want %v", got, want)
	}
}

func TestOneof(t *testing.T) {
	m := &Communique{}
	b, err := Marshal(m)
	if err != nil {
		t.Fatalf("Marshal of empty message with oneof: %v", err)
	}
	if len(b) != 0 {
		t.Errorf("Marshal of empty message yielded too many bytes: %v", b)
	}

	m = &Communique{
		Union: &Communique_Name{"Barry"},
	}

	// Round-trip.
	b, err = Marshal(m)
	if err != nil {
		t.Fatalf("Marshal of message with oneof: %v", err)
	}
	if len(b) != 7 { // name tag/wire (1) + name len (1) + name (5)
		t.Errorf("Incorrect marshal of message with oneof: %v", b)
	}
	m.Reset()
	if err := Unmarshal(b, m); err != nil {
		t.Fatalf("Unmarshal of message with oneof: %v", err)
	}
	if x, ok := m.Union.(*Communique_Name); !ok || x.Name != "Barry" {
		t.Errorf("After round trip, Union = %+v", m.Union)
	}
	if name := m.GetName(); name != "Barry" {
		t.Errorf("After round trip, GetName = %q, want %q", name, "Barry")
	}

	// Let's try with a message in the oneof.
	m.Union = &Communique_Msg{&Strings{StringField: String("deep deep string")}}
	b, err = Marshal(m)
	if err != nil {
		t.Fatalf("Marshal of message with oneof set to message: %v", err)
	}
	if len(b) != 20 { // msg tag/wire (1) + msg len (1) + msg (1 + 1 + 16)
		t.Errorf("Incorrect marshal of message with oneof set to message: %v", b)
	}
	m.Reset()
	if err := Unmarshal(b, m); err != nil {
		t.Fatalf("Unmarshal of message with oneof set to message: %v", err)
	}
	ss, ok := m.Union.(*Communique_Msg)
	if !ok || ss.Msg.GetStringField() != "deep deep string" {
		t.Errorf("After round trip with oneof set to message, Union = %+v", m.Union)
	}
}

func TestInefficientPackedBool(t *testing.T) {
	// https://github.com/golang/protobuf/issues/76
	inp := []byte{
		0x12, 0x02, // 0x12 = 2<<3|2; 2 bytes
		// Usually a bool should take a single byte,
		// but it is permitted to be any varint.
		0xb9, 0x30,
	}
	if err := Unmarshal(inp, new(MoreRepeated)); err != nil {
		t.Error(err)
	}
}

// Benchmarks

func testMsg() *GoTest {
	pb := initGoTest(true)
	const N = 1000 // Internally the library starts much smaller.
	pb.F_Int32Repeated = make([]int32, N)
	pb.F_DoubleRepeated = make([]float64, N)
	for i := 0; i < N; i++ {
		pb.F_Int32Repeated[i] = int32(i)
		pb.F_DoubleRepeated[i] = float64(i)
	}
	return pb
}

func bytesMsg() *GoTest {
	pb := initGoTest(true)
	buf := make([]byte, 4000)
	for i := range buf {
		buf[i] = byte(i)
	}
	pb.F_BytesDefaulted = buf
	return pb
}

func benchmarkMarshal(b *testing.B, pb Message, marshal func(Message) ([]byte, error)) {
	d, _ := marshal(pb)
	b.SetBytes(int64(len(d)))
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		marshal(pb)
	}
}

func benchmarkBufferMarshal(b *testing.B, pb Message) {
	p := NewBuffer(nil)
	benchmarkMarshal(b, pb, func(pb0 Message) ([]byte, error) {
		p.Reset()
		err := p.Marshal(pb0)
		return p.Bytes(), err
	})
}

func benchmarkSize(b *testing.B, pb Message) {
	benchmarkMarshal(b, pb, func(pb0 Message) ([]byte, error) {
		Size(pb)
		return nil, nil
	})
}

func newOf(pb Message) Message {
	in := reflect.ValueOf(pb)
	if in.IsNil() {
		return pb
	}
	return reflect.New(in.Type().Elem()).Interface().(Message)
}

func benchmarkUnmarshal(b *testing.B, pb Message, unmarshal func([]byte, Message) error) {
	d, _ := Marshal(pb)
	b.SetBytes(int64(len(d)))
	pbd := newOf(pb)

	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		unmarshal(d, pbd)
	}
}

func benchmarkBufferUnmarshal(b *testing.B, pb Message) {
	p := NewBuffer(nil)
	benchmarkUnmarshal(b, pb, func(d []byte, pb0 Message) error {
		p.SetBuf(d)
		return p.Unmarshal(pb0)
	})
}

// Benchmark{Marshal,BufferMarshal,Size,Unmarshal,BufferUnmarshal}{,Bytes}

func BenchmarkMarshal(b *testing.B) {
	benchmarkMarshal(b, testMsg(), Marshal)
}

func BenchmarkBufferMarshal(b *testing.B) {
	benchmarkBufferMarshal(b, testMsg())
}

func BenchmarkSize(b *testing.B) {
	benchmarkSize(b, testMsg())
}

func BenchmarkUnmarshal(b *testing.B) {
	benchmarkUnmarshal(b, testMsg(), Unmarshal)
}

func BenchmarkBufferUnmarshal(b *testing.B) {
	benchmarkBufferUnmarshal(b, testMsg())
}

func BenchmarkMarshalBytes(b *testing.B) {
	benchmarkMarshal(b, bytesMsg(), Marshal)
}

func BenchmarkBufferMarshalBytes(b *testing.B) {
	benchmarkBufferMarshal(b, bytesMsg())
}

func BenchmarkSizeBytes(b *testing.B) {
	benchmarkSize(b, bytesMsg())
}

func BenchmarkUnmarshalBytes(b *testing.B) {
	benchmarkUnmarshal(b, bytesMsg(), Unmarshal)
}

func BenchmarkBufferUnmarshalBytes(b *testing.B) {
	benchmarkBufferUnmarshal(b, bytesMsg())
}

func BenchmarkUnmarshalUnrecognizedFields(b *testing.B) {
	b.StopTimer()
	pb := initGoTestField()
	skip := &GoSkipTest{
		SkipInt32:   Int32(32),
		SkipFixed32: Uint32(3232),
		SkipFixed64: Uint64(6464),
		SkipString:  String("skipper"),
		Skipgroup: &GoSkipTest_SkipGroup{
			GroupInt32:  Int32(75),
			GroupString: String("wxyz"),
		},
	}

	pbd := new(GoTestField)
	p := NewBuffer(nil)
	p.Marshal(pb)
	p.Marshal(skip)
	p2 := NewBuffer(nil)

	b.StartTimer()
	for i := 0; i < b.N; i++ {
		p2.SetBuf(p.Bytes())
		p2.Unmarshal(pbd)
	}
}


================================================
FILE: vendor/github.com/golang/protobuf/proto/any_test.go
================================================
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2016 The Go Authors.  All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

package proto_test

import (
	"strings"
	"testing"

	"github.com/golang/protobuf/proto"

	pb "github.com/golang/protobuf/proto/proto3_proto"
	testpb "github.com/golang/protobuf/proto/testdata"
	anypb "github.com/golang/protobuf/ptypes/any"
)

var (
	expandedMarshaler        = proto.TextMarshaler{ExpandAny: true}
	expandedCompactMarshaler = proto.TextMarshaler{Compact: true, ExpandAny: true}
)

// anyEqual reports whether two messages which may be google.protobuf.Any or may
// contain google.protobuf.Any fields are equal. We can't use proto.Equal for
// comparison, because semantically equivalent messages may be marshaled to
// binary in different tag order. Instead, trust that TextMarshaler with
// ExpandAny option works and compare the text marshaling results.
func anyEqual(got, want proto.Message) bool {
	// if messages are proto.Equal, no need to marshal.
	if proto.Equal(got, want) {
		return true
	}
	g := expandedMarshaler.Text(got)
	w := expandedMarshaler.Text(want)
	return g == w
}

type golden struct {
	m    proto.Message
	t, c string
}

var goldenMessages = makeGolden()

func makeGolden() []golden {
	nested := &pb.Nested{Bunny: "Monty"}
	nb, err := proto.Marshal(nested)
	if err != nil {
		panic(err)
	}
	m1 := &pb.Message{
		Name:        "David",
		ResultCount: 47,
		Anything:    &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(nested), Value: nb},
	}
	m2 := &pb.Message{
		Name:        "David",
		ResultCount: 47,
		Anything:    &anypb.Any{TypeUrl: "http://[::1]/type.googleapis.com/" + proto.MessageName(nested), Value: nb},
	}
	m3 := &pb.Message{
		Name:        "David",
		ResultCount: 47,
		Anything:    &anypb.Any{TypeUrl: `type.googleapis.com/"/` + proto.MessageName(nested), Value: nb},
	}
	m4 := &pb.Message{
		Name:        "David",
		ResultCount: 47,
		Anything:    &anypb.Any{TypeUrl: "type.googleapis.com/a/path/" + proto.MessageName(nested), Value: nb},
	}
	m5 := &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(nested), Value: nb}

	any1 := &testpb.MyMessage{Count: proto.Int32(47), Name: proto.String("David")}
	proto.SetExtension(any1, testpb.E_Ext_More, &testpb.Ext{Data: proto.String("foo")})
	proto.SetExtension(any1, testpb.E_Ext_Text, proto.String("bar"))
	any1b, err := proto.Marshal(any1)
	if err != nil {
		panic(err)
	}
	any2 := &testpb.MyMessage{Count: proto.Int32(42), Bikeshed: testpb.MyMessage_GREEN.Enum(), RepBytes: [][]byte{[]byte("roboto")}}
	proto.SetExtension(any2, testpb.E_Ext_More, &testpb.Ext{Data: proto.String("baz")})
	any2b, err := proto.Marshal(any2)
	if err != nil {
		panic(err)
	}
	m6 := &pb.Message{
		Name:        "David",
		ResultCount: 47,
		Anything:    &anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(any1), Value: any1b},
		ManyThings: []*anypb.Any{
			&anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(any2), Value: any2b},
			&anypb.Any{TypeUrl: "type.googleapis.com/" + proto.MessageName(any1), Value: any1b},
		},
	}

	const (
		m1Golden = `
name: "David"
result_count: 47
anything: <
  [type.googleapis.com/proto3_proto.Nested]: <
    bunny: "Monty"
  >
>
`
		m2Golden = `
name: "David"
result_count: 47
anything: <
  ["http://[::1]/type.googleapis.com/proto3_proto.Nested"]: <
    bunny: "Monty"
  >
>
`
		m3Golden = `
name: "David"
result_count: 47
anything: <
  ["type.googleapis.com/\"/proto3_proto.Nested"]: <
    bunny: "Monty"
  >
>
`
		m4Golden = `
name: "David"
result_count: 47
anything: <
  [type.googleapis.com/a/path/proto3_proto.Nested]: <
    bunny: "Monty"
  >
>
`
		m5Golden = `
[type.googleapis.com/proto3_proto.Nested]: <
  bunny: "Monty"
>
`
		m6Golden = `
name: "David"
result_count: 47
anything: <
  [type.googleapis.com/testdata.MyMessage]: <
    count: 47
    name: "David"
    [testdata.Ext.more]: <
      data: "foo"
    >
    [testdata.Ext.text]: "bar"
  >
>
many_things: <
  [type.googleapis.com/testdata.MyMessage]: <
    count: 42
    bikeshed: GREEN
    rep_bytes: "roboto"
    [testdata.Ext.more]: <
      data: "baz"
    >
  >
>
many_things: <
  [type.googleapis.com/testdata.MyMessage]: <
    count: 47
    name: "David"
    [testdata.Ext.more]: <
      data: "foo"
    >
    [testdata.Ext.text]: "bar"
  >
>
`
	)
	return []golden{
		{m1, strings.TrimSpace(m1Golden) + "\n", strings.TrimSpace(compact(m1Golden)) + " "},
		{m2, strings.TrimSpace(m2Golden) + "\n", strings.TrimSpace(compact(m2Golden)) + " "},
		{m3, strings.TrimSpace(m3Golden) + "\n", strings.TrimSpace(compact(m3Golden)) + " "},
		{m4, strings.TrimSpace(m4Golden) + "\n", strings.TrimSpace(compact(m4Golden)) + " "},
		{m5, strings.TrimSpace(m5Golden) + "\n", strings.TrimSpace(compact(m5Golden)) + " "},
		{m6, strings.TrimSpace(m6Golden) + "\n", strings.TrimSpace(compact(m6Golden)) + " "},
	}
}

func TestMarshalGolden(t *testing.T) {
	for _, tt := range goldenMessages {
		if got, want := expandedMarshaler.Text(tt.m), tt.t; got != want {
			t.Errorf("message %v: got:\n%s\nwant:\n%s", tt.m, got, want)
		}
		if got, want := expandedCompactMarshaler.Text(tt.m), tt.c; got != want {
			t.Errorf("message %v: got:\n`%s`\nwant:\n`%s`", tt.m, got, want)
		}
	}
}

func TestUnmarshalGolden(t *testing.T) {
	for _, tt := range goldenMessages {
		want := tt.m
		got := proto.Clone(tt.m)
		got.Reset()
		if err := proto.UnmarshalText(tt.t, got); err != nil {
			t.Errorf("failed to unmarshal\n%s\nerror: %v", tt.t, err)
		}
		if !anyEqual(got, want) {
			t.Errorf("message:\n%s\ngot:\n%s\nwant:\n%s", tt.t, got, want)
		}
		got.Reset()
		if err := proto.UnmarshalText(tt.c, got); err != nil {
			t.Errorf("failed to unmarshal\n%s\nerror: %v", tt.c, err)
		}
		if !anyEqual(got, want) {
			t.Errorf("message:\n%s\ngot:\n%s\nwant:\n%s", tt.c, got, want)
		}
	}
}

func TestMarshalUnknownAny(t *testing.T) {
	m := &pb.Message{
		Anything: &anypb.Any{
			TypeUrl: "foo",
			Value:   []byte("bar"),
		},
	}
	want := `anything: <
  type_url: "foo"
  value: "bar"
>
`
	got := expandedMarshaler.Text(m)
	if got != want {
		t.Errorf("got\n`%s`\nwant\n`%s`", got, want)
	}
}

func TestAmbiguousAny(t *testing.T) {
	pb := &anypb.Any{}
	err := proto.UnmarshalText(`
	type_url: "ttt/proto3_proto.Nested"
	value: "\n\x05Monty"
	`, pb)
	t.Logf("result: %v (error: %v)", expandedMarshaler.Text(pb), err)
	if err != nil {
		t.Errorf("failed to parse ambiguous Any message: %v", err)
	}
}

func TestUnmarshalOverwriteAny(t *testing.T) {
	pb := &anypb.Any{}
	err := proto.UnmarshalText(`
  [type.googleapis.com/a/path/proto3_proto.Nested]: <
    bunny: "Monty"
  >
  [type.googleapis.com/a/path/proto3_proto.Nested]: <
    bunny: "Rabbit of Caerbannog"
  >
	`, pb)
	want := `line 7: Any message unpacked multiple times, or "type_url" already set`
	if err.Error() != want {
		t.Errorf("incorrect error.\nHave: %v\nWant: %v", err.Error(), want)
	}
}

func TestUnmarshalAnyMixAndMatch(t *testing.T) {
	pb := &anypb.Any{}
	err := proto.UnmarshalText(`
	value: "\n\x05Monty"
  [type.googleapis.com/a/path/proto3_proto.Nested]: <
    bunny: "Rabbit of Caerbannog"
  >
	`, pb)
	want := `line 5: Any message unpacked multiple times, or "value" already set`
	if err.Error() != want {
		t.Errorf("incorrect error.\nHave: %v\nWant: %v", err.Error(), want)
	}
}


================================================
FILE: vendor/github.com/golang/protobuf/proto/clone.go
================================================
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2011 The Go Authors.  All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// Protocol buffer deep copy and merge.
// TODO: RawMessage.

package proto

import (
	"log"
	"reflect"
	"strings"
)

// Clone returns a deep copy of a protocol buffer.
func Clone(pb Message) Message {
	in := reflect.ValueOf(pb)
	if in.IsNil() {
		return pb
	}

	out := reflect.New(in.Type().Elem())
	// out is empty so a merge is a deep copy.
	mergeStruct(out.Elem(), in.Elem())
	return out.Interface().(Message)
}

// Merge merges src into dst.
// Required and optional fields that are set in src will be set to that value in dst.
// Elements of repeated fields will be appended.
// Merge panics if src and dst are not the same type, or if dst is nil.
func Merge(dst, src Message) {
	in := reflect.ValueOf(src)
	out := reflect.ValueOf(dst)
	if out.IsNil() {
		panic("proto: nil destination")
	}
	if in.Type() != out.Type() {
		// Explicit test prior to mergeStruct so that mistyped nils will fail
		panic("proto: type mismatch")
	}
	if in.IsNil() {
		// Merging nil into non-nil is a quiet no-op
		return
	}
	mergeStruct(out.Elem(), in.Elem())
}

func mergeStruct(out, in reflect.Value) {
	sprop := GetProperties(in.Type())
	for i := 0; i < in.NumField(); i++ {
		f := in.Type().Field(i)
		if strings.HasPrefix(f.Name, "XXX_") {
			continue
		}
		mergeAny(out.Field(i), in.Field(i), false, sprop.Prop[i])
	}

	if emIn, ok := extendable(in.Addr().Interface()); ok {
		emOut, _ := extendable(out.Addr().Interface())
		mIn, muIn := emIn.extensionsRead()
		if mIn != nil {
			mOut := emOut.extensionsWrite()
			muIn.Lock()
			mergeExtension(mOut, mIn)
			muIn.Unlock()
		}
	}

	uf := in.FieldByName("XXX_unrecognized")
	if !uf.IsValid() {
		return
	}
	uin := uf.Bytes()
	if len(uin) > 0 {
		out.FieldByName("XXX_unrecognized").SetBytes(append([]byte(nil), uin...))
	}
}

// mergeAny performs a merge between two values of the same type.
// viaPtr indicates whether the values were indirected through a pointer (implying proto2).
// prop is set if this is a struct field (it may be nil).
func mergeAny(out, in reflect.Value, viaPtr bool, prop *Properties) {
	if in.Type() == protoMessageType {
		if !in.IsNil() {
			if out.IsNil() {
				out.Set(reflect.ValueOf(Clone(in.Interface().(Message))))
			} else {
				Merge(out.Interface().(Message), in.Interface().(Message))
			}
		}
		return
	}
	switch in.Kind() {
	case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64,
		reflect.String, reflect.Uint32, reflect.Uint64:
		if !viaPtr && isProto3Zero(in) {
			return
		}
		out.Set(in)
	case reflect.Interface:
		// Probably a oneof field; copy non-nil values.
		if in.IsNil() {
			return
		}
		// Allocate destination if it is not set, or set to a different type.
		// Otherwise we will merge as normal.
		if out.IsNil() || out.Elem().Type() != in.Elem().Type() {
			out.Set(reflect.New(in.Elem().Elem().Type())) // interface -> *T -> T -> new(T)
		}
		mergeAny(out.Elem(), in.Elem(), false, nil)
	case reflect.Map:
		if in.Len() == 0 {
			return
		}
		if out.IsNil() {
			out.Set(reflect.MakeMap(in.Type()))
		}
		// For maps with value types of *T or []byte we need to deep copy each value.
		elemKind := in.Type().Elem().Kind()
		for _, key := range in.MapKeys() {
			var val reflect.Value
			switch elemKind {
			case reflect.Ptr:
				val = reflect.New(in.Type().Elem().Elem())
				mergeAny(val, in.MapIndex(key), false, nil)
			case reflect.Slice:
				val = in.MapIndex(key)
				val = reflect.ValueOf(append([]byte{}, val.Bytes()...))
			default:
				val = in.MapIndex(key)
			}
			out.SetMapIndex(key, val)
		}
	case reflect.Ptr:
		if in.IsNil() {
			return
		}
		if out.IsNil() {
			out.Set(reflect.New(in.Elem().Type()))
		}
		mergeAny(out.Elem(), in.Elem(), true, nil)
	case reflect.Slice:
		if in.IsNil() {
			return
		}
		if in.Type().Elem().Kind() == reflect.Uint8 {
			// []byte is a scalar bytes field, not a repeated field.

			// Edge case: if this is in a proto3 message, a zero length
			// bytes field is considered the zero value, and should not
			// be merged.
			if prop != nil && prop.proto3 && in.Len() == 0 {
				return
			}

			// Make a deep copy.
			// Append to []byte{} instead of []byte(nil) so that we never end up
			// with a nil result.
			out.SetBytes(append([]byte{}, in.Bytes()...))
			return
		}
		n := in.Len()
		if out.IsNil() {
			out.Set(reflect.MakeSlice(in.Type(), 0, n))
		}
		switch in.Type().Elem().Kind() {
		case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64,
			reflect.String, reflect.Uint32, reflect.Uint64:
			out.Set(reflect.AppendSlice(out, in))
		default:
			for i := 0; i < n; i++ {
				x := reflect.Indirect(reflect.New(in.Type().Elem()))
				mergeAny(x, in.Index(i), false, nil)
				out.Set(reflect.Append(out, x))
			}
		}
	case reflect.Struct:
		mergeStruct(out, in)
	default:
		// unknown type, so not a protocol buffer
		log.Printf("proto: don't know how to copy %v", in)
	}
}

func mergeExtension(out, in map[int32]Extension) {
	for extNum, eIn := range in {
		eOut := Extension{desc: eIn.desc}
		if eIn.value != nil {
			v := reflect.New(reflect.TypeOf(eIn.value)).Elem()
			mergeAny(v, reflect.ValueOf(eIn.value), false, nil)
			eOut.value = v.Interface()
		}
		if eIn.enc != nil {
			eOut.enc = make([]byte, len(eIn.enc))
			copy(eOut.enc, eIn.enc)
		}

		out[extNum] = eOut
	}
}


================================================
FILE: vendor/github.com/golang/protobuf/proto/clone_test.go
================================================
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2011 The Go Authors.  All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

package proto_test

import (
	"testing"

	"github.com/golang/protobuf/proto"

	proto3pb "github.com/golang/protobuf/proto/proto3_proto"
	pb "github.com/golang/protobuf/proto/testdata"
)

var cloneTestMessage = &pb.MyMessage{
	Count: proto.Int32(42),
	Name:  proto.String("Dave"),
	Pet:   []string{"bunny", "kitty", "horsey"},
	Inner: &pb.InnerMessage{
		Host:      proto.String("niles"),
		Port:      proto.Int32(9099),
		Connected: proto.Bool(true),
	},
	Others: []*pb.OtherMessage{
		{
			Value: []byte("some bytes"),
		},
	},
	Somegroup: &pb.MyMessage_SomeGroup{
		GroupField: proto.Int32(6),
	},
	RepBytes: [][]byte{[]byte("sham"), []byte("wow")},
}

func init() {
	ext := &pb.Ext{
		Data: proto.String("extension"),
	}
	if err := proto.SetExtension(cloneTestMessage, pb.E_Ext_More, ext); err != nil {
		panic("SetExtension: " + err.Error())
	}
}

func TestClone(t *testing.T) {
	m := proto.Clone(cloneTestMessage).(*pb.MyMessage)
	if !proto.Equal(m, cloneTestMessage) {
		t.Errorf("Clone(%v) = %v", cloneTestMessage, m)
	}

	// Verify it was a deep copy.
	*m.Inner.Port++
	if proto.Equal(m, cloneTestMessage) {
		t.Error("Mutating clone changed the original")
	}
	// Byte fields and repeated fields should be copied.
	if &m.Pet[0] == &cloneTestMessage.Pet[0] {
		t.Error("Pet: repeated field not copied")
	}
	if &m.Others[0] == &cloneTestMessage.Others[0] {
		t.Error("Others: repeated field not copied")
	}
	if &m.Others[0].Value[0] == &cloneTestMessage.Others[0].Value[0] {
		t.Error("Others[0].Value: bytes field not copied")
	}
	if &m.RepBytes[0] == &cloneTestMessage.RepBytes[0] {
		t.Error("RepBytes: repeated field not copied")
	}
	if &m.RepBytes[0][0] == &cloneTestMessage.RepBytes[0][0] {
		t.Error("RepBytes[0]: bytes field not copied")
	}
}

func TestCloneNil(t *testing.T) {
	var m *pb.MyMessage
	if c := proto.Clone(m); !proto.Equal(m, c) {
		t.Errorf("Clone(%v) = %v", m, c)
	}
}

var mergeTests = []struct {
	src, dst, want proto.Message
}{
	{
		src: &pb.MyMessage{
			Count: proto.Int32(42),
		},
		dst: &pb.MyMessage{
			Name: proto.String("Dave"),
		},
		want: &pb.MyMessage{
			Count: proto.Int32(42),
			Name:  proto.String("Dave"),
		},
	},
	{
		src: &pb.MyMessage{
			Inner: &pb.InnerMessage{
				Host:      proto.String("hey"),
				Connected: proto.Bool(true),
			},
			Pet: []string{"horsey"},
			Others: []*pb.OtherMessage{
				{
					Value: []byte("some bytes"),
				},
			},
		},
		dst: &pb.MyMessage{
			Inner: &pb.InnerMessage{
				Host: proto.String("niles"),
				Port: proto.Int32(9099),
			},
			Pet: []string{"bunny", "kitty"},
			Others: []*pb.OtherMessage{
				{
					Key: proto.Int64(31415926535),
				},
				{
					// Explicitly test a src=nil field
					Inner: nil,
				},
			},
		},
		want: &pb.MyMessage{
			Inner: &pb.InnerMessage{
				Host:      proto.String("hey"),
				Connected: proto.Bool(true),
				Port:      proto.Int32(9099),
			},
			Pet: []string{"bunny", "kitty", "horsey"},
			Others: []*pb.OtherMessage{
				{
					Key: proto.Int64(31415926535),
				},
				{},
				{
					Value: []byte("some bytes"),
				},
			},
		},
	},
	{
		src: &pb.MyMessage{
			RepBytes: [][]byte{[]byte("wow")},
		},
		dst: &pb.MyMessage{
			Somegroup: &pb.MyMessage_SomeGroup{
				GroupField: proto.Int32(6),
			},
			RepBytes: [][]byte{[]byte("sham")},
		},
		want: &pb.MyMessage{
			Somegroup: &pb.MyMessage_SomeGroup{
				GroupField: proto.Int32(6),
			},
			RepBytes: [][]byte{[]byte("sham"), []byte("wow")},
		},
	},
	// Check that a scalar bytes field replaces rather than appends.
	{
		src:  &pb.OtherMessage{Value: []byte("foo")},
		dst:  &pb.OtherMessage{Value: []byte("bar")},
		want: &pb.OtherMessage{Value: []byte("foo")},
	},
	{
		src: &pb.MessageWithMap{
			NameMapping: map[int32]string{6: "Nigel"},
			MsgMapping: map[int64]*pb.FloatingPoint{
				0x4001: &pb.FloatingPoint{F: proto.Float64(2.0)},
				0x4002: &pb.FloatingPoint{
					F: proto.Float64(2.0),
				},
			},
			ByteMapping: map[bool][]byte{true: []byte("wowsa")},
		},
		dst: &pb.MessageWithMap{
			NameMapping: map[int32]string{
				6: "Bruce", // should be overwritten
				7: "Andrew",
			},
			MsgMapping: map[int64]*pb.FloatingPoint{
				0x4002: &pb.FloatingPoint{
					F:     proto.Float64(3.0),
					Exact: proto.Bool(true),
				}, // the entire message should be overwritten
			},
		},
		want: &pb.MessageWithMap{
			NameMapping: map[int32]string{
				6: "Nigel",
				7: "Andrew",
			},
			MsgMapping: map[int64]*pb.FloatingPoint{
				0x4001: &pb.FloatingPoint{F: proto.Float64(2.0)},
				0x4002: &pb.FloatingPoint{
					F: proto.Float64(2.0),
				},
			},
			ByteMapping: map[bool][]byte{true: []byte("wowsa")},
		},
	},
	// proto3 shouldn't merge zero values,
	// in the same way that proto2 shouldn't merge nils.
	{
		src: &proto3pb.Message{
			Name: "Aaron",
			Data: []byte(""), // zero value, but not nil
		},
		dst: &proto3pb.Message{
			HeightInCm: 176,
			Data:       []byte("texas!"),
		},
		want: &proto3pb.Message{
			Name:       "Aaron",
			HeightInCm: 176,
			Data:       []byte("texas!"),
		},
	},
	// Oneof fields should merge by assignment.
	{
		src: &pb.Communique{
			Union: &pb.Communique_Number{41},
		},
		dst: &pb.Communique{
			Union: &pb.Communique_Name{"Bobby Tables"},
		},
		want: &pb.Communique{
			Union: &pb.Communique_Number{41},
		},
	},
	// Oneof nil is the same as not set.
	{
		src: &pb.Communique{},
		dst: &pb.Communique{
			Union: &pb.Communique_Name{"Bobby Tables"},
		},
		want: &pb.Communique{
			Union: &pb.Communique_Name{"Bobby Tables"},
		},
	},
	{
		src: &proto3pb.Message{
			Terrain: map[string]*proto3pb.Nested{
				"kay_a": &proto3pb.Nested{Cute: true},      // replace
				"kay_b": &proto3pb.Nested{Bunny: "rabbit"}, // insert
			},
		},
		dst: &proto3pb.Message{
			Terrain: map[string]*proto3pb.Nested{
				"kay_a": &proto3pb.Nested{Bunny: "lost"},  // replaced
				"kay_c": &proto3pb.Nested{Bunny: "bunny"}, // keep
			},
		},
		want: &proto3pb.Message{
			Terrain: map[string]*proto3pb.Nested{
				"kay_a": &proto3pb.Nested{Cute: true},
				"kay_b": &proto3pb.Nested{Bunny: "rabbit"},
				"kay_c": &proto3pb.Nested{Bunny: "bunny"},
			},
		},
	},
}

func TestMerge(t *testing.T) {
	for _, m := range mergeTests {
		got := proto.Clone(m.dst)
		proto.Merge(got, m.src)
		if !proto.Equal(got, m.want) {
			t.Errorf("Merge(%v, %v)\n got %v\nwant %v\n", m.dst, m.src, got, m.want)
		}
	}
}


================================================
FILE: vendor/github.com/golang/protobuf/proto/decode.go
================================================
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2010 The Go Authors.  All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

package proto

/*
 * Routines for decoding protocol buffer data to construct in-memory representations.
 */

import (
	"errors"
	"fmt"
	"io"
	"os"
	"reflect"
)

// errOverflow is returned when an integer is too large to be represented.
var errOverflow = errors.New("proto: integer overflow")

// ErrInternalBadWireType is returned by generated code when an incorrect
// wire type is encountered. It does not get returned to user code.
var ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof")

// The fundamental decoders that interpret bytes on the wire.
// Those that take integer types all return uint64 and are
// therefore of type valueDecoder.

// DecodeVarint reads a varint-encoded integer from the slice.
// It returns the integer and the number of bytes consumed, or
// zero if there is not enough.
// This is the format for the
// int32, int64, uint32, uint64, bool, and enum
// protocol buffer types.
func DecodeVarint(buf []byte) (x uint64, n int) {
	for shift := uint(0); shift < 64; shift += 7 {
		if n >= len(buf) {
			return 0, 0
		}
		b := uint64(buf[n])
		n++
		x |= (b & 0x7F) << shift
		if (b & 0x80) == 0 {
			return x, n
		}
	}

	// The number is too large to represent in a 64-bit value.
	return 0, 0
}

func (p *Buffer) decodeVarintSlow() (x uint64, err error) {
	i := p.index
	l := len(p.buf)

	for shift := uint(0); shift < 64; shift += 7 {
		if i >= l {
			err = io.ErrUnexpectedEOF
			return
		}
		b := p.buf[i]
		i++
		x |= (uint64(b) & 0x7F) << shift
		if b < 0x80 {
			p.index = i
			return
		}
	}

	// The number is too large to represent in a 64-bit value.
	err = errOverflow
	return
}

// DecodeVarint reads a varint-encoded integer from the Buffer.
// This is the format for the
// int32, int64, uint32, uint64, bool, and enum
// protocol buffer types.
func (p *Buffer) DecodeVarint() (x uint64, err error) {
	i := p.index
	buf := p.buf

	if i >= len(buf) {
		return 0, io.ErrUnexpectedEOF
	} else if buf[i] < 0x80 {
		p.index++
		return uint64(buf[i]), nil
	} else if len(buf)-i < 10 {
		return p.decodeVarintSlow()
	}

	var b uint64
	// we already checked the first byte
	x = uint64(buf[i]) - 0x80
	i++

	b = uint64(buf[i])
	i++
	x += b << 7
	if b&0x80 == 0 {
		goto done
	}
	x -= 0x80 << 7

	b = uint64(buf[i])
	i++
	x += b << 14
	if b&0x80 == 0 {
		goto done
	}
	x -= 0x80 << 14

	b = uint64(buf[i])
	i++
	x += b << 21
	if b&0x80 == 0 {
		goto done
	}
	x -= 0x80 << 21

	b = uint64(buf[i])
	i++
	x += b << 28
	if b&0x80 == 0 {
		goto done
	}
	x -= 0x80 << 28

	b = uint64(buf[i])
	i++
	x += b << 35
	if b&0x80 == 0 {
		goto done
	}
	x -= 0x80 << 35

	b = uint64(buf[i])
	i++
	x += b << 42
	if b&0x80 == 0 {
		goto done
	}
	x -= 0x80 << 42

	b = uint64(buf[i])
	i++
	x += b << 49
	if b&0x80 == 0 {
		goto done
	}
	x -= 0x80 << 49

	b = uint64(buf[i])
	i++
	x += b << 56
	if b&0x80 == 0 {
		goto done
	}
	x -= 0x80 << 56

	b = uint64(buf[i])
	i++
	x += b << 63
	if b&0x80 == 0 {
		goto done
	}
	// x -= 0x80 << 63 // Always zero.

	return 0, errOverflow

done:
	p.index = i
	return x, nil
}

// DecodeFixed64 reads a 64-bit integer from the Buffer.
// This is the format for the
// fixed64, sfixed64, and double protocol buffer types.
func (p *Buffer) DecodeFixed64() (x uint64, err error) {
	// x, err already 0
	i := p.index + 8
	if i < 0 || i > len(p.buf) {
		err = io.ErrUnexpectedEOF
		return
	}
	p.index = i

	x = uint64(p.buf[i-8])
	x |= uint64(p.buf[i-7]) << 8
	x |= uint64(p.buf[i-6]) << 16
	x |= uint64(p.buf[i-5]) << 24
	x |= uint64(p.buf[i-4]) << 32
	x |= uint64(p.buf[i-3]) << 40
	x |= uint64(p.buf[i-2]) << 48
	x |= uint64(p.buf[i-1]) << 56
	return
}

// DecodeFixed32 reads a 32-bit integer from the Buffer.
// This is the format for the
// fixed32, sfixed32, and float protocol buffer types.
func (p *Buffer) DecodeFixed32() (x uint64, err error) {
	// x, err already 0
	i := p.index + 4
	if i < 0 || i > len(p.buf) {
		err = io.ErrUnexpectedEOF
		return
	}
	p.index = i

	x = uint64(p.buf[i-4])
	x |= uint64(p.buf[i-3]) << 8
	x |= uint64(p.buf[i-2]) << 16
	x |= uint64(p.buf[i-1]) << 24
	return
}

// DecodeZigzag64 reads a zigzag-encoded 64-bit integer
// from the Buffer.
// This is the format used for the sint64 protocol buffer type.
func (p *Buffer) DecodeZigzag64() (x uint64, err error) {
	x, err = p.DecodeVarint()
	if err != nil {
		return
	}
	x = (x >> 1) ^ uint64((int64(x&1)<<63)>>63)
	return
}

// DecodeZigzag32 reads a zigzag-encoded 32-bit integer
// from  the Buffer.
// This is the format used for the sint32 protocol buffer type.
func (p *Buffer) DecodeZigzag32() (x uint64, err error) {
	x, err = p.DecodeVarint()
	if err != nil {
		return
	}
	x = uint64((uint32(x) >> 1) ^ uint32((int32(x&1)<<31)>>31))
	return
}

// These are not ValueDecoders: they produce an array of bytes or a string.
// bytes, embedded messages

// DecodeRawBytes reads a count-delimited byte buffer from the Buffer.
// This is the format used for the bytes protocol buffer
// type and for embedded messages.
func (p *Buffer) DecodeRawBytes(alloc bool) (buf []byte, err error) {
	n, err := p.DecodeVarint()
	if err != nil {
		return nil, err
	}

	nb := int(n)
	if nb < 0 {
		return nil, fmt.Errorf("proto: bad byte length %d", nb)
	}
	end := p.index + nb
	if end < p.index || end > len(p.buf) {
		return nil, io.ErrUnexpectedEOF
	}

	if !alloc {
		// todo: check if can get more uses of alloc=false
		buf = p.buf[p.index:end]
		p.index += nb
		return
	}

	buf = make([]byte, nb)
	copy(buf, p.buf[p.index:])
	p.index += nb
	return
}

// DecodeStringBytes reads an encoded string from the Buffer.
// This is the format used for the proto2 string type.
func (p *Buffer) DecodeStringBytes() (s string, err error) {
	buf, err := p.DecodeRawBytes(false)
	if err != nil {
		return
	}
	return string(buf), nil
}

// Skip the next item in the buffer. Its wire type is decoded and presented as an argument.
// If the protocol buffer has extensions, and the field matches, add it as an extension.
// Otherwise, if the XXX_unrecognized field exists, append the skipped data there.
func (o *Buffer) skipAndSave(t reflect.Type, tag, wire int, base structPointer, unrecField field) error {
	oi := o.index

	err := o.skip(t, tag, wire)
	if err != nil {
		return err
	}

	if !unrecField.IsValid() {
		return nil
	}

	ptr := structPointer_Bytes(base, unrecField)

	// Add the skipped field to struct field
	obuf := o.buf

	o.buf = *ptr
	o.EncodeVarint(uint64(tag<<3 | wire))
	*ptr = append(o.buf, obuf[oi:o.index]...)

	o.buf = obuf

	return nil
}

// Skip the next item in the buffer. Its wire type is decoded and presented as an argument.
func (o *Buffer) skip(t reflect.Type, tag, wire int) error {

	var u uint64
	var err error

	switch wire {
	case WireVarint:
		_, err = o.DecodeVarint()
	case WireFixed64:
		_, err = o.DecodeFixed64()
	case WireBytes:
		_, err = o.DecodeRawBytes(false)
	case WireFixed32:
		_, err = o.DecodeFixed32()
	case WireStartGroup:
		for {
			u, err = o.DecodeVarint()
			if err != nil {
				break
			}
			fwire := int(u & 0x7)
			if fwire == WireEndGroup {
				break
			}
			ftag := int(u >> 3)
			err = o.skip(t, ftag, fwire)
			if err != nil {
				break
			}
		}
	default:
		err = fmt.Errorf("proto: can't skip unknown wire type %d for %s", wire, t)
	}
	return err
}

// Unmarshaler is the interface representing objects that can
// unmarshal themselves.  The method should reset the receiver before
// decoding starts.  The argument points to data that may be
// overwritten, so implementations should not keep references to the
// buffer.
type Unmarshaler interface {
	Unmarshal([]byte) error
}

// Unmarshal parses the protocol buffer representation in buf and places the
// decoded result in pb.  If the struct underlying pb does not match
// the data in buf, the results can be unpredictable.
//
// Unmarshal resets pb before starting to unmarshal, so any
// existing data in pb is always removed. Use UnmarshalMerge
// to preserve and append to existing data.
func Unmarshal(buf []byte, pb Message) error {
	pb.Reset()
	return UnmarshalMerge(buf, pb)
}

// UnmarshalMerge parses the protocol buffer representation in buf and
// writes the decoded result to pb.  If the struct underlying pb does not match
// the data in buf, the results can be unpredictable.
//
// UnmarshalMerge merges into existing data in pb.
// Most code should use Unmarshal instead.
func UnmarshalMerge(buf []byte, pb Message) error {
	// If the object can unmarshal itself, let it.
	if u, ok := pb.(Unmarshaler); ok {
		return u.Unmarshal(buf)
	}
	return NewBuffer(buf).Unmarshal(pb)
}

// DecodeMessage reads a count-delimited message from the Buffer.
func (p *Buffer) DecodeMessage(pb Message) error {
	enc, err := p.DecodeRawBytes(false)
	if err != nil {
		return err
	}
	return NewBuffer(enc).Unmarshal(pb)
}

// DecodeGroup reads a tag-delimited group from the Buffer.
func (p *Buffer) DecodeGroup(pb Message) error {
	typ, base, err := getbase(pb)
	if err != nil {
		return err
	}
	return p.unmarshalType(typ.Elem(), GetProperties(typ.Elem()), true, base)
}

// Unmarshal parses the protocol buffer representation in the
// Buffer and places the decoded result in pb.  If the struct
// underlying pb does not match the data in the buffer, the results can be
// unpredictable.
//
// Unlike proto.Unmarshal, this does not reset pb before starting to unmarshal.
func (p *Buffer) Unmarshal(pb Message) error {
	// If the object can unmarshal itself, let it.
	if u, ok := pb.(Unmarshaler); ok {
		err := u.Unmarshal(p.buf[p.index:])
		p.index = len(p.buf)
		return err
	}

	typ, base, err := getbase(pb)
	if err != nil {
		return err
	}

	err = p.unmarshalType(typ.Elem(), GetProperties(typ.Elem()), false, base)

	if collectStats {
		stats.Decode++
	}

	return err
}

// unmarshalType does the work of unmarshaling a structure.
func (o *Buffer) unmarshalType(st reflect.Type, prop *StructProperties, is_group bool, base structPointer) error {
	var state errorState
	required, reqFields := prop.reqCount, uint64(0)

	var err error
	for err == nil && o.index < len(o.buf) {
		oi := o.index
		var u uint64
		u, err = o.DecodeVarint()
		if err != nil {
			break
		}
		wire := int(u & 0x7)
		if wire == WireEndGroup {
			if is_group {
				if required > 0 {
					// Not enough information to determine the exact field.
					// (See below.)
					return &RequiredNotSetError{"{Unknown}"}
				}
				return nil // input is satisfied
			}
			return fmt.Errorf("proto: %s: wiretype end group for non-group", st)
		}
		tag := int(u >> 3)
		if tag <= 0 {
			return fmt.Errorf("proto: %s: illegal tag %d (wire type %d)", st, tag, wire)
		}
		fieldnum, ok := prop.decoderTags.get(tag)
		if !ok {
			// Maybe it's an extension?
			if prop.extendable {
				if e, _ := extendable(structPointer_Interface(base, st)); isExtensionField(e, int32(tag)) {
					if err = o.skip(st, tag, wire); err == nil {
						extmap := e.extensionsWrite()
						ext := extmap[int32(tag)] // may be missing
						ext.enc = append(ext.enc, o.buf[oi:o.index]...)
						extmap[int32(tag)] = ext
					}
					continue
				}
			}
			// Maybe it's a oneof?
			if prop.oneofUnmarshaler != nil {
				m := structPointer_Interface(base, st).(Message)
				// First return value indicates whether tag is a oneof field.
				ok, err = prop.oneofUnmarshaler(m, tag, wire, o)
				if err == ErrInternalBadWireType {
					// Map the error to something more descriptive.
					// Do the formatting here to save generated code space.
					err = fmt.Errorf("bad wiretype for oneof field in %T", m)
				}
				if ok {
					continue
				}
			}
			err = o.skipAndSave(st, tag, wire, base, prop.unrecField)
			continue
		}
		p := prop.Prop[fieldnum]

		if p.dec == nil {
			fmt.Fprintf(os.Stderr, "proto: no protobuf decoder for %s.%s\n", st, st.Field(fieldnum).Name)
			continue
		}
		dec := p.dec
		if wire != WireStartGroup && wire != p.WireType {
			if wire == WireBytes && p.packedDec != nil {
				// a packable field
				dec = p.packedDec
			} else {
				err = fmt.Errorf("proto: bad wiretype for field %s.%s: got wiretype %d, want %d", st, st.Field(fieldnum).Name, wire, p.WireType)
				continue
			}
		}
		decErr := dec(o, p, base)
		if decErr != nil && !state.shouldContinue(decErr, p) {
			err = decErr
		}
		if err == nil && p.Required {
			// Successfully decoded a required field.
			if tag <= 64 {
				// use bitmap for fields 1-64 to catch field reuse.
				var mask uint64 = 1 << uint64(tag-1)
				if reqFields&mask == 0 {
					// new required field
					reqFields |= mask
					required--
				}
			} else {
				// This is imprecise. It can be fooled by a required field
				// with a tag > 64 that is encoded twice; that's very rare.
				// A fully correct implementation would require allocating
				// a data structure, which we would like to avoid.
				required--
			}
		}
	}
	if err == nil {
		if is_group {
			return io.ErrUnexpectedEOF
		}
		if state.err != nil {
			return state.err
		}
		if required > 0 {
			// Not enough information to determine the exact field. If we use extra
			// CPU, we could determine the field only if the missing required field
			// has a tag <= 64 and we check reqFields.
			return &RequiredNotSetError{"{Unknown}"}
		}
	}
	return err
}

// Individual type decoders
// For each,
//	u is the decoded value,
//	v is a pointer to the field (pointer) in the struct

// Sizes of the pools to allocate inside the Buffer.
// The goal is modest amortization and allocation
// on at least 16-byte boundaries.
const (
	boolPoolSize   = 16
	uint32PoolSize = 8
	uint64PoolSize = 4
)

// Decode a bool.
func (o *Buffer) dec_bool(p *Properties, base structPointer) error {
	u, err := p.valDec(o)
	if err != nil {
		return err
	}
	if len(o.bools) == 0 {
		o.bools = make([]bool, boolPoolSize)
	}
	o.bools[0] = u != 0
	*structPointer_Bool(base, p.field) = &o.bools[0]
	o.bools = o.bools[1:]
	return nil
}

func (o *Buffer) dec_proto3_bool(p *Properties, base structPointer) error {
	u, err := p.valDec(o)
	if err != nil {
		return err
	}
	*structPointer_BoolVal(base, p.field) = u != 0
	return nil
}

// Decode an int32.
func (o *Buffer) dec_int32(p *Properties, base structPointer) error {
	u, err := p.valDec(o)
	if err != nil {
		return err
	}
	word32_Set(structPointer_Word32(base, p.field), o, uint32(u))
	return nil
}

func (o *Buffer) dec_proto3_int32(p *Properties, base structPointer) error {
	u, err := p.valDec(o)
	if err != nil {
		return err
	}
	word32Val_Set(structPointer_Word32Val(base, p.field), uint32(u))
	return nil
}

// Decode an int64.
func (o *Buffer) dec_int64(p *Properties, base structPointer) error {
	u, err := p.valDec(o)
	if err != nil {
		return err
	}
	word64_Set(structPointer_Word64(base, p.field), o, u)
	return nil
}

func (o *Buffer) dec_proto3_int64(p *Properties, base structPointer) error {
	u, err := p.valDec(o)
	if err != nil {
		return err
	}
	word64Val_Set(structPointer_Word64Val(base, p.field), o, u)
	return nil
}

// Decode a string.
func (o *Buffer) dec_string(p *Properties, base structPointer) error {
	s, err := o.DecodeStringBytes()
	if err != nil {
		return err
	}
	*structPointer_String(base, p.field) = &s
	return nil
}

func (o *Buffer) dec_proto3_string(p *Properties, base structPointer) error {
	s, err := o.DecodeStringBytes()
	if err != nil {
		return err
	}
	*structPointer_StringVal(base, p.field) = s
	return nil
}

// Decode a slice of bytes ([]byte).
func (o *Buffer) dec_slice_byte(p *Properties, base structPointer) error {
	b, err := o.DecodeRawBytes(true)
	if err != nil {
		return err
	}
	*structPointer_Bytes(base, p.field) = b
	return nil
}

// Decode a slice of bools ([]bool).
func (o *Buffer) dec_slice_bool(p *Properties, base structPointer) error {
	u, err := p.valDec(o)
	if err != nil {
		return err
	}
	v := structPointer_BoolSlice(base, p.field)
	*v = append(*v, u != 0)
	return nil
}

// Decode a slice of bools ([]bool) in packed format.
func (o *Buffer) dec_slice_packed_bool(p *Properties, base structPointer) error {
	v := structPointer_BoolSlice(base, p.field)

	nn, err := o.DecodeVarint()
	if err != nil {
		return err
	}
	nb := int(nn) // number of bytes of encoded bools
	fin := o.index + nb
	if fin < o.index {
		return errOverflow
	}

	y := *v
	for o.index < fin {
		u, err := p.valDec(o)
		if err != nil {
			return err
		}
		y = append(y, u != 0)
	}

	*v = y
	return nil
}

// Decode a slice of int32s ([]int32).
func (o *Buffer) dec_slice_int32(p *Properties, base structPointer) error {
	u, err := p.valDec(o)
	if err != nil {
		return err
	}
	structPointer_Word32Slice(base, p.field).Append(uint32(u))
	return nil
}

// Decode a slice of int32s ([]int32) in packed format.
func (o *Buffer) dec_slice_packed_int32(p *Properties, base structPointer) error {
	v := structPointer_Word32Slice(base, p.field)

	nn, err := o.DecodeVarint()
	if err != nil {
		return err
	}
	nb := int(nn) // number of bytes of encoded int32s

	fin := o.index + nb
	if fin < o.index {
		return errOverflow
	}
	for o.index < fin {
		u, err := p.valDec(o)
		if err != nil {
			return err
		}
		v.Append(uint32(u))
	}
	return nil
}

// Decode a slice of int64s ([]int64).
func (o *Buffer) dec_slice_int64(p *Properties, base structPointer) error {
	u, err := p.valDec(o)
	if err != nil {
		return err
	}

	structPointer_Word64Slice(base, p.field).Append(u)
	return nil
}

// Decode a slice of int64s ([]int64) in packed format.
func (o *Buffer) dec_slice_packed_int64(p *Properties, base structPointer) error {
	v := structPointer_Word64Slice(base, p.field)

	nn, err := o.DecodeVarint()
	if err != nil {
		return err
	}
	nb := int(nn) // number of bytes of encoded int64s

	fin := o.index + nb
	if fin < o.index {
		return errOverflow
	}
	for o.index < fin {
		u, err := p.valDec(o)
		if err != nil {
			return err
		}
		v.Append(u)
	}
	return nil
}

// Decode a slice of strings ([]string).
func (o *Buffer) dec_slice_string(p *Properties, base structPointer) error {
	s, err := o.DecodeStringBytes()
	if err != nil {
		return err
	}
	v := structPointer_StringSlice(base, p.field)
	*v = append(*v, s)
	return nil
}

// Decode a slice of slice of bytes ([][]byte).
func (o *Buffer) dec_slice_slice_byte(p *Properties, base structPointer) error {
	b, err := o.DecodeRawBytes(true)
	if err != nil {
		return err
	}
	v := structPointer_BytesSlice(base, p.field)
	*v = append(*v, b)
	return nil
}

// Decode a map field.
func (o *Buffer) dec_new_map(p *Properties, base structPointer) error {
	raw, err := o.DecodeRawBytes(false)
	if err != nil {
		return err
	}
	oi := o.index       // index at the end of this map entry
	o.index -= len(raw) // move buffer back to start of map entry

	mptr := structPointer_NewAt(base, p.field, p.mtype) // *map[K]V
	if mptr.Elem().IsNil() {
		mptr.Elem().Set(reflect.MakeMap(mptr.Type().Elem()))
	}
	v := mptr.Elem() // map[K]V

	// Prepare addressable doubly-indirect placeholders for the key and value types.
	// See enc_new_map for why.
	keyptr := reflect.New(reflect.PtrTo(p.mtype.Key())).Elem() // addressable *K
	keybase := toStructPointer(keyptr.Addr())                  // **K

	var valbase structPointer
	var valptr reflect.Value
	switch p.mtype.Elem().Kind() {
	case reflect.Slice:
		// []byte
		var dummy []byte
		valptr = reflect.ValueOf(&dummy)  // *[]byte
		valbase = toStructPointer(valptr) // *[]byte
	case reflect.Ptr:
		// message; valptr is **Msg; need to allocate the intermediate pointer
		valptr = reflect.New(reflect.PtrTo(p.mtype.Elem())).Elem() // addressable *V
		valptr.Set(reflect.New(valptr.Type().Elem()))
		valbase = toStructPointer(valptr)
	default:
		// everything else
		valptr = reflect.New(reflect.PtrTo(p.mtype.Elem())).Elem() // addressable *V
		valbase = toStructPointer(valptr.Addr())                   // **V
	}

	// Decode.
	// This parses a restricted wire format, namely the encoding of a message
	// with two fields. See enc_new_map for the format.
	for o.index < oi {
		// tagcode for key and value properties are always a single byte
		// because they have tags 1 and 2.
		tagcode := o.buf[o.index]
		o.index++
		switch tagcode {
		case p.mkeyprop.tagcode[0]:
			if err := p.mkeyprop.dec(o, p.mkeyprop, keybase); err != nil {
				return err
			}
		case p.mvalprop.tagcode[0]:
			if err := p.mvalprop.dec(o, p.mvalprop, valbase); err != nil {
				return err
			}
		default:
			// TODO: Should we silently skip this instead?
			return fmt.Errorf("proto: bad map data tag %d", raw[0])
		}
	}
	keyelem, valelem := keyptr.Elem(), valptr.Elem()
	if !keyelem.IsValid() {
		keyelem = reflect.Zero(p.mtype.Key())
	}
	if !valelem.IsValid() {
		valelem = reflect.Zero(p.mtype.Elem())
	}

	v.SetMapIndex(keyelem, valelem)
	return nil
}

// Decode a group.
func (o *Buffer) dec_struct_group(p *Properties, base structPointer) error {
	bas := structPointer_GetStructPointer(base, p.field)
	if structPointer_IsNil(bas) {
		// allocate new nested message
		bas = toStructPointer(reflect.New(p.stype))
		structPointer_SetStructPointer(base, p.field, bas)
	}
	return o.unmarshalType(p.stype, p.sprop, true, bas)
}

// Decode an embedded message.
func (o *Buffer) dec_struct_message(p *Properties, base structPointer) (err error) {
	raw, e := o.DecodeRawBytes(false)
	if e != nil {
		return e
	}

	bas := structPointer_GetStructPointer(base, p.field)
	if structPointer_IsNil(bas) {
		// allocate new nested message
		bas = toStructPointer(reflect.New(p.stype))
		structPointer_SetStructPointer(base, p.field, bas)
	}

	// If the object can unmarshal itself, let it.
	if p.isUnmarshaler {
		iv := structPointer_Interface(bas, p.stype)
		return iv.(Unmarshaler).Unmarshal(raw)
	}

	obuf := o.buf
	oi := o.index
	o.buf = raw
	o.index = 0

	err = o.unmarshalType(p.stype, p.sprop, false, bas)
	o.buf = obuf
	o.index = oi

	return err
}

// Decode a slice of embedded messages.
func (o *Buffer) dec_slice_struct_message(p *Properties, base structPointer) error {
	return o.dec_slice_struct(p, false, base)
}

// Decode a slice of embedded groups.
func (o *Buffer) dec_slice_struct_group(p *Properties, base structPointer) error {
	return o.dec_slice_struct(p, true, base)
}

// Decode a slice of structs ([]*struct).
func (o *Buffer) dec_slice_struct(p *Properties, is_group bool, base structPointer) error {
	v := reflect.New(p.stype)
	bas := toStructPointer(v)
	structPointer_StructPointerSlice(base, p.field).Append(bas)

	if is_group {
		err := o.unmarshalType(p.stype, p.sprop, is_group, bas)
		return err
	}

	raw, err := o.DecodeRawBytes(false)
	if err != nil {
		return err
	}

	// If the object can unmarshal itself, let it.
	if p.isUnmarshaler {
		iv := v.Interface()
		return iv.(Unmarshaler).Unmarshal(raw)
	}

	obuf := o.buf
	oi := o.index
	o.buf = raw
	o.index = 0

	err = o.unmarshalType(p.stype, p.sprop, is_group, bas)

	o.buf = obuf
	o.index = oi

	return err
}


================================================
FILE: vendor/github.com/golang/protobuf/proto/decode_test.go
================================================
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2010 The Go Authors.  All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// +build go1.7

package proto_test

import (
	"fmt"
	"testing"

	"github.com/golang/protobuf/proto"
	tpb "github.com/golang/protobuf/proto/proto3_proto"
)

var (
	bytesBlackhole []byte
	msgBlackhole   = new(tpb.Message)
)

// BenchmarkVarint32ArraySmall shows the performance on an array of small int32 fields (1 and
// 2 bytes long).
func BenchmarkVarint32ArraySmall(b *testing.B) {
	for i := uint(1); i <= 10; i++ {
		dist := genInt32Dist([7]int{0, 3, 1}, 1<<i)
		raw, err := proto.Marshal(&tpb.Message{
			ShortKey: dist,
		})
		if err != nil {
			b.Error("wrong encode", err)
		}
		b.Run(fmt.Sprintf("Len%v", len(dist)), func(b *testing.B) {
			scratchBuf := proto.NewBuffer(nil)
			b.ResetTimer()
			for k := 0; k < b.N; k++ {
				scratchBuf.SetBuf(raw)
				msgBlackhole.Reset()
				if err := scratchBuf.Unmarshal(msgBlackhole); err != nil {
					b.Error("wrong decode", err)
				}
			}
		})
	}
}

// BenchmarkVarint32ArrayLarge shows the performance on an array of large int32 fields (3 and
// 4 bytes long, with a small number of 1, 2, 5 and 10 byte long versions).
func BenchmarkVarint32ArrayLarge(b *testing.B) {
	for i := uint(1); i <= 10; i++ {
		dist := genInt32Dist([7]int{0, 1, 2, 4, 8, 1, 1}, 1<<i)
		raw, err := proto.Marshal(&tpb.Message{
			ShortKey: dist,
		})
		if err != nil {
			b.Error("wrong encode", err)
		}
		b.Run(fmt.Sprintf("Len%v", len(dist)), func(b *testing.B) {
			scratchBuf := proto.NewBuffer(nil)
			b.ResetTimer()
			for k := 0; k < b.N; k++ {
				scratchBuf.SetBuf(raw)
				msgBlackhole.Reset()
				if err := scratchBuf.Unmarshal(msgBlackhole); err != nil {
					b.Error("wrong decode", err)
				}
			}
		})
	}
}

// BenchmarkVarint64ArraySmall shows the performance on an array of small int64 fields (1 and
// 2 bytes long).
func BenchmarkVarint64ArraySmall(b *testing.B) {
	for i := uint(1); i <= 10; i++ {
		dist := genUint64Dist([11]int{0, 3, 1}, 1<<i)
		raw, err := proto.Marshal(&tpb.Message{
			Key: dist,
		})
		if err != nil {
			b.Error("wrong encode", err)
		}
		b.Run(fmt.Sprintf("Len%v", len(dist)), func(b *testing.B) {
			scratchBuf := proto.NewBuffer(nil)
			b.ResetTimer()
			for k := 0; k < b.N; k++ {
				scratchBuf.SetBuf(raw)
				msgBlackhole.Reset()
				if err := scratchBuf.Unmarshal(msgBlackhole); err != nil {
					b.Error("wrong decode", err)
				}
			}
		})
	}
}

// BenchmarkVarint64ArrayLarge shows the performance on an array of large int64 fields (6, 7,
// and 8 bytes long with a small number of the other sizes).
func BenchmarkVarint64ArrayLarge(b *testing.B) {
	for i := uint(1); i <= 10; i++ {
		dist := genUint64Dist([11]int{0, 1, 1, 2, 4, 8, 16, 32, 16, 1, 1}, 1<<i)
		raw, err := proto.Marshal(&tpb.Message{
			Key: dist,
		})
		if err != nil {
			b.Error("wrong encode", err)
		}
		b.Run(fmt.Sprintf("Len%v", len(dist)), func(b *testing.B) {
			scratchBuf := proto.NewBuffer(nil)
			b.ResetTimer()
			for k := 0; k < b.N; k++ {
				scratchBuf.SetBuf(raw)
				msgBlackhole.Reset()
				if err := scratchBuf.Unmarshal(msgBlackhole); err != nil {
					b.Error("wrong decode", err)
				}
			}
		})
	}
}

// BenchmarkVarint64ArrayMixed shows the performance of lots of small messages, each
// containing a small number of large (3, 4, and 5 byte) repeated int64s.
func BenchmarkVarint64ArrayMixed(b *testing.B) {
	for i := uint(1); i <= 1<<5; i <<= 1 {
		dist := genUint64Dist([11]int{0, 0, 0, 4, 6, 4, 0, 0, 0, 0, 0}, int(i))
		// number of sub fields
		for k := uint(1); k <= 1<<10; k <<= 2 {
			msg := &tpb.Message{}
			for m := uint(0); m < k; m++ {
				msg.Children = append(msg.Children, &tpb.Message{
					Key: dist,
				})
			}
			raw, err := proto.Marshal(msg)
			if err != nil {
				b.Error("wrong encode", err)
			}
			b.Run(fmt.Sprintf("Fields%vLen%v", k, i), func(b *testing.B) {
				scratchBuf := proto.NewBuffer(nil)
				b.ResetTimer()
				for k := 0; k < b.N; k++ {
					scratchBuf.SetBuf(raw)
					msgBlackhole.Reset()
					if err := scratchBuf.Unmarshal(msgBlackhole); err != nil {
						b.Error("wrong decode", err)
					}
				}
			})
		}
	}
}

// genInt32Dist generates a slice of ints that will match the size distribution of dist.
// A size of 6 corresponds to a max length varint32, which is 10 bytes.  The distribution
// is 1-indexed. (i.e. the value at index 1 is how many 1 byte ints to create).
func genInt32Dist(dist [7]int, count int) (dest []int32) {
	for i := 0; i < count; i++ {
		for k := 0; k < len(dist); k++ {
			var num int32
			switch k {
			case 1:
				num = 1<<7 - 1
			case 2:
				num = 1<<14 - 1
			case 3:
				num = 1<<21 - 1
			case 4:
				num = 1<<28 - 1
			case 5:
				num = 1<<29 - 1
			case 6:
				num = -1
			}
			for m := 0; m < dist[k]; m++ {
				dest = append(dest, num)
			}
		}
	}
	return
}

// genUint64Dist generates a slice of ints that will match the size distribution of dist.
// The distribution is 1-indexed. (i.e. the value at index 1 is how many 1 byte ints to create).
func genUint64Dist(dist [11]int, count int) (dest []uint64) {
	for i := 0; i < count; i++ {
		for k := 0; k < len(dist); k++ {
			var num uint64
			switch k {
			case 1:
				num = 1<<7 - 1
			case 2:
				num = 1<<14 - 1
			case 3:
				num = 1<<21 - 1
			case 4:
				num = 1<<28 - 1
			case 5:
				num = 1<<35 - 1
			case 6:
				num = 1<<42 - 1
			case 7:
				num = 1<<49 - 1
			case 8:
				num = 1<<56 - 1
			case 9:
				num = 1<<63 - 1
			case 10:
				num = 1<<64 - 1
			}
			for m := 0; m < dist[k]; m++ {
				dest = append(dest, num)
			}
		}
	}
	return
}

// BenchmarkDecodeEmpty measures the overhead of doing the minimal possible decode.
func BenchmarkDecodeEmpty(b *testing.B) {
	raw, err := proto.Marshal(&tpb.Message{})
	if err != nil {
		b.Error("wrong encode", err)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		if err := proto.Unmarshal(raw, msgBlackhole); err != nil {
			b.Error("wrong decode", err)
		}
	}
}


================================================
FILE: vendor/github.com/golang/protobuf/proto/encode.go
================================================
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2010 The Go Authors.  All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

package proto

/*
 * Routines for encoding data into the wire format for protocol buffers.
 */

import (
	"errors"
	"fmt"
	"reflect"
	"sort"
)

// RequiredNotSetError is the error returned if Marshal is called with
// a protocol buffer struct whose required fields have not
// all been initialized. It is also the error returned if Unmarshal is
// called with an encoded protocol buffer that does not include all the
// required fields.
//
// When printed, RequiredNotSetError reports the first unset required field in a
// message. If the field cannot be precisely determined, it is reported as
// "{Unknown}".
type RequiredNotSetError struct {
	field string
}

func (e *RequiredNotSetError) Error() string {
	return fmt.Sprintf("proto: required field %q not set", e.field)
}

var (
	// errRepeatedHasNil is the error returned if Marshal is called with
	// a struct with a repeated field containing a nil element.
	errRepeatedHasNil = errors.New("proto: repeated field has nil element")

	// errOneofHasNil is the error returned if Marshal is called with
	// a struct with a oneof field containing a nil element.
	errOneofHasNil = errors.New("proto: oneof field has nil value")

	// ErrNil is the error returned if Marshal is called with nil.
	ErrNil = errors.New("proto: Marshal called with nil")

	// ErrTooLarge is the error returned if Marshal is called with a
	// message that encodes to >2GB.
	ErrTooLarge = errors.New("proto: message encodes to over 2 GB")
)

// The fundamental encoders that put bytes on the wire.
// Those that take integer types all accept uint64 and are
// therefore of type valueEncoder.

const maxVarintBytes = 10 // maximum length of a varint

// maxMarshalSize is the largest allowed size of an encoded protobuf,
// since C++ and Java use signed int32s for the size.
const maxMarshalSize = 1<<31 - 1

// EncodeVarint returns the varint encoding of x.
// This is the format for the
// int32, int64, uint32, uint64, bool, and enum
// protocol buffer types.
// Not used by the package itself, but helpful to clients
// wishing to use the same encoding.
func EncodeVarint(x uint64) []byte {
	var buf [maxVarintBytes]byte
	var n int
	for n = 0; x > 127; n++ {
		buf[n] = 0x80 | uint8(x&0x7F)
		x >>= 7
	}
	buf[n] = uint8(x)
	n++
	return buf[0:n]
}

// EncodeVarint writes a varint-encoded integer to the Buffer.
// This is the format for the
// int32, int64, uint32, uint64, bool, and enum
// protocol buffer types.
func (p *Buffer) EncodeVarint(x uint64) error {
	for x >= 1<<7 {
		p.buf = append(p.buf, uint8(x&0x7f|0x80))
		x >>= 7
	}
	p.buf = append(p.buf, uint8(x))
	return nil
}

// SizeVarint returns the varint encoding size of an integer.
func SizeVarint(x uint64) int {
	return sizeVarint(x)
}

func sizeVarint(x uint64) (n int) {
	for {
		n++
		x >>= 7
		if x == 0 {
			break
		}
	}
	return n
}

// EncodeFixed64 writes a 64-bit integer to the Buffer.
// This is the format for the
// fixed64, sfixed64, and double protocol buffer types.
func (p *Buffer) EncodeFixed64(x uint64) error {
	p.buf = append(p.buf,
		uint8(x),
		uint8(x>>8),
		uint8(x>>16),
		uint8(x>>24),
		uint8(x>>32),
		uint8(x>>40),
		uint8(x>>48),
		uint8(x>>56))
	return nil
}

func sizeFixed64(x uint64) int {
	return 8
}

// EncodeFixed32 writes a 32-bit integer to the Buffer.
// This is the format for the
// fixed32, sfixed32, and float protocol buffer types.
func (p *Buffer) EncodeFixed32(x uint64) error {
	p.buf = append(p.buf,
		uint8(x),
		uint8(x>>8),
		uint8(x>>16),
		uint8(x>>24))
	return nil
}

func sizeFixed32(x uint64) int {
	return 4
}

// EncodeZigzag64 writes a zigzag-encoded 64-bit integer
// to the Buffer.
// This is the format used for the sint64 protocol buffer type.
func (p *Buffer) EncodeZigzag64(x uint64) error {
	// use signed number to get arithmetic right shift.
	return p.EncodeVarint((x << 1) ^ uint64((int64(x) >> 63)))
}

func sizeZigzag64(x uint64) int {
	return sizeVarint((x << 1) ^ uint64((int64(x) >> 63)))
}

// EncodeZigzag32 writes a zigzag-encoded 32-bit integer
// to the Buffer.
// This is the format used for the sint32 protocol buffer type.
func (p *Buffer) EncodeZigzag32(x uint64) error {
	// use signed number to get arithmetic right shift.
	return p.EncodeVarint(uint64((uint32(x) << 1) ^ uint32((int32(x) >> 31))))
}

func sizeZigzag32(x uint64) int {
	return sizeVarint(uint64((uint32(x) << 1) ^ uint32((int32(x) >> 31))))
}

// EncodeRawBytes writes a count-delimited byte buffer to the Buffer.
// This is the format used for the bytes protocol buffer
// type and for embedded messages.
func (p *Buffer) EncodeRawBytes(b []byte) error {
	p.EncodeVarint(uint64(len(b)))
	p.buf = append(p.buf, b...)
	return nil
}

func sizeRawBytes(b []byte) int {
	return sizeVarint(uint64(len(b))) +
		len(b)
}

// EncodeStringBytes writes an encoded string to the Buffer.
// This is the format used for the proto2 string type.
func (p *Buffer) EncodeStringBytes(s string) error {
	p.EncodeVarint(uint64(len(s)))
	p.buf = append(p.buf, s...)
	return nil
}

func sizeStringBytes(s string) int {
	return sizeVarint(uint64(len(s))) +
		len(s)
}

// Marshaler is the interface representing objects that can marshal themselves.
type Marshaler interface {
	Marshal() ([]byte, error)
}

// Marshal takes the protocol buffer
// and encodes it into the wire format, returning the data.
func Marshal(pb Message) ([]byte, error) {
	// Can the object marshal itself?
	if m, ok := pb.(Marshaler); ok {
		return m.Marshal()
	}
	p := NewBuffer(nil)
	err := p.Marshal(pb)
	if p.buf == nil && err == nil {
		// Return a non-nil slice on success.
		return []byte{}, nil
	}
	return p.buf, err
}

// EncodeMessage writes the protocol buffer to the Buffer,
// prefixed by a varint-encoded length.
func (p *Buffer) EncodeMessage(pb Message) error {
	t, base, err := getbase(pb)
	if structPointer_IsNil(base) {
		return ErrNil
	}
	if err == nil {
		var state errorState
		err = p.enc_len_struct(GetProperties(t.Elem()), base, &state)
	}
	return err
}

// Marshal takes the protocol buffer
// and encodes it into the wire format, writing the result to the
// Buffer.
func (p *Buffer) Marshal(pb Message) error {
	// Can the object marshal itself?
	if m, ok := pb.(Marshaler); ok {
		data, err := m.Marshal()
		p.buf = append(p.buf, data...)
		return err
	}

	t, base, err := getbase(pb)
	if structPointer_IsNil(base) {
		return ErrNil
	}
	if err == nil {
		err = p.enc_struct(GetProperties(t.Elem()), base)
	}

	if collectStats {
		(stats).Encode++ // Parens are to work around a goimports bug.
	}

	if len(p.buf) > maxMarshalSize {
		return ErrTooLarge
	}
	return err
}

// Size returns the encoded size of a protocol buffer.
func Size(pb Message) (n int) {
	// Can the object marshal itself?  If so, Size is slow.
	// TODO: add Size to Marshaler, or add a Sizer interface.
	if m, ok := pb.(Marshaler); ok {
		b, _ := m.Marshal()
		return len(b)
	}

	t, base, err := getbase(pb)
	if structPointer_IsNil(base) {
		return 0
	}
	if err == nil {
		n = size_struct(GetProperties(t.Elem()), base)
	}

	if collectStats {
		(stats).Size++ // Parens are to work around a goimports bug.
	}

	return
}

// Individual type encoders.

// Encode a bool.
func (o *Buffer) enc_bool(p *Properties, base structPointer) error {
	v := *structPointer_Bool(base, p.field)
	if v == nil {
		return ErrNil
	}
	x := 0
	if *v {
		x = 1
	}
	o.buf = append(o.buf, p.tagcode...)
	p.valEnc(o, uint64(x))
	return nil
}

func (o *Buffer) enc_proto3_bool(p *Properties, base structPointer) error {
	v := *structPointer_BoolVal(base, p.field)
	if !v {
		return ErrNil
	}
	o.buf = append(o.buf, p.tagcode...)
	p.valEnc(o, 1)
	return nil
}

func size_bool(p *Properties, base structPointer) int {
	v := *structPointer_Bool(base, p.field)
	if v == nil {
		return 0
	}
	return len(p.tagcode) + 1 // each bool takes exactly one byte
}

func size_proto3_bool(p *Properties, base structPointer) int {
	v := *structPointer_BoolVal(base, p.field)
	if !v && !p.oneof {
		return 0
	}
	return len(p.tagcode) + 1 // each bool takes exactly one byte
}

// Encode an int32.
func (o *Buffer) enc_int32(p *Properties, base structPointer) error {
	v := structPointer_Word32(base, p.field)
	if word32_IsNil(v) {
		return ErrNil
	}
	x := int32(word32_Get(v)) // permit sign extension to use full 64-bit range
	o.buf = append(o.buf, p.tagcode...)
	p.valEnc(o, uint64(x))
	return nil
}

func (o *Buffer) enc_proto3_int32(p *Properties, base structPointer) error {
	v := structPointer_Word32Val(base, p.field)
	x := int32(word32Val_Get(v)) // permit sign extension to use full 64-bit range
	if x == 0 {
		return ErrNil
	}
	o.buf = append(o.buf, p.tagcode...)
	p.valEnc(o, uint64(x))
	return nil
}

func size_int32(p *Properties, base structPointer) (n int) {
	v := structPointer_Word32(base, p.field)
	if word32_IsNil(v) {
		return 0
	}
	x := int32(word32_Get(v)) // permit sign extension to use full 64-bit range
	n += len(p.tagcode)
	n += p.valSize(uint64(x))
	return
}

func size_proto3_int32(p *Properties, base structPointer) (n int) {
	v := structPointer_Word32Val(base, p.field)
	x := int32(word32Val_Get(v)) // permit sign extension to use full 64-bit range
	if x == 0 && !p.oneof {
		return 0
	}
	n += len(p.tagcode)
	n += p.valSize(uint64(x))
	return
}

// Encode a uint32.
// Exactly the same as int32, except for no sign extension.
func (o *Buffer) enc_uint32(p *Properties, base structPointer) error {
	v := structPointer_Word32(base, p.field)
	if word32_IsNil(v) {
		return ErrNil
	}
	x := word32_Get(v)
	o.buf = append(o.buf, p.tagcode...)
	p.valEnc(o, uint64(x))
	return nil
}

func (o *Buffer) enc_proto3_uint32(p *Properties, base structPointer) error {
	v := structPointer_Word32Val(base, p.field)
	x := word32Val_Get(v)
	if x == 0 {
		return ErrNil
	}
	o.buf = append(o.buf, p.tagcode...)
	p.valEnc(o, uint64(x))
	return nil
}

func size_uint32(p *Properties, base structPointer) (n int) {
	v := structPointer_Word32(base, p.field)
	if word32_IsNil(v) {
		return 0
	}
	x := word32_Get(v)
	n += len(p.tagcode)
	n += p.valSize(uint64(x))
	return
}

func size_proto3_uint32(p *Properties, base structPointer) (n int) {
	v := structPointer_Word32Val(base, p.field)
	x := word32Val_Get(v)
	if x == 0 && !p.oneof {
		return 0
	}
	n += len(p.tagcode)
	n += p.valSize(uint64(x))
	return
}

// Encode an int64.
func (o *Buffer) enc_int64(p *Properties, base structPointer) error {
	v := structPointer_Word64(base, p.field)
	if word64_IsNil(v) {
		return ErrNil
	}
	x := word64_Get(v)
	o.buf = append(o.buf, p.tagcode...)
	p.valEnc(o, x)
	return nil
}

func (o *Buffer) enc_proto3_int64(p *Properties, base structPointer) error {
	v := structPointer_Word64Val(base, p.field)
	x := word64Val_Get(v)
	if x == 0 {
		return ErrNil
	}
	o.buf = append(o.buf, p.tagcode...)
	p.valEnc(o, x)
	return nil
}

func size_int64(p *Properties, base structPointer) (n int) {
	v := structPointer_Word64(base, p.field)
	if word64_IsNil(v) {
		return 0
	}
	x := word64_Get(v)
	n += len(p.tagcode)
	n += p.valSize(x)
	return
}

func size_proto3_int64(p *Properties, base structPointer) (n int) {
	v := structPointer_Word64Val(base, p.field)
	x := word64Val_Get(v)
	if x == 0 && !p.oneof {
		return 0
	}
	n += len(p.tagcode)
	n += p.valSize(x)
	return
}

// Encode a string.
func (o *Buffer) enc_string(p *Properties, base structPointer) error {
	v := *structPointer_String(base, p.field)
	if v == nil {
		return ErrNil
	}
	x := *v
	o.buf = append(o.buf, p.tagcode...)
	o.EncodeStringBytes(x)
	return nil
}

func (o *Buffer) enc_proto3_string(p *Properties, base structPointer) error {
	v := *structPointer_StringVal(base, p.field)
	if v == "" {
		return ErrNil
	}
	o.buf = append(o.buf, p.tagcode...)
	o.EncodeStringBytes(v)
	return nil
}

func size_string(p *Properties, base structPointer) (n int) {
	v := *structPointer_String(base, p.field)
	if v == nil {
		return 0
	}
	x := *v
	n += len(p.tagcode)
	n += sizeStringBytes(x)
	return
}

func size_proto3_string(p *Properties, base structPointer) (n int) {
	v := *structPointer_StringVal(base, p.field)
	if v == "" && !p.oneof {
		return 0
	}
	n += len(p.tagcode)
	n += sizeStringBytes(v)
	return
}

// All protocol buffer fields are nillable, but be careful.
func isNil(v reflect.Value) bool {
	switch v.Kind() {
	case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
		return v.IsNil()
	}
	return false
}

// Encode a message struct.
func (o *Buffer) enc_struct_message(p *Properties, base structPointer) error {
	var state errorState
	structp := structPointer_GetStructPointer(base, p.field)
	if structPointer_IsNil(structp) {
		return ErrNil
	}

	// Can the object marshal itself?
	if p.isMarshaler {
		m := structPointer_Interface(structp, p.stype).(Marshaler)
		data, err := m.Marshal()
		if err != nil && !state.shouldContinue(err, nil) {
			return err
		}
		o.buf = append(o.buf, p.tagcode...)
		o.EncodeRawBytes(data)
		return state.err
	}

	o.buf = append(o.buf, p.tagcode...)
	return o.enc_len_struct(p.sprop, structp, &state)
}

func size_struct_message(p *Properties, base structPointer) int {
	structp := structPointer_GetStructPointer(base, p.field)
	if structPointer_IsNil(structp) {
		return 0
	}

	// Can the object marshal itself?
	if p.isMarshaler {
		m := structPointer_Interface(structp, p.stype).(Marshaler)
		data, _ := m.Marshal()
		n0 := len(p.tagcode)
		n1 := sizeRawBytes(data)
		return n0 + n1
	}

	n0 := len(p.tagcode)
	n1 := size_struct(p.sprop, structp)
	n2 := sizeVarint(uint64(n1)) // size of encoded length
	return n0 + n1 + n2
}

// Encode a group struct.
func (o *Buffer) enc_struct_group(p *Properties, base structPointer) error {
	var state errorState
	b := structPointer_GetStructPointer(base, p.field)
	if structPointer_IsNil(b) {
		return ErrNil
	}

	o.EncodeVarint(uint64((p.Tag << 3) | WireStartGroup))
	err := o.enc_struct(p.sprop, b)
	if err != nil && !state.shouldContinue(err, nil) {
		return err
	}
	o.EncodeVarint(uint64((p.Tag << 3) | WireEndGroup))
	return state.err
}

func size_struct_group(p *Properties, base structPointer) (n int) {
	b := structPointer_GetStructPointer(base, p.field)
	if structPointer_IsNil(b) {
		return 0
	}

	n += sizeVarint(uint64((p.Tag << 3) | WireStartGroup))
	n += size_struct(p.sprop, b)
	n += sizeVarint(uint64((p.Tag << 3) | WireEndGroup))
	return
}

// Encode a slice of bools ([]bool).
func (o *Buffer) enc_slice_bool(p *Properties, base structPointer) error {
	s := *structPointer_BoolSlice(base, p.field)
	l := len(s)
	if l == 0 {
		return ErrNil
	}
	for _, x := range s {
		o.buf = append(o.buf, p.tagcode...)
		v := uint64(0)
		if x {
			v = 1
		}
		p.valEnc(o, v)
	}
	return nil
}

func size_slice_bool(p *Properties, base structPointer) int {
	s := *structPointer_BoolSlice(base, p.field)
	l := len(s)
	if l == 0 {
		return 0
	}
	return l * (len(p.tagcode) + 1) // each bool takes exactly one byte
}

// Encode a slice of bools ([]bool) in packed format.
func (o *Buffer) enc_slice_packed_bool(p *Properties, base structPointer) error {
	s := *structPointer_BoolSlice(base, p.field)
	l := len(s)
	if l == 0 {
		return ErrNil
	}
	o.buf = append(o.buf, p.tagcode...)
	o.EncodeVarint(uint64(l)) // each bool takes exactly one byte
	for _, x := range s {
		v := uint64(0)
		if x {
			v = 1
		}
		p.valEnc(o, v)
	}
	return nil
}

func size_slice_packed_bool(p *Properties, base structPointer) (n int) {
	s := *structPointer_BoolSlice(base, p.field)
	l := len(s)
	if l == 0 {
		return 0
	}
	n += len(p.tagcode)
	n += sizeVarint(uint64(l))
	n += l // each bool takes exactly one byte
	return
}

// Encode a slice of bytes ([]byte).
func (o *Buffer) enc_slice_byte(p *Properties, base structPointer) error {
	s := *structPointer_Bytes(base, p.field)
	if s == nil {
		return ErrNil
	}
	o.buf = append(o.buf, p.tagcode...)
	o.EncodeRawBytes(s)
	return nil
}

func (o *Buffer) enc_proto3_slice_byte(p *Properties, base structPointer) error {
	s := *structPointer_Bytes(base, p.field)
	if len(s) == 0 {
		return ErrNil
	}
	o.buf = append(o.buf, p.tagcode...)
	o.EncodeRawBytes(s)
	return nil
}

func size_slice_byte(p *Properties, base structPointer) (n int) {
	s := *structPointer_Bytes(base, p.field)
	if s == nil && !p.oneof {
		return 0
	}
	n += len(p.tagcode)
	n += sizeRawBytes(s)
	return
}

func size_proto3_slice_byte(p *Properties, base structPointer) (n int) {
	s := *structPointer_Bytes(base, p.field)
	if len(s) == 0 && !p.oneof {
		return 0
	}
	n += len(p.tagcode)
	n += sizeRawBytes(s)
	return
}

// Encode a slice of int32s ([]int32).
func (o *Buffer) enc_slice_int32(p *Properties, base structPointer) error {
	s := structPointer_Word32Slice(base, p.field)
	l := s.Len()
	if l == 0 {
		return ErrNil
	}
	for i := 0; i < l; i++ {
		o.buf = append(o.buf, p.tagcode...)
		x := int32(s.Index(i)) // permit sign extension to use full 64-bit range
		p.valEnc(o, uint64(x))
	}
	return nil
}

func size_slice_int32(p *Properties, base structPointer) (n int) {
	s := structPointer_Word32Slice(base, p.field)
	l := s.Len()
	if l == 0 {
		return 0
	}
	for i := 0; i < l; i++ {
		n += len(p.tagcode)
		x := int32(s.Index(i)) // permit sign extension to use full 64-bit range
		n += p.valSize(uint64(x))
	}
	return
}

// Encode a slice of int32s ([]int32) in packed format.
func (o *Buffer) enc_slice_packed_int32(p *Properties, base structPointer) error {
	s := structPointer_Word32Slice(base, p.field)
	l := s.Len()
	if l == 0 {
		return ErrNil
	}
	// TODO: Reuse a Buffer.
	buf := NewBuffer(nil)
	for i := 0; i < l; i++ {
		x := int32(s.Index(i)) // permit sign extension to use full 64-bit range
		p.valEnc(buf, uint64(x))
	}

	o.buf = append(o.buf, p.tagcode...)
	o.EncodeVarint(uint64(len(buf.buf)))
	o.buf = append(o.buf, buf.buf...)
	return nil
}

func size_slice_packed_int32(p *Properties, base structPointer) (n int) {
	s := structPointer_Word32Slice(base, p.field)
	l := s.Len()
	if l == 0 {
		return 0
	}
	var bufSize int
	for i := 0; i < l; i++ {
		x := int32(s.Index(i)) // permit sign extension to use full 64-bit range
		bufSize += p.valSize(uint64(x))
	}

	n += len(p.tagcode)
	n += sizeVarint(uint64(bufSize))
	n += bufSize
	return
}

// Encode a slice of uint32s ([]uint32).
// Exactly the same as int32, except for no sign extension.
func (o *Buffer) enc_slice_uint32(p *Properties, base structPointer) error {
	s := structPointer_Word32Slice(base, p.field)
	l := s.Len()
	if l == 0 {
		return ErrNil
	}
	for i := 0; i < l; i++ {
		o.buf = append(o.buf, p.tagcode...)
		x := s.Index(i)
		p.valEnc(o, uint64(x))
	}
	return nil
}

func size_slice_uint32(p *Properties, base structPointer) (n int) {
	s := structPointer_Word32Slice(base, p.field)
	l := s.Len()
	if l == 0 {
		return 0
	}
	for i := 0; i < l; i++ {
		n += len(p.tagcode)
		x := s.Index(i)
		n += p.valSize(uint64(x))
	}
	return
}

// Encode a slice of uint32s ([]uint32) in packed format.
// Exactly the same as int32, except for no sign extension.
func (o *Buffer) enc_slice_packed_uint32(p *Properties, base structPointer) error {
	s := structPointer_Word32Slice(base, p.field)
	l := s.Len()
	if l == 0 {
		return ErrNil
	}
	// TODO: Reuse a Buffer.
	buf := NewBuffer(nil)
	for i := 0; i < l; i++ {
		p.valEnc(buf, uint64(s.Index(i)))
	}

	o.buf = append(o.buf, p.tagcode...)
	o.EncodeVarint(uint64(len(buf.buf)))
	o.buf = append(o.buf, buf.buf...)
	return nil
}

func size_slice_packed_uint32(p *Properties, base structPointer) (n int) {
	s := structPointer_Word32Slice(base, p.field)
	l := s.Len()
	if l == 0 {
		return 0
	}
	var bufSize int
	for i := 0; i < l; i++ {
		bufSize += p.valSize(uint64(s.Index(i)))
	}

	n += len(p.tagcode)
	n += sizeVarint(uint64(bufSize))
	n += bufSize
	return
}

// Encode a slice of int64s ([]int64).
func (o *Buffer) enc_slice_int64(p *Properties, base structPointer) error {
	s := structPointer_Word64Slice(base, p.field)
	l := s.Len()
	if l == 0 {
		return ErrNil
	}
	for i := 0; i < l; i++ {
		o.buf = append(o.buf, p.tagcode...)
		p.valEnc(o, s.Index(i))
	}
	return nil
}

func size_slice_int64(p *Properties, base structPointer) (n int) {
	s := structPointer_Word64Slice(base, p.field)
	l := s.Len()
	if l == 0 {
		return 0
	}
	for i := 0; i < l; i++ {
		n += len(p.tagcode)
		n += p.valSize(s.Index(i))
	}
	return
}

// Encode a slice of int64s ([]int64) in packed format.
func (o *Buffer) enc_slice_packed_int64(p *Properties, base structPointer) error {
	s := structPointer_Word64Slice(base, p.field)
	l := s.Len()
	if l == 0 {
		return ErrNil
	}
	// TODO: Reuse a Buffer.
	buf := NewBuffer(nil)
	for i := 0; i < l; i++ {
		p.valEnc(buf, s.Index(i))
	}

	o.buf = append(o.buf, p.tagcode...)
	o.EncodeVarint(uint64(len(buf.buf)))
	o.buf = append(o.buf, buf.buf...)
	return nil
}

func size_slice_packed_int64(p *Properties, base structPointer) (n int) {
	s := structPointer_Word64Slice(base, p.field)
	l := s.Len()
	if l == 0 {
		return 0
	}
	var bufSize int
	for i := 0; i < l; i++ {
		bufSize += p.valSize(s.Index(i))
	}

	n += len(p.tagcode)
	n += sizeVarint(uint64(bufSize))
	n += bufSize
	return
}

// Encode a slice of slice of bytes ([][]byte).
func (o *Buffer) enc_slice_slice_byte(p *Properties, base structPointer) error {
	ss := *structPointer_BytesSlice(base, p.field)
	l := len(ss)
	if l == 0 {
		return ErrNil
	}
	for i := 0; i < l; i++ {
		o.buf = append(o.buf, p.tagcode...)
		o.EncodeRawBytes(ss[i])
	}
	return nil
}

func size_slice_slice_byte(p *Properties, base structPointer) (n int) {
	ss := *structPointer_BytesSlice(base, p.field)
	l := len(ss)
	if l == 0 {
		return 0
	}
	n += l * len(p.tagcode)
	for i := 0; i < l; i++ {
		n += sizeRawBytes(ss[i])
	}
	return
}

// Encode a slice of strings ([]string).
func (o *Buffer) enc_slice_string(p *Properties, base structPointer) error {
	ss := *structPointer_StringSlice(base, p.field)
	l := len(ss)
	for i := 0; i < l; i++ {
		o.buf = append(o.buf, p.tagcode...)
		o.EncodeStringBytes(ss[i])
	}
	return nil
}

func size_slice_string(p *Properties, base structPointer) (n int) {
	ss := *structPointer_StringSlice(base, p.field)
	l := len(ss)
	n += l * len(p.tagcode)
	for i := 0; i < l; i++ {
		n += sizeStringBytes(ss[i])
	}
	return
}

// Encode a slice of message structs ([]*struct).
func (o *Buffer) enc_slice_struct_message(p *Properties, base structPointer) error {
	var state errorState
	s := structPointer_StructPointerSlice(base, p.field)
	l := s.Len()

	for i := 0; i < l; i++ {
		structp := s.Index(i)
		if structPointer_IsNil(structp) {
			return errRepeatedHasNil
		}

		// Can the object marshal itself?
		if p.isMarshaler {
			m := structPointer_Interface(structp, p.stype).(Marshaler)
			data, err := m.Marshal()
			if err != nil && !state.shouldContinue(err, nil) {
				return err
			}
			o.buf = append(o.buf, p.tagcode...)
			o.EncodeRawBytes(data)
			continue
		}

		o.buf = append(o.buf, p.tagcode...)
		err := o.enc_len_struct(p.sprop, structp, &state)
		if err != nil && !state.shouldContinue(err, nil) {
			if err == ErrNil {
				return errRepeatedHasNil
			}
			return err
		}
	}
	return state.err
}

func size_slice_struct_message(p *Properties, base structPointer) (n int) {
	s := structPointer_StructPointerSlice(base, p.field)
	l := s.Len()
	n += l * len(p.tagcode)
	for i := 0; i < l; i++ {
		structp := s.Index(i)
		if structPointer_IsNil(structp) {
			return // return the size up to this point
		}

		// Can the object marshal itself?
		if p.isMarshaler {
			m := structPointer_Interface(structp, p.stype).(Marshaler)
			data, _ := m.Marshal()
			n += sizeRawBytes(data)
			continue
		}

		n0 := size_struct(p.sprop, structp)
		n1 := sizeVarint(uint64(n0)) // size of encoded length
		n += n0 + n1
	}
	return
}

// Encode a slice of group structs ([]*struct).
func (o *Buffer) enc_slice_struct_group(p *Properties, base structPointer) error {
	var state errorState
	s := structPointer_StructPointerSlice(base, p.field)
	l := s.Len()

	for i := 0; i < l; i++ {
		b := s.Index(i)
		if structPointer_IsNil(b) {
			return errRepeatedHasNil
		}

		o.EncodeVarint(uint64((p.Tag << 3) | WireStartGroup))

		err := o.enc_struct(p.sprop, b)

		if err != nil && !state.shouldContinue(err, nil) {
			if err == ErrNil {
				return errRepeatedHasNil
			}
			return err
		}

		o.EncodeVarint(uint64((p.Tag << 3) | WireEndGroup))
	}
	return state.err
}

func size_slice_struct_group(p *Properties, base structPointer) (n int) {
	s := structPointer_StructPointerSlice(base, p.field)
	l := s.Len()

	n += l * sizeVarint(uint64((p.Tag<<3)|WireStartGroup))
	n += l * sizeVarint(uint64((p.Tag<<3)|WireEndGroup))
	for i := 0; i < l; i++ {
		b := s.Index(i)
		if structPointer_IsNil(b) {
			return // return size up to this point
		}

		n += size_struct(p.sprop, b)
	}
	return
}

// Encode an extension map.
func (o *Buffer) enc_map(p *Properties, base structPointer) error {
	exts := structPointer_ExtMap(base, p.field)
	if err := encodeExtensionsMap(*exts); err != nil {
		return err
	}

	return o.enc_map_body(*exts)
}

func (o *Buffer) enc_exts(p *Properties, base structPointer) error {
	exts := structPointer_Extensions(base, p.field)

	v, mu := exts.extensionsRead()
	if v == nil {
		return nil
	}

	mu.Lock()
	defer mu.Unlock()
	if err := encodeExtensionsMap(v); err != nil {
		return err
	}

	return o.enc_map_body(v)
}

func (o *Buffer) enc_map_body(v map[int32]Extension) error {
	// Fast-path for common cases: zero or one extensions.
	if len(v) <= 1 {
		for _, e := range v {
			o.buf = append(o.buf, e.enc...)
		}
		return nil
	}

	// Sort keys to provide a deterministic encoding.
	keys := make([]int, 0, len(v))
	for k := range v {
		keys = append(keys, int(k))
	}
	sort.Ints(keys)

	for _, k := range keys {
		o.buf = append(o.buf, v[int32(k)].enc...)
	}
	return nil
}

func size_map(p *Properties, base structPointer) int {
	v := structPointer_ExtMap(base, p.field)
	return extensionsMapSize(*v)
}

func size_exts(p *Properties, base structPointer) int {
	v := structPointer_Extensions(base, p.field)
	return extensionsSize(v)
}

// Encode a map field.
func (o *Buffer) enc_new_map(p *Properties, base structPointer) error {
	var state errorState // XXX: or do we need to plumb this through?

	/*
		A map defined as
			map<key_type, value_type> map_field = N;
		is encoded in the same way as
			message MapFieldEntry {
				key_type key = 1;
				value_type value = 2;
			}
			repeated MapFieldEntry map_field = N;
	*/

	v := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V
	if v.Len() == 0 {
		return nil
	}

	keycopy, valcopy, keybase, valbase := mapEncodeScratch(p.mtype)

	enc := func() error {
		if err := p.mkeyprop.enc(o, p.mkeyprop, keybase); err != nil {
			return err
		}
		if err := p.mvalprop.enc(o, p.mvalprop, valbase); err != nil && err != ErrNil {
			return err
		}
		return nil
	}

	// Don't sort map keys. It is not required by the spec, and C++ doesn't do it.
	for _, key := range v.MapKeys() {
		val := v.MapIndex(key)

		keycopy.Set(key)
		valcopy.Set(val)

		o.buf = append(o.buf, p.tagcode...)
		if err := o.enc_len_thing(enc, &state); err != nil {
			return err
		}
	}
	return nil
}

func size_new_map(p *Properties, base structPointer) int {
	v := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V

	keycopy, valcopy, keybase, valbase := mapEncodeScratch(p.mtype)

	n := 0
	for _, key := range v.MapKeys() {
		val := v.MapIndex(key)
		keycopy.Set(key)
		valcopy.Set(val)

		// Tag codes for key and val are the responsibility of the sub-sizer.
		keysize := p.mkeyprop.size(p.mkeyprop, keybase)
		valsize := p.mvalprop.size(p.mvalprop, valbase)
		entry := keysize + valsize
		// Add on tag code and length of map entry itself.
		n += len(p.tagcode) + sizeVarint(uint64(entry)) + entry
	}
	return n
}

// mapEncodeScratch returns a new reflect.Value matching the map's value type,
// and a structPointer suitable for passing to an encoder or sizer.
func mapEncodeScratch(mapType reflect.Type) (keycopy, valcopy reflect.Value, keybase, valbase structPointer) {
	// Prepare addressable doubly-indirect placeholders for the key and value types.
	// This is needed because the element-type encoders expect **T, but the map iteration produces T.

	keycopy = reflect.New(mapType.Key()).Elem()                 // addressable K
	keyptr := reflect.New(reflect.PtrTo(keycopy.Type())).Elem() // addressable *K
	keyptr.Set(keycopy.Addr())                                  //
	keybase = toStructPointer(keyptr.Addr())                    // **K

	// Value types are more varied and require special handling.
	switch mapType.Elem().Kind() {
	case reflect.Slice:
		// []byte
		var dummy []byte
		valcopy = reflect.ValueOf(&dummy).Elem() // addressable []byte
		valbase = toStructPointer(valcopy.Addr())
	case reflect.Ptr:
		// message; the generated field type is map[K]*Msg (so V is *Msg),
		// so we only need one level of indirection.
		valcopy = reflect.New(mapType.Elem()).Elem() // addressable V
		valbase = toStructPointer(valcopy.Addr())
	default:
		// everything else
		valcopy = reflect.New(mapType.Elem()).Elem()                // addressable V
		valptr := reflect.New(reflect.PtrTo(valcopy.Type())).Elem() // addressable *V
		valptr.Set(valcopy.Addr())                                  //
		valbase = toStructPointer(valptr.Addr())                    // **V
	}
	return
}

// Encode a struct.
func (o *Buffer) enc_struct(prop *StructProperties, base structPointer) error {
	var state errorState
	// Encode fields in tag order so that decoders may use optimizations
	// that depend on the ordering.
	// https://developers.google.com/protocol-buffers/docs/encoding#order
	for _, i := range prop.order {
		p := prop.Prop[i]
		if p.enc != nil {
			err := p.enc(o, p, base)
			if err != nil {
				if err == ErrNil {
					if p.Required && state.err == nil {
						state.err = &RequiredNotSetError{p.Name}
					}
				} else if err == errRepeatedHasNil {
					// Give more context to nil values in repeated fields.
					return errors.New("repeated field " + p.OrigName + " has nil element")
				} else if !state.shouldContinue(err, p) {
					return err
				}
			}
			if len(o.buf) > maxMarshalSize {
				return ErrTooLarge
			}
		}
	}

	// Do oneof fields.
	if prop.oneofMarshaler != nil {
		m := structPointer_Interface(base, prop.stype).(Message)
		if err := prop.oneofMarshaler(m, o); err == ErrNil {
			return errOneofHasNil
		} else if err != nil {
			return err
		}
	}

	// Add unrecognized fields at the end.
	if prop.unrecField.IsValid() {
		v := *structPointer_Bytes(base, prop.unrecField)
		if len(o.buf)+len(v) > maxMarshalSize {
			return ErrTooLarge
		}
		if len(v) > 0 {
			o.buf = append(o.buf, v...)
		}
	}

	return state.err
}

func size_struct(prop *StructProperties, base stru
Download .txt
gitextract_f0axi5je/

├── .gitignore
├── Formula/
│   └── spotctl.rb
├── Gopkg.toml
├── LICENSE
├── README.md
├── bin/
│   └── package
├── cmd/
│   └── spotctl/
│       ├── auth.go
│       ├── ctl.go
│       ├── main.go
│       ├── player.go
│       └── version.go
└── vendor/
    ├── github.com/
    │   ├── golang/
    │   │   └── protobuf/
    │   │       ├── .gitignore
    │   │       ├── .travis.yml
    │   │       ├── AUTHORS
    │   │       ├── CONTRIBUTORS
    │   │       ├── LICENSE
    │   │       ├── Make.protobuf
    │   │       ├── Makefile
    │   │       ├── README.md
    │   │       └── proto/
    │   │           ├── Makefile
    │   │           ├── all_test.go
    │   │           ├── any_test.go
    │   │           ├── clone.go
    │   │           ├── clone_test.go
    │   │           ├── decode.go
    │   │           ├── decode_test.go
    │   │           ├── encode.go
    │   │           ├── encode_test.go
    │   │           ├── equal.go
    │   │           ├── equal_test.go
    │   │           ├── extensions.go
    │   │           ├── extensions_test.go
    │   │           ├── lib.go
    │   │           ├── map_test.go
    │   │           ├── message_set.go
    │   │           ├── message_set_test.go
    │   │           ├── pointer_reflect.go
    │   │           ├── pointer_unsafe.go
    │   │           ├── properties.go
    │   │           ├── proto3_test.go
    │   │           ├── size2_test.go
    │   │           ├── size_test.go
    │   │           ├── text.go
    │   │           ├── text_parser.go
    │   │           ├── text_parser_test.go
    │   │           └── text_test.go
    │   ├── inconshreveable/
    │   │   └── mousetrap/
    │   │       ├── LICENSE
    │   │       ├── README.md
    │   │       ├── trap_others.go
    │   │       ├── trap_windows.go
    │   │       └── trap_windows_1.4.go
    │   ├── maruel/
    │   │   └── panicparse/
    │   │       ├── .travis.yml
    │   │       ├── Gopkg.toml
    │   │       ├── LICENSE
    │   │       ├── README.md
    │   │       ├── main.go
    │   │       └── stack/
    │   │           ├── source.go
    │   │           ├── source_test.go
    │   │           ├── stack.go
    │   │           ├── stack_test.go
    │   │           ├── ui.go
    │   │           └── ui_test.go
    │   ├── mattn/
    │   │   └── go-runewidth/
    │   │       ├── .travis.yml
    │   │       ├── LICENSE
    │   │       ├── README.mkd
    │   │       ├── runewidth.go
    │   │       ├── runewidth_js.go
    │   │       ├── runewidth_posix.go
    │   │       ├── runewidth_test.go
    │   │       └── runewidth_windows.go
    │   ├── mitchellh/
    │   │   └── go-wordwrap/
    │   │       ├── LICENSE.md
    │   │       ├── README.md
    │   │       ├── wordwrap.go
    │   │       └── wordwrap_test.go
    │   ├── nsf/
    │   │   └── termbox-go/
    │   │       ├── AUTHORS
    │   │       ├── LICENSE
    │   │       ├── README.md
    │   │       ├── api.go
    │   │       ├── api_common.go
    │   │       ├── api_windows.go
    │   │       ├── collect_terminfo.py
    │   │       ├── syscalls.go
    │   │       ├── syscalls_darwin.go
    │   │       ├── syscalls_darwin_amd64.go
    │   │       ├── syscalls_dragonfly.go
    │   │       ├── syscalls_freebsd.go
    │   │       ├── syscalls_linux.go
    │   │       ├── syscalls_netbsd.go
    │   │       ├── syscalls_openbsd.go
    │   │       ├── syscalls_windows.go
    │   │       ├── termbox.go
    │   │       ├── termbox_common.go
    │   │       ├── termbox_windows.go
    │   │       ├── terminfo.go
    │   │       └── terminfo_builtin.go
    │   ├── spf13/
    │   │   ├── cobra/
    │   │   │   ├── .gitignore
    │   │   │   ├── .mailmap
    │   │   │   ├── .travis.yml
    │   │   │   ├── LICENSE.txt
    │   │   │   ├── README.md
    │   │   │   ├── args.go
    │   │   │   ├── args_test.go
    │   │   │   ├── bash_completions.go
    │   │   │   ├── bash_completions.md
    │   │   │   ├── bash_completions_test.go
    │   │   │   ├── cobra.go
    │   │   │   ├── cobra_test.go
    │   │   │   ├── command.go
    │   │   │   ├── command_notwin.go
    │   │   │   ├── command_test.go
    │   │   │   ├── command_win.go
    │   │   │   ├── zsh_completions.go
    │   │   │   └── zsh_completions_test.go
    │   │   └── pflag/
    │   │       ├── .gitignore
    │   │       ├── .travis.yml
    │   │       ├── LICENSE
    │   │       ├── README.md
    │   │       ├── bool.go
    │   │       ├── bool_slice.go
    │   │       ├── bool_slice_test.go
    │   │       ├── bool_test.go
    │   │       ├── count.go
    │   │       ├── count_test.go
    │   │       ├── duration.go
    │   │       ├── example_test.go
    │   │       ├── export_test.go
    │   │       ├── flag.go
    │   │       ├── flag_test.go
    │   │       ├── float32.go
    │   │       ├── float64.go
    │   │       ├── golangflag.go
    │   │       ├── golangflag_test.go
    │   │       ├── int.go
    │   │       ├── int32.go
    │   │       ├── int64.go
    │   │       ├── int8.go
    │   │       ├── int_slice.go
    │   │       ├── int_slice_test.go
    │   │       ├── ip.go
    │   │       ├── ip_slice.go
    │   │       ├── ip_slice_test.go
    │   │       ├── ip_test.go
    │   │       ├── ipmask.go
    │   │       ├── ipnet.go
    │   │       ├── ipnet_test.go
    │   │       ├── string.go
    │   │       ├── string_array.go
    │   │       ├── string_array_test.go
    │   │       ├── string_slice.go
    │   │       ├── string_slice_test.go
    │   │       ├── uint.go
    │   │       ├── uint16.go
    │   │       ├── uint32.go
    │   │       ├── uint64.go
    │   │       ├── uint8.go
    │   │       ├── uint_slice.go
    │   │       └── uint_slice_test.go
    │   └── zmb3/
    │       └── spotify/
    │           ├── .travis.yml
    │           ├── LICENSE
    │           ├── README.md
    │           ├── album.go
    │           ├── album_test.go
    │           ├── artist.go
    │           ├── artist_test.go
    │           ├── audio_analysis.go
    │           ├── audio_analysis_test.go
    │           ├── audio_features.go
    │           ├── audio_features_test.go
    │           ├── auth.go
    │           ├── category.go
    │           ├── category_test.go
    │           ├── countries.go
    │           ├── cursor.go
    │           ├── full_tests.bat
    │           ├── library.go
    │           ├── library_test.go
    │           ├── page.go
    │           ├── player.go
    │           ├── player_test.go
    │           ├── playlist.go
    │           ├── playlist_test.go
    │           ├── recommendation.go
    │           ├── recommendation_test.go
    │           ├── search.go
    │           ├── search_test.go
    │           ├── spotify.go
    │           ├── spotify_test.go
    │           ├── track.go
    │           ├── track_attributes.go
    │           ├── track_test.go
    │           ├── user.go
    │           └── user_test.go
    ├── golang.org/
    │   └── x/
    │       ├── net/
    │       │   ├── .gitattributes
    │       │   ├── .gitignore
    │       │   ├── AUTHORS
    │       │   ├── CONTRIBUTING.md
    │       │   ├── CONTRIBUTORS
    │       │   ├── LICENSE
    │       │   ├── PATENTS
    │       │   ├── README.md
    │       │   ├── codereview.cfg
    │       │   └── context/
    │       │       ├── context.go
    │       │       ├── context_test.go
    │       │       ├── ctxhttp/
    │       │       │   ├── ctxhttp.go
    │       │       │   ├── ctxhttp_17_test.go
    │       │       │   ├── ctxhttp_pre17.go
    │       │       │   ├── ctxhttp_pre17_test.go
    │       │       │   └── ctxhttp_test.go
    │       │       ├── go17.go
    │       │       ├── go19.go
    │       │       ├── pre_go17.go
    │       │       ├── pre_go19.go
    │       │       └── withtimeout_test.go
    │       └── oauth2/
    │           ├── .travis.yml
    │           ├── AUTHORS
    │           ├── CONTRIBUTING.md
    │           ├── CONTRIBUTORS
    │           ├── LICENSE
    │           ├── README.md
    │           ├── client_appengine.go
    │           ├── example_test.go
    │           ├── internal/
    │           │   ├── doc.go
    │           │   ├── oauth2.go
    │           │   ├── oauth2_test.go
    │           │   ├── token.go
    │           │   ├── token_test.go
    │           │   ├── transport.go
    │           │   └── transport_test.go
    │           ├── oauth2.go
    │           ├── oauth2_test.go
    │           ├── token.go
    │           ├── token_test.go
    │           ├── transport.go
    │           └── transport_test.go
    └── google.golang.org/
        └── appengine/
            ├── .travis.yml
            ├── LICENSE
            ├── README.md
            ├── appengine.go
            ├── appengine_test.go
            ├── appengine_vm.go
            ├── errors.go
            ├── identity.go
            ├── internal/
            │   ├── api.go
            │   ├── api_classic.go
            │   ├── api_common.go
            │   ├── api_race_test.go
            │   ├── api_test.go
            │   ├── app_id.go
            │   ├── app_id_test.go
            │   ├── base/
            │   │   ├── api_base.pb.go
            │   │   └── api_base.proto
            │   ├── datastore/
            │   │   ├── datastore_v3.pb.go
            │   │   └── datastore_v3.proto
            │   ├── identity.go
            │   ├── identity_classic.go
            │   ├── identity_vm.go
            │   ├── internal.go
            │   ├── internal_vm_test.go
            │   ├── log/
            │   │   ├── log_service.pb.go
            │   │   └── log_service.proto
            │   ├── main.go
            │   ├── main_vm.go
            │   ├── metadata.go
            │   ├── net.go
            │   ├── net_test.go
            │   ├── regen.sh
            │   ├── remote_api/
            │   │   ├── remote_api.pb.go
            │   │   └── remote_api.proto
            │   ├── transaction.go
            │   └── urlfetch/
            │       ├── urlfetch_service.pb.go
            │       └── urlfetch_service.proto
            ├── namespace.go
            ├── namespace_test.go
            ├── timeout.go
            └── urlfetch/
                └── urlfetch.go
Download .txt
Showing preview only (330K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3798 symbols across 204 files)

FILE: Formula/spotctl.rb
  class Spotctl (line 1) | class Spotctl < Formula
    method install (line 8) | def install

FILE: cmd/spotctl/auth.go
  function login (line 28) | func login(cmd *cobra.Command, args []string) error {
  function logout (line 51) | func logout(cmd *cobra.Command, args []string) error {
  type authHandler (line 56) | type authHandler struct
    method ServeHTTP (line 62) | func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
  function generateRandomBytes (line 79) | func generateRandomBytes(n int) ([]byte, error) {
  function generateRandomString (line 89) | func generateRandomString(s int) (string, error) {

FILE: cmd/spotctl/ctl.go
  function shuffle (line 73) | func shuffle(cmd *cobra.Command, args []string) error {
  function repeat (line 82) | func repeat(cmd *cobra.Command, args []string) error {
  function play (line 105) | func play(cmd *cobra.Command, args []string) error {
  function devices (line 128) | func devices(cmd *cobra.Command, args []string) error {
  function vol (line 145) | func vol(cmd *cobra.Command, args []string) error {
  function pause (line 183) | func pause(cmd *cobra.Command, args []string) error {
  function next (line 190) | func next(cmd *cobra.Command, args []string) error {
  function prev (line 197) | func prev(cmd *cobra.Command, args []string) error {
  function status (line 204) | func status(cmd *cobra.Command, args []string) error {
  function findDeviceByName (line 231) | func findDeviceByName(name string) *spotify.ID {
  function playByID (line 252) | func playByID(id string) *spotify.PlayOptions {
  function searchToPlay (line 271) | func searchToPlay(query, t string) (*spotify.PlayOptions, error) {

FILE: cmd/spotctl/main.go
  constant redirectURI (line 18) | redirectURI = "http://localhost:10028/callback"
  function ver (line 46) | func ver(cmd *cobra.Command, args []string) {
  function main (line 50) | func main() {
  function preRootCmd (line 80) | func preRootCmd(cmd *cobra.Command, args []string) {
  function postRootCmd (line 120) | func postRootCmd(cmd *cobra.Command, args []string) {
  function saveToken (line 138) | func saveToken(tok *oauth2.Token) error {
  function readToken (line 149) | func readToken() (*oauth2.Token, error) {

FILE: cmd/spotctl/player.go
  function player (line 19) | func player(cmd *cobra.Command, args []string) error {
  function quitAndFatal (line 199) | func quitAndFatal(err error) {
  function durationToStr (line 205) | func durationToStr(d int) string {
  function roundToSec (line 212) | func roundToSec(d int) float64 {
  function progressPercent (line 217) | func progressPercent(progress, total int) int {

FILE: vendor/github.com/golang/protobuf/proto/all_test.go
  function old (line 53) | func old() *Buffer {
  function equalbytes (line 61) | func equalbytes(b1, b2 []byte, t *testing.T) {
  function initGoTestField (line 73) | func initGoTestField() *GoTestField {
  function initGoTest_RequiredGroup (line 83) | func initGoTest_RequiredGroup() *GoTest_RequiredGroup {
  function initGoTest_OptionalGroup (line 89) | func initGoTest_OptionalGroup() *GoTest_OptionalGroup {
  function initGoTest_RepeatedGroup (line 95) | func initGoTest_RepeatedGroup() *GoTest_RepeatedGroup {
  function initGoTest (line 101) | func initGoTest(setdefaults bool) *GoTest {
  function fail (line 139) | func fail(msg string, b *bytes.Buffer, s string, t *testing.T) {
  function hex (line 263) | func hex(c uint8) uint8 {
  function equal (line 276) | func equal(b []byte, s string, t *testing.T) bool {
  function overify (line 293) | func overify(t *testing.T, pb *GoTest, expected string) {
  function TestNumericPrimitives (line 328) | func TestNumericPrimitives(t *testing.T) {
  type fakeMarshaler (line 399) | type fakeMarshaler struct
    method Marshal (line 404) | func (f *fakeMarshaler) Marshal() ([]byte, error) { return f.b, f.err }
    method String (line 405) | func (f *fakeMarshaler) String() string           { return fmt.Sprintf...
    method ProtoMessage (line 406) | func (f *fakeMarshaler) ProtoMessage()            {}
    method Reset (line 407) | func (f *fakeMarshaler) Reset()                   {}
  type msgWithFakeMarshaler (line 409) | type msgWithFakeMarshaler struct
    method String (line 413) | func (m *msgWithFakeMarshaler) String() string { return CompactTextStr...
    method ProtoMessage (line 414) | func (m *msgWithFakeMarshaler) ProtoMessage()  {}
    method Reset (line 415) | func (m *msgWithFakeMarshaler) Reset()         {}
  function TestMarshalerEncoding (line 418) | func TestMarshalerEncoding(t *testing.T) {
  function TestBytesPrimitives (line 486) | func TestBytesPrimitives(t *testing.T) {
  function TestStringPrimitives (line 500) | func TestStringPrimitives(t *testing.T) {
  function TestRequiredBit (line 516) | func TestRequiredBit(t *testing.T) {
  function checkInitialized (line 531) | func checkInitialized(pb *GoTest, t *testing.T) {
  function TestReset (line 574) | func TestReset(t *testing.T) {
  function TestEncodeDecode1 (line 595) | func TestEncodeDecode1(t *testing.T) {
  function TestEncodeDecode2 (line 619) | func TestEncodeDecode2(t *testing.T) {
  function TestEncodeDecode3 (line 657) | func TestEncodeDecode3(t *testing.T) {
  function TestEncodeDecode4 (line 709) | func TestEncodeDecode4(t *testing.T) {
  function TestEncodeDecode5 (line 784) | func TestEncodeDecode5(t *testing.T) {
  function TestEncodeDecode6 (line 872) | func TestEncodeDecode6(t *testing.T) {
  function TestEncodeDecodeBytes1 (line 927) | func TestEncodeDecodeBytes1(t *testing.T) {
  function TestEncodeDecodeBytes2 (line 958) | func TestEncodeDecodeBytes2(t *testing.T) {
  function TestSkippingUnrecognizedFields (line 980) | func TestSkippingUnrecognizedFields(t *testing.T) {
  function TestSubmessageUnrecognizedFields (line 1032) | func TestSubmessageUnrecognizedFields(t *testing.T) {
  function TestNegativeInt32 (line 1081) | func TestNegativeInt32(t *testing.T) {
  function TestBigRepeated (line 1115) | func TestBigRepeated(t *testing.T) {
  function TestTypeMismatch (line 1226) | func TestTypeMismatch(t *testing.T) {
  function encodeDecode (line 1243) | func encodeDecode(t *testing.T, in, out Message, msg string) {
  function TestPackedNonPackedDecoderSwitching (line 1253) | func TestPackedNonPackedDecoderSwitching(t *testing.T) {
  function TestProto1RepeatedGroup (line 1272) | func TestProto1RepeatedGroup(t *testing.T) {
  function TestEnum (line 1294) | func TestEnum(t *testing.T) {
  function TestPrintingNilEnumFields (line 1312) | func TestPrintingNilEnumFields(t *testing.T) {
  function TestRequiredFieldEnforcement (line 1318) | func TestRequiredFieldEnforcement(t *testing.T) {
  function TestRequiredFieldEnforcementGroups (line 1340) | func TestRequiredFieldEnforcementGroups(t *testing.T) {
  function TestTypedNilMarshal (line 1356) | func TestTypedNilMarshal(t *testing.T) {
  type nonNillableInt (line 1374) | type nonNillableInt
    method Marshal (line 1376) | func (nni nonNillableInt) Marshal() ([]byte, error) {
  type NNIMessage (line 1380) | type NNIMessage struct
    method Reset (line 1384) | func (*NNIMessage) Reset()         {}
    method String (line 1385) | func (*NNIMessage) String() string { return "" }
    method ProtoMessage (line 1386) | func (*NNIMessage) ProtoMessage()  {}
  type nillableMessage (line 1389) | type nillableMessage struct
    method Marshal (line 1393) | func (nm *nillableMessage) Marshal() ([]byte, error) {
  type NMMessage (line 1397) | type NMMessage struct
    method Reset (line 1401) | func (*NMMessage) Reset()         {}
    method String (line 1402) | func (*NMMessage) String() string { return "" }
    method ProtoMessage (line 1403) | func (*NMMessage) ProtoMessage()  {}
  function TestNilMarshaler (line 1406) | func TestNilMarshaler(t *testing.T) {
  function TestAllSetDefaults (line 1423) | func TestAllSetDefaults(t *testing.T) {
  function TestSetDefaultsWithSetField (line 1455) | func TestSetDefaultsWithSetField(t *testing.T) {
  function TestSetDefaultsWithSubMessage (line 1466) | func TestSetDefaultsWithSubMessage(t *testing.T) {
  function TestSetDefaultsWithRepeatedSubMessage (line 1486) | func TestSetDefaultsWithRepeatedSubMessage(t *testing.T) {
  function TestSetDefaultWithRepeatedNonMessage (line 1501) | func TestSetDefaultWithRepeatedNonMessage(t *testing.T) {
  function TestMaximumTagNumber (line 1512) | func TestMaximumTagNumber(t *testing.T) {
  function TestJSON (line 1529) | func TestJSON(t *testing.T) {
  function TestBadWireType (line 1568) | func TestBadWireType(t *testing.T) {
  function TestBytesWithInvalidLength (line 1578) | func TestBytesWithInvalidLength(t *testing.T) {
  function TestLengthOverflow (line 1584) | func TestLengthOverflow(t *testing.T) {
  function TestVarintOverflow (line 1590) | func TestVarintOverflow(t *testing.T) {
  function TestUnmarshalFuzz (line 1598) | func TestUnmarshalFuzz(t *testing.T) {
  function TestMergeMessages (line 1612) | func TestMergeMessages(t *testing.T) {
  function TestExtensionMarshalOrder (line 1642) | func TestExtensionMarshalOrder(t *testing.T) {
  function TestMessageSetMarshalOrder (line 1725) | func TestMessageSetMarshalOrder(t *testing.T) {
  function TestUnmarshalMergesMessages (line 1762) | func TestUnmarshalMergesMessages(t *testing.T) {
  function TestEncodingSizes (line 1805) | func TestEncodingSizes(t *testing.T) {
  function TestRequiredNotSetError (line 1827) | func TestRequiredNotSetError(t *testing.T) {
  function fuzzUnmarshal (line 1891) | func fuzzUnmarshal(t *testing.T, data []byte) {
  function TestMapFieldMarshal (line 1904) | func TestMapFieldMarshal(t *testing.T) {
  function TestMapFieldRoundTrips (line 1949) | func TestMapFieldRoundTrips(t *testing.T) {
  function TestMapFieldWithNil (line 1984) | func TestMapFieldWithNil(t *testing.T) {
  function TestMapFieldWithNilBytes (line 2005) | func TestMapFieldWithNilBytes(t *testing.T) {
  function TestDecodeMapFieldMissingKey (line 2036) | func TestDecodeMapFieldMissingKey(t *testing.T) {
  function TestDecodeMapFieldMissingValue (line 2053) | func TestDecodeMapFieldMissingValue(t *testing.T) {
  function TestOneof (line 2070) | func TestOneof(t *testing.T) {
  function TestInefficientPackedBool (line 2122) | func TestInefficientPackedBool(t *testing.T) {
  function testMsg (line 2137) | func testMsg() *GoTest {
  function bytesMsg (line 2149) | func bytesMsg() *GoTest {
  function benchmarkMarshal (line 2159) | func benchmarkMarshal(b *testing.B, pb Message, marshal func(Message) ([...
  function benchmarkBufferMarshal (line 2168) | func benchmarkBufferMarshal(b *testing.B, pb Message) {
  function benchmarkSize (line 2177) | func benchmarkSize(b *testing.B, pb Message) {
  function newOf (line 2184) | func newOf(pb Message) Message {
  function benchmarkUnmarshal (line 2192) | func benchmarkUnmarshal(b *testing.B, pb Message, unmarshal func([]byte,...
  function benchmarkBufferUnmarshal (line 2203) | func benchmarkBufferUnmarshal(b *testing.B, pb Message) {
  function BenchmarkMarshal (line 2213) | func BenchmarkMarshal(b *testing.B) {
  function BenchmarkBufferMarshal (line 2217) | func BenchmarkBufferMarshal(b *testing.B) {
  function BenchmarkSize (line 2221) | func BenchmarkSize(b *testing.B) {
  function BenchmarkUnmarshal (line 2225) | func BenchmarkUnmarshal(b *testing.B) {
  function BenchmarkBufferUnmarshal (line 2229) | func BenchmarkBufferUnmarshal(b *testing.B) {
  function BenchmarkMarshalBytes (line 2233) | func BenchmarkMarshalBytes(b *testing.B) {
  function BenchmarkBufferMarshalBytes (line 2237) | func BenchmarkBufferMarshalBytes(b *testing.B) {
  function BenchmarkSizeBytes (line 2241) | func BenchmarkSizeBytes(b *testing.B) {
  function BenchmarkUnmarshalBytes (line 2245) | func BenchmarkUnmarshalBytes(b *testing.B) {
  function BenchmarkBufferUnmarshalBytes (line 2249) | func BenchmarkBufferUnmarshalBytes(b *testing.B) {
  function BenchmarkUnmarshalUnrecognizedFields (line 2253) | func BenchmarkUnmarshalUnrecognizedFields(b *testing.B) {

FILE: vendor/github.com/golang/protobuf/proto/any_test.go
  function anyEqual (line 55) | func anyEqual(got, want proto.Message) bool {
  type golden (line 65) | type golden struct
  function makeGolden (line 72) | func makeGolden() []golden {
  function TestMarshalGolden (line 210) | func TestMarshalGolden(t *testing.T) {
  function TestUnmarshalGolden (line 221) | func TestUnmarshalGolden(t *testing.T) {
  function TestMarshalUnknownAny (line 242) | func TestMarshalUnknownAny(t *testing.T) {
  function TestAmbiguousAny (line 260) | func TestAmbiguousAny(t *testing.T) {
  function TestUnmarshalOverwriteAny (line 272) | func TestUnmarshalOverwriteAny(t *testing.T) {
  function TestUnmarshalAnyMixAndMatch (line 288) | func TestUnmarshalAnyMixAndMatch(t *testing.T) {

FILE: vendor/github.com/golang/protobuf/proto/clone.go
  function Clone (line 44) | func Clone(pb Message) Message {
  function Merge (line 60) | func Merge(dst, src Message) {
  function mergeStruct (line 77) | func mergeStruct(out, in reflect.Value) {
  function mergeAny (line 111) | func mergeAny(out, in reflect.Value, viaPtr bool, prop *Properties) {
  function mergeExtension (line 214) | func mergeExtension(out, in map[int32]Extension) {

FILE: vendor/github.com/golang/protobuf/proto/clone_test.go
  function init (line 63) | func init() {
  function TestClone (line 72) | func TestClone(t *testing.T) {
  function TestCloneNil (line 101) | func TestCloneNil(t *testing.T) {
  function TestMerge (line 292) | func TestMerge(t *testing.T) {

FILE: vendor/github.com/golang/protobuf/proto/decode.go
  function DecodeVarint (line 63) | func DecodeVarint(buf []byte) (x uint64, n int) {
  method decodeVarintSlow (line 80) | func (p *Buffer) decodeVarintSlow() (x uint64, err error) {
  method DecodeVarint (line 107) | func (p *Buffer) DecodeVarint() (x uint64, err error) {
  method DecodeFixed64 (line 207) | func (p *Buffer) DecodeFixed64() (x uint64, err error) {
  method DecodeFixed32 (line 230) | func (p *Buffer) DecodeFixed32() (x uint64, err error) {
  method DecodeZigzag64 (line 249) | func (p *Buffer) DecodeZigzag64() (x uint64, err error) {
  method DecodeZigzag32 (line 261) | func (p *Buffer) DecodeZigzag32() (x uint64, err error) {
  method DecodeRawBytes (line 276) | func (p *Buffer) DecodeRawBytes(alloc bool) (buf []byte, err error) {
  method DecodeStringBytes (line 306) | func (p *Buffer) DecodeStringBytes() (s string, err error) {
  method skipAndSave (line 317) | func (o *Buffer) skipAndSave(t reflect.Type, tag, wire int, base structP...
  method skip (line 344) | func (o *Buffer) skip(t reflect.Type, tag, wire int) error {
  type Unmarshaler (line 385) | type Unmarshaler interface
  function Unmarshal (line 396) | func Unmarshal(buf []byte, pb Message) error {
  function UnmarshalMerge (line 407) | func UnmarshalMerge(buf []byte, pb Message) error {
  method DecodeMessage (line 416) | func (p *Buffer) DecodeMessage(pb Message) error {
  method DecodeGroup (line 425) | func (p *Buffer) DecodeGroup(pb Message) error {
  method Unmarshal (line 439) | func (p *Buffer) Unmarshal(pb Message) error {
  method unmarshalType (line 462) | func (o *Buffer) unmarshalType(st reflect.Type, prop *StructProperties, ...
  constant boolPoolSize (line 586) | boolPoolSize   = 16
  constant uint32PoolSize (line 587) | uint32PoolSize = 8
  constant uint64PoolSize (line 588) | uint64PoolSize = 4
  method dec_bool (line 592) | func (o *Buffer) dec_bool(p *Properties, base structPointer) error {
  method dec_proto3_bool (line 606) | func (o *Buffer) dec_proto3_bool(p *Properties, base structPointer) error {
  method dec_int32 (line 616) | func (o *Buffer) dec_int32(p *Properties, base structPointer) error {
  method dec_proto3_int32 (line 625) | func (o *Buffer) dec_proto3_int32(p *Properties, base structPointer) err...
  method dec_int64 (line 635) | func (o *Buffer) dec_int64(p *Properties, base structPointer) error {
  method dec_proto3_int64 (line 644) | func (o *Buffer) dec_proto3_int64(p *Properties, base structPointer) err...
  method dec_string (line 654) | func (o *Buffer) dec_string(p *Properties, base structPointer) error {
  method dec_proto3_string (line 663) | func (o *Buffer) dec_proto3_string(p *Properties, base structPointer) er...
  method dec_slice_byte (line 673) | func (o *Buffer) dec_slice_byte(p *Properties, base structPointer) error {
  method dec_slice_bool (line 683) | func (o *Buffer) dec_slice_bool(p *Properties, base structPointer) error {
  method dec_slice_packed_bool (line 694) | func (o *Buffer) dec_slice_packed_bool(p *Properties, base structPointer...
  method dec_slice_int32 (line 721) | func (o *Buffer) dec_slice_int32(p *Properties, base structPointer) error {
  method dec_slice_packed_int32 (line 731) | func (o *Buffer) dec_slice_packed_int32(p *Properties, base structPointe...
  method dec_slice_int64 (line 755) | func (o *Buffer) dec_slice_int64(p *Properties, base structPointer) error {
  method dec_slice_packed_int64 (line 766) | func (o *Buffer) dec_slice_packed_int64(p *Properties, base structPointe...
  method dec_slice_string (line 790) | func (o *Buffer) dec_slice_string(p *Properties, base structPointer) err...
  method dec_slice_slice_byte (line 801) | func (o *Buffer) dec_slice_slice_byte(p *Properties, base structPointer)...
  method dec_new_map (line 812) | func (o *Buffer) dec_new_map(p *Properties, base structPointer) error {
  method dec_struct_group (line 885) | func (o *Buffer) dec_struct_group(p *Properties, base structPointer) err...
  method dec_struct_message (line 896) | func (o *Buffer) dec_struct_message(p *Properties, base structPointer) (...
  method dec_slice_struct_message (line 928) | func (o *Buffer) dec_slice_struct_message(p *Properties, base structPoin...
  method dec_slice_struct_group (line 933) | func (o *Buffer) dec_slice_struct_group(p *Properties, base structPointe...
  method dec_slice_struct (line 938) | func (o *Buffer) dec_slice_struct(p *Properties, is_group bool, base str...

FILE: vendor/github.com/golang/protobuf/proto/decode_test.go
  function BenchmarkVarint32ArraySmall (line 51) | func BenchmarkVarint32ArraySmall(b *testing.B) {
  function BenchmarkVarint32ArrayLarge (line 76) | func BenchmarkVarint32ArrayLarge(b *testing.B) {
  function BenchmarkVarint64ArraySmall (line 101) | func BenchmarkVarint64ArraySmall(b *testing.B) {
  function BenchmarkVarint64ArrayLarge (line 126) | func BenchmarkVarint64ArrayLarge(b *testing.B) {
  function BenchmarkVarint64ArrayMixed (line 151) | func BenchmarkVarint64ArrayMixed(b *testing.B) {
  function genInt32Dist (line 184) | func genInt32Dist(dist [7]int, count int) (dest []int32) {
  function genUint64Dist (line 212) | func genUint64Dist(dist [11]int, count int) (dest []uint64) {
  function BenchmarkDecodeEmpty (line 247) | func BenchmarkDecodeEmpty(b *testing.B) {

FILE: vendor/github.com/golang/protobuf/proto/encode.go
  type RequiredNotSetError (line 54) | type RequiredNotSetError struct
    method Error (line 58) | func (e *RequiredNotSetError) Error() string {
  constant maxVarintBytes (line 83) | maxVarintBytes = 10
  constant maxMarshalSize (line 87) | maxMarshalSize = 1<<31 - 1
  function EncodeVarint (line 95) | func EncodeVarint(x uint64) []byte {
  method EncodeVarint (line 111) | func (p *Buffer) EncodeVarint(x uint64) error {
  function SizeVarint (line 121) | func SizeVarint(x uint64) int {
  function sizeVarint (line 125) | func sizeVarint(x uint64) (n int) {
  method EncodeFixed64 (line 139) | func (p *Buffer) EncodeFixed64(x uint64) error {
  function sizeFixed64 (line 152) | func sizeFixed64(x uint64) int {
  method EncodeFixed32 (line 159) | func (p *Buffer) EncodeFixed32(x uint64) error {
  function sizeFixed32 (line 168) | func sizeFixed32(x uint64) int {
  method EncodeZigzag64 (line 175) | func (p *Buffer) EncodeZigzag64(x uint64) error {
  function sizeZigzag64 (line 180) | func sizeZigzag64(x uint64) int {
  method EncodeZigzag32 (line 187) | func (p *Buffer) EncodeZigzag32(x uint64) error {
  function sizeZigzag32 (line 192) | func sizeZigzag32(x uint64) int {
  method EncodeRawBytes (line 199) | func (p *Buffer) EncodeRawBytes(b []byte) error {
  function sizeRawBytes (line 205) | func sizeRawBytes(b []byte) int {
  method EncodeStringBytes (line 212) | func (p *Buffer) EncodeStringBytes(s string) error {
  function sizeStringBytes (line 218) | func sizeStringBytes(s string) int {
  type Marshaler (line 224) | type Marshaler interface
  function Marshal (line 230) | func Marshal(pb Message) ([]byte, error) {
  method EncodeMessage (line 246) | func (p *Buffer) EncodeMessage(pb Message) error {
  method Marshal (line 261) | func (p *Buffer) Marshal(pb Message) error {
  function Size (line 288) | func Size(pb Message) (n int) {
  method enc_bool (line 314) | func (o *Buffer) enc_bool(p *Properties, base structPointer) error {
  method enc_proto3_bool (line 328) | func (o *Buffer) enc_proto3_bool(p *Properties, base structPointer) error {
  function size_bool (line 338) | func size_bool(p *Properties, base structPointer) int {
  function size_proto3_bool (line 346) | func size_proto3_bool(p *Properties, base structPointer) int {
  method enc_int32 (line 355) | func (o *Buffer) enc_int32(p *Properties, base structPointer) error {
  method enc_proto3_int32 (line 366) | func (o *Buffer) enc_proto3_int32(p *Properties, base structPointer) err...
  function size_int32 (line 377) | func size_int32(p *Properties, base structPointer) (n int) {
  function size_proto3_int32 (line 388) | func size_proto3_int32(p *Properties, base structPointer) (n int) {
  method enc_uint32 (line 401) | func (o *Buffer) enc_uint32(p *Properties, base structPointer) error {
  method enc_proto3_uint32 (line 412) | func (o *Buffer) enc_proto3_uint32(p *Properties, base structPointer) er...
  function size_uint32 (line 423) | func size_uint32(p *Properties, base structPointer) (n int) {
  function size_proto3_uint32 (line 434) | func size_proto3_uint32(p *Properties, base structPointer) (n int) {
  method enc_int64 (line 446) | func (o *Buffer) enc_int64(p *Properties, base structPointer) error {
  method enc_proto3_int64 (line 457) | func (o *Buffer) enc_proto3_int64(p *Properties, base structPointer) err...
  function size_int64 (line 468) | func size_int64(p *Properties, base structPointer) (n int) {
  function size_proto3_int64 (line 479) | func size_proto3_int64(p *Properties, base structPointer) (n int) {
  method enc_string (line 491) | func (o *Buffer) enc_string(p *Properties, base structPointer) error {
  method enc_proto3_string (line 502) | func (o *Buffer) enc_proto3_string(p *Properties, base structPointer) er...
  function size_string (line 512) | func size_string(p *Properties, base structPointer) (n int) {
  function size_proto3_string (line 523) | func size_proto3_string(p *Properties, base structPointer) (n int) {
  function isNil (line 534) | func isNil(v reflect.Value) bool {
  method enc_struct_message (line 543) | func (o *Buffer) enc_struct_message(p *Properties, base structPointer) e...
  function size_struct_message (line 566) | func size_struct_message(p *Properties, base structPointer) int {
  method enc_struct_group (line 588) | func (o *Buffer) enc_struct_group(p *Properties, base structPointer) err...
  function size_struct_group (line 604) | func size_struct_group(p *Properties, base structPointer) (n int) {
  method enc_slice_bool (line 617) | func (o *Buffer) enc_slice_bool(p *Properties, base structPointer) error {
  function size_slice_bool (line 634) | func size_slice_bool(p *Properties, base structPointer) int {
  method enc_slice_packed_bool (line 644) | func (o *Buffer) enc_slice_packed_bool(p *Properties, base structPointer...
  function size_slice_packed_bool (line 662) | func size_slice_packed_bool(p *Properties, base structPointer) (n int) {
  method enc_slice_byte (line 675) | func (o *Buffer) enc_slice_byte(p *Properties, base structPointer) error {
  method enc_proto3_slice_byte (line 685) | func (o *Buffer) enc_proto3_slice_byte(p *Properties, base structPointer...
  function size_slice_byte (line 695) | func size_slice_byte(p *Properties, base structPointer) (n int) {
  function size_proto3_slice_byte (line 705) | func size_proto3_slice_byte(p *Properties, base structPointer) (n int) {
  method enc_slice_int32 (line 716) | func (o *Buffer) enc_slice_int32(p *Properties, base structPointer) error {
  function size_slice_int32 (line 730) | func size_slice_int32(p *Properties, base structPointer) (n int) {
  method enc_slice_packed_int32 (line 745) | func (o *Buffer) enc_slice_packed_int32(p *Properties, base structPointe...
  function size_slice_packed_int32 (line 764) | func size_slice_packed_int32(p *Properties, base structPointer) (n int) {
  method enc_slice_uint32 (line 784) | func (o *Buffer) enc_slice_uint32(p *Properties, base structPointer) err...
  function size_slice_uint32 (line 798) | func size_slice_uint32(p *Properties, base structPointer) (n int) {
  method enc_slice_packed_uint32 (line 814) | func (o *Buffer) enc_slice_packed_uint32(p *Properties, base structPoint...
  function size_slice_packed_uint32 (line 832) | func size_slice_packed_uint32(p *Properties, base structPointer) (n int) {
  method enc_slice_int64 (line 850) | func (o *Buffer) enc_slice_int64(p *Properties, base structPointer) error {
  function size_slice_int64 (line 863) | func size_slice_int64(p *Properties, base structPointer) (n int) {
  method enc_slice_packed_int64 (line 877) | func (o *Buffer) enc_slice_packed_int64(p *Properties, base structPointe...
  function size_slice_packed_int64 (line 895) | func size_slice_packed_int64(p *Properties, base structPointer) (n int) {
  method enc_slice_slice_byte (line 913) | func (o *Buffer) enc_slice_slice_byte(p *Properties, base structPointer)...
  function size_slice_slice_byte (line 926) | func size_slice_slice_byte(p *Properties, base structPointer) (n int) {
  method enc_slice_string (line 940) | func (o *Buffer) enc_slice_string(p *Properties, base structPointer) err...
  function size_slice_string (line 950) | func size_slice_string(p *Properties, base structPointer) (n int) {
  method enc_slice_struct_message (line 961) | func (o *Buffer) enc_slice_struct_message(p *Properties, base structPoin...
  function size_slice_struct_message (line 996) | func size_slice_struct_message(p *Properties, base structPointer) (n int) {
  method enc_slice_struct_group (line 1022) | func (o *Buffer) enc_slice_struct_group(p *Properties, base structPointe...
  function size_slice_struct_group (line 1049) | func size_slice_struct_group(p *Properties, base structPointer) (n int) {
  method enc_map (line 1067) | func (o *Buffer) enc_map(p *Properties, base structPointer) error {
  method enc_exts (line 1076) | func (o *Buffer) enc_exts(p *Properties, base structPointer) error {
  method enc_map_body (line 1093) | func (o *Buffer) enc_map_body(v map[int32]Extension) error {
  function size_map (line 1115) | func size_map(p *Properties, base structPointer) int {
  function size_exts (line 1120) | func size_exts(p *Properties, base structPointer) int {
  method enc_new_map (line 1126) | func (o *Buffer) enc_new_map(p *Properties, base structPointer) error {
  function size_new_map (line 1172) | func size_new_map(p *Properties, base structPointer) int {
  function mapEncodeScratch (line 1195) | func mapEncodeScratch(mapType reflect.Type) (keycopy, valcopy reflect.Va...
  method enc_struct (line 1227) | func (o *Buffer) enc_struct(prop *StructProperties, base structPointer) ...
  function size_struct (line 1278) | func size_struct(prop *StructProperties, base structPointer) (n int) {
  method enc_len_struct (line 1304) | func (o *Buffer) enc_len_struct(prop *StructProperties, base structPoint...
  method enc_len_thing (line 1309) | func (o *Buffer) enc_len_thing(enc func() error, state *errorState) error {
  type errorState (line 1338) | type errorState struct
    method shouldContinue (line 1349) | func (s *errorState) shouldContinue(err error, prop *Properties) bool {

FILE: vendor/github.com/golang/protobuf/proto/encode_test.go
  function BenchmarkAny (line 51) | func BenchmarkAny(b *testing.B) {
  function BenchmarkEmpy (line 77) | func BenchmarkEmpy(b *testing.B) {

FILE: vendor/github.com/golang/protobuf/proto/equal.go
  function Equal (line 72) | func Equal(a, b Message) bool {
  function equalStruct (line 96) | func equalStruct(v1, v2 reflect.Value) bool {
  function equalAny (line 158) | func equalAny(v1, v2 reflect.Value, prop *Properties) bool {
  function equalExtensions (line 245) | func equalExtensions(base reflect.Type, x1, x2 XXX_InternalExtensions) b...
  function equalExtMap (line 251) | func equalExtMap(base reflect.Type, em1, em2 map[int32]Extension) bool {

FILE: vendor/github.com/golang/protobuf/proto/equal_test.go
  function init (line 53) | func init() {
  function TestEqual (line 218) | func TestEqual(t *testing.T) {

FILE: vendor/github.com/golang/protobuf/proto/extensions.go
  type ExtensionRange (line 51) | type ExtensionRange struct
  type extendableProto (line 57) | type extendableProto interface
  type extendableProtoV1 (line 66) | type extendableProtoV1 interface
  type extensionAdapter (line 73) | type extensionAdapter struct
    method extensionsWrite (line 77) | func (e extensionAdapter) extensionsWrite() map[int32]Extension {
    method extensionsRead (line 81) | func (e extensionAdapter) extensionsRead() (map[int32]Extension, sync....
  type notLocker (line 86) | type notLocker struct
    method Lock (line 88) | func (n notLocker) Lock()   {}
    method Unlock (line 89) | func (n notLocker) Unlock() {}
  function extendable (line 94) | func extendable(p interface{}) (extendableProto, bool) {
  type XXX_InternalExtensions (line 111) | type XXX_InternalExtensions struct
    method extensionsWrite (line 126) | func (e *XXX_InternalExtensions) extensionsWrite() map[int32]Extension {
    method extensionsRead (line 139) | func (e *XXX_InternalExtensions) extensionsRead() (map[int32]Extension...
  type ExtensionDesc (line 151) | type ExtensionDesc struct
    method repeated (line 160) | func (ed *ExtensionDesc) repeated() bool {
  type Extension (line 166) | type Extension struct
  function SetRawExtension (line 181) | func SetRawExtension(base Message, id int32, b []byte) {
  function isExtensionField (line 191) | func isExtensionField(pb extendableProto, field int32) bool {
  function checkExtensionTypes (line 201) | func checkExtensionTypes(pb extendableProto, extension *ExtensionDesc) e...
  type extPropKey (line 218) | type extPropKey struct
  function extensionProperties (line 230) | func extensionProperties(ed *ExtensionDesc) *Properties {
  function encodeExtensions (line 254) | func encodeExtensions(e *XXX_InternalExtensions) error {
  function encodeExtensionsMap (line 265) | func encodeExtensionsMap(m map[int32]Extension) error {
  function extensionsSize (line 293) | func extensionsSize(e *XXX_InternalExtensions) (n int) {
  function extensionsMapSize (line 303) | func extensionsMapSize(m map[int32]Extension) (n int) {
  function HasExtension (line 328) | func HasExtension(pb Message, extension *ExtensionDesc) bool {
  function ClearExtension (line 345) | func ClearExtension(pb Message, extension *ExtensionDesc) {
  function GetExtension (line 357) | func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, er...
  function defaultExtensionValue (line 407) | func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) {
  function decodeExtension (line 441) | func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, e...
  function GetExtensions (line 475) | func GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interf...
  function ExtensionDescs (line 496) | func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) {
  function SetExtension (line 525) | func SetExtension(pb Message, extension *ExtensionDesc, value interface{...
  function ClearAllExtensions (line 552) | func ClearAllExtensions(pb Message) {
  function RegisterExtension (line 569) | func RegisterExtension(desc *ExtensionDesc) {
  function RegisteredExtensions (line 585) | func RegisteredExtensions(pb Message) map[int32]*ExtensionDesc {

FILE: vendor/github.com/golang/protobuf/proto/extensions_test.go
  function TestGetExtensionsWithMissingExtensions (line 46) | func TestGetExtensionsWithMissingExtensions(t *testing.T) {
  function TestExtensionDescsWithMissingExtensions (line 67) | func TestExtensionDescsWithMissingExtensions(t *testing.T) {
  type ExtensionDescSlice (line 109) | type ExtensionDescSlice
    method Len (line 111) | func (s ExtensionDescSlice) Len() int           { return len(s) }
    method Less (line 112) | func (s ExtensionDescSlice) Less(i, j int) bool { return s[i].Field < ...
    method Swap (line 113) | func (s ExtensionDescSlice) Swap(i, j int)      { s[i], s[j] = s[j], s...
  function sortExtDescs (line 115) | func sortExtDescs(s []*proto.ExtensionDesc) {
  function TestGetExtensionStability (line 119) | func TestGetExtensionStability(t *testing.T) {
  function TestGetExtensionDefaults (line 153) | func TestGetExtensionDefaults(t *testing.T) {
  function TestExtensionsRoundTrip (line 290) | func TestExtensionsRoundTrip(t *testing.T) {
  function TestNilExtension (line 333) | func TestNilExtension(t *testing.T) {
  function TestMarshalUnmarshalRepeatedExtension (line 349) | func TestMarshalUnmarshalRepeatedExtension(t *testing.T) {
  function TestUnmarshalRepeatingNonRepeatedExtension (line 411) | func TestUnmarshalRepeatingNonRepeatedExtension(t *testing.T) {
  function TestClearAllExtensions (line 486) | func TestClearAllExtensions(t *testing.T) {
  function TestMarshalRace (line 511) | func TestMarshalRace(t *testing.T) {

FILE: vendor/github.com/golang/protobuf/proto/lib.go
  type Message (line 277) | type Message interface
  type Stats (line 285) | type Stats struct
  constant collectStats (line 296) | collectStats = false
  function GetStats (line 301) | func GetStats() Stats { return stats }
  type Buffer (line 308) | type Buffer struct
    method Reset (line 331) | func (p *Buffer) Reset() {
    method SetBuf (line 338) | func (p *Buffer) SetBuf(s []byte) {
    method Bytes (line 344) | func (p *Buffer) Bytes() []byte { return p.buf }
    method DebugPrint (line 446) | func (p *Buffer) DebugPrint(s string, b []byte) {
  function NewBuffer (line 326) | func NewBuffer(e []byte) *Buffer {
  function Bool (line 352) | func Bool(v bool) *bool {
  function Int32 (line 358) | func Int32(v int32) *int32 {
  function Int (line 365) | func Int(v int) *int32 {
  function Int64 (line 373) | func Int64(v int64) *int64 {
  function Float32 (line 379) | func Float32(v float32) *float32 {
  function Float64 (line 385) | func Float64(v float64) *float64 {
  function Uint32 (line 391) | func Uint32(v uint32) *uint32 {
  function Uint64 (line 397) | func Uint64(v uint64) *uint64 {
  function String (line 403) | func String(v string) *string {
  function EnumName (line 409) | func EnumName(m map[int32]string, v int32) string {
  function UnmarshalJSONEnum (line 423) | func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string)...
  function SetDefaults (line 551) | func SetDefaults(pb Message) {
  function setDefaults (line 556) | func setDefaults(v reflect.Value, recur, zeros bool) {
  type defaultMessage (line 698) | type defaultMessage struct
  type scalarField (line 703) | type scalarField struct
  function buildDefaultMessage (line 710) | func buildDefaultMessage(t reflect.Type) (dm defaultMessage) {
  function fieldDefault (line 739) | func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, n...
  function mapKeys (line 839) | func mapKeys(vs []reflect.Value) sort.Interface {
  type mapKeySorter (line 863) | type mapKeySorter struct
    method Len (line 868) | func (s mapKeySorter) Len() int      { return len(s.vs) }
    method Swap (line 869) | func (s mapKeySorter) Swap(i, j int) { s.vs[i], s.vs[j] = s.vs[j], s.v...
    method Less (line 870) | func (s mapKeySorter) Less(i, j int) bool {
  function isProto3Zero (line 875) | func isProto3Zero(v reflect.Value) bool {
  constant ProtoPackageIsVersion2 (line 893) | ProtoPackageIsVersion2 = true
  constant ProtoPackageIsVersion1 (line 897) | ProtoPackageIsVersion1 = true

FILE: vendor/github.com/golang/protobuf/proto/map_test.go
  function marshalled (line 11) | func marshalled() []byte {
  function BenchmarkConcurrentMapUnmarshal (line 25) | func BenchmarkConcurrentMapUnmarshal(b *testing.B) {
  function BenchmarkSequentialMapUnmarshal (line 37) | func BenchmarkSequentialMapUnmarshal(b *testing.B) {

FILE: vendor/github.com/golang/protobuf/proto/message_set.go
  type _MessageSet_Item (line 62) | type _MessageSet_Item struct
  type messageSet (line 67) | type messageSet struct
    method find (line 82) | func (ms *messageSet) find(pb Message) *_MessageSet_Item {
    method Has (line 96) | func (ms *messageSet) Has(pb Message) bool {
    method Unmarshal (line 103) | func (ms *messageSet) Unmarshal(pb Message) error {
    method Marshal (line 113) | func (ms *messageSet) Marshal(pb Message) error {
    method Reset (line 137) | func (ms *messageSet) Reset()         { *ms = messageSet{} }
    method String (line 138) | func (ms *messageSet) String() string { return CompactTextString(ms) }
    method ProtoMessage (line 139) | func (*messageSet) ProtoMessage()     {}
  type messageTypeIder (line 78) | type messageTypeIder interface
  function skipVarint (line 143) | func skipVarint(buf []byte) []byte {
  function MarshalMessageSet (line 152) | func MarshalMessageSet(exts interface{}) ([]byte, error) {
  function UnmarshalMessageSet (line 193) | func UnmarshalMessageSet(buf []byte, exts interface{}) error {
  function MarshalMessageSetJSON (line 234) | func MarshalMessageSetJSON(exts interface{}) ([]byte, error) {
  function UnmarshalMessageSetJSON (line 286) | func UnmarshalMessageSetJSON(buf []byte, exts interface{}) error {
  type messageSetDesc (line 300) | type messageSetDesc struct
  function RegisterMessageSetType (line 306) | func RegisterMessageSetType(m Message, fieldNum int32, name string) {

FILE: vendor/github.com/golang/protobuf/proto/message_set_test.go
  function TestUnmarshalMessageSetWithDuplicate (line 39) | func TestUnmarshalMessageSetWithDuplicate(t *testing.T) {

FILE: vendor/github.com/golang/protobuf/proto/pointer_reflect.go
  type structPointer (line 46) | type structPointer struct
  function toStructPointer (line 52) | func toStructPointer(v reflect.Value) structPointer {
  function structPointer_IsNil (line 57) | func structPointer_IsNil(p structPointer) bool {
  function structPointer_Interface (line 62) | func structPointer_Interface(p structPointer, _ reflect.Type) interface{} {
  type field (line 69) | type field
    method IsValid (line 80) | func (f field) IsValid() bool { return f != nil }
  function toField (line 72) | func toField(f *reflect.StructField) field {
  function structPointer_field (line 83) | func structPointer_field(p structPointer, f field) reflect.Value {
  function structPointer_ifield (line 98) | func structPointer_ifield(p structPointer, f field) interface{} {
  function structPointer_Bytes (line 103) | func structPointer_Bytes(p structPointer, f field) *[]byte {
  function structPointer_BytesSlice (line 108) | func structPointer_BytesSlice(p structPointer, f field) *[][]byte {
  function structPointer_Bool (line 113) | func structPointer_Bool(p structPointer, f field) **bool {
  function structPointer_BoolVal (line 118) | func structPointer_BoolVal(p structPointer, f field) *bool {
  function structPointer_BoolSlice (line 123) | func structPointer_BoolSlice(p structPointer, f field) *[]bool {
  function structPointer_String (line 128) | func structPointer_String(p structPointer, f field) **string {
  function structPointer_StringVal (line 133) | func structPointer_StringVal(p structPointer, f field) *string {
  function structPointer_StringSlice (line 138) | func structPointer_StringSlice(p structPointer, f field) *[]string {
  function structPointer_Extensions (line 143) | func structPointer_Extensions(p structPointer, f field) *XXX_InternalExt...
  function structPointer_ExtMap (line 148) | func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension {
  function structPointer_NewAt (line 153) | func structPointer_NewAt(p structPointer, f field, typ reflect.Type) ref...
  function structPointer_SetStructPointer (line 158) | func structPointer_SetStructPointer(p structPointer, f field, q structPo...
  function structPointer_GetStructPointer (line 163) | func structPointer_GetStructPointer(p structPointer, f field) structPoin...
  function structPointer_StructPointerSlice (line 168) | func structPointer_StructPointerSlice(p structPointer, f field) structPo...
  type structPointerSlice (line 174) | type structPointerSlice struct
    method Len (line 178) | func (p structPointerSlice) Len() int                  { return p.v.Le...
    method Index (line 179) | func (p structPointerSlice) Index(i int) structPointer { return struct...
    method Append (line 180) | func (p structPointerSlice) Append(q structPointer) {
  type word32 (line 195) | type word32 struct
  function word32_IsNil (line 200) | func word32_IsNil(p word32) bool {
  function word32_Set (line 205) | func word32_Set(p word32, o *Buffer, x uint32) {
  function word32_Get (line 240) | func word32_Get(p word32) uint32 {
  function structPointer_Word32 (line 254) | func structPointer_Word32(p structPointer, f field) word32 {
  type word32Val (line 260) | type word32Val struct
  function word32Val_Set (line 265) | func word32Val_Set(p word32Val, x uint32) {
  function word32Val_Get (line 283) | func word32Val_Get(p word32Val) uint32 {
  function structPointer_Word32Val (line 297) | func structPointer_Word32Val(p structPointer, f field) word32Val {
  type word32Slice (line 303) | type word32Slice struct
    method Append (line 307) | func (p word32Slice) Append(x uint32) {
    method Len (line 326) | func (p word32Slice) Len() int {
    method Index (line 330) | func (p word32Slice) Index(i int) uint32 {
  function structPointer_Word32Slice (line 344) | func structPointer_Word32Slice(p structPointer, f field) word32Slice {
  type word64 (line 349) | type word64 struct
  function word64_Set (line 353) | func word64_Set(p word64, o *Buffer, x uint64) {
  function word64_IsNil (line 384) | func word64_IsNil(p word64) bool {
  function word64_Get (line 388) | func word64_Get(p word64) uint64 {
  function structPointer_Word64 (line 401) | func structPointer_Word64(p structPointer, f field) word64 {
  type word64Val (line 406) | type word64Val struct
  function word64Val_Set (line 410) | func word64Val_Set(p word64Val, o *Buffer, x uint64) {
  function word64Val_Get (line 425) | func word64Val_Get(p word64Val) uint64 {
  function structPointer_Word64Val (line 438) | func structPointer_Word64Val(p structPointer, f field) word64Val {
  type word64Slice (line 442) | type word64Slice struct
    method Append (line 446) | func (p word64Slice) Append(x uint64) {
    method Len (line 465) | func (p word64Slice) Len() int {
    method Index (line 469) | func (p word64Slice) Index(i int) uint64 {
  function structPointer_Word64Slice (line 482) | func structPointer_Word64Slice(p structPointer, f field) word64Slice {

FILE: vendor/github.com/golang/protobuf/proto/pointer_unsafe.go
  type structPointer (line 53) | type structPointer
  function toStructPointer (line 56) | func toStructPointer(v reflect.Value) structPointer {
  function structPointer_IsNil (line 61) | func structPointer_IsNil(p structPointer) bool {
  function structPointer_Interface (line 67) | func structPointer_Interface(p structPointer, t reflect.Type) interface{} {
  type field (line 73) | type field
    method IsValid (line 84) | func (f field) IsValid() bool {
  function toField (line 76) | func toField(f *reflect.StructField) field {
  constant invalidField (line 81) | invalidField = ^field(0)
  function structPointer_Bytes (line 89) | func structPointer_Bytes(p structPointer, f field) *[]byte {
  function structPointer_BytesSlice (line 94) | func structPointer_BytesSlice(p structPointer, f field) *[][]byte {
  function structPointer_Bool (line 99) | func structPointer_Bool(p structPointer, f field) **bool {
  function structPointer_BoolVal (line 104) | func structPointer_BoolVal(p structPointer, f field) *bool {
  function structPointer_BoolSlice (line 109) | func structPointer_BoolSlice(p structPointer, f field) *[]bool {
  function structPointer_String (line 114) | func structPointer_String(p structPointer, f field) **string {
  function structPointer_StringVal (line 119) | func structPointer_StringVal(p structPointer, f field) *string {
  function structPointer_StringSlice (line 124) | func structPointer_StringSlice(p structPointer, f field) *[]string {
  function structPointer_Extensions (line 129) | func structPointer_Extensions(p structPointer, f field) *XXX_InternalExt...
  function structPointer_ExtMap (line 133) | func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension {
  function structPointer_NewAt (line 138) | func structPointer_NewAt(p structPointer, f field, typ reflect.Type) ref...
  function structPointer_SetStructPointer (line 143) | func structPointer_SetStructPointer(p structPointer, f field, q structPo...
  function structPointer_GetStructPointer (line 148) | func structPointer_GetStructPointer(p structPointer, f field) structPoin...
  function structPointer_StructPointerSlice (line 153) | func structPointer_StructPointerSlice(p structPointer, f field) *structP...
  type structPointerSlice (line 158) | type structPointerSlice
    method Len (line 160) | func (v *structPointerSlice) Len() int                  { return len(*...
    method Index (line 161) | func (v *structPointerSlice) Index(i int) structPointer { return (*v)[...
    method Append (line 162) | func (v *structPointerSlice) Append(p structPointer)    { *v = append(...
  type word32 (line 165) | type word32
  function word32_IsNil (line 168) | func word32_IsNil(p word32) bool {
  function word32_Set (line 173) | func word32_Set(p word32, o *Buffer, x uint32) {
  function word32_Get (line 183) | func word32_Get(p word32) uint32 {
  function structPointer_Word32 (line 188) | func structPointer_Word32(p structPointer, f field) word32 {
  type word32Val (line 193) | type word32Val
  function word32Val_Set (line 196) | func word32Val_Set(p word32Val, x uint32) {
  function word32Val_Get (line 201) | func word32Val_Get(p word32Val) uint32 {
  function structPointer_Word32Val (line 206) | func structPointer_Word32Val(p structPointer, f field) word32Val {
  type word32Slice (line 211) | type word32Slice
    method Append (line 213) | func (v *word32Slice) Append(x uint32)    { *v = append(*v, x) }
    method Len (line 214) | func (v *word32Slice) Len() int           { return len(*v) }
    method Index (line 215) | func (v *word32Slice) Index(i int) uint32 { return (*v)[i] }
  function structPointer_Word32Slice (line 218) | func structPointer_Word32Slice(p structPointer, f field) *word32Slice {
  type word64 (line 223) | type word64
  function word64_Set (line 225) | func word64_Set(p word64, o *Buffer, x uint64) {
  function word64_IsNil (line 234) | func word64_IsNil(p word64) bool {
  function word64_Get (line 238) | func word64_Get(p word64) uint64 {
  function structPointer_Word64 (line 242) | func structPointer_Word64(p structPointer, f field) word64 {
  type word64Val (line 247) | type word64Val
  function word64Val_Set (line 249) | func word64Val_Set(p word64Val, o *Buffer, x uint64) {
  function word64Val_Get (line 253) | func word64Val_Get(p word64Val) uint64 {
  function structPointer_Word64Val (line 257) | func structPointer_Word64Val(p structPointer, f field) word64Val {
  type word64Slice (line 262) | type word64Slice
    method Append (line 264) | func (v *word64Slice) Append(x uint64)    { *v = append(*v, x) }
    method Len (line 265) | func (v *word64Slice) Len() int           { return len(*v) }
    method Index (line 266) | func (v *word64Slice) Index(i int) uint64 { return (*v)[i] }
  function structPointer_Word64Slice (line 268) | func structPointer_Word64Slice(p structPointer, f field) *word64Slice {

FILE: vendor/github.com/golang/protobuf/proto/properties.go
  constant debug (line 49) | debug bool = false
  constant WireVarint (line 53) | WireVarint     = 0
  constant WireFixed64 (line 54) | WireFixed64    = 1
  constant WireBytes (line 55) | WireBytes      = 2
  constant WireStartGroup (line 56) | WireStartGroup = 3
  constant WireEndGroup (line 57) | WireEndGroup   = 4
  constant WireFixed32 (line 58) | WireFixed32    = 5
  constant startSize (line 61) | startSize = 10
  type encoder (line 66) | type encoder
  type valueEncoder (line 69) | type valueEncoder
  type sizer (line 74) | type sizer
  type valueSizer (line 78) | type valueSizer
  type decoder (line 83) | type decoder
  type valueDecoder (line 86) | type valueDecoder
  type oneofMarshaler (line 89) | type oneofMarshaler
  type oneofUnmarshaler (line 92) | type oneofUnmarshaler
  type oneofSizer (line 95) | type oneofSizer
  type tagMap (line 100) | type tagMap struct
    method get (line 109) | func (p *tagMap) get(t int) (int, bool) {
    method put (line 121) | func (p *tagMap) put(t int, fi int) {
  constant tagMapFastLimit (line 107) | tagMapFastLimit = 1024
  type StructProperties (line 137) | type StructProperties struct
    method Len (line 166) | func (sp *StructProperties) Len() int { return len(sp.order) }
    method Less (line 167) | func (sp *StructProperties) Less(i, j int) bool {
    method Swap (line 170) | func (sp *StructProperties) Swap(i, j int) { sp.order[i], sp.order[j] ...
  type OneofProperties (line 157) | type OneofProperties struct
  type Properties (line 173) | type Properties struct
    method String (line 217) | func (p *Properties) String() string {
    method Parse (line 253) | func (p *Properties) Parse(s string) {
    method setEncAndDec (line 342) | func (p *Properties) setEncAndDec(typ reflect.Type, f *reflect.StructF...
    method Init (line 616) | func (p *Properties) Init(typ reflect.Type, name, tag string, f *refle...
    method init (line 620) | func (p *Properties) init(typ reflect.Type, name, tag string, f *refle...
  function logNoSliceEnc (line 335) | func logNoSliceEnc(t1, t2 reflect.Type) {
  function isMarshaler (line 594) | func isMarshaler(t reflect.Type) bool {
  function isUnmarshaler (line 605) | func isUnmarshaler(t reflect.Type) bool {
  function GetProperties (line 641) | func GetProperties(t reflect.Type) *StructProperties {
  function getPropertiesLocked (line 665) | func getPropertiesLocked(t reflect.Type) *StructProperties {
  function propByIndex (line 783) | func propByIndex(t reflect.Type, x []int) *Properties {
  function getbase (line 793) | func getbase(pb Message) (t reflect.Type, b structPointer, err error) {
  function RegisterEnum (line 813) | func RegisterEnum(typeName string, unusedNameMap map[int32]string, value...
  function EnumValueMap (line 822) | func EnumValueMap(enumType string) map[string]int32 {
  function RegisterType (line 835) | func RegisterType(x Message, name string) {
  function MessageName (line 847) | func MessageName(x Message) string {
  function MessageType (line 858) | func MessageType(name string) reflect.Type { return protoTypes[name] }
  function RegisterFile (line 867) | func RegisterFile(filename string, fileDescriptor []byte) {
  function FileDescriptor (line 872) | func FileDescriptor(filename string) []byte { return protoFiles[filename] }

FILE: vendor/github.com/golang/protobuf/proto/proto3_test.go
  function TestProto3ZeroValues (line 42) | func TestProto3ZeroValues(t *testing.T) {
  function TestRoundTripProto3 (line 62) | func TestRoundTripProto3(t *testing.T) {
  function TestGettersForBasicTypesExist (line 96) | func TestGettersForBasicTypesExist(t *testing.T) {
  function TestProto3SetDefaults (line 106) | func TestProto3SetDefaults(t *testing.T) {

FILE: vendor/github.com/golang/protobuf/proto/size2_test.go
  function TestVarintSize (line 42) | func TestVarintSize(t *testing.T) {

FILE: vendor/github.com/golang/protobuf/proto/size_test.go
  function init (line 49) | func init() {
  function TestSize (line 151) | func TestSize(t *testing.T) {

FILE: vendor/github.com/golang/protobuf/proto/text.go
  type writer (line 65) | type writer interface
  type textWriter (line 71) | type textWriter struct
    method WriteString (line 78) | func (w *textWriter) WriteString(s string) (n int, err error) {
    method Write (line 92) | func (w *textWriter) Write(p []byte) (n int, err error) {
    method WriteByte (line 141) | func (w *textWriter) WriteByte(c byte) error {
    method indent (line 153) | func (w *textWriter) indent() { w.ind++ }
    method unindent (line 155) | func (w *textWriter) unindent() {
    method writeIndent (line 763) | func (w *textWriter) writeIndent() {
  function writeName (line 163) | func writeName(w *textWriter, props *Properties) error {
  type raw (line 174) | type raw interface
  function requiresQuotes (line 178) | func requiresQuotes(u string) bool {
  function isAny (line 198) | func isAny(sv reflect.Value) bool {
  function writeRaw (line 468) | func writeRaw(w *textWriter, b []byte) error {
  function isprint (line 561) | func isprint(c byte) bool {
  function writeString (line 570) | func writeString(w *textWriter, s string) error {
  function writeUnknownStruct (line 606) | func writeUnknownStruct(w *textWriter, data []byte) (err error) {
  function writeUnknownInt (line 673) | func writeUnknownInt(w *textWriter, x uint64, err error) error {
  type int32Slice (line 682) | type int32Slice
    method Len (line 684) | func (s int32Slice) Len() int           { return len(s) }
    method Less (line 685) | func (s int32Slice) Less(i, j int) bool { return s[i] < s[j] }
    method Swap (line 686) | func (s int32Slice) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
  type TextMarshaler (line 780) | type TextMarshaler struct
    method writeProto3Any (line 213) | func (tm *TextMarshaler) writeProto3Any(w *textWriter, sv reflect.Valu...
    method writeStruct (line 259) | func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) ...
    method writeAny (line 489) | func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, prop...
    method writeExtensions (line 690) | func (tm *TextMarshaler) writeExtensions(w *textWriter, pv reflect.Val...
    method writeExtension (line 745) | func (tm *TextMarshaler) writeExtension(w *textWriter, name string, pb...
    method Marshal (line 787) | func (tm *TextMarshaler) Marshal(w io.Writer, pb Message) error {
    method Text (line 830) | func (tm *TextMarshaler) Text(pb Message) string {
  function MarshalText (line 845) | func MarshalText(w io.Writer, pb Message) error { return defaultTextMars...
  function MarshalTextString (line 848) | func MarshalTextString(pb Message) string { return defaultTextMarshaler....
  function CompactText (line 851) | func CompactText(w io.Writer, pb Message) error { return compactTextMars...
  function CompactTextString (line 854) | func CompactTextString(pb Message) string { return compactTextMarshaler....

FILE: vendor/github.com/golang/protobuf/proto/text_parser.go
  constant anyRepeatedlyUnpacked (line 48) | anyRepeatedlyUnpacked = "Any message unpacked multiple times, or %q alre...
  type ParseError (line 50) | type ParseError struct
    method Error (line 56) | func (p *ParseError) Error() string {
  type token (line 64) | type token struct
    method String (line 72) | func (t *token) String() string {
  type textParser (line 79) | type textParser struct
    method errorf (line 95) | func (p *textParser) errorf(format string, a ...interface{}) *ParseErr...
    method skipWhitespace (line 133) | func (p *textParser) skipWhitespace() {
    method advance (line 157) | func (p *textParser) advance() {
    method back (line 336) | func (p *textParser) back() { p.backed = true }
    method next (line 339) | func (p *textParser) next() *token {
    method consumeToken (line 369) | func (p *textParser) consumeToken(s string) error {
    method missingRequiredFieldError (line 382) | func (p *textParser) missingRequiredFieldError(sv reflect.Value) *Requ...
    method checkForColon (line 409) | func (p *textParser) checkForColon(props *Properties, typ reflect.Type...
    method readStruct (line 449) | func (p *textParser) readStruct(sv reflect.Value, terminator string) e...
    method consumeExtName (line 708) | func (p *textParser) consumeExtName() (string, error) {
    method consumeOptionalSeparator (line 737) | func (p *textParser) consumeOptionalSeparator() error {
    method readAny (line 748) | func (p *textParser) readAny(v reflect.Value, props *Properties) error {
  function newTextParser (line 87) | func newTextParser(s string) *textParser {
  function isIdentOrNumberChar (line 103) | func isIdentOrNumberChar(c byte) bool {
  function isWhitespace (line 117) | func isWhitespace(c byte) bool {
  function isQuote (line 125) | func isQuote(c byte) bool {
  function unquoteC (line 212) | func unquoteC(s string, quote rune) (string, error) {
  function unescape (line 255) | func unescape(s string) (ch string, tail string, err error) {
  function unhex (line 322) | func unhex(b byte) (v byte, ok bool) {
  function structFieldByName (line 399) | func structFieldByName(sprops *StructProperties, name string) (int, *Pro...
  function UnmarshalText (line 884) | func UnmarshalText(s string, pb Message) error {

FILE: vendor/github.com/golang/protobuf/proto/text_parser_test.go
  type UnmarshalTextTest (line 44) | type UnmarshalTextTest struct
  function buildExtStructTest (line 50) | func buildExtStructTest(text string) UnmarshalTextTest {
  function buildExtDataTest (line 60) | func buildExtDataTest(text string) UnmarshalTextTest {
  function buildExtRepStringTest (line 69) | func buildExtRepStringTest(text string) UnmarshalTextTest {
  function TestUnmarshalText (line 529) | func TestUnmarshalText(t *testing.T) {
  function TestUnmarshalTextCustomMessage (line 556) | func TestUnmarshalTextCustomMessage(t *testing.T) {
  function TestRepeatedEnum (line 567) | func TestRepeatedEnum(t *testing.T) {
  function TestProto3TextParsing (line 580) | func TestProto3TextParsing(t *testing.T) {
  function TestMapParsing (line 595) | func TestMapParsing(t *testing.T) {
  function TestOneofParsing (line 628) | func TestOneofParsing(t *testing.T) {
  function init (line 653) | func init() {
  function BenchmarkUnmarshalText (line 667) | func BenchmarkUnmarshalText(b *testing.B) {

FILE: vendor/github.com/golang/protobuf/proto/text_test.go
  type textMessage (line 50) | type textMessage struct
    method MarshalText (line 53) | func (*textMessage) MarshalText() ([]byte, error) {
    method UnmarshalText (line 57) | func (*textMessage) UnmarshalText(bytes []byte) error {
    method Reset (line 64) | func (*textMessage) Reset()         {}
    method String (line 65) | func (*textMessage) String() string { return "" }
    method ProtoMessage (line 66) | func (*textMessage) ProtoMessage()  {}
  function newTestMessage (line 68) | func newTestMessage() *pb.MyMessage {
  constant text (line 126) | text = `count: 42
  function TestMarshalText (line 166) | func TestMarshalText(t *testing.T) {
  function TestMarshalTextCustomMessage (line 177) | func TestMarshalTextCustomMessage(t *testing.T) {
  function TestMarshalTextNil (line 187) | func TestMarshalTextNil(t *testing.T) {
  function TestMarshalTextUnknownEnum (line 201) | func TestMarshalTextUnknownEnum(t *testing.T) {
  function TestTextOneof (line 211) | func TestTextOneof(t *testing.T) {
  function BenchmarkMarshalTextBuffered (line 235) | func BenchmarkMarshalTextBuffered(b *testing.B) {
  function BenchmarkMarshalTextUnbuffered (line 244) | func BenchmarkMarshalTextUnbuffered(b *testing.B) {
  function compact (line 252) | func compact(src string) string {
  function TestCompactText (line 299) | func TestCompactText(t *testing.T) {
  function TestStringEscaping (line 306) | func TestStringEscaping(t *testing.T) {
  type limitedWriter (line 356) | type limitedWriter struct
    method Write (line 363) | func (w *limitedWriter) Write(p []byte) (n int, err error) {
  function TestMarshalTextFailing (line 375) | func TestMarshalTextFailing(t *testing.T) {
  function TestFloats (line 393) | func TestFloats(t *testing.T) {
  function TestRepeatedNilText (line 414) | func TestRepeatedNilText(t *testing.T) {
  function TestProto3Text (line 435) | func TestProto3Text(t *testing.T) {

FILE: vendor/github.com/inconshreveable/mousetrap/trap_others.go
  function StartedByExplorer (line 13) | func StartedByExplorer() bool {

FILE: vendor/github.com/inconshreveable/mousetrap/trap_windows.go
  constant th32cs_snapprocess (line 15) | th32cs_snapprocess uintptr = 0x2
  type processEntry32 (line 26) | type processEntry32 struct
  function getProcessEntry (line 39) | func getProcessEntry(pid int) (pe *processEntry32, err error) {
  function getppid (line 69) | func getppid() (pid int, err error) {
  function StartedByExplorer (line 85) | func StartedByExplorer() bool {

FILE: vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go
  function getProcessEntry (line 12) | func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) {
  function StartedByExplorer (line 40) | func StartedByExplorer() bool {

FILE: vendor/github.com/maruel/panicparse/main.go
  function main (line 26) | func main() {

FILE: vendor/github.com/maruel/panicparse/stack/source.go
  type cache (line 23) | type cache struct
    method augmentGoroutine (line 42) | func (c *cache) augmentGoroutine(goroutine *Goroutine) {
    method load (line 67) | func (c *cache) load(fileName string) {
    method getFuncAST (line 103) | func (c *cache) getFuncAST(call *Call) *ast.FuncDecl {
  function Augment (line 31) | func Augment(goroutines []Goroutine) {
  type parsedFile (line 110) | type parsedFile struct
    method getFuncAST (line 117) | func (p *parsedFile) getFuncAST(f string, l int) (d *ast.FuncDecl) {
  function name (line 166) | func name(n ast.Node) string {
  function fieldToType (line 182) | func fieldToType(f *ast.Field) (string, bool) {
  function extractArgumentsType (line 210) | func extractArgumentsType(f *ast.FuncDecl) ([]string, bool) {
  function processCall (line 240) | func processCall(call *Call, f *ast.FuncDecl) {

FILE: vendor/github.com/maruel/panicparse/stack/source_test.go
  function TestAugment (line 20) | func TestAugment(t *testing.T) {
  function TestAugmentDummy (line 451) | func TestAugmentDummy(t *testing.T) {
  function TestLoad (line 464) | func TestLoad(t *testing.T) {
  constant pointer (line 491) | pointer = uint64(0xfffffffff)
  constant pointerStr (line 492) | pointerStr = "0xfffffffff"
  function overrideEnv (line 494) | func overrideEnv(env []string, key, value string) []string {
  function getCrash (line 505) | func getCrash(t *testing.T, content string) (string, []byte) {
  function zapPointers (line 530) | func zapPointers(t *testing.T, name string, expected, s *Stack) {
  function zapPaths (line 559) | func zapPaths(s *Stack) {

FILE: vendor/github.com/maruel/panicparse/stack/stack.go
  constant lockedToThread (line 30) | lockedToThread = "locked to thread"
  type Similarity (line 74) | type Similarity
  constant ExactFlags (line 78) | ExactFlags Similarity = iota
  constant ExactLines (line 80) | ExactLines
  constant AnyPointer (line 82) | AnyPointer
  constant AnyValue (line 84) | AnyValue
  type Function (line 91) | type Function struct
    method String (line 100) | func (f Function) String() string {
    method Name (line 106) | func (f Function) Name() string {
    method PkgName (line 115) | func (f Function) PkgName() string {
    method PkgDotName (line 125) | func (f Function) PkgDotName() string {
    method IsExported (line 138) | func (f Function) IsExported() bool {
  type Arg (line 149) | type Arg struct
    method IsPtr (line 156) | func (a *Arg) IsPtr() bool {
    method String (line 161) | func (a Arg) String() string {
  type Args (line 172) | type Args struct
    method String (line 178) | func (a Args) String() string {
    method Equal (line 198) | func (a *Args) Equal(r *Args) bool {
    method Similar (line 212) | func (a *Args) Similar(r *Args, similar Similarity) bool {
    method Merge (line 235) | func (a *Args) Merge(r *Args) Args {
  type Call (line 252) | type Call struct
    method Equal (line 260) | func (c *Call) Equal(r *Call) bool {
    method Similar (line 266) | func (c *Call) Similar(r *Call, similar Similarity) bool {
    method Merge (line 271) | func (c *Call) Merge(r *Call) Call {
    method SourceName (line 281) | func (c *Call) SourceName() string {
    method SourceLine (line 286) | func (c *Call) SourceLine() string {
    method FullSourceLine (line 291) | func (c *Call) FullSourceLine() string {
    method PkgSource (line 296) | func (c *Call) PkgSource() string {
    method IsStdlib (line 304) | func (c *Call) IsStdlib() bool {
    method IsPkgMain (line 315) | func (c *Call) IsPkgMain() bool {
  constant testMainSource (line 300) | testMainSource = "_test" + string(os.PathSeparator) + "_testmain.go"
  type Stack (line 320) | type Stack struct
    method Equal (line 326) | func (s *Stack) Equal(r *Stack) bool {
    method Similar (line 340) | func (s *Stack) Similar(r *Stack, similar Similarity) bool {
    method Merge (line 353) | func (s *Stack) Merge(r *Stack) *Stack {
    method Less (line 369) | func (s *Stack) Less(r *Stack) bool {
  type Signature (line 430) | type Signature struct
    method Equal (line 456) | func (s *Signature) Equal(r *Signature) bool {
    method Similar (line 465) | func (s *Signature) Similar(r *Signature, similar Similarity) bool {
    method Merge (line 476) | func (s *Signature) Merge(r *Signature) *Signature {
    method Less (line 499) | func (s *Signature) Less(r *Signature) bool {
  type Goroutine (line 522) | type Goroutine struct
  function Bucketize (line 529) | func Bucketize(goroutines []Goroutine, similar Similarity) map[*Signatur...
  type Bucket (line 561) | type Bucket struct
    method First (line 568) | func (b *Bucket) First() bool {
    method Less (line 578) | func (b *Bucket) Less(r *Bucket) bool {
  type Buckets (line 589) | type Buckets
    method Len (line 591) | func (b Buckets) Len() int {
    method Less (line 595) | func (b Buckets) Less(i, j int) bool {
    method Swap (line 599) | func (b Buckets) Swap(i, j int) {
  function SortBuckets (line 604) | func SortBuckets(buckets map[*Signature][]Goroutine) Buckets {
  function scanLines (line 617) | func scanLines(data []byte, atEOF bool) (advance int, token []byte, err ...
  function ParseDump (line 640) | func ParseDump(r io.Reader, out io.Writer) ([]Goroutine, error) {
  function nameArguments (line 771) | func nameArguments(goroutines []Goroutine) {
  type uint64Slice (line 828) | type uint64Slice
    method Len (line 830) | func (a uint64Slice) Len() int           { return len(a) }
    method Swap (line 831) | func (a uint64Slice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
    method Less (line 832) | func (a uint64Slice) Less(i, j int) bool { return a[i] < a[j] }

FILE: vendor/github.com/maruel/panicparse/stack/stack_test.go
  constant crash (line 23) | crash = `panic: oh no!
  function Example (line 34) | func Example() {
  function TestParseDump1 (line 61) | func TestParseDump1(t *testing.T) {
  function TestParseDumpLongWait (line 122) | func TestParseDumpLongWait(t *testing.T) {
  function TestParseDumpAsm (line 204) | func TestParseDumpAsm(t *testing.T) {
  function TestParseDumpLineErr (line 238) | func TestParseDumpLineErr(t *testing.T) {
  function TestParseDumpValueErr (line 264) | func TestParseDumpValueErr(t *testing.T) {
  function TestParseDumpOrderErr (line 287) | func TestParseDumpOrderErr(t *testing.T) {
  function TestParseDumpElided (line 311) | func TestParseDumpElided(t *testing.T) {
  function TestParseDumpSysCall (line 363) | func TestParseDumpSysCall(t *testing.T) {
  function TestParseDumpUnavail (line 435) | func TestParseDumpUnavail(t *testing.T) {
  function TestParseDumpSameBucket (line 469) | func TestParseDumpSameBucket(t *testing.T) {
  function TestBucketizeNotAggressive (line 537) | func TestBucketizeNotAggressive(t *testing.T) {
  function TestBucketizeAggressive (line 596) | func TestBucketizeAggressive(t *testing.T) {
  function TestParseDumpNoOffset (line 693) | func TestParseDumpNoOffset(t *testing.T) {
  function TestParseDumpJunk (line 732) | func TestParseDumpJunk(t *testing.T) {
  function TestParseCCode (line 752) | func TestParseCCode(t *testing.T) {
  function TestParseWithCarriageReturn (line 839) | func TestParseWithCarriageReturn(t *testing.T) {
  function TestCallPkg1 (line 892) | func TestCallPkg1(t *testing.T) {
  function TestCallPkg2 (line 910) | func TestCallPkg2(t *testing.T) {
  function TestCallStdlib (line 930) | func TestCallStdlib(t *testing.T) {
  function TestCallMain (line 948) | func TestCallMain(t *testing.T) {
  function TestCallC (line 965) | func TestCallC(t *testing.T) {
  function TestArgs (line 983) | func TestArgs(t *testing.T) {
  function TestFunctionAnonymous (line 1002) | func TestFunctionAnonymous(t *testing.T) {
  function TestFunctionGC (line 1011) | func TestFunctionGC(t *testing.T) {

FILE: vendor/github.com/maruel/panicparse/stack/ui.go
  type Palette (line 15) | type Palette struct
    method functionColor (line 60) | func (p *Palette) functionColor(line *Call) string {
    method routineColor (line 75) | func (p *Palette) routineColor(bucket *Bucket, multipleBuckets bool) s...
    method BucketHeader (line 83) | func (p *Palette) BucketHeader(bucket *Bucket, fullPath, multipleBucke...
    method callLine (line 113) | func (p *Palette) callLine(line *Call, srcLen, pkgLen int, fullPath bo...
    method StackLines (line 130) | func (p *Palette) StackLines(signature *Signature, srcLen, pkgLen int,...
  function CalcLengths (line 35) | func CalcLengths(buckets Buckets, fullPath bool) (int, int) {

FILE: vendor/github.com/maruel/panicparse/stack/ui_test.go
  function TestCalcLengths (line 28) | func TestCalcLengths(t *testing.T) {
  function TestBucketHeader (line 44) | func TestBucketHeader(t *testing.T) {
  function TestStackLines (line 81) | func TestStackLines(t *testing.T) {

FILE: vendor/github.com/mattn/go-runewidth/runewidth.go
  type interval (line 11) | type interval struct
  type table (line 16) | type table
  function inTables (line 18) | func inTables(r rune, ts ...table) bool {
  function inTable (line 27) | func inTable(r rune, t table) bool {
  type Condition (line 1081) | type Condition struct
    method RuneWidth (line 1092) | func (c *Condition) RuneWidth(r rune) int {
    method StringWidth (line 1106) | func (c *Condition) StringWidth(s string) (width int) {
    method Truncate (line 1114) | func (c *Condition) Truncate(s string, w int, tail string) string {
    method Wrap (line 1134) | func (c *Condition) Wrap(s string, w int) string {
    method FillLeft (line 1157) | func (c *Condition) FillLeft(s string, w int) string {
    method FillRight (line 1171) | func (c *Condition) FillRight(s string, w int) string {
  function NewCondition (line 1086) | func NewCondition() *Condition {
  function RuneWidth (line 1186) | func RuneWidth(r rune) int {
  function IsAmbiguousWidth (line 1191) | func IsAmbiguousWidth(r rune) bool {
  function IsNeutralWidth (line 1196) | func IsNeutralWidth(r rune) bool {
  function StringWidth (line 1201) | func StringWidth(s string) (width int) {
  function Truncate (line 1206) | func Truncate(s string, w int, tail string) string {
  function Wrap (line 1211) | func Wrap(s string, w int) string {
  function FillLeft (line 1216) | func FillLeft(s string, w int) string {
  function FillRight (line 1221) | func FillRight(s string, w int) string {

FILE: vendor/github.com/mattn/go-runewidth/runewidth_js.go
  function IsEastAsian (line 5) | func IsEastAsian() bool {

FILE: vendor/github.com/mattn/go-runewidth/runewidth_posix.go
  function isEastAsian (line 31) | func isEastAsian(locale string) bool {
  function IsEastAsian (line 62) | func IsEastAsian() bool {

FILE: vendor/github.com/mattn/go-runewidth/runewidth_test.go
  method Len (line 10) | func (t table) Len() int {
  method Less (line 14) | func (t table) Less(i, j int) bool {
  method Swap (line 18) | func (t *table) Swap(i, j int) {
  function TestSorted (line 33) | func TestSorted(t *testing.T) {
  function TestRuneWidth (line 57) | func TestRuneWidth(t *testing.T) {
  function TestIsAmbiguousWidth (line 104) | func TestIsAmbiguousWidth(t *testing.T) {
  function TestStringWidth (line 122) | func TestStringWidth(t *testing.T) {
  function TestStringWidthInvalid (line 137) | func TestStringWidthInvalid(t *testing.T) {
  function TestTruncateSmaller (line 144) | func TestTruncateSmaller(t *testing.T) {
  function TestTruncate (line 153) | func TestTruncate(t *testing.T) {
  function TestTruncateFit (line 166) | func TestTruncateFit(t *testing.T) {
  function TestTruncateJustFit (line 180) | func TestTruncateJustFit(t *testing.T) {
  function TestWrap (line 194) | func TestWrap(t *testing.T) {
  function TestTruncateNoNeeded (line 211) | func TestTruncateNoNeeded(t *testing.T) {
  function TestIsNeutralWidth (line 233) | func TestIsNeutralWidth(t *testing.T) {
  function TestFillLeft (line 241) | func TestFillLeft(t *testing.T) {
  function TestFillLeftFit (line 250) | func TestFillLeftFit(t *testing.T) {
  function TestFillRight (line 259) | func TestFillRight(t *testing.T) {
  function TestFillRightFit (line 268) | func TestFillRightFit(t *testing.T) {

FILE: vendor/github.com/mattn/go-runewidth/runewidth_windows.go
  function IsEastAsian (line 13) | func IsEastAsian() bool {

FILE: vendor/github.com/mitchellh/go-wordwrap/wordwrap.go
  function WrapString (line 14) | func WrapString(s string, lim uint) string {

FILE: vendor/github.com/mitchellh/go-wordwrap/wordwrap_test.go
  function TestWrapString (line 7) | func TestWrapString(t *testing.T) {

FILE: vendor/github.com/nsf/termbox-go/api.go
  function Init (line 23) | func Init() error {
  function Interrupt (line 114) | func Interrupt() {
  function Close (line 120) | func Close() {
  function Flush (line 151) | func Flush() error {
  function SetCursor (line 203) | func SetCursor(x, y int) {
  function HideCursor (line 219) | func HideCursor() {
  function SetCell (line 225) | func SetCell(x, y int, ch rune, fg, bg Attribute) {
  function CellBuffer (line 239) | func CellBuffer() []Cell {
  function ParseEvent (line 254) | func ParseEvent(data []byte) Event {
  function PollRawEvent (line 270) | func PollRawEvent(data []byte) Event {
  function PollEvent (line 305) | func PollEvent() Event {
  function Size (line 352) | func Size() (width int, height int) {
  function Clear (line 357) | func Clear(fg, bg Attribute) error {
  function SetInputMode (line 377) | func SetInputMode(mode InputMode) InputMode {
  function SetOutputMode (line 436) | func SetOutputMode(mode OutputMode) OutputMode {
  function Sync (line 449) | func Sync() error {

FILE: vendor/github.com/nsf/termbox-go/api_common.go
  type InputMode (line 7) | type InputMode
  type OutputMode (line 8) | type OutputMode
  type EventType (line 9) | type EventType
  type Modifier (line 10) | type Modifier
  type Key (line 11) | type Key
  type Attribute (line 12) | type Attribute
  type Event (line 18) | type Event struct
  type Cell (line 34) | type Cell struct
  constant KeyF1 (line 47) | KeyF1 Key = 0xFFFF - iota
  constant KeyF2 (line 48) | KeyF2
  constant KeyF3 (line 49) | KeyF3
  constant KeyF4 (line 50) | KeyF4
  constant KeyF5 (line 51) | KeyF5
  constant KeyF6 (line 52) | KeyF6
  constant KeyF7 (line 53) | KeyF7
  constant KeyF8 (line 54) | KeyF8
  constant KeyF9 (line 55) | KeyF9
  constant KeyF10 (line 56) | KeyF10
  constant KeyF11 (line 57) | KeyF11
  constant KeyF12 (line 58) | KeyF12
  constant KeyInsert (line 59) | KeyInsert
  constant KeyDelete (line 60) | KeyDelete
  constant KeyHome (line 61) | KeyHome
  constant KeyEnd (line 62) | KeyEnd
  constant KeyPgup (line 63) | KeyPgup
  constant KeyPgdn (line 64) | KeyPgdn
  constant KeyArrowUp (line 65) | KeyArrowUp
  constant KeyArrowDown (line 66) | KeyArrowDown
  constant KeyArrowLeft (line 67) | KeyArrowLeft
  constant KeyArrowRight (line 68) | KeyArrowRight
  constant key_min (line 69) | key_min
  constant MouseLeft (line 70) | MouseLeft
  constant MouseMiddle (line 71) | MouseMiddle
  constant MouseRight (line 72) | MouseRight
  constant MouseRelease (line 73) | MouseRelease
  constant MouseWheelUp (line 74) | MouseWheelUp
  constant MouseWheelDown (line 75) | MouseWheelDown
  constant KeyCtrlTilde (line 79) | KeyCtrlTilde      Key = 0x00
  constant KeyCtrl2 (line 80) | KeyCtrl2          Key = 0x00
  constant KeyCtrlSpace (line 81) | KeyCtrlSpace      Key = 0x00
  constant KeyCtrlA (line 82) | KeyCtrlA          Key = 0x01
  constant KeyCtrlB (line 83) | KeyCtrlB          Key = 0x02
  constant KeyCtrlC (line 84) | KeyCtrlC          Key = 0x03
  constant KeyCtrlD (line 85) | KeyCtrlD          Key = 0x04
  constant KeyCtrlE (line 86) | KeyCtrlE          Key = 0x05
  constant KeyCtrlF (line 87) | KeyCtrlF          Key = 0x06
  constant KeyCtrlG (line 88) | KeyCtrlG          Key = 0x07
  constant KeyBackspace (line 89) | KeyBackspace      Key = 0x08
  constant KeyCtrlH (line 90) | KeyCtrlH          Key = 0x08
  constant KeyTab (line 91) | KeyTab            Key = 0x09
  constant KeyCtrlI (line 92) | KeyCtrlI          Key = 0x09
  constant KeyCtrlJ (line 93) | KeyCtrlJ          Key = 0x0A
  constant KeyCtrlK (line 94) | KeyCtrlK          Key = 0x0B
  constant KeyCtrlL (line 95) | KeyCtrlL          Key = 0x0C
  constant KeyEnter (line 96) | KeyEnter          Key = 0x0D
  constant KeyCtrlM (line 97) | KeyCtrlM          Key = 0x0D
  constant KeyCtrlN (line 98) | KeyCtrlN          Key = 0x0E
  constant KeyCtrlO (line 99) | KeyCtrlO          Key = 0x0F
  constant KeyCtrlP (line 100) | KeyCtrlP          Key = 0x10
  constant KeyCtrlQ (line 101) | KeyCtrlQ          Key = 0x11
  constant KeyCtrlR (line 102) | KeyCtrlR          Key = 0x12
  constant KeyCtrlS (line 103) | KeyCtrlS          Key = 0x13
  constant KeyCtrlT (line 104) | KeyCtrlT          Key = 0x14
  constant KeyCtrlU (line 105) | KeyCtrlU          Key = 0x15
  constant KeyCtrlV (line 106) | KeyCtrlV          Key = 0x16
  constant KeyCtrlW (line 107) | KeyCtrlW          Key = 0x17
  constant KeyCtrlX (line 108) | KeyCtrlX          Key = 0x18
  constant KeyCtrlY (line 109) | KeyCtrlY          Key = 0x19
  constant KeyCtrlZ (line 110) | KeyCtrlZ          Key = 0x1A
  constant KeyEsc (line 111) | KeyEsc            Key = 0x1B
  constant KeyCtrlLsqBracket (line 112) | KeyCtrlLsqBracket Key = 0x1B
  constant KeyCtrl3 (line 113) | KeyCtrl3          Key = 0x1B
  constant KeyCtrl4 (line 114) | KeyCtrl4          Key = 0x1C
  constant KeyCtrlBackslash (line 115) | KeyCtrlBackslash  Key = 0x1C
  constant KeyCtrl5 (line 116) | KeyCtrl5          Key = 0x1D
  constant KeyCtrlRsqBracket (line 117) | KeyCtrlRsqBracket Key = 0x1D
  constant KeyCtrl6 (line 118) | KeyCtrl6          Key = 0x1E
  constant KeyCtrl7 (line 119) | KeyCtrl7          Key = 0x1F
  constant KeyCtrlSlash (line 120) | KeyCtrlSlash      Key = 0x1F
  constant KeyCtrlUnderscore (line 121) | KeyCtrlUnderscore Key = 0x1F
  constant KeySpace (line 122) | KeySpace          Key = 0x20
  constant KeyBackspace2 (line 123) | KeyBackspace2     Key = 0x7F
  constant KeyCtrl8 (line 124) | KeyCtrl8          Key = 0x7F
  constant ModAlt (line 129) | ModAlt Modifier = 1 << iota
  constant ModMotion (line 130) | ModMotion
  constant ColorDefault (line 136) | ColorDefault Attribute = iota
  constant ColorBlack (line 137) | ColorBlack
  constant ColorRed (line 138) | ColorRed
  constant ColorGreen (line 139) | ColorGreen
  constant ColorYellow (line 140) | ColorYellow
  constant ColorBlue (line 141) | ColorBlue
  constant ColorMagenta (line 142) | ColorMagenta
  constant ColorCyan (line 143) | ColorCyan
  constant ColorWhite (line 144) | ColorWhite
  constant AttrBold (line 156) | AttrBold Attribute = 1 << (iota + 9)
  constant AttrUnderline (line 157) | AttrUnderline
  constant AttrReverse (line 158) | AttrReverse
  constant InputEsc (line 163) | InputEsc InputMode = 1 << iota
  constant InputAlt (line 164) | InputAlt
  constant InputMouse (line 165) | InputMouse
  constant InputCurrent (line 166) | InputCurrent InputMode = 0
  constant OutputCurrent (line 171) | OutputCurrent OutputMode = iota
  constant OutputNormal (line 172) | OutputNormal
  constant Output256 (line 173) | Output256
  constant Output216 (line 174) | Output216
  constant OutputGrayscale (line 175) | OutputGrayscale
  constant EventKey (line 180) | EventKey EventType = iota
  constant EventResize (line 181) | EventResize
  constant EventMouse (line 182) | EventMouse
  constant EventError (line 183) | EventError
  constant EventInterrupt (line 184) | EventInterrupt
  constant EventRaw (line 185) | EventRaw
  constant EventNone (line 186) | EventNone

FILE: vendor/github.com/nsf/termbox-go/api_windows.go
  function Init (line 18) | func Init() error {
  function Close (line 75) | func Close() {
  function Interrupt (line 102) | func Interrupt() {
  function Flush (line 107) | func Flush() error {
  function SetCursor (line 126) | func SetCursor(x, y int) {
  function HideCursor (line 142) | func HideCursor() {
  function SetCell (line 148) | func SetCell(x, y int, ch rune, fg, bg Attribute) {
  function CellBuffer (line 162) | func CellBuffer() []Cell {
  function PollEvent (line 167) | func PollEvent() Event {
  function Size (line 180) | func Size() (int, int) {
  function Clear (line 185) | func Clear(fg, bg Attribute) error {
  function SetInputMode (line 205) | func SetInputMode(mode InputMode) InputMode {
  function SetOutputMode (line 229) | func SetOutputMode(mode OutputMode) OutputMode {
  function Sync (line 237) | func Sync() error {

FILE: vendor/github.com/nsf/termbox-go/collect_terminfo.py
  function escaped (line 5) | def escaped(s):
  function tput (line 8) | def tput(term, name):
  function w (line 15) | def w(s):
  function iter_pairs (line 69) | def iter_pairs(iterable):
  function do_term (line 74) | def do_term(term, nick):
  function do_terms (line 94) | def do_terms(d):

FILE: vendor/github.com/nsf/termbox-go/syscalls.go
  type syscall_Termios (line 11) | type syscall_Termios
  constant syscall_IGNBRK (line 14) | syscall_IGNBRK = C.IGNBRK
  constant syscall_BRKINT (line 15) | syscall_BRKINT = C.BRKINT
  constant syscall_PARMRK (line 16) | syscall_PARMRK = C.PARMRK
  constant syscall_ISTRIP (line 17) | syscall_ISTRIP = C.ISTRIP
  constant syscall_INLCR (line 18) | syscall_INLCR  = C.INLCR
  constant syscall_IGNCR (line 19) | syscall_IGNCR  = C.IGNCR
  constant syscall_ICRNL (line 20) | syscall_ICRNL  = C.ICRNL
  constant syscall_IXON (line 21) | syscall_IXON   = C.IXON
  constant syscall_OPOST (line 22) | syscall_OPOST  = C.OPOST
  constant syscall_ECHO (line 23) | syscall_ECHO   = C.ECHO
  constant syscall_ECHONL (line 24) | syscall_ECHONL = C.ECHONL
  constant syscall_ICANON (line 25) | syscall_ICANON = C.ICANON
  constant syscall_ISIG (line 26) | syscall_ISIG   = C.ISIG
  constant syscall_IEXTEN (line 27) | syscall_IEXTEN = C.IEXTEN
  constant syscall_CSIZE (line 28) | syscall_CSIZE  = C.CSIZE
  constant syscall_PARENB (line 29) | syscall_PARENB = C.PARENB
  constant syscall_CS8 (line 30) | syscall_CS8    = C.CS8
  constant syscall_VMIN (line 31) | syscall_VMIN   = C.VMIN
  constant syscall_VTIME (line 32) | syscall_VTIME  = C.VTIME
  constant syscall_TCGETS (line 37) | syscall_TCGETS = C.TCGETS
  constant syscall_TCSETS (line 38) | syscall_TCSETS = C.TCSETS

FILE: vendor/github.com/nsf/termbox-go/syscalls_darwin.go
  type syscall_Termios (line 8) | type syscall_Termios struct
  constant syscall_IGNBRK (line 19) | syscall_IGNBRK = 0x1
  constant syscall_BRKINT (line 20) | syscall_BRKINT = 0x2
  constant syscall_PARMRK (line 21) | syscall_PARMRK = 0x8
  constant syscall_ISTRIP (line 22) | syscall_ISTRIP = 0x20
  constant syscall_INLCR (line 23) | syscall_INLCR  = 0x40
  constant syscall_IGNCR (line 24) | syscall_IGNCR  = 0x80
  constant syscall_ICRNL (line 25) | syscall_ICRNL  = 0x100
  constant syscall_IXON (line 26) | syscall_IXON   = 0x200
  constant syscall_OPOST (line 27) | syscall_OPOST  = 0x1
  constant syscall_ECHO (line 28) | syscall_ECHO   = 0x8
  constant syscall_ECHONL (line 29) | syscall_ECHONL = 0x10
  constant syscall_ICANON (line 30) | syscall_ICANON = 0x100
  constant syscall_ISIG (line 31) | syscall_ISIG   = 0x80
  constant syscall_IEXTEN (line 32) | syscall_IEXTEN = 0x400
  constant syscall_CSIZE (line 33) | syscall_CSIZE  = 0x300
  constant syscall_PARENB (line 34) | syscall_PARENB = 0x1000
  constant syscall_CS8 (line 35) | syscall_CS8    = 0x300
  constant syscall_VMIN (line 36) | syscall_VMIN   = 0x10
  constant syscall_VTIME (line 37) | syscall_VTIME  = 0x11
  constant syscall_TCGETS (line 39) | syscall_TCGETS = 0x402c7413
  constant syscall_TCSETS (line 40) | syscall_TCSETS = 0x802c7414

FILE: vendor/github.com/nsf/termbox-go/syscalls_darwin_amd64.go
  type syscall_Termios (line 6) | type syscall_Termios struct
  constant syscall_IGNBRK (line 18) | syscall_IGNBRK = 0x1
  constant syscall_BRKINT (line 19) | syscall_BRKINT = 0x2
  constant syscall_PARMRK (line 20) | syscall_PARMRK = 0x8
  constant syscall_ISTRIP (line 21) | syscall_ISTRIP = 0x20
  constant syscall_INLCR (line 22) | syscall_INLCR  = 0x40
  constant syscall_IGNCR (line 23) | syscall_IGNCR  = 0x80
  constant syscall_ICRNL (line 24) | syscall_ICRNL  = 0x100
  constant syscall_IXON (line 25) | syscall_IXON   = 0x200
  constant syscall_OPOST (line 26) | syscall_OPOST  = 0x1
  constant syscall_ECHO (line 27) | syscall_ECHO   = 0x8
  constant syscall_ECHONL (line 28) | syscall_ECHONL = 0x10
  constant syscall_ICANON (line 29) | syscall_ICANON = 0x100
  constant syscall_ISIG (line 30) | syscall_ISIG   = 0x80
  constant syscall_IEXTEN (line 31) | syscall_IEXTEN = 0x400
  constant syscall_CSIZE (line 32) | syscall_CSIZE  = 0x300
  constant syscall_PARENB (line 33) | syscall_PARENB = 0x1000
  constant syscall_CS8 (line 34) | syscall_CS8    = 0x300
  constant syscall_VMIN (line 35) | syscall_VMIN   = 0x10
  constant syscall_VTIME (line 36) | syscall_VTIME  = 0x11
  constant syscall_TCGETS (line 38) | syscall_TCGETS = 0x40487413
  constant syscall_TCSETS (line 39) | syscall_TCSETS = 0x80487414

FILE: vendor/github.com/nsf/termbox-go/syscalls_dragonfly.go
  type syscall_Termios (line 6) | type syscall_Termios struct
  constant syscall_IGNBRK (line 17) | syscall_IGNBRK = 0x1
  constant syscall_BRKINT (line 18) | syscall_BRKINT = 0x2
  constant syscall_PARMRK (line 19) | syscall_PARMRK = 0x8
  constant syscall_ISTRIP (line 20) | syscall_ISTRIP = 0x20
  constant syscall_INLCR (line 21) | syscall_INLCR  = 0x40
  constant syscall_IGNCR (line 22) | syscall_IGNCR  = 0x80
  constant syscall_ICRNL (line 23) | syscall_ICRNL  = 0x100
  constant syscall_IXON (line 24) | syscall_IXON   = 0x200
  constant syscall_OPOST (line 25) | syscall_OPOST  = 0x1
  constant syscall_ECHO (line 26) | syscall_ECHO   = 0x8
  constant syscall_ECHONL (line 27) | syscall_ECHONL = 0x10
  constant syscall_ICANON (line 28) | syscall_ICANON = 0x100
  constant syscall_ISIG (line 29) | syscall_ISIG   = 0x80
  constant syscall_IEXTEN (line 30) | syscall_IEXTEN = 0x400
  constant syscall_CSIZE (line 31) | syscall_CSIZE  = 0x300
  constant syscall_PARENB (line 32) | syscall_PARENB = 0x1000
  constant syscall_CS8 (line 33) | syscall_CS8    = 0x300
  constant syscall_VMIN (line 34) | syscall_VMIN   = 0x10
  constant syscall_VTIME (line 35) | syscall_VTIME  = 0x11
  constant syscall_TCGETS (line 37) | syscall_TCGETS = 0x402c7413
  constant syscall_TCSETS (line 38) | syscall_TCSETS = 0x802c7414

FILE: vendor/github.com/nsf/termbox-go/syscalls_freebsd.go
  type syscall_Termios (line 6) | type syscall_Termios struct
  constant syscall_IGNBRK (line 17) | syscall_IGNBRK = 0x1
  constant syscall_BRKINT (line 18) | syscall_BRKINT = 0x2
  constant syscall_PARMRK (line 19) | syscall_PARMRK = 0x8
  constant syscall_ISTRIP (line 20) | syscall_ISTRIP = 0x20
  constant syscall_INLCR (line 21) | syscall_INLCR  = 0x40
  constant syscall_IGNCR (line 22) | syscall_IGNCR  = 0x80
  constant syscall_ICRNL (line 23) | syscall_ICRNL  = 0x100
  constant syscall_IXON (line 24) | syscall_IXON   = 0x200
  constant syscall_OPOST (line 25) | syscall_OPOST  = 0x1
  constant syscall_ECHO (line 26) | syscall_ECHO   = 0x8
  constant syscall_ECHONL (line 27) | syscall_ECHONL = 0x10
  constant syscall_ICANON (line 28) | syscall_ICANON = 0x100
  constant syscall_ISIG (line 29) | syscall_ISIG   = 0x80
  constant syscall_IEXTEN (line 30) | syscall_IEXTEN = 0x400
  constant syscall_CSIZE (line 31) | syscall_CSIZE  = 0x300
  constant syscall_PARENB (line 32) | syscall_PARENB = 0x1000
  constant syscall_CS8 (line 33) | syscall_CS8    = 0x300
  constant syscall_VMIN (line 34) | syscall_VMIN   = 0x10
  constant syscall_VTIME (line 35) | syscall_VTIME  = 0x11
  constant syscall_TCGETS (line 37) | syscall_TCGETS = 0x402c7413
  constant syscall_TCSETS (line 38) | syscall_TCSETS = 0x802c7414

FILE: vendor/github.com/nsf/termbox-go/syscalls_linux.go
  type syscall_Termios (line 8) | type syscall_Termios
  constant syscall_IGNBRK (line 11) | syscall_IGNBRK = syscall.IGNBRK
  constant syscall_BRKINT (line 12) | syscall_BRKINT = syscall.BRKINT
  constant syscall_PARMRK (line 13) | syscall_PARMRK = syscall.PARMRK
  constant syscall_ISTRIP (line 14) | syscall_ISTRIP = syscall.ISTRIP
  constant syscall_INLCR (line 15) | syscall_INLCR  = syscall.INLCR
  constant syscall_IGNCR (line 16) | syscall_IGNCR  = syscall.IGNCR
  constant syscall_ICRNL (line 17) | syscall_ICRNL  = syscall.ICRNL
  constant syscall_IXON (line 18) | syscall_IXON   = syscall.IXON
  constant syscall_OPOST (line 19) | syscall_OPOST  = syscall.OPOST
  constant syscall_ECHO (line 20) | syscall_ECHO   = syscall.ECHO
  constant syscall_ECHONL (line 21) | syscall_ECHONL = syscall.ECHONL
  constant syscall_ICANON (line 22) | syscall_ICANON = syscall.ICANON
  constant syscall_ISIG (line 23) | syscall_ISIG   = syscall.ISIG
  constant syscall_IEXTEN (line 24) | syscall_IEXTEN = syscall.IEXTEN
  constant syscall_CSIZE (line 25) | syscall_CSIZE  = syscall.CSIZE
  constant syscall_PARENB (line 26) | syscall_PARENB = syscall.PARENB
  constant syscall_CS8 (line 27) | syscall_CS8    = syscall.CS8
  constant syscall_VMIN (line 28) | syscall_VMIN   = syscall.VMIN
  constant syscall_VTIME (line 29) | syscall_VTIME  = syscall.VTIME
  constant syscall_TCGETS (line 31) | syscall_TCGETS = syscall.TCGETS
  constant syscall_TCSETS (line 32) | syscall_TCSETS = syscall.TCSETS

FILE: vendor/github.com/nsf/termbox-go/syscalls_netbsd.go
  type syscall_Termios (line 6) | type syscall_Termios struct
  constant syscall_IGNBRK (line 17) | syscall_IGNBRK = 0x1
  constant syscall_BRKINT (line 18) | syscall_BRKINT = 0x2
  constant syscall_PARMRK (line 19) | syscall_PARMRK = 0x8
  constant syscall_ISTRIP (line 20) | syscall_ISTRIP = 0x20
  constant syscall_INLCR (line 21) | syscall_INLCR  = 0x40
  constant syscall_IGNCR (line 22) | syscall_IGNCR  = 0x80
  constant syscall_ICRNL (line 23) | syscall_ICRNL  = 0x100
  constant syscall_IXON (line 24) | syscall_IXON   = 0x200
  constant syscall_OPOST (line 25) | syscall_OPOST  = 0x1
  constant syscall_ECHO (line 26) | syscall_ECHO   = 0x8
  constant syscall_ECHONL (line 27) | syscall_ECHONL = 0x10
  constant syscall_ICANON (line 28) | syscall_ICANON = 0x100
  constant syscall_ISIG (line 29) | syscall_ISIG   = 0x80
  constant syscall_IEXTEN (line 30) | syscall_IEXTEN = 0x400
  constant syscall_CSIZE (line 31) | syscall_CSIZE  = 0x300
  constant syscall_PARENB (line 32) | syscall_PARENB = 0x1000
  constant syscall_CS8 (line 33) | syscall_CS8    = 0x300
  constant syscall_VMIN (line 34) | syscall_VMIN   = 0x10
  constant syscall_VTIME (line 35) | syscall_VTIME  = 0x11
  constant syscall_TCGETS (line 37) | syscall_TCGETS = 0x402c7413
  constant syscall_TCSETS (line 38) | syscall_TCSETS = 0x802c7414

FILE: vendor/github.com/nsf/termbox-go/syscalls_openbsd.go
  type syscall_Termios (line 6) | type syscall_Termios struct
  constant syscall_IGNBRK (line 17) | syscall_IGNBRK = 0x1
  constant syscall_BRKINT (line 18) | syscall_BRKINT = 0x2
  constant syscall_PARMRK (line 19) | syscall_PARMRK = 0x8
  constant syscall_ISTRIP (line 20) | syscall_ISTRIP = 0x20
  constant syscall_INLCR (line 21) | syscall_INLCR  = 0x40
  constant syscall_IGNCR (line 22) | syscall_IGNCR  = 0x80
  constant syscall_ICRNL (line 23) | syscall_ICRNL  = 0x100
  constant syscall_IXON (line 24) | syscall_IXON   = 0x200
  constant syscall_OPOST (line 25) | syscall_OPOST  = 0x1
  constant syscall_ECHO (line 26) | syscall_ECHO   = 0x8
  constant syscall_ECHONL (line 27) | syscall_ECHONL = 0x10
  constant syscall_ICANON (line 28) | syscall_ICANON = 0x100
  constant syscall_ISIG (line 29) | syscall_ISIG   = 0x80
  constant syscall_IEXTEN (line 30) | syscall_IEXTEN = 0x400
  constant syscall_CSIZE (line 31) | syscall_CSIZE  = 0x300
  constant syscall_PARENB (line 32) | syscall_PARENB = 0x1000
  constant syscall_CS8 (line 33) | syscall_CS8    = 0x300
  constant syscall_VMIN (line 34) | syscall_VMIN   = 0x10
  constant syscall_VTIME (line 35) | syscall_VTIME  = 0x11
  constant syscall_TCGETS (line 37) | syscall_TCGETS = 0x402c7413
  constant syscall_TCSETS (line 38) | syscall_TCSETS = 0x802c7414

FILE: vendor/github.com/nsf/termbox-go/syscalls_windows.go
  constant foreground_blue (line 7) | foreground_blue          = 0x1
  constant foreground_green (line 8) | foreground_green         = 0x2
  constant foreground_red (line 9) | foreground_red           = 0x4
  constant foreground_intensity (line 10) | foreground_intensity     = 0x8
  constant background_blue (line 11) | background_blue          = 0x10
  constant background_green (line 12) | background_green         = 0x20
  constant background_red (line 13) | background_red           = 0x40
  constant background_intensity (line 14) | background_intensity     = 0x80
  constant std_input_handle (line 15) | std_input_handle         = -0xa
  constant std_output_handle (line 16) | std_output_handle        = -0xb
  constant key_event (line 17) | key_event                = 0x1
  constant mouse_event (line 18) | mouse_event              = 0x2
  constant window_buffer_size_event (line 19) | window_buffer_size_event = 0x4
  constant enable_window_input (line 20) | enable_window_input      = 0x8
  constant enable_mouse_input (line 21) | enable_mouse_input       = 0x10
  constant enable_extended_flags (line 22) | enable_extended_flags    = 0x80
  constant vk_f1 (line 24) | vk_f1          = 0x70
  constant vk_f2 (line 25) | vk_f2          = 0x71
  constant vk_f3 (line 26) | vk_f3          = 0x72
  constant vk_f4 (line 27) | vk_f4          = 0x73
  constant vk_f5 (line 28) | vk_f5          = 0x74
  constant vk_f6 (line 29) | vk_f6          = 0x75
  constant vk_f7 (line 30) | vk_f7          = 0x76
  constant vk_f8 (line 31) | vk_f8          = 0x77
  constant vk_f9 (line 32) | vk_f9          = 0x78
  constant vk_f10 (line 33) | vk_f10         = 0x79
  constant vk_f11 (line 34) | vk_f11         = 0x7a
  constant vk_f12 (line 35) | vk_f12         = 0x7b
  constant vk_insert (line 36) | vk_insert      = 0x2d
  constant vk_delete (line 37) | vk_delete      = 0x2e
  constant vk_home (line 38) | vk_home        = 0x24
  constant vk_end (line 39) | vk_end         = 0x23
  constant vk_pgup (line 40) | vk_pgup        = 0x21
  constant vk_pgdn (line 41) | vk_pgdn        = 0x22
  constant vk_arrow_up (line 42) | vk_arrow_up    = 0x26
  constant vk_arrow_down (line 43) | vk_arrow_down  = 0x28
  constant vk_arrow_left (line 44) | vk_arrow_left  = 0x25
  constant vk_arrow_right (line 45) | vk_arrow_right = 0x27
  constant vk_backspace (line 46) | vk_backspace   = 0x8
  constant vk_tab (line 47) | vk_tab         = 0x9
  constant vk_enter (line 48) | vk_enter       = 0xd
  constant vk_esc (line 49) | vk_esc         = 0x1b
  constant vk_space (line 50) | vk_space       = 0x20
  constant left_alt_pressed (line 52) | left_alt_pressed   = 0x2
  constant left_ctrl_pressed (line 53) | left_ctrl_pressed  = 0x8
  constant right_alt_pressed (line 54) | right_alt_pressed  = 0x1
  constant right_ctrl_pressed (line 55) | right_ctrl_pressed = 0x4
  constant shift_pressed (line 56) | shift_pressed      = 0x10
  constant generic_read (line 58) | generic_read            = 0x80000000
  constant generic_write (line 59) | generic_write           = 0x40000000
  constant console_textmode_buffer (line 60) | console_textmode_buffer = 0x1

FILE: vendor/github.com/nsf/termbox-go/termbox.go
  constant t_enter_ca (line 17) | t_enter_ca = iota
  constant t_exit_ca (line 18) | t_exit_ca
  constant t_show_cursor (line 19) | t_show_cursor
  constant t_hide_cursor (line 20) | t_hide_cursor
  constant t_clear_screen (line 21) | t_clear_screen
  constant t_sgr0 (line 22) | t_sgr0
  constant t_underline (line 23) | t_underline
  constant t_bold (line 24) | t_bold
  constant t_blink (line 25) | t_blink
  constant t_reverse (line 26) | t_reverse
  constant t_enter_keypad (line 27) | t_enter_keypad
  constant t_exit_keypad (line 28) | t_exit_keypad
  constant t_enter_mouse (line 29) | t_enter_mouse
  constant t_exit_mouse (line 30) | t_exit_mouse
  constant t_max_funcs (line 31) | t_max_funcs
  constant coord_invalid (line 35) | coord_invalid = -2
  constant attr_invalid (line 36) | attr_invalid  = Attribute(0xFFFF)
  type input_event (line 39) | type input_event struct
  function write_cursor (line 83) | func write_cursor(x, y int) {
  function write_sgr_fg (line 91) | func write_sgr_fg(a Attribute) {
  function write_sgr_bg (line 104) | func write_sgr_bg(a Attribute) {
  function write_sgr (line 117) | func write_sgr(fg, bg Attribute) {
  type winsize (line 135) | type winsize struct
  function get_term_size (line 142) | func get_term_size(fd uintptr) (int, int) {
  function send_attr (line 149) | func send_attr(fg, bg Attribute) {
  function send_char (line 223) | func send_char(x, y int, ch rune) {
  function flush (line 233) | func flush() error {
  function send_clear (line 239) | func send_clear() error {
  function update_size_maybe (line 257) | func update_size_maybe() error {
  function tcsetattr (line 269) | func tcsetattr(fd uintptr, termios *syscall_Termios) error {
  function tcgetattr (line 278) | func tcgetattr(fd uintptr, termios *syscall_Termios) error {
  function parse_mouse_event (line 287) | func parse_mouse_event(event *Event, buf string) (int, bool) {
  function parse_escape_sequence (line 410) | func parse_escape_sequence(event *Event, buf []byte) (int, bool) {
  function extract_raw_event (line 424) | func extract_raw_event(data []byte, event *Event) bool {
  function extract_event (line 443) | func extract_event(inbuf []byte, event *Event) bool {
  function fcntl (line 503) | func fcntl(fd int, cmd int, arg int) (val int, err error) {

FILE: vendor/github.com/nsf/termbox-go/termbox_common.go
  type cellbuf (line 5) | type cellbuf struct
    method init (line 11) | func (this *cellbuf) init(width, height int) {
    method resize (line 17) | func (this *cellbuf) resize(width, height int) {
    method clear (line 46) | func (this *cellbuf) clear() {
  constant cursor_hidden (line 55) | cursor_hidden = -1
  function is_cursor_hidden (line 57) | func is_cursor_hidden(x, y int) bool {

FILE: vendor/github.com/nsf/termbox-go/termbox_windows.go
  type wchar (line 9) | type wchar
  type short (line 10) | type short
  type dword (line 11) | type dword
  type word (line 12) | type word
  type char_info (line 13) | type char_info struct
  type coord (line 17) | type coord struct
    method uintptr (line 70) | func (this coord) uintptr() uintptr {
  type small_rect (line 21) | type small_rect struct
  type console_screen_buffer_info (line 27) | type console_screen_buffer_info struct
  type console_cursor_info (line 34) | type console_cursor_info struct
  type input_record (line 38) | type input_record struct
  type key_event_record (line 43) | type key_event_record struct
  type window_buffer_size_record (line 51) | type window_buffer_size_record struct
  type mouse_event_record (line 54) | type mouse_event_record struct
  constant mouse_lmb (line 63) | mouse_lmb = 0x1
  constant mouse_rmb (line 64) | mouse_rmb = 0x2
  constant mouse_mmb (line 65) | mouse_mmb = 0x4 | 0x8 | 0x10
  constant SM_CXMIN (line 66) | SM_CXMIN  = 28
  constant SM_CYMIN (line 67) | SM_CYMIN  = 29
  function set_console_active_screen_buffer (line 100) | func set_console_active_screen_buffer(h syscall.Handle) (err error) {
  function set_console_screen_buffer_size (line 113) | func set_console_screen_buffer_size(h syscall.Handle, size coord) (err e...
  function create_console_screen_buffer (line 126) | func create_console_screen_buffer() (h syscall.Handle, err error) {
  function get_console_screen_buffer_info (line 139) | func get_console_screen_buffer_info(h syscall.Handle, info *console_scre...
  function write_console_output (line 152) | func write_console_output(h syscall.Handle, chars []char_info, dst small...
  function write_console_output_character (line 168) | func write_console_output_character(h syscall.Handle, chars []wchar, pos...
  function write_console_output_attribute (line 182) | func write_console_output_attribute(h syscall.Handle, attrs []word, pos ...
  function set_console_cursor_info (line 196) | func set_console_cursor_info(h syscall.Handle, info *console_cursor_info...
  function get_console_cursor_info (line 209) | func get_console_cursor_info(h syscall.Handle, info *console_cursor_info...
  function set_console_cursor_position (line 222) | func set_console_cursor_position(h syscall.Handle, pos coord) (err error) {
  function read_console_input (line 235) | func read_console_input(h syscall.Handle, record *input_record) (err err...
  function get_console_mode (line 248) | func get_console_mode(h syscall.Handle, mode *dword) (err error) {
  function set_console_mode (line 261) | func set_console_mode(h syscall.Handle, mode dword) (err error) {
  function fill_console_output_character (line 274) | func fill_console_output_character(h syscall.Handle, char wchar, n int) ...
  function fill_console_output_attribute (line 288) | func fill_console_output_attribute(h syscall.Handle, attr word, n int) (...
  function create_event (line 302) | func create_event() (out syscall.Handle, err error) {
  function wait_for_multiple_objects (line 315) | func wait_for_multiple_objects(objects []syscall.Handle) (err error) {
  function set_event (line 329) | func set_event(ev syscall.Handle) (err error) {
  type diff_msg (line 342) | type diff_msg struct
  type input_event (line 348) | type input_event struct
  function get_cursor_position (line 388) | func get_cursor_position(out syscall.Handle) coord {
  function get_term_size (line 396) | func get_term_size(out syscall.Handle) coord {
  function get_win_min_size (line 404) | func get_win_min_size(out syscall.Handle) coord {
  function get_win_size (line 420) | func get_win_size(out syscall.Handle) coord {
  function update_size_maybe (line 444) | func update_size_maybe() {
  constant replacement_char (line 485) | replacement_char = '\uFFFD'
  constant max_rune (line 486) | max_rune         = '\U0010FFFF'
  constant surr1 (line 487) | surr1            = 0xd800
  constant surr2 (line 488) | surr2            = 0xdc00
  constant surr3 (line 489) | surr3            = 0xe000
  constant surr_self (line 490) | surr_self        = 0x10000
  function append_diff_line (line 493) | func append_diff_line(y int) int {
  function prepare_diff_messages (line 518) | func prepare_diff_messages() {
  function get_ct (line 558) | func get_ct(table []word, idx int) word {
  function cell_to_char_info (line 566) | func cell_to_char_info(c Cell) (attr word, wc [2]wchar) {
  function move_cursor (line 589) | func move_cursor(x, y int) {
  function show_cursor (line 596) | func show_cursor(visible bool) {
  function clear (line 611) | func clear() {
  function key_event_record_to_event (line 633) | func key_event_record_to_event(r *key_event_record) (Event, bool) {
  function input_event_producer (line 784) | func input_event_producer() {

FILE: vendor/github.com/nsf/termbox-go/terminfo.go
  constant ti_magic (line 24) | ti_magic         = 0432
  constant ti_header_length (line 25) | ti_header_length = 12
  constant ti_mouse_enter (line 26) | ti_mouse_enter   = "\x1b[?1000h\x1b[?1002h\x1b[?1015h\x1b[?1006h"
  constant ti_mouse_leave (line 27) | ti_mouse_leave   = "\x1b[?1006l\x1b[?1015l\x1b[?1002l\x1b[?1000l"
  function load_terminfo (line 30) | func load_terminfo() ([]byte, error) {
  function ti_try_path (line 76) | func ti_try_path(path string) (data []byte, err error) {
  function setup_term_builtin (line 93) | func setup_term_builtin() error {
  function setup_term (line 134) | func setup_term() (err error) {
  function ti_read_string (line 182) | func ti_read_string(rd *bytes.Reader, str_off, table int16) (string, err...

FILE: vendor/github.com/spf13/cobra/args.go
  type PositionalArgs (line 7) | type PositionalArgs
  function legacyArgs (line 13) | func legacyArgs(cmd *Command, args []string) error {
  function NoArgs (line 27) | func NoArgs(cmd *Command, args []string) error {
  function OnlyValidArgs (line 35) | func OnlyValidArgs(cmd *Command, args []string) error {
  function ArbitraryArgs (line 47) | func ArbitraryArgs(cmd *Command, args []string) error {
  function MinimumNArgs (line 52) | func MinimumNArgs(n int) PositionalArgs {
  function MaximumNArgs (line 62) | func MaximumNArgs(n int) PositionalArgs {
  function ExactArgs (line 72) | func ExactArgs(n int) PositionalArgs {
  function RangeArgs (line 82) | func RangeArgs(min int, max int) PositionalArgs {

FILE: vendor/github.com/spf13/cobra/args_test.go
  function TestNoArgs (line 8) | func TestNoArgs(t *testing.T) {
  function TestNoArgsWithArgs (line 20) | func TestNoArgsWithArgs(t *testing.T) {
  function TestOnlyValidArgs (line 35) | func TestOnlyValidArgs(t *testing.T) {
  function TestOnlyValidArgsWithInvalidArgs (line 52) | func TestOnlyValidArgsWithInvalidArgs(t *testing.T) {
  function TestArbitraryArgs (line 72) | func TestArbitraryArgs(t *testing.T) {
  function TestMinimumNArgs (line 83) | func TestMinimumNArgs(t *testing.T) {
  function TestMinimumNArgsWithLessArgs (line 94) | func TestMinimumNArgsWithLessArgs(t *testing.T) {
  function TestMaximumNArgs (line 109) | func TestMaximumNArgs(t *testing.T) {
  function TestMaximumNArgsWithMoreArgs (line 120) | func TestMaximumNArgsWithMoreArgs(t *testing.T) {
  function TestExactArgs (line 135) | func TestExactArgs(t *testing.T) {
  function TestExactArgsWithInvalidCount (line 146) | func TestExactArgsWithInvalidCount(t *testing.T) {
  function TestRangeArgs (line 161) | func TestRangeArgs(t *testing.T) {
  function TestRangeArgsWithInvalidCount (line 172) | func TestRangeArgsWithInvalidCount(t *testing.T) {
  function TestRootTakesNoArgs (line 187) | func TestRootTakesNoArgs(t *testing.T) {
  function TestRootTakesArgs (line 204) | func TestRootTakesArgs(t *testing.T) {
  function TestChildTakesNoArgs (line 215) | func TestChildTakesNoArgs(t *testing.T) {
  function TestChildTakesArgs (line 232) | func TestChildTakesArgs(t *testing.T) {

FILE: vendor/github.com/spf13/cobra/bash_completions.go
  constant BashCompFilenameExt (line 16) | BashCompFilenameExt     = "cobra_annotation_bash_completion_filename_ext...
  constant BashCompCustom (line 17) | BashCompCustom          = "cobra_annotation_bash_completion_custom"
  constant BashCompOneRequiredFlag (line 18) | BashCompOneRequiredFlag = "cobra_annotation_bash_completion_one_required...
  constant BashCompSubdirsInDir (line 19) | BashCompSubdirsInDir    = "cobra_annotation_bash_completion_subdirs_in_dir"
  function writePreamble (line 22) | func writePreamble(buf *bytes.Buffer, name string) {
  function writePostscript (line 254) | func writePostscript(buf *bytes.Buffer, name string) {
  function writeCommands (line 292) | func writeCommands(buf *bytes.Buffer, cmd *Command) {
  function writeFlagHandler (line 303) | func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[st...
  function writeShortFlag (line 338) | func writeShortFlag(buf *bytes.Buffer, flag *pflag.Flag) {
  function writeFlag (line 349) | func writeFlag(buf *bytes.Buffer, flag *pflag.Flag) {
  function writeLocalNonPersistentFlag (line 360) | func writeLocalNonPersistentFlag(buf *bytes.Buffer, flag *pflag.Flag) {
  function writeFlags (line 370) | func writeFlags(buf *bytes.Buffer, cmd *Command) {
  function writeRequiredFlag (line 404) | func writeRequiredFlag(buf *bytes.Buffer, cmd *Command) {
  function writeRequiredNouns (line 429) | func writeRequiredNouns(buf *bytes.Buffer, cmd *Command) {
  function writeArgAliases (line 437) | func writeArgAliases(buf *bytes.Buffer, cmd *Command) {
  function gen (line 445) | func gen(buf *bytes.Buffer, cmd *Command) {
  method GenBashCompletion (line 466) | func (c *Command) GenBashCompletion(w io.Writer) error {
  function nonCompletableFlag (line 479) | func nonCompletableFlag(flag *pflag.Flag) bool {
  method GenBashCompletionFile (line 484) | func (c *Command) GenBashCompletionFile(filename string) error {
  method MarkFlagRequired (line 495) | func (c *Command) MarkFlagRequired(name string) error {
  method MarkPersistentFlagRequired (line 500) | func (c *Command) MarkPersistentFlagRequired(name string) error {
  function MarkFlagRequired (line 505) | func MarkFlagRequired(flags *pflag.FlagSet, name string) error {
  method MarkFlagFilename (line 511) | func (c *Command) MarkFlagFilename(name string, extensions ...string) er...
  method MarkFlagCustom (line 517) | func (c *Command) MarkFlagCustom(name string, f string) error {
  method MarkPersistentFlagFilename (line 523) | func (c *Command) MarkPersistentFlagFilename(name string, extensions ......
  function MarkFlagFilename (line 529) | func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...s...
  function MarkFlagCustom (line 535) | func MarkFlagCustom(flags *pflag.FlagSet, name string, f string) error {

FILE: vendor/github.com/spf13/cobra/bash_completions_test.go
  function checkOmit (line 11) | func checkOmit(t *testing.T, found, unexpected string) {
  function check (line 17) | func check(t *testing.T, found, expected string) {
  function runShellCheck (line 23) | func runShellCheck(s string) error {
  constant bashCompletionFunc (line 44) | bashCompletionFunc = `__custom_func() {
  function TestBashCompletions (line 49) | func TestBashCompletions(t *testing.T) {
  function TestBashCompletionHiddenFlag (line 166) | func TestBashCompletionHiddenFlag(t *testing.T) {
  function TestBashCompletionDeprecatedFlag (line 182) | func TestBashCompletionDeprecatedFlag(t *testing.T) {

FILE: vendor/github.com/spf13/cobra/cobra.go
  function AddTemplateFunc (line 61) | func AddTemplateFunc(name string, tmplFunc interface{}) {
  function AddTemplateFuncs (line 67) | func AddTemplateFuncs(tmplFuncs template.FuncMap) {
  function OnInitialize (line 75) | func OnInitialize(y ...func()) {
  function Gt (line 84) | func Gt(a interface{}, b interface{}) bool {
  function Eq (line 114) | func Eq(a interface{}, b interface{}) bool {
  function trimRightSpace (line 129) | func trimRightSpace(s string) string {
  function appendIfNotPresent (line 136) | func appendIfNotPresent(s, stringToAppend string) string {
  function rpad (line 144) | func rpad(s string, padding int) string {
  function tmpl (line 150) | func tmpl(w io.Writer, text string, data interface{}) error {
  function ld (line 158) | func ld(s, t string, ignoreCase bool) int {
  function stringInSlice (line 193) | func stringInSlice(a string, list []string) bool {

FILE: vendor/github.com/spf13/cobra/cobra_test.go
  function TestAddTemplateFunctions (line 8) | func TestAddTemplateFunctions(t *testing.T) {

FILE: vendor/github.com/spf13/cobra/command.go
  type Command (line 34) | type Command struct
    method SetArgs (line 191) | func (c *Command) SetArgs(a []string) {
    method SetOutput (line 197) | func (c *Command) SetOutput(output io.Writer) {
    method SetUsageFunc (line 202) | func (c *Command) SetUsageFunc(f func(*Command) error) {
    method SetUsageTemplate (line 207) | func (c *Command) SetUsageTemplate(s string) {
    method SetFlagErrorFunc (line 213) | func (c *Command) SetFlagErrorFunc(f func(*Command, error) error) {
    method SetHelpFunc (line 218) | func (c *Command) SetHelpFunc(f func(*Command, []string)) {
    method SetHelpCommand (line 223) | func (c *Command) SetHelpCommand(cmd *Command) {
    method SetHelpTemplate (line 228) | func (c *Command) SetHelpTemplate(s string) {
    method SetVersionTemplate (line 233) | func (c *Command) SetVersionTemplate(s string) {
    method SetGlobalNormalizationFunc (line 239) | func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, n...
    method OutOrStdout (line 250) | func (c *Command) OutOrStdout() io.Writer {
    method OutOrStderr (line 255) | func (c *Command) OutOrStderr() io.Writer {
    method getOut (line 259) | func (c *Command) getOut(def io.Writer) io.Writer {
    method UsageFunc (line 271) | func (c *Command) UsageFunc() (f func(*Command) error) {
    method Usage (line 291) | func (c *Command) Usage() error {
    method HelpFunc (line 297) | func (c *Command) HelpFunc() func(*Command, []string) {
    method Help (line 316) | func (c *Command) Help() error {
    method UsageString (line 322) | func (c *Command) UsageString() string {
    method FlagErrorFunc (line 334) | func (c *Command) FlagErrorFunc() (f func(*Command, error) error) {
    method UsagePadding (line 350) | func (c *Command) UsagePadding() int {
    method CommandPathPadding (line 360) | func (c *Command) CommandPathPadding() int {
    method NamePadding (line 370) | func (c *Command) NamePadding() int {
    method UsageTemplate (line 378) | func (c *Command) UsageTemplate() string {
    method HelpTemplate (line 413) | func (c *Command) HelpTemplate() string {
    method VersionTemplate (line 427) | func (c *Command) VersionTemplate() string {
    method Find (line 515) | func (c *Command) Find(args []string) (*Command, []string, error) {
    method findSuggestions (line 539) | func (c *Command) findSuggestions(arg string) string {
    method findNext (line 556) | func (c *Command) findNext(next string) *Command {
    method Traverse (line 575) | func (c *Command) Traverse(args []string) (*Command, []string, error) {
    method SuggestionsFor (line 617) | func (c *Command) SuggestionsFor(typedName string) []string {
    method VisitParents (line 638) | func (c *Command) VisitParents(fn func(*Command)) {
    method Root (line 646) | func (c *Command) Root() *Command {
    method ArgsLenAtDash (line 655) | func (c *Command) ArgsLenAtDash() int {
    method execute (line 659) | func (c *Command) execute(a []string) (err error) {
    method preRun (line 774) | func (c *Command) preRun() {
    method Execute (line 783) | func (c *Command) Execute() error {
    method ExecuteC (line 789) | func (c *Command) ExecuteC() (cmd *Command, err error) {
    method ValidateArgs (line 855) | func (c *Command) ValidateArgs(args []string) error {
    method validateRequiredFlags (line 862) | func (c *Command) validateRequiredFlags() error {
    method InitDefaultHelpFlag (line 884) | func (c *Command) InitDefaultHelpFlag() {
    method InitDefaultVersionFlag (line 901) | func (c *Command) InitDefaultVersionFlag() {
    method InitDefaultHelpCmd (line 921) | func (c *Command) InitDefaultHelpCmd() {
    method ResetCommands (line 950) | func (c *Command) ResetCommands() {
    method Commands (line 965) | func (c *Command) Commands() []*Command {
    method AddCommand (line 975) | func (c *Command) AddCommand(cmds ...*Command) {
    method RemoveCommand (line 1004) | func (c *Command) RemoveCommand(cmds ...*Command) {
    method Print (line 1038) | func (c *Command) Print(i ...interface{}) {
    method Println (line 1043) | func (c *Command) Println(i ...interface{}) {
    method Printf (line 1048) | func (c *Command) Printf(format string, i ...interface{}) {
    method CommandPath (line 1053) | func (c *Command) CommandPath() string {
    method UseLine (line 1061) | func (c *Command) UseLine() string {
    method DebugFlags (line 1079) | func (c *Command) DebugFlags() {
    method Name (line 1119) | func (c *Command) Name() string {
    method HasAlias (line 1129) | func (c *Command) HasAlias(s string) bool {
    method hasNameOrAliasPrefix (line 1140) | func (c *Command) hasNameOrAliasPrefix(prefix string) bool {
    method NameAndAliases (line 1153) | func (c *Command) NameAndAliases() string {
    method HasExample (line 1158) | func (c *Command) HasExample() bool {
    method Runnable (line 1163) | func (c *Command) Runnable() bool {
    method HasSubCommands (line 1168) | func (c *Command) HasSubCommands() bool {
    method IsAvailableCommand (line 1174) | func (c *Command) IsAvailableCommand() bool {
    method IsAdditionalHelpTopicCommand (line 1195) | func (c *Command) IsAdditionalHelpTopicCommand() bool {
    method HasHelpSubCommands (line 1215) | func (c *Command) HasHelpSubCommands() bool {
    method HasAvailableSubCommands (line 1229) | func (c *Command) HasAvailableSubCommands() bool {
    method HasParent (line 1244) | func (c *Command) HasParent() bool {
    method GlobalNormalizationFunc (line 1249) | func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name...
    method Flags (line 1255) | func (c *Command) Flags() *flag.FlagSet {
    method LocalNonPersistentFlags (line 1268) | func (c *Command) LocalNonPersistentFlags() *flag.FlagSet {
    method LocalFlags (line 1281) | func (c *Command) LocalFlags() *flag.FlagSet {
    method InheritedFlags (line 1307) | func (c *Command) InheritedFlags() *flag.FlagSet {
    method NonInheritedFlags (line 1332) | func (c *Command) NonInheritedFlags() *flag.FlagSet {
    method PersistentFlags (line 1337) | func (c *Command) PersistentFlags() *flag.FlagSet {
    method ResetFlags (line 1349) | func (c *Command) ResetFlags() {
    method HasFlags (line 1363) | func (c *Command) HasFlags() bool {
    method HasPersistentFlags (line 1368) | func (c *Command) HasPersistentFlags() bool {
    method HasLocalFlags (line 1373) | func (c *Command) HasLocalFlags() bool {
    method HasInheritedFlags (line 1378) | func (c *Command) HasInheritedFlags() bool {
    method HasAvailableFlags (line 1384) | func (c *Command) HasAvailableFlags() bool {
    method HasAvailablePersistentFlags (line 1389) | func (c *Command) HasAvailablePersistentFlags() bool {
    method HasAvailableLocalFlags (line 1395) | func (c *Command) HasAvailableLocalFlags() bool {
    method HasAvailableInheritedFlags (line 1401) | func (c *Command) HasAvailableInheritedFlags() bool {
    method Flag (line 1406) | func (c *Command) Flag(name string) (flag *flag.Flag) {
    method persistentFlag (line 1417) | func (c *Command) persistentFlag(name string) (flag *flag.Flag) {
    method ParseFlags (line 1430) | func (c *Command) ParseFlags(args []string) error {
    method Parent (line 1450) | func (c *Command) Parent() *Command {
    method mergePersistentFlags (line 1456) | func (c *Command) mergePersistentFlags() {
    method updateParentsPflags (line 1465) | func (c *Command) updateParentsPflags() {
  function hasNoOptDefVal (line 439) | func hasNoOptDefVal(name string, fs *flag.FlagSet) bool {
  function shortHasNoOptDefVal (line 447) | func shortHasNoOptDefVal(name string, fs *flag.FlagSet) bool {
  function stripFlags (line 459) | func stripFlags(args []string, c *Command) []string {
  function argsMinusFirstX (line 496) | func argsMinusFirstX(args []string, x string) []string {
  function isFlagArg (line 508) | func isFlagArg(arg string) bool {
  type commandSorterByName (line 958) | type commandSorterByName
    method Len (line 960) | func (c commandSorterByName) Len() int           { return len(c) }
    method Swap (line 961) | func (c commandSorterByName) Swap(i, j int)      { c[i], c[j] = c[j], ...
    method Less (line 962) | func (c commandSorterByName) Less(i, j int) bool { return c[i].Name() ...

FILE: vendor/github.com/spf13/cobra/command_test.go
  function emptyRun (line 14) | func emptyRun(*Command, []string) {}
  function executeCommand (line 16) | func executeCommand(root *Command, args ...string) (output string, err e...
  function executeCommandC (line 21) | func executeCommandC(root *Command, args ...string) (c *Command, output ...
  function resetCommandLineFlagSet (line 31) | func resetCommandLineFlagSet() {
  function checkStringContains (line 35) | func checkStringContains(t *testing.T, got, expected string) {
  function checkStringOmits (line 41) | func checkStringOmits(t *testing.T, got, expected string) {
  function TestSingleCommand (line 47) | func TestSingleCommand(t *testing.T) {
  function TestChildCommand (line 73) | func TestChildCommand(t *testing.T) {
  function TestCallCommandWithoutSubcommands (line 99) | func TestCallCommandWithoutSubcommands(t *testing.T) {
  function TestRootExecuteUnknownCommand (line 107) | func TestRootExecuteUnknownCommand(t *testing.T) {
  function TestSubcommandExecuteC (line 120) | func TestSubcommandExecuteC(t *testing.T) {
  function TestRootUnknownCommandSilenced (line 138) | func TestRootUnknownCommandSilenced(t *testing.T) {
  function TestCommandAlias (line 150) | func TestCommandAlias(t *testing.T) {
  function TestEnablePrefixMatching (line 182) | func TestEnablePrefixMatching(t *testing.T) {
  function TestAliasPrefixMatching (line 212) | func TestAliasPrefixMatching(t *testing.T) {
  function TestChildSameName (line 251) | func TestChildSameName(t *testing.T) {
  function TestGrandChildSameName (line 280) | func TestGrandChildSameName(t *testing.T) {
  function TestFlagLong (line 307) | func TestFlagLong(t *testing.T) {
  function TestFlagShort (line 345) | func TestFlagShort(t *testing.T) {
  function TestChildFlag (line 380) | func TestChildFlag(t *testing.T) {
  function TestChildFlagWithParentLocalFlag (line 401) | func TestChildFlagWithParentLocalFlag(t *testing.T) {
  function TestFlagInvalidInput (line 422) | func TestFlagInvalidInput(t *testing.T) {
  function TestFlagBeforeCommand (line 434) | func TestFlagBeforeCommand(t *testing.T) {
  function TestStripFlags (line 461) | func TestStripFlags(t *testing.T) {
  function TestDisableFlagParsing (line 534) | func TestDisableFlagParsing(t *testing.T) {
  function TestPersistentFlagsOnSameCommand (line 558) | func TestPersistentFlagsOnSameCommand(t *testing.T) {
  function TestEmptyInputs (line 589) | func TestEmptyInputs(t *testing.T) {
  function TestOverwrittenFlag (line 608) | func TestOverwrittenFlag(t *testing.T) {
  function TestPersistentFlagsOnChild (line 640) | func TestPersistentFlagsOnChild(t *testing.T) {
  function TestRequiredFlags (line 676) | func TestRequiredFlags(t *testing.T) {
  function TestPersistentRequiredFlags (line 694) | func TestPersistentRequiredFlags(t *testing.T) {
  function TestInitHelpFlagMergesFlags (line 719) | func TestInitHelpFlagMergesFlags(t *testing.T) {
  function TestHelpCommandExecuted (line 733) | func TestHelpCommandExecuted(t *testing.T) {
  function TestHelpCommandExecutedOnChild (line 745) | func TestHelpCommandExecutedOnChild(t *testing.T) {
  function TestSetHelpCommand (line 758) | func TestSetHelpCommand(t *testing.T) {
  function TestHelpFlagExecuted (line 781) | func TestHelpFlagExecuted(t *testing.T) {
  function TestHelpFlagExecutedOnChild (line 792) | func TestHelpFlagExecutedOnChild(t *testing.T) {
  function TestHelpFlagInHelp (line 809) | func TestHelpFlagInHelp(t *testing.T) {
  function TestFlagsInUsage (line 823) | func TestFlagsInUsage(t *testing.T) {
  function TestHelpExecutedOnNonRunnableChild (line 833) | func TestHelpExecutedOnNonRunnableChild(t *testing.T) {
  function TestVersionFlagExecuted (line 846) | func TestVersionFlagExecuted(t *testing.T) {
  function TestVersionTemplate (line 857) | func TestVersionTemplate(t *testing.T) {
  function TestVersionFlagExecutedOnSubcommand (line 869) | func TestVersionFlagExecutedOnSubcommand(t *testing.T) {
  function TestVersionFlagOnlyAddedToRoot (line 881) | func TestVersionFlagOnlyAddedToRoot(t *testing.T) {
  function TestVersionFlagOnlyExistsIfVersionNonEmpty (line 893) | func TestVersionFlagOnlyExistsIfVersionNonEmpty(t *testing.T) {
  function TestUsageIsNotPrintedTwice (line 903) | func TestUsageIsNotPrintedTwice(t *testing.T) {
  function TestVisitParents (line 914) | func TestVisitParents(t *testing.T) {
  function TestSuggestions (line 943) | func TestSuggestions(t *testing.T) {
  function TestRemoveCommand (line 990) | func TestRemoveCommand(t *testing.T) {
  function TestReplaceCommandWithRemove (line 1002) | func TestReplaceCommandWithRemove(t *testing.T) {
  function TestDeprecatedCommand (line 1033) | func TestDeprecatedCommand(t *testing.T) {
  function TestHooks (line 1050) | func TestHooks(t *testing.T) {
  function TestPersistentHooks (line 1103) | func TestPersistentHooks(t *testing.T) {
  function TestGlobalNormFuncPropagation (line 1207) | func TestGlobalNormFuncPropagation(t *testing.T) {
  function TestNormPassedOnLocal (line 1227) | func TestNormPassedOnLocal(t *testing.T) {
  function TestNormPassedOnInherited (line 1241) | func TestNormPassedOnInherited(t *testing.T) {
  function TestConsistentNormalizedName (line 1269) | func TestConsistentNormalizedName(t *testing.T) {
  function TestFlagOnPflagCommandLine (line 1287) | func TestFlagOnPflagCommandLine(t *testing.T) {
  function TestHiddenCommandExecutes (line 1302) | func TestHiddenCommandExecutes(t *testing.T) {
  function TestHiddenCommandIsHidden (line 1324) | func TestHiddenCommandIsHidden(t *testing.T) {
  function TestCommandsAreSorted (line 1331) | func TestCommandsAreSorted(t *testing.T) {
  function TestEnableCommandSortingIsDisabled (line 1353) | func TestEnableCommandSortingIsDisabled(t *testing.T) {
  function TestSetOutput (line 1374) | func TestSetOutput(t *testing.T) {
  function TestFlagErrorFunc (line 1382) | func TestFlagErrorFunc(t *testing.T) {
  function TestSortedFlags (line 1402) | func TestSortedFlags(t *testing.T) {
  function TestMergeCommandLineToFlags (line 1428) | func TestMergeCommandLineToFlags(t *testing.T) {
  function TestUseDeprecatedFlags (line 1442) | func TestUseDeprecatedFlags(t *testing.T) {
  function TestTraverseWithParentFlags (line 1454) | func TestTraverseWithParentFlags(t *testing.T) {
  function TestTraverseNoParentFlags (line 1476) | func TestTraverseNoParentFlags(t *testing.T) {
  function TestTraverseWithBadParentFlags (line 1496) | func TestTraverseWithBadParentFlags(t *testing.T) {
  function TestTraverseWithBadChildFlag (line 1514) | func TestTraverseWithBadChildFlag(t *testing.T) {
  function TestTraverseWithTwoSubcommands (line 1535) | func TestTraverseWithTwoSubcommands(t *testing.T) {
  function TestUpdateName (line 1557) | func TestUpdateName(t *testing.T) {

FILE: vendor/github.com/spf13/cobra/command_win.go
  function preExecHook (line 14) | func preExecHook(c *Command) {

FILE: vendor/github.com/spf13/cobra/zsh_completions.go
  method GenZshCompletionFile (line 12) | func (c *Command) GenZshCompletionFile(filename string) error {
  method GenZshCompletion (line 23) | func (c *Command) GenZshCompletion(w io.Writer) error {
  function writeHeader (line 35) | func writeHeader(w io.Writer, cmd *Command) {
  function maxDepth (line 39) | func maxDepth(c *Command) int {
  function writeLevelMapping (line 53) | func writeLevelMapping(w io.Writer, numLevels int) {
  function writeLevelCases (line 63) | func writeLevelCases(w io.Writer, maxDepth int, root *Command) {
  function writeLevel (line 77) | func writeLevel(w io.Writer, root *Command, i int) {
  function filterByLevel (line 96) | func filterByLevel(c *Command, l int) []*Command {
  function groupByParent (line 108) | func groupByParent(commands []*Command) map[string][]*Command {
  function names (line 120) | func names(commands []*Command) []string {

FILE: vendor/github.com/spf13/cobra/zsh_completions_test.go
  function TestZshCompletion (line 9) | func TestZshCompletion(t *testing.T) {

FILE: vendor/github.com/spf13/pflag/bool.go
  type boolFlag (line 7) | type boolFlag interface
  type boolValue (line 13) | type boolValue
    method Set (line 20) | func (b *boolValue) Set(s string) error {
    method Type (line 26) | func (b *boolValue) Type() string {
    method String (line 30) | func (b *boolValue) String() string { return strconv.FormatBool(bool(*...
    method IsBoolFlag (line 32) | func (b *boolValue) IsBoolFlag() bool { return true }
  function newBoolValue (line 15) | func newBoolValue(val bool, p *bool) *boolValue {
  function boolConv (line 34) | func boolConv(sval string) (interface{}, error) {
  method GetBool (line 39) | func (f *FlagSet) GetBool(name string) (bool, error) {
  method BoolVar (line 49) | func (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string) {
  method BoolVarP (line 54) | func (f *FlagSet) BoolVarP(p *bool, name, shorthand string, value bool, ...
  function BoolVar (line 61) | func BoolVar(p *bool, name string, value bool, usage string) {
  function BoolVarP (line 66) | func BoolVarP(p *bool, name, shorthand string, value bool, usage string) {
  method Bool (line 73) | func (f *FlagSet) Bool(name string, value bool, usage string) *bool {
  method BoolP (line 78) | func (f *FlagSet) BoolP(name, shorthand string, value bool, usage string...
  function Bool (line 86) | func Bool(name string, value bool, usage string) *bool {
  function BoolP (line 91) | func BoolP(name, shorthand string, value bool, usage string) *bool {

FILE: vendor/github.com/spf13/pflag/bool_slice.go
  type boolSliceValue (line 10) | type boolSliceValue struct
    method Set (line 24) | func (s *boolSliceValue) Set(val string) error {
    method Type (line 57) | func (s *boolSliceValue) Type() string {
    method String (line 62) | func (s *boolSliceValue) String() string {
  function newBoolSliceValue (line 15) | func newBoolSliceValue(val []bool, p *[]bool) *boolSliceValue {
  function boolSliceConv (line 74) | func boolSliceConv(val string) (interface{}, error) {
  method GetBoolSlice (line 93) | func (f *FlagSet) GetBoolSlice(name string) ([]bool, error) {
  method BoolSliceVar (line 103) | func (f *FlagSet) BoolSliceVar(p *[]bool, name string, value []bool, usa...
  method BoolSliceVarP (line 108) | func (f *FlagSet) BoolSliceVarP(p *[]bool, name, shorthand string, value...
  function BoolSliceVar (line 114) | func BoolSliceVar(p *[]bool, name string, value []bool, usage string) {
  function BoolSliceVarP (line 119) | func BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usag...
  method BoolSlice (line 125) | func (f *FlagSet) BoolSlice(name string, value []bool, usage string) *[]...
  method BoolSliceP (line 132) | func (f *FlagSet) BoolSliceP(name, shorthand string, value []bool, usage...
  function BoolSlice (line 140) | func BoolSlice(name string, value []bool, usage string) *[]bool {
  function BoolSliceP (line 145) | func BoolSliceP(name, shorthand string, value []bool, usage string) *[]b...

FILE: vendor/github.com/spf13/pflag/bool_slice_test.go
  function setUpBSFlagSet (line 10) | func setUpBSFlagSet(bsp *[]bool) *FlagSet {
  function setUpBSFlagSetWithDefault (line 16) | func setUpBSFlagSetWithDefault(bsp *[]bool) *FlagSet {
  function TestEmptyBS (line 22) | func TestEmptyBS(t *testing.T) {
  function TestBS (line 39) | func TestBS(t *testing.T) {
  function TestBSDefault (line 73) | func TestBSDefault(t *testing.T) {
  function TestBSWithDefault (line 108) | func TestBSWithDefault(t *testing.T) {
  function TestBSCalledTwice (line 143) | func TestBSCalledTwice(t *testing.T) {
  function TestBSBadQuoting (line 163) | func TestBSBadQuoting(t *testing.T) {

FILE: vendor/github.com/spf13/pflag/bool_test.go
  type triStateValue (line 14) | type triStateValue
    method IsBoolFlag (line 24) | func (v *triStateValue) IsBoolFlag() bool {
    method Get (line 28) | func (v *triStateValue) Get() interface{} {
    method Set (line 32) | func (v *triStateValue) Set(s string) error {
    method String (line 46) | func (v *triStateValue) String() string {
    method Type (line 54) | func (v *triStateValue) Type() string {
  constant triStateFalse (line 17) | triStateFalse triStateValue = 0
  constant triStateTrue (line 18) | triStateTrue  triStateValue = 1
  constant triStateMaybe (line 19) | triStateMaybe triStateValue = 2
  constant strTriStateMaybe (line 22) | strTriStateMaybe = "maybe"
  function setUpFlagSet (line 58) | func setUpFlagSet(tristate *triStateValue) *FlagSet {
  function TestExplicitTrue (line 66) | func TestExplicitTrue(t *testing.T) {
  function TestImplicitTrue (line 78) | func TestImplicitTrue(t *testing.T) {
  function TestShortFlag (line 90) | func TestShortFlag(t *testing.T) {
  function TestShortFlagExtraArgument (line 102) | func TestShortFlagExtraArgument(t *testing.T) {
  function TestExplicitMaybe (line 119) | func TestExplicitMaybe(t *testing.T) {
  function TestExplicitFalse (line 131) | func TestExplicitFalse(t *testing.T) {
  function TestImplicitFalse (line 143) | func TestImplicitFalse(t *testing.T) {
  function TestInvalidValue (line 155) | func TestInvalidValue(t *testing.T) {
  function TestBoolP (line 166) | func TestBoolP(t *testing.T) {

FILE: vendor/github.com/spf13/pflag/count.go
  type countValue (line 6) | type countValue
    method Set (line 13) | func (i *countValue) Set(s string) error {
    method Type (line 24) | func (i *countValue) Type() string {
    method String (line 28) | func (i *countValue) String() string { return strconv.Itoa(int(*i)) }
  function newCountValue (line 8) | func newCountValue(val int, p *int) *countValue {
  function countConv (line 30) | func countConv(sval string) (interface{}, error) {
  method GetCount (line 39) | func (f *FlagSet) GetCount(name string) (int, error) {
  method CountVar (line 50) | func (f *FlagSet) CountVar(p *int, name string, usage string) {
  method CountVarP (line 55) | func (f *FlagSet) CountVarP(p *int, name, shorthand string, usage string) {
  function CountVar (line 61) | func CountVar(p *int, name string, usage string) {
  function CountVarP (line 66) | func CountVarP(p *int, name, shorthand string, usage string) {
  method Count (line 73) | func (f *FlagSet) Count(name string, usage string) *int {
  method CountP (line 80) | func (f *FlagSet) CountP(name, shorthand string, usage string) *int {
  function Count (line 89) | func Count(name string, usage string) *int {
  function CountP (line 94) | func CountP(name, shorthand string, usage string) *int {

FILE: vendor/github.com/spf13/pflag/count_test.go
  function setUpCount (line 8) | func setUpCount(c *int) *FlagSet {
  function TestCount (line 14) | func TestCount(t *testing.T) {

FILE: vendor/github.com/spf13/pflag/duration.go
  type durationValue (line 8) | type durationValue
    method Set (line 15) | func (d *durationValue) Set(s string) error {
    method Type (line 21) | func (d *durationValue) Type() string {
    method String (line 25) | func (d *durationValue) String() string { return (*time.Duration)(d).S...
  function newDurationValue (line 10) | func newDurationValue(val time.Duration, p *time.Duration) *durationValue {
  function durationConv (line 27) | func durationConv(sval string) (interface{}, error) {
  method GetDuration (line 32) | func (f *FlagSet) GetDuration(name string) (time.Duration, error) {
  method DurationVar (line 42) | func (f *FlagSet) DurationVar(p *time.Duration, name string, value time....
  method DurationVarP (line 47) | func (f *FlagSet) DurationVarP(p *time.Duration, name, shorthand string,...
  function DurationVar (line 53) | func DurationVar(p *time.Duration, name string, value time.Duration, usa...
  function DurationVarP (line 58) | func DurationVarP(p *time.Duration, name, shorthand string, value time.D...
  method Duration (line 64) | func (f *FlagSet) Duration(name string, value time.Duration, usage strin...
  method DurationP (line 71) | func (f *FlagSet) DurationP(name, shorthand string, value time.Duration,...
  function Duration (line 79) | func Duration(name string, value time.Duration, usage string) *time.Dura...
  function DurationP (line 84) | func DurationP(name, shorthand string, value time.Duration, usage string...

FILE: vendor/github.com/spf13/pflag/example_test.go
  function ExampleShorthandLookup (line 13) | func ExampleShorthandLookup() {
  function ExampleFlagSet_ShorthandLookup (line 25) | func ExampleFlagSet_ShorthandLookup() {

FILE: vendor/github.com/spf13/pflag/export_test.go
  function ResetForTesting (line 17) | func ResetForTesting(usage func()) {
  function GetCommandLine (line 27) | func GetCommandLine() *FlagSet {

FILE: vendor/github.com/spf13/pflag/flag.go
  type ErrorHandling (line 115) | type ErrorHandling
  constant ContinueOnError (line 119) | ContinueOnError ErrorHandling = iota
  constant ExitOnError (line 121) | ExitOnError
  constant PanicOnError (line 123) | PanicOnError
  type NormalizedName (line 128) | type NormalizedName
  type FlagSet (line 131) | type FlagSet struct
    method SetNormalizeFunc (line 202) | func (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) Nor...
    method GetNormalizeFunc (line 216) | func (f *FlagSet) GetNormalizeFunc() func(f *FlagSet, name string) Nor...
    method normalizeFlagName (line 223) | func (f *FlagSet) normalizeFlagName(name string) NormalizedName {
    method out (line 228) | func (f *FlagSet) out() io.Writer {
    method SetOutput (line 237) | func (f *FlagSet) SetOutput(output io.Writer) {
    method VisitAll (line 244) | func (f *FlagSet) VisitAll(fn func(*Flag)) {
    method HasFlags (line 265) | func (f *FlagSet) HasFlags() bool {
    method HasAvailableFlags (line 271) | func (f *FlagSet) HasAvailableFlags() bool {
    method Visit (line 290) | func (f *FlagSet) Visit(fn func(*Flag)) {
    method Lookup (line 318) | func (f *FlagSet) Lookup(name string) *Flag {
    method ShorthandLookup (line 325) | func (f *FlagSet) ShorthandLookup(name string) *Flag {
    method lookup (line 339) | func (f *FlagSet) lookup(name NormalizedName) *Flag {
    method getFlagType (line 344) | func (f *FlagSet) getFlagType(name string, ftype string, convFunc func...
    method ArgsLenAtDash (line 367) | func (f *FlagSet) ArgsLenAtDash() int {
    method MarkDeprecated (line 374) | func (f *FlagSet) MarkDeprecated(name string, usageMessage string) err...
    method MarkShorthandDeprecated (line 389) | func (f *FlagSet) MarkShorthandDeprecated(name string, usageMessage st...
    method MarkHidden (line 403) | func (f *FlagSet) MarkHidden(name string) error {
    method Set (line 425) | func (f *FlagSet) Set(name, value string) error {
    method SetAnnotation (line 460) | func (f *FlagSet) SetAnnotation(name, key string, values []string) err...
    method Changed (line 475) | func (f *FlagSet) Changed(name string) bool {
    method PrintDefaults (line 491) | func (f *FlagSet) PrintDefaults() {
    method FlagUsagesWrapped (line 633) | func (f *FlagSet) FlagUsagesWrapped(cols int) string {
    method FlagUsages (line 699) | func (f *FlagSet) FlagUsages() string {
    method NFlag (line 728) | func (f *FlagSet) NFlag() int { return len(f.actual) }
    method Arg (line 735) | func (f *FlagSet) Arg(i int) string {
    method NArg (line 749) | func (f *FlagSet) NArg() int { return len(f.args) }
    method Args (line 755) | func (f *FlagSet) Args() []string { return f.args }
    method Var (line 766) | func (f *FlagSet) Var(value Value, name string, usage string) {
    method VarPF (line 771) | func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *F...
    method VarP (line 785) | func (f *FlagSet) VarP(value Value, name, shorthand, usage string) {
    method AddFlag (line 790) | func (f *FlagSet) AddFlag(flag *Flag) {
    method AddFlagSet (line 830) | func (f *FlagSet) AddFlagSet(newSet *FlagSet) {
    method failf (line 858) | func (f *FlagSet) failf(format string, a ...interface{}) error {
    method usage (line 867) | func (f *FlagSet) usage() {
    method parseLongArg (line 877) | func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) ...
    method parseSingleShortArg (line 918) | func (f *FlagSet) parseSingleShortArg(shorthands string, args []string...
    method parseShortArg (line 968) | func (f *FlagSet) parseShortArg(s string, args []string, fn parseFunc)...
    method parseArgs (line 983) | func (f *FlagSet) parseArgs(args []string, fn parseFunc) (err error) {
    method Parse (line 1018) | func (f *FlagSet) Parse(arguments []string) error {
    method ParseAll (line 1052) | func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, val...
    method Parsed (line 1071) | func (f *FlagSet) Parsed() bool {
    method SetInterspersed (line 1117) | func (f *FlagSet) SetInterspersed(interspersed bool) {
    method Init (line 1124) | func (f *FlagSet) Init(name string, errorHandling ErrorHandling) {
  type Flag (line 159) | type Flag struct
    method defaultIsZeroValue (line 498) | func (f *Flag) defaultIsZeroValue() bool {
  type Value (line 175) | type Value interface
  function sortFlags (line 182) | func sortFlags(flags map[NormalizedName]*Flag) []*Flag {
  function VisitAll (line 283) | func VisitAll(fn func(*Flag)) {
  function Visit (line 313) | func Visit(fn func(*Flag)) {
  function Lookup (line 414) | func Lookup(name string) *Flag {
  function ShorthandLookup (line 420) | func ShorthandLookup(name string) *Flag {
  function Set (line 485) | func Set(name, value string) error {
  function UnquoteUsage (line 533) | func UnquoteUsage(flag *Flag) (name string, usage string) {
  function wrapN (line 568) | func wrapN(i, slop int, s string) (string, string) {
  function wrap (line 584) | func wrap(i, w int, s string) string {
  function PrintDefaults (line 704) | func PrintDefaults() {
  function defaultUsage (line 709) | func defaultUsage(f *FlagSet) {
  function NFlag (line 731) | func NFlag() int { return len(CommandLine.actual) }
  function Arg (line 744) | func Arg(i int) string {
  function NArg (line 752) | func NArg() int { return len(CommandLine.args) }
  function Args (line 758) | func Args() []string { return CommandLine.args }
  function Var (line 847) | func Var(value Value, name string, usage string) {
  function VarP (line 852) | func VarP(value Value, name, shorthand, usage string) {
  type parseFunc (line 1045) | type parseFunc
  function Parse (line 1077) | func Parse() {
  function ParseAll (line 1085) | func ParseAll(fn func(flag *Flag, value string) error) {
  function SetInterspersed (line 1091) | func SetInterspersed(interspersed bool) {
  function Parsed (line 1096) | func Parsed() bool {
  function NewFlagSet (line 1105) | func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet {

FILE: vendor/github.com/spf13/pflag/flag_test.go
  function boolString (line 35) | func boolString(s string) string {
  function TestEverything (line 42) | func TestEverything(t *testing.T) {
  function TestUsage (line 103) | func TestUsage(t *testing.T) {
  function TestAddFlagSet (line 114) | func TestAddFlagSet(t *testing.T) {
  function TestAnnotation (line 131) | func TestAnnotation(t *testing.T) {
  function testParse (line 162) | func testParse(f *FlagSet, t *testing.T) {
  function testParseAll (line 336) | func testParseAll(f *FlagSet, t *testing.T) {
  function TestShorthand (line 389) | func TestShorthand(t *testing.T) {
  function TestShorthandLookup (line 449) | func TestShorthandLookup(t *testing.T) {
  function TestParse (line 485) | func TestParse(t *testing.T) {
  function TestParseAll (line 490) | func TestParseAll(t *testing.T) {
  function TestFlagSetParse (line 495) | func TestFlagSetParse(t *testing.T) {
  function TestChangedHelper (line 499) | func TestChangedHelper(t *testing.T) {
  function replaceSeparators (line 530) | func replaceSeparators(name string, from []string, to string) string {
  function wordSepNormalizeFunc (line 539) | func wordSepNormalizeFunc(f *FlagSet, name string) NormalizedName {
  function testWordSepNormalizedNames (line 547) | func testWordSepNormalizedNames(args []string, t *testing.T) {
  function TestWordSepNormalizedNames (line 574) | func TestWordSepNormalizedNames(t *testing.T) {
  function aliasAndWordSepFlagNames (line 597) | func aliasAndWordSepFlagNames(f *FlagSet, name string) NormalizedName {
  function TestCustomNormalizedNames (line 613) | func TestCustomNormalizedNames(t *testing.T) {
  function TestNormalizationFuncShouldChangeFlagName (line 637) | func TestNormalizationFuncShouldChangeFlagName(t *testing.T) {
  type flagVar (line 662) | type flagVar
    method String (line 664) | func (f *flagVar) String() string {
    method Set (line 668) | func (f *flagVar) Set(value string) error {
    method Type (line 673) | func (f *flagVar) Type() string {
  function TestUserDefined (line 677) | func TestUserDefined(t *testing.T) {
  function TestSetOutput (line 694) | func TestSetOutput(t *testing.T) {
  function TestChangingArgs (line 707) | func TestChangingArgs(t *testing.T) {
  function TestHelp (line 728) | func TestHelp(t *testing.T) {
  function TestNoInterspersed (line 770) | func TestNoInterspersed(t *testing.T) {
  function TestTermination (line 785) | func TestTermination(t *testing.T) {
  function TestDeprecatedFlagInDocs (line 822) | func TestDeprecatedFlagInDocs(t *testing.T) {
  function TestDeprecatedFlagShorthandInDocs (line 836) | func TestDeprecatedFlagShorthandInDocs(t *testing.T) {
  function parseReturnStderr (line 851) | func parseReturnStderr(t *testing.T, f *FlagSet, args []string) (string,...
  function TestDeprecatedFlagUsage (line 873) | func TestDeprecatedFlagUsage(t *testing.T) {
  function TestDeprecatedFlagShorthandUsage (line 890) | func TestDeprecatedFlagShorthandUsage(t *testing.T) {
  function TestDeprecatedFlagUsageNormalized (line 908) | func TestDeprecatedFlagUsageNormalized(t *testing.T) {
  function TestMultipleNormalizeFlagNameInvocations (line 927) | func TestMultipleNormalizeFlagNameInvocations(t *testing.T) {
  function TestHiddenFlagInUsage (line 940) | func TestHiddenFlagInUsage(t *testing.T) {
  function TestHiddenFlagUsage (line 955) | func TestHiddenFlagUsage(t *testing.T) {
  constant defaultOutput (line 971) | defaultOutput = `      --A                         for bootstrapping, al...
  type customValue (line 994) | type customValue
    method String (line 996) | func (cv *customValue) String() string { return fmt.Sprintf("%v", *cv) }
    method Set (line 998) | func (cv *customValue) Set(s string) error {
    method Type (line 1004) | func (cv *customValue) Type() string { return "custom" }
  function TestPrintDefaults (line 1006) | func TestPrintDefaults(t *testing.T) {
  function TestVisitAllFlagOrder (line 1047) | func TestVisitAllFlagOrder(t *testing.T) {
  function TestVisitFlagOrder (line 1069) | func TestVisitFlagOrder(t *testing.T) {

FILE: vendor/github.com/spf13/pflag/float32.go
  type float32Value (line 6) | type float32Value
    method Set (line 13) | func (f *float32Value) Set(s string) error {
    method Type (line 19) | func (f *float32Value) Type() string {
    method String (line 23) | func (f *float32Value) String() string { return strconv.FormatFloat(fl...
  function newFloat32Value (line 8) | func newFloat32Value(val float32, p *float32) *float32Value {
  function float32Conv (line 25) | func float32Conv(sval string) (interface{}, error) {
  method GetFloat32 (line 34) | func (f *FlagSet) GetFloat32(name string) (float32, error) {
  method Float32Var (line 44) | func (f *FlagSet) Float32Var(p *float32, name string, value float32, usa...
  method Float32VarP (line 49) | func (f *FlagSet) Float32VarP(p *float32, name, shorthand string, value ...
  function Float32Var (line 55) | func Float32Var(p *float32, name string, value float32, usage string) {
  function Float32VarP (line 60) | func Float32VarP(p *float32, name, shorthand string, value float32, usag...
  method Float32 (line 66) | func (f *FlagSet) Float32(name string, value float32, usage string) *flo...
  method Float32P (line 73) | func (f *FlagSet) Float32P(name, shorthand string, value float32, usage ...
  function Float32 (line 81) | func Float32(name string, value float32, usage string) *float32 {
  function Float32P (line 86) | func Float32P(name, shorthand string, value float32, usage string) *floa...

FILE: vendor/github.com/spf13/pflag/float64.go
  type float64Value (line 6) | type float64Value
    method Set (line 13) | func (f *float64Value) Set(s string) error {
    method Type (line 19) | func (f *float64Value) Type() string {
    method String (line 23) | func (f *float64Value) String() string { return strconv.FormatFloat(fl...
  function newFloat64Value (line 8) | func newFloat64Value(val float64, p *float64) *float64Value {
  function float64Conv (line 25) | func float64Conv(sval string) (interface{}, error) {
  method GetFloat64 (line 30) | func (f *FlagSet) GetFloat64(name string) (float64, error) {
  method Float64Var (line 40) | func (f *FlagSet) Float64Var(p *float64, name string, value float64, usa...
  method Float64VarP (line 45) | func (f *FlagSet) Float64VarP(p *float64, name, shorthand string, value ...
  function Float64Var (line 51) | func Float64Var(p *float64, name string, value float64, usage string) {
  function Float64VarP (line 56) | func Float64VarP(p *float64, name, shorthand string, value float64, usag...
  method Float64 (line 62) | func (f *FlagSet) Float64(name string, value float64, usage string) *flo...
  method Float64P (line 69) | func (f *FlagSet) Float64P(name, shorthand string, value float64, usage ...
  function Float64 (line 77) | func Float64(name string, value float64, usage string) *float64 {
  function Float64P (line 82) | func Float64P(name, shorthand string, value float64, usage string) *floa...

FILE: vendor/github.com/spf13/pflag/golangflag.go
  type flagValueWrapper (line 17) | type flagValueWrapper struct
    method String (line 48) | func (v *flagValueWrapper) String() string {
    method Set (line 52) | func (v *flagValueWrapper) Set(s string) error {
    method Type (line 56) | func (v *flagValueWrapper) Type() string {
  type goBoolFlag (line 24) | type goBoolFlag interface
  function wrapFlagValue (line 29) | func wrapFlagValue(v goflag.Value) Value {
  function PFlagFromGoFlag (line 64) | func PFlagFromGoFlag(goflag *goflag.Flag) *Flag {
  method AddGoFlag (line 85) | func (f *FlagSet) AddGoFlag(goflag *goflag.Flag) {
  method AddGoFlagSet (line 94) | func (f *FlagSet) AddGoFlagSet(newSet *goflag.FlagSet) {

FILE: vendor/github.com/spf13/pflag/golangflag_test.go
  function TestGoflags (line 12) | func TestGoflags(t *testing.T) {

FILE: vendor/github.com/spf13/pflag/int.go
  type intValue (line 6) | type intValue
    method Set (line 13) | func (i *intValue) Set(s string) error {
    method Type (line 19) | func (i *intValue) Type() string {
    method String (line 23) | func (i *intValue) String() string { return strconv.Itoa(int(*i)) }
  function newIntValue (line 8) | func newIntValue(val int, p *int) *intValue {
  function intConv (line 25) | func intConv(sval string) (interface{}, error) {
  method GetInt (line 30) | func (f *FlagSet) GetInt(name string) (int, error) {
  method IntVar (line 40) | func (f *FlagSet) IntVar(p *int, name string, value int, usage string) {
  method IntVarP (line 45) | func (f *FlagSet) IntVarP(p *int, name, shorthand string, value int, usa...
  function IntVar (line 51) | func IntVar(p *int, name string, value int, usage string) {
  function IntVarP (line 56) | func IntVarP(p *int, name, shorthand string, value int, usage string) {
  method Int (line 62) | func (f *FlagSet) Int(name string, value int, usage string) *int {
  method IntP (line 69) | func (f *FlagSet) IntP(name, shorthand string, value int, usage string) ...
  function Int (line 77) | func Int(name string, value int, usage string) *int {
  function IntP (line 82) | func IntP(name, shorthand string, value int, usage string) *int {

FILE: vendor/github.com/spf13/pflag/int32.go
  type int32Value (line 6) | type int32Value
    method Set (line 13) | func (i *int32Value) Set(s string) error {
    method Type (line 19) | func (i *int32Value) Type() string {
    method String (line 23) | func (i *int32Value) String() string { return strconv.FormatInt(int64(...
  function newInt32Value (line 8) | func newInt32Value(val int32, p *int32) *int32Value {
  function int32Conv (line 25) | func int32Conv(sval string) (interface{}, error) {
  method GetInt32 (line 34) | func (f *FlagSet) GetInt32(name string) (int32, error) {
  method Int32Var (line 44) | func (f *FlagSet) Int32Var(p *int32, name string, value int32, usage str...
  method Int32VarP (line 49) | func (f *FlagSet) Int32VarP(p *int32, name, shorthand string, value int3...
  function Int32Var (line 55) | func Int32Var(p *int32, name string, value int32, usage string) {
  function Int32VarP (line 60) | func Int32VarP(p *int32, name, shorthand string, value int32, usage stri...
  method Int32 (line 66) | func (f *FlagSet) Int32(name string, value int32, usage string) *int32 {
  method Int32P (line 73) | func (f *FlagSet) Int32P(name, shorthand string, value int32, usage stri...
  function Int32 (line 81) | func Int32(name string, value int32, usage string) *int32 {
  function Int32P (line 86) | func Int32P(name, shorthand string, value int32, usage string) *int32 {

FILE: vendor/github.com/spf13/pflag/int64.go
  type int64Value (line 6) | type int64Value
    method Set (line 13) | func (i *int64Value) Set(s string) error {
    method Type (line 19) | func (i *int64Value) Type() string {
    method String (line 23) | func (i *int64Value) String() string { return strconv.FormatInt(int64(...
  function newInt64Value (line 8) | func newInt64Value(val int64, p *int64) *int64Value {
  function int64Conv (line 25) | func int64Conv(sval string) (interface{}, error) {
  method GetInt64 (line 30) | func (f *FlagSet) GetInt64(name string) (int64, error) {
  method Int64Var (line 40) | func (f *FlagSet) Int64Var(p *int64, name string, value int64, usage str...
  method Int64VarP (line 45) | func (f *FlagSet) Int64VarP(p *int64, name, shorthand string, value int6...
  function Int64Var (line 51) | func Int64Var(p *int64, name string, value int64, usage string) {
  function Int64VarP (line 56) | func Int64VarP(p *int64, name, shorthand string, value int64, usage stri...
  method Int64 (line 62) | func (f *FlagSet) Int64(name string, value int64, usage string) *int64 {
  method Int64P (line 69) | func (f *FlagSet) Int64P(name, shorthand string, value int64, usage stri...
  function Int64 (line 77) | func Int64(name string, value int64, usage string) *int64 {
  function Int64P (line 82) | func Int64P(name, shorthand string, value int64, usage string) *int64 {

FILE: vendor/github.com/spf13/pflag/int8.go
  type int8Value (line 6) | type int8Value
    method Set (line 13) | func (i *int8Value) Set(s string) error {
    method Type (line 19) | func (i *int8Value) Type() string {
    method String (line 23) | func (i *int8Value) String() string { return strconv.FormatInt(int64(*...
  function newInt8Value (line 8) | func newInt8Value(val int8, p *int8) *int8Value {
  function int8Conv (line 25) | func int8Conv(sval string) (interface{}, error) {
  method GetInt8 (line 34) | func (f *FlagSet) GetInt8(name string) (int8, error) {
  method Int8Var (line 44) | func (f *FlagSet) Int8Var(p *int8, name string, value int8, usage string) {
  method Int8VarP (line 49) | func (f *FlagSet) Int8VarP(p *int8, name, shorthand string, value int8, ...
  function Int8Var (line 55) | func Int8Var(p *int8, name string, value int8, usage string) {
  function Int8VarP (line 60) | func Int8VarP(p *int8, name, shorthand string, value int8, usage string) {
  method Int8 (line 66) | func (f *FlagSet) Int8(name string, value int8, usage string) *int8 {
  method Int8P (line 73) | func (f *FlagSet) Int8P(name, shorthand string, value int8, usage string...
  function Int8 (line 81) | func Int8(name string, value int8, usage string) *int8 {
  function Int8P (line 86) | func Int8P(name, shorthand string, value int8, usage string) *int8 {

FILE: vendor/github.com/spf13/pflag/int_slice.go
  type intSliceValue (line 10) | type intSliceValue struct
    method Set (line 22) | func (s *intSliceValue) Set(val string) error {
    method Type (line 42) | func (s *intSliceValue) Type() string {
    method String (line 46) | func (s *intSliceValue) String() string {
  function newIntSliceValue (line 15) | func newIntSliceValue(val []int, p *[]int) *intSliceValue {
  function intSliceConv (line 54) | func intSliceConv(val string) (interface{}, error) {
  method GetIntSlice (line 74) | func (f *FlagSet) GetIntSlice(name string) ([]int, error) {
  method IntSliceVar (line 84) | func (f *FlagSet) IntSliceVar(p *[]int, name string, value []int, usage ...
  method IntSliceVarP (line 89) | func (f *FlagSet) IntSliceVarP(p *[]int, name, shorthand string, value [...
  function IntSliceVar (line 95) | func IntSliceVar(p *[]int, name string, value []int, usage string) {
  function IntSliceVarP (line 100) | func IntSliceVarP(p *[]int, name, shorthand string, value []int, usage s...
  method IntSlice (line 106) | func (f *FlagSet) IntSlice(name string, value []int, usage string) *[]int {
  method IntSliceP (line 113) | func (f *FlagSet) IntSliceP(name, shorthand string, value []int, usage s...
  function IntSlice (line 121) | func IntSlice(name string, value []int, usage string) *[]int {
  function IntSliceP (line 126) | func IntSliceP(name, shorthand string, value []int, usage string) *[]int {

FILE: vendor/github.com/spf13/pflag/int_slice_test.go
  function setUpISFlagSet (line 14) | func setUpISFlagSet(isp *[]int) *FlagSet {
  function setUpISFlagSetWithDefault (line 20) | func setUpISFlagSetWithDefault(isp *[]int) *FlagSet {
  function TestEmptyIS (line 26) | func TestEmptyIS(t *testing.T) {
  function TestIS (line 43) | func TestIS(t *testing.T) {
  function TestISDefault (line 77) | func TestISDefault(t *testing.T) {
  function TestISWithDefault (line 112) | func TestISWithDefault(t *testing.T) {
  function TestISCalledTwice (line 147) | func TestISCalledTwice(t *testing.T) {

FILE: vendor/github.com/spf13/pflag/ip.go
  type ipValue (line 10) | type ipValue
    method String (line 17) | func (i *ipValue) String() string { return net.IP(*i).String() }
    method Set (line 18) | func (i *ipValue) Set(s string) error {
    method Type (line 27) | func (i *ipValue) Type() string {
  function newIPValue (line 12) | func newIPValue(val net.IP, p *net.IP) *ipValue {
  function ipConv (line 31) | func ipConv(sval string) (interface{}, error) {
  method GetIP (line 40) | func (f *FlagSet) GetIP(name string) (net.IP, error) {
  method IPVar (line 50) | func (f *FlagSet) IPVar(p *net.IP, name string, value net.IP, usage stri...
  method IPVarP (line 55) | func (f *FlagSet) IPVarP(p *net.IP, name, shorthand string, value net.IP...
  function IPVar (line 61) | func IPVar(p *net.IP, name string, value net.IP, usage string) {
  function IPVarP (line 66) | func IPVarP(p *net.IP, name, shorthand string, value net.IP, usage strin...
  method IP (line 72) | func (f *FlagSet) IP(name string, value net.IP, usage string) *net.IP {
  method IPP (line 79) | func (f *FlagSet) IPP(name, shorthand string, value net.IP, usage string...
  function IP (line 87) | func IP(name string, value net.IP, usage string) *net.IP {
  function IPP (line 92) | func IPP(name, shorthand string, value net.IP, usage string) *net.IP {

FILE: vendor/github.com/spf13/pflag/ip_slice.go
  type ipSliceValue (line 11) | type ipSliceValue struct
    method Set (line 25) | func (s *ipSliceValue) Set(val string) error {
    method Type (line 58) | func (s *ipSliceValue) Type() string {
    method String (line 63) | func (s *ipSliceValue) String() string {
  function newIPSliceValue (line 16) | func newIPSliceValue(val []net.IP, p *[]net.IP) *ipSliceValue {
  function ipSliceConv (line 75) | func ipSliceConv(val string) (interface{}, error) {
  method GetIPSlice (line 94) | func (f *FlagSet) GetIPSlice(name string) ([]net.IP, error) {
  method IPSliceVar (line 104) | func (f *FlagSet) IPSliceVar(p *[]net.IP, name string, value []net.IP, u...
  method IPSliceVarP (line 109) | func (f *FlagSet) IPSliceVarP(p *[]net.IP, name, shorthand string, value...
  function IPSliceVar (line 115) | func IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) {
  function IPSliceVarP (line 120) | func IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, us...
  method IPSlice (line 126) | func (f *FlagSet) IPSlice(name string, value []net.IP, usage string) *[]...
  method IPSliceP (line 133) | func (f *FlagSet) IPSliceP(name, shorthand string, value []net.IP, usage...
  function IPSlice (line 141) | func IPSlice(name string, value []net.IP, usage string) *[]net.IP {
  function IPSliceP (line 146) | func IPSliceP(name, shorthand string, value []net.IP, usage string) *[]n...

FILE: vendor/github.com/spf13/pflag/ip_slice_test.go
  function setUpIPSFlagSet (line 10) | func setUpIPSFlagSet(ipsp *[]net.IP) *FlagSet {
  function setUpIPSFlagSetWithDefault (line 16) | func setUpIPSFlagSetWithDefault(ipsp *[]net.IP) *FlagSet {
  function TestEmptyIP (line 27) | func TestEmptyIP(t *testing.T) {
  function TestIPS (line 44) | func TestIPS(t *testing.T) {
  function TestIPSDefault (line 63) | func TestIPSDefault(t *testing.T) {
  function TestIPSWithDefault (line 93) | func TestIPSWithDefault(t *testing.T) {
  function TestIPSCalledTwice (line 124) | func TestIPSCalledTwice(t *testing.T) {
  function TestIPSBadQuoting (line 144) | func TestIPSBadQuoting(t *testing.T) {

FILE: vendor/github.com/spf13/pflag/ip_test.go
  function setUpIP (line 10) | func setUpIP(ip *net.IP) *FlagSet {
  function TestIP (line 16) | func TestIP(t *testing.T) {

FILE: vendor/github.com/spf13/pflag/ipmask.go
  type ipMaskValue (line 10) | type ipMaskValue
    method String (line 17) | func (i *ipMaskValue) String() string { return net.IPMask(*i).String() }
    method Set (line 18) | func (i *ipMaskValue) Set(s string) error {
    method Type (line 27) | func (i *ipMaskValue) Type() string {
  function newIPMaskValue (line 12) | func newIPMaskValue(val net.IPMask, p *net.IPMask) *ipMaskValue {
  function ParseIPv4Mask (line 33) | func ParseIPv4Mask(s string) net.IPMask {
  function parseIPv4Mask (line 59) | func parseIPv4Mask(sval string) (interface{}, error) {
  method GetIPv4Mask (line 68) | func (f *FlagSet) GetIPv4Mask(name string) (net.IPMask, error) {
  method IPMaskVar (line 78) | func (f *FlagSet) IPMaskVar(p *net.IPMask, name string, value net.IPMask...
  method IPMaskVarP (line 83) | func (f *FlagSet) IPMaskVarP(p *net.IPMask, name, shorthand string, valu...
  function IPMaskVar (line 89) | func IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage strin...
  function IPMaskVarP (line 94) | func IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask,...
  method IPMask (line 100) | func (f *FlagSet) IPMask(name string, value net.IPMask, usage string) *n...
  method IPMaskP (line 107) | func (f *FlagSet) IPMaskP(name, shorthand string, value net.IPMask, usag...
  function IPMask (line 115) | func IPMask(name string, value net.IPMask, usage string) *net.IPMask {
  function IPMaskP (line 120) | func IPMaskP(name, shorthand string, value net.IPMask, usage string) *ne...

FILE: vendor/github.com/spf13/pflag/ipnet.go
  type ipNetValue (line 10) | type ipNetValue
    method String (line 12) | func (ipnet ipNetValue) String() string {
    method Set (line 17) | func (ipnet *ipNetValue) Set(value string) error {
    method Type (line 26) | func (*ipNetValue) Type() string {
  function newIPNetValue (line 30) | func newIPNetValue(val net.IPNet, p *net.IPNet) *ipNetValue {
  function ipNetConv (line 35) | func ipNetConv(sval string) (interface{}, error) {
  method GetIPNet (line 44) | func (f *FlagSet) GetIPNet(name string) (net.IPNet, error) {
  method IPNetVar (line 54) | func (f *FlagSet) IPNetVar(p *net.IPNet, name string, value net.IPNet, u...
  method IPNetVarP (line 59) | func (f *FlagSet) IPNetVarP(p *net.IPNet, name, shorthand string, value ...
  function IPNetVar (line 65) | func IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) {
  function IPNetVarP (line 70) | func IPNetVarP(p *net.IPNet, name, shorthand string, value net.IPNet, us...
  method IPNet (line 76) | func (f *FlagSet) IPNet(name string, value net.IPNet, usage string) *net...
  method IPNetP (line 83) | func (f *FlagSet) IPNetP(name, shorthand string, value net.IPNet, usage ...
  function IPNet (line 91) | func IPNet(name string, value net.IPNet, usage string) *net.IPNet {
  function IPNetP (line 96) | func IPNetP(name, shorthand string, value net.IPNet, usage string) *net....

FILE: vendor/github.com/spf13/pflag/ipnet_test.go
  function setUpIPNet (line 10) | func setUpIPNet(ip *net.IPNet) *FlagSet {
  function TestIPNet (line 17) | func TestIPNet(t *testing.T) {

FILE: vendor/github.com/spf13/pflag/string.go
  type stringValue (line 4) | type stringValue
    method Set (line 11) | func (s *stringValue) Set(val string) error {
    method Type (line 15) | func (s *stringValue) Type() string {
    method String (line 19) | func (s *stringValue) String() string { return string(*s) }
  function newStringValue (line 6) | func newStringValue(val string, p *string) *stringValue {
  function stringConv (line 21) | func stringConv(sval string) (interface{}, error) {
  method GetString (line 26) | func (f *FlagSet) GetString(name string) (string, error) {
  method StringVar (line 36) | func (f *FlagSet) StringVar(p *string, name string, value string, usage ...
  method StringVarP (line 41) | func (f *FlagSet) StringVarP(p *string, name, shorthand string, value st...
  function StringVar (line 47) | func StringVar(p *string, name string, value string, usage string) {
  function StringVarP (line 52) | func StringVarP(p *string, name, shorthand string, value string, usage s...
  method String (line 58) | func (f *FlagSet) String(name string, value string, usage string) *string {
  method StringP (line 65) | func (f *FlagSet) StringP(name, shorthand string, value string, usage st...
  function String (line 73) | func String(name string, value string, usage string) *string {
  function StringP (line 78) | func StringP(name, shorthand string, value string, usage string) *string {

FILE: vendor/github.com/spf13/pflag/string_array.go
  type stringArrayValue (line 4) | type stringArrayValue struct
    method Set (line 16) | func (s *stringArrayValue) Set(val string) error {
    method Type (line 26) | func (s *stringArrayValue) Type() string {
    method String (line 30) | func (s *stringArrayValue) String() string {
  function newStringArrayValue (line 9) | func newStringArrayValue(val []string, p *[]string) *stringArrayValue {
  function stringArrayConv (line 35) | func stringArrayConv(sval string) (interface{}, error) {
  method GetStringArray (line 45) | func (f *FlagSet) GetStringArray(name string) ([]string, error) {
  method StringArrayVar (line 56) | func (f *FlagSet) StringArrayVar(p *[]string, name string, value []strin...
  method StringArrayVarP (line 61) | func (f *FlagSet) StringArrayVarP(p *[]string, name, shorthand string, v...
  function StringArrayVar (line 68) | func StringArrayVar(p *[]string, name string, value []string, usage stri...
  function StringArrayVarP (line 73) | func StringArrayVarP(p *[]string, name, shorthand string, value []string...
  method StringArray (line 80) | func (f *FlagSet) StringArray(name string, value []string, usage string)...
  method StringArrayP (line 87) | func (f *FlagSet) StringArrayP(name, shorthand string, value []string, u...
  function StringArray (line 96) | func StringArray(name string, value []string, usage string) *[]string {
  function StringArrayP (line 101) | func StringArrayP(name, shorthand string, value []string, usage string) ...

FILE: vendor/github.com/spf13/pflag/string_array_test.go
  function setUpSAFlagSet (line 12) | func setUpSAFlagSet(sap *[]string) *FlagSet {
  function setUpSAFlagSetWithDefault (line 18) | func setUpSAFlagSetWithDefault(sap *[]string) *FlagSet {
  function TestEmptySA (line 24) | func TestEmptySA(t *testing.T) {
  function TestEmptySAValue (line 41) | func TestEmptySAValue(t *testing.T) {
  function TestSADefault (line 58) | func TestSADefault(t *testing.T) {
  function TestSAWithDefault (line 85) | func TestSAWithDefault(t *testing.T) {
  function TestSACalledTwice (line 118) | func TestSACalledTwice(t *testing.T) {
  function TestSAWithSpecialChar (line 156) | func TestSAWithSpecialChar(t *testing.T) {
  function TestSAWithSquareBrackets (line 196) | func TestSAWithSquareBrackets(t *testing.T) {

FILE: vendor/github.com/spf13/pflag/string_slice.go
  type stringSliceValue (line 10) | type stringSliceValue struct
    method Set (line 42) | func (s *stringSliceValue) Set(val string) error {
    method Type (line 56) | func (s *stringSliceValue) Type() string {
    method String (line 60) | func (s *stringSliceValue) String() string {
  function newStringSliceValue (line 15) | func newStringSliceValue(val []string, p *[]string) *stringSliceValue {
  function readAsCSV (line 22) | func readAsCSV(val string) ([]string, error) {
  function writeAsCSV (line 31) | func writeAsCSV(vals []string) (string, error) {
  function stringSliceConv (line 65) | func stringSliceConv(sval string) (interface{}, error) {
  method GetStringSlice (line 75) | func (f *FlagSet) GetStringSlice(name string) ([]string, error) {
  method StringSliceVar (line 85) | func (f *FlagSet) StringSliceVar(p *[]string, name string, value []strin...
  method StringSliceVarP (line 90) | func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, v...
  function StringSliceVar (line 96) | func StringSliceVar(p *[]string, name string, value []string, usage stri...
  function StringSliceVarP (line 101) | func StringSliceVarP(p *[]string, name, shorthand string, value []string...
  method StringSlice (line 107) | func (f *FlagSet) StringSlice(name string, value []string, usage string)...
  method StringSliceP (line 114) | func (f *FlagSet) StringSliceP(name, shorthand string, value []string, u...
  function StringSlice (line 122) | func StringSlice(name string, value []string, usage string) *[]string {
  function StringSliceP (line 127) | func StringSliceP(name, shorthand string, value []string, usage string) ...

FILE: vendor/github.com/spf13/pflag/string_slice_test.go
  function setUpSSFlagSet (line 13) | func setUpSSFlagSet(ssp *[]string) *FlagSet {
  function setUpSSFlagSetWithDefault (line 19) | func setUpSSFlagSetWithDefault(ssp *[]string) *FlagSet {
  function TestEmptySS (line 25) | func TestEmptySS(t *testing.T) {
  function TestEmptySSValue (line 42) | func TestEmptySSValue(t *testing.T) {
  function TestSS (line 59) | func TestSS(t *testing.T) {
  function TestSSDefault (line 86) | func TestSSDefault(t *testing.T) {
  function TestSSWithDefault (line 113) | func TestSSWithDefault(t *testing.T) {
  function TestSSCalledTwice (line 140) | func TestSSCalledTwice(t *testing.T) {
  function TestSSWithComma (line 178) | func TestSSWithComma(t *testing.T) {
  function TestSSWithSquareBrackets (line 217) | func TestSSWithSquareBrackets(t *testing.T) {

FILE: vendor/github.com/spf13/pflag/uint.go
  type uintValue (line 6) | type uintValue
    method Set (line 13) | func (i *uintValue) Set(s string) error {
    method Type (line 19) | func (i *uintValue) Type() string {
    method String (line 23) | func (i *uintValue) String() string { return strconv.FormatUint(uint64...
  function newUintValue (line 8) | func newUintValue(val uint, p *uint) *uintValue {
  function uintConv (line 25) | func uintConv(sval string) (interface{}, error) {
  method GetUint (line 34) | func (f *FlagSet) GetUint(name string) (uint, error) {
  method UintVar (line 44) | func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string) {
  method UintVarP (line 49) | func (f *FlagSet) UintVarP(p *uint, name, shorthand string, value uint, ...
  function UintVar (line 55) | func UintVar(p *uint, name string, value uint, usage string) {
  function UintVarP (line 60) | func UintVarP(p *uint, name, shorthand string, value uint, usage string) {
  method Uint (line 66) | func (f *FlagSet) Uint(name string, value uint, usage string) *uint {
  method UintP (line 73) | func (f *FlagSet) UintP(name, shorthand string, value uint, usage string...
  function Uint (line 81) | func Uint(name string, value uint, usage string) *uint {
  function UintP (line 86) | func UintP(name, shorthand string, value uint, usage string) *uint {

FILE: vendor/github.com/spf13/pflag/uint16.go
  type uint16Value (line 6) | type uint16Value
    method Set (line 13) | func (i *uint16Value) Set(s string) error {
    method Type (line 19) | func (i *uint16Value) Type() string {
    method String (line 23) | func (i *uint16Value) String() string { return strconv.FormatUint(uint...
  function newUint16Value (line 8) | func newUint16Value(val uint16, p *uint16) *uint16Value {
  function uint16Conv (line 25) | func uint16Conv(sval string) (interface{}, error) {
  method GetUint16 (line 34) | func (f *FlagSet) GetUint16(name string) (uint16, error) {
  method Uint16Var (line 44) | func (f *FlagSet) Uint16Var(p *uint16, name string, value uint16, usage ...
  method Uint16VarP (line 49) | func (f *FlagSet) Uint16VarP(p *uint16, name, shorthand string, value ui...
  function Uint16Var (line 55) | func Uint16Var(p *uint16, name string, value uint16, usage string) {
  function Uint16VarP (line 60) | func Uint16VarP(p *uint16, name, shorthand string, value uint16, usage s...
  method Uint16 (line 66) | func (f *FlagSet) Uint16(name string, value uint16, usage string) *uint16 {
  method Uint16P (line 73) | func (f *FlagSet) Uint16P(name, shorthand string, value uint16, usage st...
  function Uint16 (line 81) | func Uint16(name string, value uint16, usage string) *uint16 {
  function Uint16P (line 86) | func Uint16P(name, shorthand string, value uint16, usage string) *uint16 {

FILE: vendor/github.com/spf13/pflag/uint32.go
  type uint32Value (line 6) | type uint32Value
    method Set (line 13) | func (i *uint32Value) Set(s string) error {
    method Type (line 19) | func (i *uint32Value) Type() string {
    method String (line 23) | func (i *uint32Value) String() string { return strconv.FormatUint(uint...
  function newUint32Value (line 8) | func newUint32Value(val uint32, p *uint32) *uint32Value {
  function uint32Conv (line 25) | func uint32Conv(sval string) (interface{}, error) {
  method GetUint32 (line 34) | func (f *FlagSet) GetUint32(name string) (uint32, error) {
  method Uint32Var (line 44) | func (f *FlagSet) Uint32Var(p *uint32, name string, value uint32, usage ...
  method Uint32VarP (line 49) | func (f *FlagSet) Uint32VarP(p *uint32, name, shorthand string, value ui...
  function Uint32Var (line 55) | func Uint32Var(p *uint32, name string, value uint32, usage string) {
  function Uint32VarP (line 60) | func Uint32VarP(p *uint32, name, shorthand string, value uint32, usage s...
  method Uint32 (line 66) | func (f *FlagSet) Uint32(name string, value uint32, usage string) *uint32 {
  method Uint32P (line 73) | func (f *FlagSet) Uint32P(name, shorthand string, value uint32, usage st...
  function Uint32 (line 81) | func Uint32(name string, value uint32, usage string) *uint32 {
  function Uint32P (line 86) | func Uint32P(name, shorthand string, value uint32, usage string) *uint32 {

FILE: vendor/github.com/spf13/pflag/uint64.go
  type uint64Value (line 6) | type uint64Value
    method Set (line 13) | func (i *uint64Value) Set(s string) error {
    method Type (line 19) | func (i *uint64Value) Type() string {
    method String (line 23) | func (i *uint64Value) String() string { return strconv.FormatUint(uint...
  function newUint64Value (line 8) | func newUint64Value(val uint64, p *uint64) *uint64Value {
  function uint64Conv (line 25) | func uint64Conv(sval string) (interface{}, error) {
  method GetUint64 (line 34) | func (f *FlagSet) GetUint64(name string) (uint64, error) {
  method Uint64Var (line 44) | func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage ...
  method Uint64VarP (line 49) | func (f *FlagSet) Uint64VarP(p *uint64, name, shorthand string, value ui...
  function Uint64Var (line 55) | func Uint64Var(p *uint64, name string, value uint64, usage string) {
  function Uint64VarP (line 60) | func Uint64VarP(p *uint64, name, shorthand string, value uint64, usage s...
  method Uint64 (line 66) | func (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64 {
  method Uint64P (line 73) | func (f *FlagSet) Uint64P(name, shorthand string, value uint64, usage st...
  function Uint64 (line 81) | func Uint64(name string, value uint64, usage string) *uint64 {
  function Uint64P (line 86) | func Uint64P(name, shorthand string, value uint64, usage string) *uint64 {

FILE: vendor/github.com/spf13/pflag/uint8.go
  type uint8Value (line 6) | type uint8Value
    method Set (line 13) | func (i *uint8Value) Set(s string) error {
    method Type (line 19) | func (i *uint8Value) Type() string {
    method String (line 23) | func (i *uint8Value) String() string { return strconv.FormatUint(uint6...
  function newUint8Value (line 8) | func newUint8Value(val uint8, p *uint8) *uint8Value {
  function uint8Conv (line 25) | func uint8Conv(sval string) (interface{}, error) {
  method GetUint8 (line 34) | func (f *FlagSet) GetUint8(name string) (uint8, error) {
  method Uint8Var (line 44) | func (f *FlagSet) Uint8Var(p *uint8, name string, value uint8, usage str...
  method Uint8VarP (line 49) | func (f *FlagSet) Uint8VarP(p *uint8, name, shorthand string, value uint...
  function Uint8Var (line 55) | func Uint8Var(p *uint8, name string, value uint8, usage string) {
  function Uint8VarP (line 60) | func Uint8VarP(p *uint8, name, shorthand string, value uint8, usage stri...
  method Uint8 (line 66) | func (f *FlagSet) Uint8(name string, value uint8, usage string) *uint8 {
  method Uint8P (line 73) | func (f *FlagSet) Uint8P(name, shorthand string, value uint8, usage stri...
  function Uint8 (line 81) | func Uint8(name string, value uint8, usage string) *uint8 {
  function Uint8P (line 86) | func Uint8P(name, shorthand string, value uint8, usage string) *uint8 {

FILE: vendor/github.com/spf13/pflag/uint_slice.go
  type uintSliceValue (line 10) | type uintSliceValue struct
    method Set (line 22) | func (s *uintSliceValue) Set(val string) error {
    method Type (line 41) | func (s *uintSliceValue) Type() string {
    method String (line 45) | func (s *uintSliceValue) String() string {
  function newUintSliceValue (line 15) | func newUintSliceValue(val []uint, p *[]uint) *uintSliceValue {
  function uintSliceConv (line 53) | func uintSliceConv(val string) (interface{}, error) {
  method GetUintSlice (line 72) | func (f *FlagSet) GetUintSlice(name string) ([]uint, error) {
  method UintSliceVar (line 82) | func (f *FlagSet) UintSliceVar(p *[]uint, name string, value []uint, usa...
  method UintSliceVarP (line 87) | func (f *FlagSet) UintSliceVarP(p *[]uint, name, shorthand string, value...
  function UintSliceVar (line 93) | func UintSliceVar(p *[]uint, name string, value []uint, usage string) {
  function UintSliceVarP (line 98) | func UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usag...
  method UintSlice (line 104) | func (f *FlagSet) UintSlice(name string, value []uint, usage string) *[]...
  method UintSliceP (line 111) | func (f *FlagSet) UintSliceP(name, shorthand string, value []uint, usage...
  function UintSlice (line 119) | func UintSlice(name string, value []uint, usage string) *[]uint {
  function UintSliceP (line 124) | func UintSliceP(name, shorthand string, value []uint, usage string) *[]u...

FILE: vendor/github.com/spf13/pflag/uint_slice_test.go
  function setUpUISFlagSet (line 10) | func setUpUISFlagSet(uisp *[]uint) *FlagSet {
  function setUpUISFlagSetWithDefault (line 16) | func setUpUISFlagSetWithDefault(uisp *[]uint) *FlagSet {
  function TestEmptyUIS (line 22) | func TestEmptyUIS(t *testing.T) {
  function TestUIS (line 39) | func TestUIS(t *testing.T) {
  function TestUISDefault (line 73) | func TestUISDefault(t *testing.T) {
  function TestUISWithDefault (line 108) | func TestUISWithDefault(t *testing.T) {
  function TestUISCalledTwice (line 143) | func TestUISCalledTwice(t *testing.T) {

FILE: vendor/github.com/zmb3/spotify/album.go
  type SimpleAlbum (line 13) | type SimpleAlbum struct
  type Copyright (line 42) | type Copyright struct
  type FullAlbum (line 50) | type FullAlbum struct
    method ReleaseDateTime (line 84) | func (f *FullAlbum) ReleaseDateTime() time.Time {
  type SavedAlbum (line 71) | type SavedAlbum struct
  method GetAlbum (line 100) | func (c *Client) GetAlbum(id ID) (*FullAlbum, error) {
  function toStringSlice (line 113) | func toStringSlice(ids []ID) []string {
  method GetAlbums (line 125) | func (c *Client) GetAlbums(ids ...ID) ([]*FullAlbum, error) {
  type AlbumType (line 145) | type AlbumType
    method encode (line 157) | func (at AlbumType) encode() string {
  constant AlbumTypeAlbum (line 151) | AlbumTypeAlbum       AlbumType = 1 << iota
  constant AlbumTypeSingle (line 152) | AlbumTypeSingle                = 1 << iota
  constant AlbummTypeAppearsOn (line 153) | AlbummTypeAppearsOn            = 1 << iota
  constant AlbumTypeCompilation (line 154) | AlbumTypeCompilation           = 1 << iota
  method GetAlbumTracks (line 177) | func (c *Client) GetAlbumTracks(id ID) (*SimpleTrackPage, error) {
  method GetAlbumTracksOpt (line 186) | func (c *Client) GetAlbumTracksOpt(id ID, limit, offset int) (*SimpleTra...

FILE: vendor/github.com/zmb3/spotify/album_test.go
  function TestFindAlbum (line 9) | func TestFindAlbum(t *testing.T) {
  function TestFindAlbumBadID (line 29) | func TestFindAlbumBadID(t *testing.T) {
  function TestFindAlbums (line 50) | func TestFindAlbums(t *testing.T) {
  function TestFindAlbumTracks (line 88) | func TestFindAlbumTracks(t *testing.T) {

FILE: vendor/github.com/zmb3/spotify/artist.go
  type SimpleArtist (line 11) | type SimpleArtist struct
  type FullArtist (line 22) | type FullArtist struct
  method GetArtist (line 36) | func (c *Client) GetArtist(id ID) (*FullArtist, error) {
  method GetArtists (line 53) | func (c *Client) GetArtists(ids ...ID) ([]*FullArtist, error) {
  method GetArtistsTopTracks (line 71) | func (c *Client) GetArtistsTopTracks(artistID ID, country string) ([]Ful...
  method GetRelatedArtists (line 90) | func (c *Client) GetRelatedArtists(id ID) ([]FullArtist, error) {
  method GetArtistAlbums (line 107) | func (c *Client) GetArtistAlbums(artistID ID) (*SimpleAlbumPage, error) {
  method GetArtistAlbumsOpt (line 116) | func (c *Client) GetArtistAlbumsOpt(artistID ID, options *Options, t *Al...

FILE: vendor/github.com/zmb3/spotify/artist_test.go
  constant albumsResponse (line 22) | albumsResponse = `
  function TestFindArtist (line 81) | func TestFindArtist(t *testing.T) {
  function TestArtistTopTracks (line 97) | func TestArtistTopTracks(t *testing.T) {
  function TestRelatedArtists (line 118) | func TestRelatedArtists(t *testing.T) {
  function TestArtistAlbumsFiltered (line 138) | func TestArtistAlbumsFiltered(t *testing.T) {

FILE: vendor/github.com/zmb3/spotify/audio_analysis.go
  type AudioAnalysis (line 10) | type AudioAnalysis struct
  type Marker (line 22) | type Marker struct
  type AnalysisMeta (line 29) | type AnalysisMeta struct
  type Section (line 42) | type Section struct
  type Segment (line 57) | type Segment struct
  type AnalysisTrack (line 68) | type AnalysisTrack struct
  method GetAudioAnalysis (line 99) | func (c *Client) GetAudioAnalysis(id ID) (*AudioAnalysis, error) {

FILE: vendor/github.com/zmb3/spotify/audio_analysis_test.go
  constant fieldsDifferTemplate (line 9) | fieldsDifferTemplate = "Actual response is not the same as expected resp...
  function TestAudioAnalysis (line 105) | func TestAudioAnalysis(t *testing.T) {

FILE: vendor/github.com/zmb3/spotify/audio_features.go
  type AudioFeatures (line 10) | type AudioFeatures struct
  type Key (line 76) | type Key
  constant C (line 79) | C Key = iota
  constant CSharp (line 80) | CSharp
  constant D (line 81) | D
  constant DSharp (line 82) | DSharp
  constant E (line 83) | E
  constant F (line 84) | F
  constant FSharp (line 85) | FSharp
  constant G (line 86) | G
  constant GSharp (line 87) | GSharp
  constant A (line 88) | A
  constant ASharp (line 89) | ASharp
  constant B (line 90) | B
  constant DFlat (line 91) | DFlat = CSharp
  constant EFlat (line 92) | EFlat = DSharp
  constant GFlat (line 93) | GFlat = FSharp
  constant AFlat (line 94) | AFlat = GSharp
  constant BFlat (line 95) | BFlat = ASharp
  type Mode (line 99) | type Mode
  constant Minor (line 102) | Minor Mode = iota
  constant Major (line 103) | Major
  method GetAudioFeatures (line 110) | func (c *Client) GetAudioFeatures(ids ...ID) ([]*AudioFeatures, error) {

FILE: vendor/github.com/zmb3/spotify/audio_features_test.go
  function TestAudioFeatures (line 71) | func TestAudioFeatures(t *testing.T) {

FILE: vendor/github.com/zmb3/spotify/auth.go
  constant AuthURL (line 15) | AuthURL = "https://accounts.spotify.com/authorize"
  constant TokenURL (line 18) | TokenURL = "https://accounts.spotify.com/api/token"
  constant ScopeImageUpload (line 26) | ScopeImageUpload = "ugc-image-upload"
  constant ScopePlaylistReadPrivate (line 29) | ScopePlaylistReadPrivate = "playlist-read-private"
  constant ScopePlaylistModifyPublic (line 32) | ScopePlaylistModifyPublic = "playlist-modify-public"
  constant ScopePlaylistModifyPrivate (line 35) | ScopePlaylistModifyPrivate = "playlist-modify-private"
  constant ScopePlaylistReadCollaborative (line 38) | ScopePlaylistReadCollaborative = "playlist-read-collaborative"
  constant ScopeUserFollowModify (line 41) | ScopeUserFollowModify = "user-follow-modify"
  constant ScopeUserFollowRead (line 44) | ScopeUserFollowRead = "user-follow-read"
  constant ScopeUserLibraryModify (line 47) | ScopeUserLibraryModify = "user-library-modify"
  constant ScopeUserLibraryRead (line 49) | ScopeUserLibraryRead = "user-library-read"
  constant ScopeUserReadPrivate (line 52) | ScopeUserReadPrivate = "user-read-private"
  constant ScopeUserReadEmail (line 54) | ScopeUserReadEmail = "user-read-email"
  constant ScopeUserReadBirthdate (line 56) | ScopeUserReadBirthdate = "user-read-birthdate"
  constant ScopeUserReadCurrentlyPlaying (line 58) | ScopeUserReadCurrentlyPlaying = "user-read-currently-playing"
  constant ScopeUserReadPlaybackState (line 60) | ScopeUserReadPlaybackState = "user-read-playback-state"
  constant ScopeUserModifyPlaybackState (line 62) | ScopeUserModifyPlaybackState = "user-modify-playback-state"
  constant ScopeUserReadRecentlyPlayed (line 64) | ScopeUserReadRecentlyPlayed = "user-read-recently-played"
  constant ScopeUserTopRead (line 66) | ScopeUserTopRead = "user-top-read"
  type Authenticator (line 82) | type Authenticator struct
    method SetAuthInfo (line 120) | func (a *Authenticator) SetAuthInfo(clientID, secretKey string) {
    method AuthURL (line 130) | func (a Authenticator) AuthURL(state string) string {
    method Token (line 137) | func (a Authenticator) Token(state string, r *http.Request) (*oauth2.T...
    method Exchange (line 155) | func (a Authenticator) Exchange(code string) (*oauth2.Token, error) {
    method NewClient (line 160) | func (a Authenticator) NewClient(token *oauth2.Token) Client {
  function NewAuthenticator (line 95) | func NewAuthenticator(redirectURL string, scopes ...string) Authenticator {
  method Token (line 169) | func (c *Client) Token() (*oauth2.Token, error) {

FILE: vendor/github.com/zmb3/spotify/category.go
  type Category (line 11) | type Category struct
  method GetCategoryOpt (line 32) | func (c *Client) GetCategoryOpt(id, country, locale string) (Category, e...
  method GetCategory (line 56) | func (c *Client) GetCategory(id string) (Category, error) {
  method GetCategoryPlaylists (line 61) | func (c *Client) GetCategoryPlaylists(catID string) (*SimplePlaylistPage...
  method GetCategoryPlaylistsOpt (line 67) | func (c *Client) GetCategoryPlaylistsOpt(catID string, opt *Options) (*S...
  method GetCategories (line 99) | func (c *Client) GetCategories() (*CategoryPage, error) {
  method GetCategoriesOpt (line 109) | func (c *Client) GetCategoriesOpt(opt *Options, locale string) (*Categor...

FILE: vendor/github.com/zmb3/spotify/category_test.go
  function TestGetCategories (line 8) | func TestGetCategories(t *testing.T) {
  function TestGetCategory (line 24) | func TestGetCategory(t *testing.T) {
  function TestGetCategoryPlaylists (line 37) | func TestGetCategoryPlaylists(t *testing.T) {
  function TestGetCategoryOpt (line 59) | func TestGetCategoryOpt(t *testing.T) {
  function TestGetCategoryPlaylistsOpt (line 78) | func TestGetCategoryPlaylistsOpt(t *testing.T) {
  function TestGetCategoriesInvalidToken (line 101) | func TestGetCategoriesInvalidToken(t *testing.T) {

FILE: vendor/github.com/zmb3/spotify/countries.go
  constant CountryArgentina (line 7) | CountryArgentina          = "AR"
  constant CountryAustralia (line 8) | CountryAustralia          = "AU"
  constant CountryAustria (line 9) | CountryAustria            = "AT"
  constant CountryBelarus (line 10) | CountryBelarus            = "BY"
  constant CountryBelgium (line 11) | CountryBelgium            = "BE"
  constant CountryBrazil (line 12) | CountryBrazil             = "BR"
  constant CountryCanada (line 13) | CountryCanada             = "CA"
  constant CountryChile (line 14) | CountryChile              = "CL"
  constant CountryChina (line 15) | CountryChina              = "CN"
  constant CountryGermany (line 16) | CountryGermany            = "DE"
  constant CountryHongKong (line 17) | CountryHongKong           = "HK"
  constant CountryIreland (line 18) | CountryIreland            = "IE"
  constant CountryIndia (line 19) | CountryIndia              = "IN"
  constant CountryItaly (line 20) | CountryItaly              = "IT"
  constant CountryJapan (line 21) | CountryJapan              = "JP"
  constant CountrySpain (line 22) | CountrySpain              = "ES"
  constant CountryFinland (line 23) | CountryFinland            = "FI"
  constant CountryFrance (line 24) | CountryFrance             = "FR"
  constant CountryMexico (line 25) | CountryMexico             = "MX"
  constant CountryNewZealand (line 26) | CountryNewZealand         = "NZ"
  constant CountryRussia (line 27) | CountryRussia             = "RU"
  constant CountrySwitzerland (line 28) | CountrySwitzerland        = "CH"
  constant CountryUnitedArabEmirates (line 29) | CountryUnitedArabEmirates = "AE"
  constant CountryUnitedKingdom (line 30) | CountryUnitedKingdom      = "GB"
  constant CountryUSA (line 31) | CountryUSA                = "US"

FILE: vendor/github.com/zmb3/spotify/cursor.go
  type Cursor (line 10) | type Cursor struct
  type cursorPage (line 17) | type cursorPage struct
  type FullArtistCursorPage (line 34) | type FullArtistCursorPage struct

FILE: vendor/github.com/zmb3/spotify/library.go
  method UserHasTracks (line 12) | func (c *Client) UserHasTracks(ids ...ID) ([]bool, error) {
  method AddTracksToLibrary (line 31) | func (c *Client) AddTracksToLibrary(ids ...ID) error {
  method RemoveTracksFromLibrary (line 39) | func (c *Client) RemoveTracksFromLibrary(ids ...ID) error {
  method modifyLibraryTracks (line 43) | func (c *Client) modifyLibraryTracks(add bool, ids ...ID) error {

FILE: vendor/github.com/zmb3/spotify/library_test.go
  function TestUserHasTracks (line 8) | func TestUserHasTracks(t *testing.T) {
  function TestAddTracksToLibrary (line 24) | func TestAddTracksToLibrary(t *testing.T) {
  function TestAddTracksToLibraryFailure (line 34) | func TestAddTracksToLibraryFailure(t *testing.T) {
  function TestRemoveTracksFromLibrary (line 49) | func TestRemoveTracksFromLibrary(t *testing.T) {

FILE: vendor/github.com/zmb3/spotify/page.go
  type basePage (line 17) | type basePage struct
  type FullArtistPage (line 36) | type FullArtistPage struct
  type SimpleAlbumPage (line 42) | type SimpleAlbumPage struct
  type SavedAlbumPage (line 48) | type SavedAlbumPage struct
  type SimplePlaylistPage (line 54) | type SimplePlaylistPage struct
  type SimpleTrackPage (line 60) | type SimpleTrackPage struct
  type FullTrackPage (line 66) | type FullTrackPage struct
  type SavedTrackPage (line 72) | type SavedTrackPage struct
  type PlaylistTrackPage (line 78) | type PlaylistTrackPage struct
  type CategoryPage (line 84) | type CategoryPage struct

FILE: vendor/github.com/zmb3/spotify/player.go
  type PlayerDevice (line 13) | type PlayerDevice struct
  type PlayerState (line 30) | type PlayerState struct
  type PlaybackContext (line 41) | type PlaybackContext struct
  type CurrentlyPlaying (line 53) | type CurrentlyPlaying struct
  type RecentlyPlayedItem (line 66) | type RecentlyPlayedItem struct
  type RecentlyPlayedResult (line 77) | type RecentlyPlayedResult struct
  type PlaybackOffset (line 84) | type PlaybackOffset struct
  type PlayOptions (line 91) | type PlayOptions struct
  type RecentlyPlayedOptions (line 110) | type RecentlyPlayedOptions struct
  method PlayerDevices (line 127) | func (c *Client) PlayerDevices() ([]PlayerDevice, error) {
  method PlayerState (line 143) | func (c *Client) PlayerState() (*PlayerState, error) {
  method PlayerStateOpt (line 149) | func (c *Client) PlayerStateOpt(opt *Options) (*PlayerState, error) {
  method PlayerCurrentlyPlaying (line 176) | func (c *Client) PlayerCurrentlyPlaying() (*CurrentlyPlaying, error) {
  method PlayerCurrentlyPlayingOpt (line 182) | func (c *Client) PlayerCurrentlyPlayingOpt(opt *Options) (*CurrentlyPlay...
  method PlayerRecentlyPlayed (line 205) | func (c *Client) PlayerRecentlyPlayed() ([]RecentlyPlayedItem, error) {
  method PlayerRecentlyPlayedOpt (line 211) | func (c *Client) PlayerRecentlyPlayedOpt(opt *RecentlyPlayedOptions) ([]...
  method TransferPlayback (line 247) | func (c *Client) TransferPlayback(deviceID ID, play bool) error {
  method Play (line 275) | func (c *Client) Play() error {
  method PlayOpt (line 280) | func (c *Client) PlayOpt(opt *PlayOptions) error {
  method Pause (line 312) | func (c *Client) Pause() error {
  method PauseOpt (line 319) | func (c *Client) PauseOpt(opt *PlayOptions) error {
  method Next (line 345) | func (c *Client) Next() error {
  method NextOpt (line 352) | func (c *Client) NextOpt(opt *PlayOptions) error {
  method Previous (line 378) | func (c *Client) Previous() error {
  method PreviousOpt (line 385) | func (c *Client) PreviousOpt(opt *PlayOptions) error {
  method Seek (line 415) | func (c *Client) Seek(position int) error {
  method SeekOpt (line 422) | func (c *Client) SeekOpt(position int, opt *PlayOptions) error {
  method Repeat (line 437) | func (c *Client) Repeat(state string) error {
  method RepeatOpt (line 444) | func (c *Client) RepeatOpt(state string, opt *PlayOptions) error {
  method Volume (line 459) | func (c *Client) Volume(percent int) error {
  method VolumeOpt (line 466) | func (c *Client) VolumeOpt(percent int, opt *PlayOptions) error {
  method Shuffle (line 479) | func (c *Client) Shuffle(shuffle bool) error {
  method ShuffleOpt (line 486) | func (c *Client) ShuffleOpt(shuffle bool, opt *PlayOptions) error {
  method playerFuncWithOpt (line 496) | func (c *Client) playerFuncWithOpt(urlSuffix string, values url.Values, ...

FILE: vendor/github.com/zmb3/spotify/player_test.go
  function TestTransferPlaybackDeviceUnavailable (line 8) | func TestTransferPlaybackDeviceUnavailable(t *testing.T) {
  function TestTransferPlayback (line 17) | func TestTransferPlayback(t *testing.T) {
  function TestVolume (line 27) | func TestVolume(t *testing.T) {
  function TestPlayerDevices (line 37) | func TestPlayerDevices(t *testing.T) {
  function TestPlayerState (line 58) | func TestPlayerState(t *testing.T) {
  function TestPlayerCurrentlyPlaying (line 89) | func TestPlayerCurrentlyPlaying(t *testing.T) {
  function TestPlayerRecentlyPlayed (line 120) | func TestPlayerRecentlyPlayed(t *testing.T) {
  function TestPlayArgsError (line 141) | func TestPlayArgsError(t *testing.T) {

FILE: vendor/github.com/zmb3/spotify/playlist.go
  type PlaylistTracks (line 16) | type PlaylistTracks struct
  type SimplePlaylist (line 25) | type SimplePlaylist struct
  type FullPlaylist (line 50) | type FullPlaylist struct
  type PlaylistOptions (line 61) | type PlaylistOptions struct
  method FeaturedPlaylistsOpt (line 80) | func (c *Client) FeaturedPlaylistsOpt(opt *PlaylistOptions) (message str...
  method FeaturedPlaylists (line 119) | func (c *Client) FeaturedPlaylists() (message string, playlists *SimpleP...
  method FollowPlaylist (line 131) | func (c *Client) FollowPlaylist(owner ID, playlist ID, public bool) error {
  method UnfollowPlaylist (line 149) | func (c *Client) UnfollowPlaylist(owner, playlist ID) error {
  function buildFollowURI (line 162) | func buildFollowURI(url string, owner, playlist ID) string {
  method GetPlaylistsForUser (line 176) | func (c *Client) GetPlaylistsForUser(userID string) (*SimplePlaylistPage...
  method GetPlaylistsForUserOpt (line 182) | func (c *Client) GetPlaylistsForUserOpt(userID string, opt *Options) (*S...
  method GetPlaylist (line 210) | func (c *Client) GetPlaylist(userID string, playlistID ID) (*FullPlaylis...
  method GetPlaylistOpt (line 232) | func (c *Client) GetPlaylistOpt(userID string, playlistID ID, fields str...
  method GetPlaylistTracks (line 250) | func (c *Client) GetPlaylistTracks(userID string, playlistID ID) (*Playl...
  method GetPlaylistTracksOpt (line 272) | func (c *Client) GetPlaylistTracksOpt(userID string, playlistID ID,
  method CreatePlaylistForUser (line 311) | func (c *Client) CreatePlaylistForUser(userID, playlistName string, publ...
  method ChangePlaylistName (line 343) | func (c *Client) ChangePlaylistName(userID string, playlistID ID, newNam...
  method ChangePlaylistAccess (line 351) | func (c *Client) ChangePlaylistAccess(userID string, playlistID ID, publ...
  method ChangePlaylistNameAndAccess (line 359) | func (c *Client) ChangePlaylistNameAndAccess(userID string, playlistID I...
  method modifyPlaylist (line 363) | func (c *Client) modifyPlaylist(userID string, playlistID ID, newName st...
  method AddTracksToPlaylist (line 393) | func (c *Client) AddTracksToPlaylist(userID string, playlis
Condensed preview — 275 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,766K chars).
[
  {
    "path": ".gitignore",
    "chars": 14,
    "preview": "build\nrelease\n"
  },
  {
    "path": "Formula/spotctl.rb",
    "chars": 339,
    "preview": "class Spotctl < Formula\n  desc \"A CLI to Spotify\"\n  homepage \"https://github.com/jingweno/spotctl\"\n  version \"1.0.1\"\n  s"
  },
  {
    "path": "Gopkg.toml",
    "chars": 747,
    "preview": "\n# Gopkg.toml example\n#\n# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md\n# for detailed Gopkg.tom"
  },
  {
    "path": "LICENSE",
    "chars": 1059,
    "preview": "Copyright (c) 2018 Jingwen Owen Ou\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this"
  },
  {
    "path": "README.md",
    "chars": 2208,
    "preview": "# Spotctl\n\n`spotctl` is command-line interface to control Spotify from your favorite terminal.\n\n## Demo\n\nOne of the high"
  },
  {
    "path": "bin/package",
    "chars": 933,
    "preview": "#!/bin/bash -e\n\nversion() {\n  ver=\"$(git describe --tags HEAD 2>/dev/null || true)\"\n\n  if [ -z \"$ver\" ]; then\n    ver=\"$"
  },
  {
    "path": "cmd/spotctl/auth.go",
    "chars": 1799,
    "preview": "package main\n\nimport (\n\t\"crypto/rand\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\n\t\"github.com/spf13/cobra\"\n\t\"gi"
  },
  {
    "path": "cmd/spotctl/ctl.go",
    "chars": 6994,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/zmb3/spotify\"\n)\n\nvar (\n\tplay"
  },
  {
    "path": "cmd/spotctl/main.go",
    "chars": 3808,
    "preview": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"os/user\"\n\t\"path/filepath\"\n\n\t\"github.com/spf13"
  },
  {
    "path": "cmd/spotctl/player.go",
    "chars": 4487,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"strings\"\n\t\"time\"\n\n\tui \"github.com/gizak/termui\"\n\t\"github.com/spf13/cobra\"\n)\n\nvar "
  },
  {
    "path": "cmd/spotctl/version.go",
    "chars": 41,
    "preview": "package main\n\nvar (\n\tversion = \"1.0.1\"\n)\n"
  },
  {
    "path": "vendor/github.com/golang/protobuf/.gitignore",
    "chars": 160,
    "preview": ".DS_Store\n*.[568ao]\n*.ao\n*.so\n*.pyc\n._*\n.nfs.*\n[568a].out\n*~\n*.orig\ncore\n_obj\n_test\n_testmain.go\nprotoc-gen-go/testdata/"
  },
  {
    "path": "vendor/github.com/golang/protobuf/.travis.yml",
    "chars": 350,
    "preview": "sudo: false\nlanguage: go\ngo:\n- 1.6.x\n- 1.7.x\n- 1.8.x\n- 1.9.x\n\ninstall:\n  - go get -v -d -t github.com/golang/protobuf/.."
  },
  {
    "path": "vendor/github.com/golang/protobuf/AUTHORS",
    "chars": 173,
    "preview": "# This source code refers to The Go Authors for copyright purposes.\n# The master list of authors is in the main Go distr"
  },
  {
    "path": "vendor/github.com/golang/protobuf/CONTRIBUTORS",
    "chars": 170,
    "preview": "# This source code was written by the Go contributors.\n# The master list of contributors is in the main Go distribution,"
  },
  {
    "path": "vendor/github.com/golang/protobuf/LICENSE",
    "chars": 1583,
    "preview": "Go support for Protocol Buffers - Google's data interchange format\n\nCopyright 2010 The Go Authors.  All rights reserved."
  },
  {
    "path": "vendor/github.com/golang/protobuf/Make.protobuf",
    "chars": 1955,
    "preview": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors.  All rights rese"
  },
  {
    "path": "vendor/github.com/golang/protobuf/Makefile",
    "chars": 2113,
    "preview": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors.  All rights rese"
  },
  {
    "path": "vendor/github.com/golang/protobuf/README.md",
    "chars": 9936,
    "preview": "# Go support for Protocol Buffers\n\n[![Build Status](https://travis-ci.org/golang/protobuf.svg?branch=master)](https://tr"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/Makefile",
    "chars": 1934,
    "preview": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors.  All rights rese"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/all_test.go",
    "chars": 67392,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/any_test.go",
    "chars": 8841,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2016 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/clone.go",
    "chars": 6969,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2011 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/clone_test.go",
    "chars": 8029,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2011 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/decode.go",
    "chars": 24427,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/decode_test.go",
    "chars": 7502,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/encode.go",
    "chars": 34774,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/encode_test.go",
    "chars": 2792,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/equal.go",
    "chars": 8625,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2011 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/equal_test.go",
    "chars": 8536,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2011 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/extensions.go",
    "chars": 18200,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/extensions_test.go",
    "chars": 16828,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2014 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/lib.go",
    "chars": 24168,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/map_test.go",
    "chars": 936,
    "preview": "package proto_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/golang/protobuf/proto\"\n\tppb \"github.com/golang/protobuf/pro"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/message_set.go",
    "chars": 9097,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/message_set_test.go",
    "chars": 2608,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2014 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/pointer_reflect.go",
    "chars": 13896,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2012 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/pointer_unsafe.go",
    "chars": 9493,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2012 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/properties.go",
    "chars": 25817,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/proto3_test.go",
    "chars": 4354,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2014 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/size2_test.go",
    "chars": 2334,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2012 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/size_test.go",
    "chars": 8018,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2012 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/text.go",
    "chars": 21196,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/text_parser.go",
    "chars": 22429,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/text_parser_test.go",
    "chars": 15966,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/golang/protobuf/proto/text_test.go",
    "chars": 12147,
    "preview": "// Go support for Protocol Buffers - Google's data interchange format\n//\n// Copyright 2010 The Go Authors.  All rights r"
  },
  {
    "path": "vendor/github.com/inconshreveable/mousetrap/LICENSE",
    "chars": 551,
    "preview": "Copyright 2014 Alan Shreve\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file ex"
  },
  {
    "path": "vendor/github.com/inconshreveable/mousetrap/README.md",
    "chars": 848,
    "preview": "# mousetrap\n\nmousetrap is a tiny library that answers a single question.\n\nOn a Windows machine, was the process invoked "
  },
  {
    "path": "vendor/github.com/inconshreveable/mousetrap/trap_others.go",
    "chars": 483,
    "preview": "// +build !windows\n\npackage mousetrap\n\n// StartedByExplorer returns true if the program was invoked by the user\n// doubl"
  },
  {
    "path": "vendor/github.com/inconshreveable/mousetrap/trap_windows.go",
    "chars": 2393,
    "preview": "// +build windows\n// +build !go1.4\n\npackage mousetrap\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst (\n\t// defined"
  },
  {
    "path": "vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go",
    "chars": 1185,
    "preview": "// +build windows\n// +build go1.4\n\npackage mousetrap\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc getProcessEntry(pid in"
  },
  {
    "path": "vendor/github.com/maruel/panicparse/.travis.yml",
    "chars": 300,
    "preview": "# Copyright 2014 Marc-Antoine Ruel. All rights reserved.\n# Use of this source code is governed under the Apache License,"
  },
  {
    "path": "vendor/github.com/maruel/panicparse/Gopkg.toml",
    "chars": 823,
    "preview": "\n# Gopkg.toml example\n#\n# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md\n# for detailed Gopkg.tom"
  },
  {
    "path": "vendor/github.com/maruel/panicparse/LICENSE",
    "chars": 11347,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "vendor/github.com/maruel/panicparse/README.md",
    "chars": 4094,
    "preview": "panicparse\n==========\n\nParses panic stack traces, densifies and deduplicates goroutines with similar\nstack traces. Helps"
  },
  {
    "path": "vendor/github.com/maruel/panicparse/main.go",
    "chars": 788,
    "preview": "// Copyright 2015 Marc-Antoine Ruel. All rights reserved.\n// Use of this source code is governed under the Apache Licens"
  },
  {
    "path": "vendor/github.com/maruel/panicparse/stack/source.go",
    "chars": 8434,
    "preview": "// Copyright 2015 Marc-Antoine Ruel. All rights reserved.\n// Use of this source code is governed under the Apache Licens"
  },
  {
    "path": "vendor/github.com/maruel/panicparse/stack/source_test.go",
    "chars": 12523,
    "preview": "// Copyright 2015 Marc-Antoine Ruel. All rights reserved.\n// Use of this source code is governed under the Apache Licens"
  },
  {
    "path": "vendor/github.com/maruel/panicparse/stack/stack.go",
    "chars": 23603,
    "preview": "// Copyright 2015 Marc-Antoine Ruel. All rights reserved.\n// Use of this source code is governed under the Apache Licens"
  },
  {
    "path": "vendor/github.com/maruel/panicparse/stack/stack_test.go",
    "chars": 28761,
    "preview": "// Copyright 2015 Marc-Antoine Ruel. All rights reserved.\n// Use of this source code is governed under the Apache Licens"
  },
  {
    "path": "vendor/github.com/maruel/panicparse/stack/ui.go",
    "chars": 3669,
    "preview": "// Copyright 2016 Marc-Antoine Ruel. All rights reserved.\n// Use of this source code is governed under the Apache Licens"
  },
  {
    "path": "vendor/github.com/maruel/panicparse/stack/ui_test.go",
    "chars": 4349,
    "preview": "// Copyright 2016 Marc-Antoine Ruel. All rights reserved.\n// Use of this source code is governed under the Apache Licens"
  },
  {
    "path": "vendor/github.com/mattn/go-runewidth/.travis.yml",
    "chars": 205,
    "preview": "language: go\ngo:\n  - tip\nbefore_install:\n  - go get github.com/mattn/goveralls\n  - go get golang.org/x/tools/cmd/cover\ns"
  },
  {
    "path": "vendor/github.com/mattn/go-runewidth/LICENSE",
    "chars": 1085,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2016 Yasuhiro Matsumoto\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "vendor/github.com/mattn/go-runewidth/README.mkd",
    "chars": 798,
    "preview": "go-runewidth\n============\n\n[![Build Status](https://travis-ci.org/mattn/go-runewidth.png?branch=master)](https://travis-"
  },
  {
    "path": "vendor/github.com/mattn/go-runewidth/runewidth.go",
    "chars": 61195,
    "preview": "package runewidth\n\nvar (\n\t// EastAsianWidth will be set true if the current locale is CJK\n\tEastAsianWidth = IsEastAsian("
  },
  {
    "path": "vendor/github.com/mattn/go-runewidth/runewidth_js.go",
    "chars": 169,
    "preview": "// +build js\n\npackage runewidth\n\nfunc IsEastAsian() bool {\n\t// TODO: Implement this for the web. Detect east asian in a "
  },
  {
    "path": "vendor/github.com/mattn/go-runewidth/runewidth_posix.go",
    "chars": 1376,
    "preview": "// +build !windows,!js\n\npackage runewidth\n\nimport (\n\t\"os\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nvar reLoc = regexp.MustCompile(`^[a-z]"
  },
  {
    "path": "vendor/github.com/mattn/go-runewidth/runewidth_test.go",
    "chars": 5489,
    "preview": "package runewidth\n\nimport (\n\t\"sort\"\n\t\"testing\"\n)\n\nvar _ sort.Interface = (*table)(nil)\n\nfunc (t table) Len() int {\n\tretu"
  },
  {
    "path": "vendor/github.com/mattn/go-runewidth/runewidth_windows.go",
    "chars": 416,
    "preview": "package runewidth\n\nimport (\n\t\"syscall\"\n)\n\nvar (\n\tkernel32               = syscall.NewLazyDLL(\"kernel32\")\n\tprocGetConsole"
  },
  {
    "path": "vendor/github.com/mitchellh/go-wordwrap/LICENSE.md",
    "chars": 1085,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2014 Mitchell Hashimoto\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "vendor/github.com/mitchellh/go-wordwrap/README.md",
    "chars": 1063,
    "preview": "# go-wordwrap\n\n`go-wordwrap` (Golang package: `wordwrap`) is a package for Go that\nautomatically wraps words into multip"
  },
  {
    "path": "vendor/github.com/mitchellh/go-wordwrap/wordwrap.go",
    "chars": 1679,
    "preview": "package wordwrap\n\nimport (\n\t\"bytes\"\n\t\"unicode\"\n)\n\n// WrapString wraps the given string within lim width in characters.\n/"
  },
  {
    "path": "vendor/github.com/mitchellh/go-wordwrap/wordwrap_test.go",
    "chars": 1694,
    "preview": "package wordwrap\n\nimport (\n\t\"testing\"\n)\n\nfunc TestWrapString(t *testing.T) {\n\tcases := []struct {\n\t\tInput, Output string"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/AUTHORS",
    "chars": 101,
    "preview": "# Please keep this file sorted.\n\nGeorg Reinke <guelfey@googlemail.com>\nnsf <no.smile.face@gmail.com>\n"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/LICENSE",
    "chars": 1062,
    "preview": "Copyright (C) 2012 termbox-go authors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof t"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/README.md",
    "chars": 3222,
    "preview": "## Termbox\nTermbox is a library that provides a minimalistic API which allows the programmer to write text-based user in"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/api.go",
    "chars": 11985,
    "preview": "// +build !windows\n\npackage termbox\n\nimport \"github.com/mattn/go-runewidth\"\nimport \"fmt\"\nimport \"os\"\nimport \"os/signal\"\n"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/api_common.go",
    "chars": 4435,
    "preview": "// termbox is a library for creating cross-platform text-based interfaces\npackage termbox\n\n// public API, common OS agno"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/api_windows.go",
    "chars": 6034,
    "preview": "package termbox\n\nimport (\n\t\"syscall\"\n)\n\n// public API\n\n// Initializes termbox library. This function should be called be"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/collect_terminfo.py",
    "chars": 2041,
    "preview": "#!/usr/bin/env python\n\nimport sys, os, subprocess\n\ndef escaped(s):\n\treturn repr(s)[1:-1]\n\ndef tput(term, name):\n\ttry:\n\t\t"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/syscalls.go",
    "chars": 773,
    "preview": "// +build ignore\n\npackage termbox\n\n/*\n#include <termios.h>\n#include <sys/ioctl.h>\n*/\nimport \"C\"\n\ntype syscall_Termios C."
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/syscalls_darwin.go",
    "chars": 753,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs syscalls.go\n\n// +build !amd64\n\npackage termbox\n\ntype syscall_Term"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/syscalls_darwin_amd64.go",
    "chars": 775,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs syscalls.go\n\npackage termbox\n\ntype syscall_Termios struct {\n\tIfla"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/syscalls_dragonfly.go",
    "chars": 735,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs syscalls.go\n\npackage termbox\n\ntype syscall_Termios struct {\n\tIfla"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/syscalls_freebsd.go",
    "chars": 735,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs syscalls.go\n\npackage termbox\n\ntype syscall_Termios struct {\n\tIfla"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/syscalls_linux.go",
    "chars": 828,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs syscalls.go\n\npackage termbox\n\nimport \"syscall\"\n\ntype syscall_Term"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/syscalls_netbsd.go",
    "chars": 733,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs syscalls.go\n\npackage termbox\n\ntype syscall_Termios struct {\n\tIfla"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/syscalls_openbsd.go",
    "chars": 733,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs syscalls.go\n\npackage termbox\n\ntype syscall_Termios struct {\n\tIfla"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/syscalls_windows.go",
    "chars": 1487,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs -- -DUNICODE syscalls.go\n\npackage termbox\n\nconst (\n\tforeground_bl"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/termbox.go",
    "chars": 11043,
    "preview": "// +build !windows\n\npackage termbox\n\nimport \"unicode/utf8\"\nimport \"bytes\"\nimport \"syscall\"\nimport \"unsafe\"\nimport \"strin"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/termbox_common.go",
    "chars": 994,
    "preview": "package termbox\n\n// private API, common OS agnostic part\n\ntype cellbuf struct {\n\twidth  int\n\theight int\n\tcells  []Cell\n}"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/termbox_windows.go",
    "chars": 20930,
    "preview": "package termbox\n\nimport \"syscall\"\nimport \"unsafe\"\nimport \"unicode/utf16\"\nimport \"github.com/mattn/go-runewidth\"\n\ntype (\n"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/terminfo.go",
    "chars": 5437,
    "preview": "// +build !windows\n// This file contains a simple and incomplete implementation of the terminfo\n// database. Information"
  },
  {
    "path": "vendor/github.com/nsf/termbox-go/terminfo_builtin.go",
    "chars": 3427,
    "preview": "// +build !windows\n\npackage termbox\n\n// Eterm\nvar eterm_keys = []string{\n\t\"\\x1b[11~\", \"\\x1b[12~\", \"\\x1b[13~\", \"\\x1b[14~\""
  },
  {
    "path": "vendor/github.com/spf13/cobra/.gitignore",
    "chars": 467,
    "preview": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture spe"
  },
  {
    "path": "vendor/github.com/spf13/cobra/.mailmap",
    "chars": 171,
    "preview": "Steve Francia <steve.francia@gmail.com>\nBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>\nFabiano Franz <ffranz@redhat"
  },
  {
    "path": "vendor/github.com/spf13/cobra/.travis.yml",
    "chars": 521,
    "preview": "language: go\n\nmatrix:\n  include:\n    - go: 1.7.6\n    - go: 1.8.3\n    - go: tip\n  allow_failures:\n    - go: tip\n\nbefore_i"
  },
  {
    "path": "vendor/github.com/spf13/cobra/LICENSE.txt",
    "chars": 10140,
    "preview": "                                Apache License\n                           Version 2.0, January 2004\n                    "
  },
  {
    "path": "vendor/github.com/spf13/cobra/README.md",
    "chars": 23198,
    "preview": "![cobra logo](https://cloud.githubusercontent.com/assets/173412/10886352/ad566232-814f-11e5-9cd0-aa101788c117.png)\n\nCobr"
  },
  {
    "path": "vendor/github.com/spf13/cobra/args.go",
    "chars": 2571,
    "preview": "package cobra\n\nimport (\n\t\"fmt\"\n)\n\ntype PositionalArgs func(cmd *Command, args []string) error\n\n// Legacy arg validation "
  },
  {
    "path": "vendor/github.com/spf13/cobra/args_test.go",
    "chars": 5727,
    "preview": "package cobra\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestNoArgs(t *testing.T) {\n\tc := &Command{Use: \"c\", Args: NoArgs, "
  },
  {
    "path": "vendor/github.com/spf13/cobra/bash_completions.go",
    "chars": 15836,
    "preview": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/spf13/pflag\"\n)\n\n// Annotations for "
  },
  {
    "path": "vendor/github.com/spf13/cobra/bash_completions.md",
    "chars": 6754,
    "preview": "# Generating Bash Completions For Your Own cobra.Command\n\nGenerating bash completions from a cobra command is incredibly"
  },
  {
    "path": "vendor/github.com/spf13/cobra/bash_completions_test.go",
    "chars": 5903,
    "preview": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc checkOmit(t *testing.T, found, unexpecte"
  },
  {
    "path": "vendor/github.com/spf13/cobra/cobra.go",
    "chars": 5953,
    "preview": "// Copyright © 2013 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "vendor/github.com/spf13/cobra/cobra_test.go",
    "chars": 547,
    "preview": "package cobra\n\nimport (\n\t\"testing\"\n\t\"text/template\"\n)\n\nfunc TestAddTemplateFunctions(t *testing.T) {\n\tAddTemplateFunc(\"t"
  },
  {
    "path": "vendor/github.com/spf13/cobra/command.go",
    "chars": 41744,
    "preview": "// Copyright © 2013 Steve Francia <spf@spf13.com>.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "vendor/github.com/spf13/cobra/command_notwin.go",
    "chars": 68,
    "preview": "// +build !windows\n\npackage cobra\n\nvar preExecHookFn func(*Command)\n"
  },
  {
    "path": "vendor/github.com/spf13/cobra/command_test.go",
    "chars": 41841,
    "preview": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/spf13/pflag\"\n)\n\nfunc emptyR"
  },
  {
    "path": "vendor/github.com/spf13/cobra/command_win.go",
    "chars": 305,
    "preview": "// +build windows\n\npackage cobra\n\nimport (\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/inconshreveable/mousetrap\"\n)\n\nvar preExecHookFn ="
  },
  {
    "path": "vendor/github.com/spf13/cobra/zsh_completions.go",
    "chars": 2746,
    "preview": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\n// GenZshCompletionFile generates zsh completion file."
  },
  {
    "path": "vendor/github.com/spf13/cobra/zsh_completions_test.go",
    "chars": 1873,
    "preview": "package cobra\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestZshCompletion(t *testing.T) {\n\ttcs := []struct {\n\t\tna"
  },
  {
    "path": "vendor/github.com/spf13/pflag/.gitignore",
    "chars": 9,
    "preview": ".idea/*\n\n"
  },
  {
    "path": "vendor/github.com/spf13/pflag/.travis.yml",
    "chars": 254,
    "preview": "sudo: false\n\nlanguage: go\n\ngo:\n  - 1.7.3\n  - 1.8.1\n  - tip\n\nmatrix:\n  allow_failures:\n    - go: tip\n\ninstall:\n  - go get"
  },
  {
    "path": "vendor/github.com/spf13/pflag/LICENSE",
    "chars": 1531,
    "preview": "Copyright (c) 2012 Alex Ogier. All rights reserved.\nCopyright (c) 2012 The Go Authors. All rights reserved.\n\nRedistribut"
  },
  {
    "path": "vendor/github.com/spf13/pflag/README.md",
    "chars": 9756,
    "preview": "[![Build Status](https://travis-ci.org/spf13/pflag.svg?branch=master)](https://travis-ci.org/spf13/pflag)\n[![Go Report C"
  },
  {
    "path": "vendor/github.com/spf13/pflag/bool.go",
    "chars": 3072,
    "preview": "package pflag\n\nimport \"strconv\"\n\n// optional interface to indicate boolean flags that can be\n// supplied without \"=value"
  },
  {
    "path": "vendor/github.com/spf13/pflag/bool_slice.go",
    "chars": 4587,
    "preview": "package pflag\n\nimport (\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// -- boolSlice Value\ntype boolSliceValue struct {\n\tvalue   *[]bo"
  },
  {
    "path": "vendor/github.com/spf13/pflag/bool_slice_test.go",
    "chars": 4889,
    "preview": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc setUpBSFlagSet(bsp *[]bool) *FlagSet {\n\tf := New"
  },
  {
    "path": "vendor/github.com/spf13/pflag/bool_test.go",
    "chars": 4461,
    "preview": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "vendor/github.com/spf13/pflag/count.go",
    "chars": 2956,
    "preview": "package pflag\n\nimport \"strconv\"\n\n// -- count Value\ntype countValue int\n\nfunc newCountValue(val int, p *int) *countValue "
  },
  {
    "path": "vendor/github.com/spf13/pflag/count_test.go",
    "chars": 1096,
    "preview": "package pflag\n\nimport (\n\t\"os\"\n\t\"testing\"\n)\n\nfunc setUpCount(c *int) *FlagSet {\n\tf := NewFlagSet(\"test\", ContinueOnError)"
  },
  {
    "path": "vendor/github.com/spf13/pflag/duration.go",
    "chars": 3317,
    "preview": "package pflag\n\nimport (\n\t\"time\"\n)\n\n// -- time.Duration Value\ntype durationValue time.Duration\n\nfunc newDurationValue(val"
  },
  {
    "path": "vendor/github.com/spf13/pflag/example_test.go",
    "chars": 719,
    "preview": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "vendor/github.com/spf13/pflag/export_test.go",
    "chars": 735,
    "preview": "// Copyright 2010 The Go Authors.  All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license"
  },
  {
    "path": "vendor/github.com/spf13/pflag/flag.go",
    "chars": 33559,
    "preview": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "vendor/github.com/spf13/pflag/flag_test.go",
    "chars": 31579,
    "preview": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "vendor/github.com/spf13/pflag/float32.go",
    "chars": 3168,
    "preview": "package pflag\n\nimport \"strconv\"\n\n// -- float32 Value\ntype float32Value float32\n\nfunc newFloat32Value(val float32, p *flo"
  },
  {
    "path": "vendor/github.com/spf13/pflag/float64.go",
    "chars": 3105,
    "preview": "package pflag\n\nimport \"strconv\"\n\n// -- float64 Value\ntype float64Value float64\n\nfunc newFloat64Value(val float64, p *flo"
  },
  {
    "path": "vendor/github.com/spf13/pflag/golangflag.go",
    "chars": 2675,
    "preview": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "vendor/github.com/spf13/pflag/golangflag_test.go",
    "chars": 944,
    "preview": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "vendor/github.com/spf13/pflag/int.go",
    "chars": 2780,
    "preview": "package pflag\n\nimport \"strconv\"\n\n// -- int Value\ntype intValue int\n\nfunc newIntValue(val int, p *int) *intValue {\n\t*p = "
  },
  {
    "path": "vendor/github.com/spf13/pflag/int32.go",
    "chars": 3013,
    "preview": "package pflag\n\nimport \"strconv\"\n\n// -- int32 Value\ntype int32Value int32\n\nfunc newInt32Value(val int32, p *int32) *int32"
  },
  {
    "path": "vendor/github.com/spf13/pflag/int64.go",
    "chars": 2952,
    "preview": "package pflag\n\nimport \"strconv\"\n\n// -- int64 Value\ntype int64Value int64\n\nfunc newInt64Value(val int64, p *int64) *int64"
  },
  {
    "path": "vendor/github.com/spf13/pflag/int8.go",
    "chars": 2935,
    "preview": "package pflag\n\nimport \"strconv\"\n\n// -- int8 Value\ntype int8Value int8\n\nfunc newInt8Value(val int8, p *int8) *int8Value {"
  },
  {
    "path": "vendor/github.com/spf13/pflag/int_slice.go",
    "chars": 3785,
    "preview": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// -- intSlice Value\ntype intSliceValue struct {\n\tvalue   *[]int"
  },
  {
    "path": "vendor/github.com/spf13/pflag/int_slice_test.go",
    "chars": 3696,
    "preview": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "vendor/github.com/spf13/pflag/ip.go",
    "chars": 3043,
    "preview": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"strings\"\n)\n\n// -- net.IP value\ntype ipValue net.IP\n\nfunc newIPValue(val net.IP, "
  },
  {
    "path": "vendor/github.com/spf13/pflag/ip_slice.go",
    "chars": 4675,
    "preview": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"strings\"\n)\n\n// -- ipSlice Value\ntype ipSliceValue struct {\n\tvalue   *[]net"
  },
  {
    "path": "vendor/github.com/spf13/pflag/ip_slice_test.go",
    "chars": 5844,
    "preview": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc setUpIPSFlagSet(ipsp *[]net.IP) *FlagSet {\n\tf := New"
  },
  {
    "path": "vendor/github.com/spf13/pflag/ip_test.go",
    "chars": 1381,
    "preview": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc setUpIP(ip *net.IP) *FlagSet {\n\tf := NewFlagSet(\"test\", C"
  },
  {
    "path": "vendor/github.com/spf13/pflag/ipmask.go",
    "chars": 4052,
    "preview": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"strconv\"\n)\n\n// -- net.IPMask value\ntype ipMaskValue net.IPMask\n\nfunc newIPMaskVa"
  },
  {
    "path": "vendor/github.com/spf13/pflag/ipnet.go",
    "chars": 3330,
    "preview": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"strings\"\n)\n\n// IPNet adapts net.IPNet for use as a flag.\ntype ipNetValue net.IPN"
  },
  {
    "path": "vendor/github.com/spf13/pflag/ipnet_test.go",
    "chars": 1650,
    "preview": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc setUpIPNet(ip *net.IPNet) *FlagSet {\n\tf := NewFlagSet(\"te"
  },
  {
    "path": "vendor/github.com/spf13/pflag/string.go",
    "chars": 2925,
    "preview": "package pflag\n\n// -- string Value\ntype stringValue string\n\nfunc newStringValue(val string, p *string) *stringValue {\n\t*p"
  },
  {
    "path": "vendor/github.com/spf13/pflag/string_array.go",
    "chars": 3825,
    "preview": "package pflag\n\n// -- stringArray Value\ntype stringArrayValue struct {\n\tvalue   *[]string\n\tchanged bool\n}\n\nfunc newString"
  },
  {
    "path": "vendor/github.com/spf13/pflag/string_array_test.go",
    "chars": 5752,
    "preview": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "vendor/github.com/spf13/pflag/string_slice.go",
    "chars": 4055,
    "preview": "package pflag\n\nimport (\n\t\"bytes\"\n\t\"encoding/csv\"\n\t\"strings\"\n)\n\n// -- stringSlice Value\ntype stringSliceValue struct {\n\tv"
  },
  {
    "path": "vendor/github.com/spf13/pflag/string_slice_test.go",
    "chars": 6225,
    "preview": "// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
  },
  {
    "path": "vendor/github.com/spf13/pflag/uint.go",
    "chars": 2935,
    "preview": "package pflag\n\nimport \"strconv\"\n\n// -- uint Value\ntype uintValue uint\n\nfunc newUintValue(val uint, p *uint) *uintValue {"
  },
  {
    "path": "vendor/github.com/spf13/pflag/uint16.go",
    "chars": 3072,
    "preview": "package pflag\n\nimport \"strconv\"\n\n// -- uint16 value\ntype uint16Value uint16\n\nfunc newUint16Value(val uint16, p *uint16) "
  },
  {
    "path": "vendor/github.com/spf13/pflag/uint32.go",
    "chars": 3088,
    "preview": "package pflag\n\nimport \"strconv\"\n\n// -- uint32 value\ntype uint32Value uint32\n\nfunc newUint32Value(val uint32, p *uint32) "
  },
  {
    "path": "vendor/github.com/spf13/pflag/uint64.go",
    "chars": 3085,
    "preview": "package pflag\n\nimport \"strconv\"\n\n// -- uint64 Value\ntype uint64Value uint64\n\nfunc newUint64Value(val uint64, p *uint64) "
  },
  {
    "path": "vendor/github.com/spf13/pflag/uint8.go",
    "chars": 3007,
    "preview": "package pflag\n\nimport \"strconv\"\n\n// -- uint8 Value\ntype uint8Value uint8\n\nfunc newUint8Value(val uint8, p *uint8) *uint8"
  },
  {
    "path": "vendor/github.com/spf13/pflag/uint_slice.go",
    "chars": 3893,
    "preview": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// -- uintSlice Value\ntype uintSliceValue struct {\n\tvalue   *[]u"
  },
  {
    "path": "vendor/github.com/spf13/pflag/uint_slice_test.go",
    "chars": 3742,
    "preview": "package pflag\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc setUpUISFlagSet(uisp *[]uint) *FlagSet {\n\tf := N"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/.travis.yml",
    "chars": 34,
    "preview": "language: go\n\ngo:\n  - 1.8\n  - 1.9\n"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/LICENSE",
    "chars": 11324,
    "preview": "Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licens"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/README.md",
    "chars": 4065,
    "preview": "\nSpotify\n=======\n\n[![GoDoc](https://godoc.org/github.com/zmb3/spotify?status.svg)](http://godoc.org/github.com/zmb3/spot"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/album.go",
    "chars": 6648,
    "preview": "package spotify\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\n// SimpleAlbum contains basic dat"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/album_test.go",
    "chars": 3024,
    "preview": "package spotify\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n)\n\n// The example from https://developer.spotify.com/web-api/get-album/"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/artist.go",
    "chars": 4740,
    "preview": "package spotify\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// SimpleArtist contains basic info about an artist"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/artist_test.go",
    "chars": 5408,
    "preview": "// Copyright 2014, 2015 Zac Bergquist\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may n"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/audio_analysis.go",
    "chars": 4248,
    "preview": "package spotify\n\nimport (\n\t\"fmt\"\n)\n\n// AudioAnalysis contains a detailed audio analysis for a single track\n// identified"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/audio_analysis_test.go",
    "chars": 3569,
    "preview": "package spotify\n\nimport (\n\t\"net/http\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nconst fieldsDifferTemplate = \"Actual response is not the "
  },
  {
    "path": "vendor/github.com/zmb3/spotify/audio_features.go",
    "chars": 4660,
    "preview": "package spotify\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// AudioFeatures contains various high-level acoustic attributes\n// for a"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/audio_features_test.go",
    "chars": 3062,
    "preview": "package spotify\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n)\n\nvar response = `\n{\n  \"audio_features\" : [ {\n    \"danceability\" : 0.8"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/auth.go",
    "chars": 6931,
    "preview": "package spotify\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"errors\"\n\t\"net/http\"\n\t\"os\"\n\n\t\"golang.org/x/oauth2\"\n)\n\nconst (\n\t// Au"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/category.go",
    "chars": 4169,
    "preview": "package spotify\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\t\"strconv\"\n)\n\n// Category is used by Spotify to tag items in.  For example, "
  },
  {
    "path": "vendor/github.com/zmb3/spotify/category_test.go",
    "chars": 6930,
    "preview": "package spotify\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n)\n\nfunc TestGetCategories(t *testing.T) {\n\tclient, server := testClient"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/countries.go",
    "chars": 974,
    "preview": "package spotify\n\n// ISO 3166-1 alpha 2 country codes.\n//\n// see: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\nconst "
  },
  {
    "path": "vendor/github.com/zmb3/spotify/cursor.go",
    "chars": 1298,
    "preview": "package spotify\n\n// This file contains the types that implement Spotify's cursor-based\n// paging object.  Like the stand"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/full_tests.bat",
    "chars": 199,
    "preview": "@echo off\nREM - The tests that actually hit the Spotify Web API don't run by default.\nREM - Use this script to run them "
  },
  {
    "path": "vendor/github.com/zmb3/spotify/library.go",
    "chars": 1805,
    "preview": "package spotify\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n)\n\n// UserHasTracks checks if one or more tracks are s"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/library_test.go",
    "chars": 1350,
    "preview": "package spotify\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n)\n\nfunc TestUserHasTracks(t *testing.T) {\n\tclient, server := testClient"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/page.go",
    "chars": 2520,
    "preview": "package spotify\n\nimport (\n\t\"errors\"\n)\n\n// ErrNoMorePages is the error returned when you attempt to get the next\n// (or p"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/player.go",
    "chars": 14917,
    "preview": "package spotify\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"time\"\n)\n\n// PlayerDevice contain"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/player_test.go",
    "chars": 3380,
    "preview": "package spotify\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n)\n\nfunc TestTransferPlaybackDeviceUnavailable(t *testing.T) {\n\tclient, "
  },
  {
    "path": "vendor/github.com/zmb3/spotify/playlist.go",
    "chars": 23206,
    "preview": "package spotify\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strconv\"\n\t\""
  },
  {
    "path": "vendor/github.com/zmb3/spotify/playlist_test.go",
    "chars": 12388,
    "preview": "package spotify\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestFeatu"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/recommendation.go",
    "chars": 3607,
    "preview": "package spotify\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// Seeds contains IDs of artists, genres and/or tra"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/recommendation_test.go",
    "chars": 2148,
    "preview": "package spotify\n\nimport (\n\t\"net/url\"\n\t\"testing\"\n)\n\nfunc TestGetRecommendations(t *testing.T) {\n\t// test data correspondi"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/search.go",
    "chars": 7363,
    "preview": "package spotify\n\nimport (\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\t// MarketFromToken can be used in place of the Ma"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/search_test.go",
    "chars": 3935,
    "preview": "package spotify\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n)\n\nfunc TestSearchArtist(t *testing.T) {\n\tclient, server := testClientF"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/spotify.go",
    "chars": 7862,
    "preview": "// Package spotify provides utilties for interfacing\n// with Spotify's Web API.\npackage spotify\n\nimport (\n\t\"bytes\"\n\t\"enc"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/spotify_test.go",
    "chars": 2682,
    "preview": "package spotify\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc testClient(code int"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/track.go",
    "chars": 4079,
    "preview": "package spotify\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n)\n\n// SimpleTrack contains basic info about a track.\ntype "
  },
  {
    "path": "vendor/github.com/zmb3/spotify/track_attributes.go",
    "chars": 18424,
    "preview": "package spotify\n\n// TrackAttributes contains various tuneable parameters that can be used for recommendations.\n// For ea"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/track_test.go",
    "chars": 1340,
    "preview": "package spotify\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n)\n\nfunc TestFindTrack(t *testing.T) {\n\tclient, server := testClientFile"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/user.go",
    "chars": 12300,
    "preview": "package spotify\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// User contains the basic, p"
  },
  {
    "path": "vendor/github.com/zmb3/spotify/user_test.go",
    "chars": 11900,
    "preview": "package spotify\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"strings\"\n\t\"testing\"\n)\n\nconst userResponse = `\n"
  },
  {
    "path": "vendor/golang.org/x/net/.gitattributes",
    "chars": 345,
    "preview": "# Treat all files in this repo as binary, with no git magic updating\n# line endings. Windows users contributing to Go wi"
  },
  {
    "path": "vendor/golang.org/x/net/.gitignore",
    "chars": 84,
    "preview": "# Add no patterns to .hgignore except for files generated by the build.\nlast-change\n"
  },
  {
    "path": "vendor/golang.org/x/net/AUTHORS",
    "chars": 173,
    "preview": "# This source code refers to The Go Authors for copyright purposes.\n# The master list of authors is in the main Go distr"
  },
  {
    "path": "vendor/golang.org/x/net/CONTRIBUTING.md",
    "chars": 1031,
    "preview": "# Contributing to Go\n\nGo is an open source project.\n\nIt is the work of hundreds of contributors. We appreciate your help"
  },
  {
    "path": "vendor/golang.org/x/net/CONTRIBUTORS",
    "chars": 170,
    "preview": "# This source code was written by the Go contributors.\n# The master list of contributors is in the main Go distribution,"
  },
  {
    "path": "vendor/golang.org/x/net/LICENSE",
    "chars": 1479,
    "preview": "Copyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or with"
  },
  {
    "path": "vendor/golang.org/x/net/PATENTS",
    "chars": 1303,
    "preview": "Additional IP Rights Grant (Patents)\n\n\"This implementation\" means the copyrightable works distributed by\nGoogle as part "
  },
  {
    "path": "vendor/golang.org/x/net/README.md",
    "chars": 597,
    "preview": "# Go Networking\n\nThis repository holds supplementary Go networking libraries.\n\n## Download/Install\n\nThe easiest way to i"
  }
]

// ... and 75 more files (download for full content)

About this extraction

This page contains the full source code of the jingweno/spotctl GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 275 files (1.5 MB), approximately 486.4k tokens, and a symbol index with 3798 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!