- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew
-
-import (
- "fmt"
- "io"
-)
-
-// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter. It
-// returns the formatted string as a value that satisfies error. See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Errorf(format, spew.NewFormatter(a), spew.NewFormatter(b))
-func Errorf(format string, a ...interface{}) (err error) {
- return fmt.Errorf(format, convertArgs(a)...)
-}
-
-// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter. It
-// returns the number of bytes written and any write error encountered. See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Fprint(w, spew.NewFormatter(a), spew.NewFormatter(b))
-func Fprint(w io.Writer, a ...interface{}) (n int, err error) {
- return fmt.Fprint(w, convertArgs(a)...)
-}
-
-// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter. It
-// returns the number of bytes written and any write error encountered. See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Fprintf(w, format, spew.NewFormatter(a), spew.NewFormatter(b))
-func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) {
- return fmt.Fprintf(w, format, convertArgs(a)...)
-}
-
-// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it
-// passed with a default Formatter interface returned by NewFormatter. See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Fprintln(w, spew.NewFormatter(a), spew.NewFormatter(b))
-func Fprintln(w io.Writer, a ...interface{}) (n int, err error) {
- return fmt.Fprintln(w, convertArgs(a)...)
-}
-
-// Print is a wrapper for fmt.Print that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter. It
-// returns the number of bytes written and any write error encountered. See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Print(spew.NewFormatter(a), spew.NewFormatter(b))
-func Print(a ...interface{}) (n int, err error) {
- return fmt.Print(convertArgs(a)...)
-}
-
-// Printf is a wrapper for fmt.Printf that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter. It
-// returns the number of bytes written and any write error encountered. See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Printf(format, spew.NewFormatter(a), spew.NewFormatter(b))
-func Printf(format string, a ...interface{}) (n int, err error) {
- return fmt.Printf(format, convertArgs(a)...)
-}
-
-// Println is a wrapper for fmt.Println that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter. It
-// returns the number of bytes written and any write error encountered. See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Println(spew.NewFormatter(a), spew.NewFormatter(b))
-func Println(a ...interface{}) (n int, err error) {
- return fmt.Println(convertArgs(a)...)
-}
-
-// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter. It
-// returns the resulting string. See NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Sprint(spew.NewFormatter(a), spew.NewFormatter(b))
-func Sprint(a ...interface{}) string {
- return fmt.Sprint(convertArgs(a)...)
-}
-
-// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter. It
-// returns the resulting string. See NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Sprintf(format, spew.NewFormatter(a), spew.NewFormatter(b))
-func Sprintf(format string, a ...interface{}) string {
- return fmt.Sprintf(format, convertArgs(a)...)
-}
-
-// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it
-// were passed with a default Formatter interface returned by NewFormatter. It
-// returns the resulting string. See NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-// fmt.Sprintln(spew.NewFormatter(a), spew.NewFormatter(b))
-func Sprintln(a ...interface{}) string {
- return fmt.Sprintln(convertArgs(a)...)
-}
-
-// convertArgs accepts a slice of arguments and returns a slice of the same
-// length with each argument converted to a default spew Formatter interface.
-func convertArgs(args []interface{}) (formatters []interface{}) {
- formatters = make([]interface{}, len(args))
- for index, arg := range args {
- formatters[index] = NewFormatter(arg)
- }
- return formatters
-}
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/pmezard/go-difflib/LICENSE b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/pmezard/go-difflib/LICENSE
deleted file mode 100644
index c67dad612..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/pmezard/go-difflib/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) 2013, Patrick Mezard
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
- The names of its contributors may not be used to endorse or promote
-products derived from this software without specific prior written
-permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
-IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/pmezard/go-difflib/difflib/difflib.go b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/pmezard/go-difflib/difflib/difflib.go
deleted file mode 100644
index 003e99fad..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/pmezard/go-difflib/difflib/difflib.go
+++ /dev/null
@@ -1,772 +0,0 @@
-// Package difflib is a partial port of Python difflib module.
-//
-// It provides tools to compare sequences of strings and generate textual diffs.
-//
-// The following class and functions have been ported:
-//
-// - SequenceMatcher
-//
-// - unified_diff
-//
-// - context_diff
-//
-// Getting unified diffs was the main goal of the port. Keep in mind this code
-// is mostly suitable to output text differences in a human friendly way, there
-// are no guarantees generated diffs are consumable by patch(1).
-package difflib
-
-import (
- "bufio"
- "bytes"
- "fmt"
- "io"
- "strings"
-)
-
-func min(a, b int) int {
- if a < b {
- return a
- }
- return b
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}
-
-func calculateRatio(matches, length int) float64 {
- if length > 0 {
- return 2.0 * float64(matches) / float64(length)
- }
- return 1.0
-}
-
-type Match struct {
- A int
- B int
- Size int
-}
-
-type OpCode struct {
- Tag byte
- I1 int
- I2 int
- J1 int
- J2 int
-}
-
-// SequenceMatcher compares sequence of strings. The basic
-// algorithm predates, and is a little fancier than, an algorithm
-// published in the late 1980's by Ratcliff and Obershelp under the
-// hyperbolic name "gestalt pattern matching". The basic idea is to find
-// the longest contiguous matching subsequence that contains no "junk"
-// elements (R-O doesn't address junk). The same idea is then applied
-// recursively to the pieces of the sequences to the left and to the right
-// of the matching subsequence. This does not yield minimal edit
-// sequences, but does tend to yield matches that "look right" to people.
-//
-// SequenceMatcher tries to compute a "human-friendly diff" between two
-// sequences. Unlike e.g. UNIX(tm) diff, the fundamental notion is the
-// longest *contiguous* & junk-free matching subsequence. That's what
-// catches peoples' eyes. The Windows(tm) windiff has another interesting
-// notion, pairing up elements that appear uniquely in each sequence.
-// That, and the method here, appear to yield more intuitive difference
-// reports than does diff. This method appears to be the least vulnerable
-// to synching up on blocks of "junk lines", though (like blank lines in
-// ordinary text files, or maybe "" lines in HTML files). That may be
-// because this is the only method of the 3 that has a *concept* of
-// "junk" .
-//
-// Timing: Basic R-O is cubic time worst case and quadratic time expected
-// case. SequenceMatcher is quadratic time for the worst case and has
-// expected-case behavior dependent in a complicated way on how many
-// elements the sequences have in common; best case time is linear.
-type SequenceMatcher struct {
- a []string
- b []string
- b2j map[string][]int
- IsJunk func(string) bool
- autoJunk bool
- bJunk map[string]struct{}
- matchingBlocks []Match
- fullBCount map[string]int
- bPopular map[string]struct{}
- opCodes []OpCode
-}
-
-func NewMatcher(a, b []string) *SequenceMatcher {
- m := SequenceMatcher{autoJunk: true}
- m.SetSeqs(a, b)
- return &m
-}
-
-func NewMatcherWithJunk(a, b []string, autoJunk bool,
- isJunk func(string) bool) *SequenceMatcher {
-
- m := SequenceMatcher{IsJunk: isJunk, autoJunk: autoJunk}
- m.SetSeqs(a, b)
- return &m
-}
-
-// Set two sequences to be compared.
-func (m *SequenceMatcher) SetSeqs(a, b []string) {
- m.SetSeq1(a)
- m.SetSeq2(b)
-}
-
-// Set the first sequence to be compared. The second sequence to be compared is
-// not changed.
-//
-// SequenceMatcher computes and caches detailed information about the second
-// sequence, so if you want to compare one sequence S against many sequences,
-// use .SetSeq2(s) once and call .SetSeq1(x) repeatedly for each of the other
-// sequences.
-//
-// See also SetSeqs() and SetSeq2().
-func (m *SequenceMatcher) SetSeq1(a []string) {
- if &a == &m.a {
- return
- }
- m.a = a
- m.matchingBlocks = nil
- m.opCodes = nil
-}
-
-// Set the second sequence to be compared. The first sequence to be compared is
-// not changed.
-func (m *SequenceMatcher) SetSeq2(b []string) {
- if &b == &m.b {
- return
- }
- m.b = b
- m.matchingBlocks = nil
- m.opCodes = nil
- m.fullBCount = nil
- m.chainB()
-}
-
-func (m *SequenceMatcher) chainB() {
- // Populate line -> index mapping
- b2j := map[string][]int{}
- for i, s := range m.b {
- indices := b2j[s]
- indices = append(indices, i)
- b2j[s] = indices
- }
-
- // Purge junk elements
- m.bJunk = map[string]struct{}{}
- if m.IsJunk != nil {
- junk := m.bJunk
- for s, _ := range b2j {
- if m.IsJunk(s) {
- junk[s] = struct{}{}
- }
- }
- for s, _ := range junk {
- delete(b2j, s)
- }
- }
-
- // Purge remaining popular elements
- popular := map[string]struct{}{}
- n := len(m.b)
- if m.autoJunk && n >= 200 {
- ntest := n/100 + 1
- for s, indices := range b2j {
- if len(indices) > ntest {
- popular[s] = struct{}{}
- }
- }
- for s, _ := range popular {
- delete(b2j, s)
- }
- }
- m.bPopular = popular
- m.b2j = b2j
-}
-
-func (m *SequenceMatcher) isBJunk(s string) bool {
- _, ok := m.bJunk[s]
- return ok
-}
-
-// Find longest matching block in a[alo:ahi] and b[blo:bhi].
-//
-// If IsJunk is not defined:
-//
-// Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where
-// alo <= i <= i+k <= ahi
-// blo <= j <= j+k <= bhi
-// and for all (i',j',k') meeting those conditions,
-// k >= k'
-// i <= i'
-// and if i == i', j <= j'
-//
-// In other words, of all maximal matching blocks, return one that
-// starts earliest in a, and of all those maximal matching blocks that
-// start earliest in a, return the one that starts earliest in b.
-//
-// If IsJunk is defined, first the longest matching block is
-// determined as above, but with the additional restriction that no
-// junk element appears in the block. Then that block is extended as
-// far as possible by matching (only) junk elements on both sides. So
-// the resulting block never matches on junk except as identical junk
-// happens to be adjacent to an "interesting" match.
-//
-// If no blocks match, return (alo, blo, 0).
-func (m *SequenceMatcher) findLongestMatch(alo, ahi, blo, bhi int) Match {
- // CAUTION: stripping common prefix or suffix would be incorrect.
- // E.g.,
- // ab
- // acab
- // Longest matching block is "ab", but if common prefix is
- // stripped, it's "a" (tied with "b"). UNIX(tm) diff does so
- // strip, so ends up claiming that ab is changed to acab by
- // inserting "ca" in the middle. That's minimal but unintuitive:
- // "it's obvious" that someone inserted "ac" at the front.
- // Windiff ends up at the same place as diff, but by pairing up
- // the unique 'b's and then matching the first two 'a's.
- besti, bestj, bestsize := alo, blo, 0
-
- // find longest junk-free match
- // during an iteration of the loop, j2len[j] = length of longest
- // junk-free match ending with a[i-1] and b[j]
- j2len := map[int]int{}
- for i := alo; i != ahi; i++ {
- // look at all instances of a[i] in b; note that because
- // b2j has no junk keys, the loop is skipped if a[i] is junk
- newj2len := map[int]int{}
- for _, j := range m.b2j[m.a[i]] {
- // a[i] matches b[j]
- if j < blo {
- continue
- }
- if j >= bhi {
- break
- }
- k := j2len[j-1] + 1
- newj2len[j] = k
- if k > bestsize {
- besti, bestj, bestsize = i-k+1, j-k+1, k
- }
- }
- j2len = newj2len
- }
-
- // Extend the best by non-junk elements on each end. In particular,
- // "popular" non-junk elements aren't in b2j, which greatly speeds
- // the inner loop above, but also means "the best" match so far
- // doesn't contain any junk *or* popular non-junk elements.
- for besti > alo && bestj > blo && !m.isBJunk(m.b[bestj-1]) &&
- m.a[besti-1] == m.b[bestj-1] {
- besti, bestj, bestsize = besti-1, bestj-1, bestsize+1
- }
- for besti+bestsize < ahi && bestj+bestsize < bhi &&
- !m.isBJunk(m.b[bestj+bestsize]) &&
- m.a[besti+bestsize] == m.b[bestj+bestsize] {
- bestsize += 1
- }
-
- // Now that we have a wholly interesting match (albeit possibly
- // empty!), we may as well suck up the matching junk on each
- // side of it too. Can't think of a good reason not to, and it
- // saves post-processing the (possibly considerable) expense of
- // figuring out what to do with it. In the case of an empty
- // interesting match, this is clearly the right thing to do,
- // because no other kind of match is possible in the regions.
- for besti > alo && bestj > blo && m.isBJunk(m.b[bestj-1]) &&
- m.a[besti-1] == m.b[bestj-1] {
- besti, bestj, bestsize = besti-1, bestj-1, bestsize+1
- }
- for besti+bestsize < ahi && bestj+bestsize < bhi &&
- m.isBJunk(m.b[bestj+bestsize]) &&
- m.a[besti+bestsize] == m.b[bestj+bestsize] {
- bestsize += 1
- }
-
- return Match{A: besti, B: bestj, Size: bestsize}
-}
-
-// Return list of triples describing matching subsequences.
-//
-// Each triple is of the form (i, j, n), and means that
-// a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in
-// i and in j. It's also guaranteed that if (i, j, n) and (i', j', n') are
-// adjacent triples in the list, and the second is not the last triple in the
-// list, then i+n != i' or j+n != j'. IOW, adjacent triples never describe
-// adjacent equal blocks.
-//
-// The last triple is a dummy, (len(a), len(b), 0), and is the only
-// triple with n==0.
-func (m *SequenceMatcher) GetMatchingBlocks() []Match {
- if m.matchingBlocks != nil {
- return m.matchingBlocks
- }
-
- var matchBlocks func(alo, ahi, blo, bhi int, matched []Match) []Match
- matchBlocks = func(alo, ahi, blo, bhi int, matched []Match) []Match {
- match := m.findLongestMatch(alo, ahi, blo, bhi)
- i, j, k := match.A, match.B, match.Size
- if match.Size > 0 {
- if alo < i && blo < j {
- matched = matchBlocks(alo, i, blo, j, matched)
- }
- matched = append(matched, match)
- if i+k < ahi && j+k < bhi {
- matched = matchBlocks(i+k, ahi, j+k, bhi, matched)
- }
- }
- return matched
- }
- matched := matchBlocks(0, len(m.a), 0, len(m.b), nil)
-
- // It's possible that we have adjacent equal blocks in the
- // matching_blocks list now.
- nonAdjacent := []Match{}
- i1, j1, k1 := 0, 0, 0
- for _, b := range matched {
- // Is this block adjacent to i1, j1, k1?
- i2, j2, k2 := b.A, b.B, b.Size
- if i1+k1 == i2 && j1+k1 == j2 {
- // Yes, so collapse them -- this just increases the length of
- // the first block by the length of the second, and the first
- // block so lengthened remains the block to compare against.
- k1 += k2
- } else {
- // Not adjacent. Remember the first block (k1==0 means it's
- // the dummy we started with), and make the second block the
- // new block to compare against.
- if k1 > 0 {
- nonAdjacent = append(nonAdjacent, Match{i1, j1, k1})
- }
- i1, j1, k1 = i2, j2, k2
- }
- }
- if k1 > 0 {
- nonAdjacent = append(nonAdjacent, Match{i1, j1, k1})
- }
-
- nonAdjacent = append(nonAdjacent, Match{len(m.a), len(m.b), 0})
- m.matchingBlocks = nonAdjacent
- return m.matchingBlocks
-}
-
-// Return list of 5-tuples describing how to turn a into b.
-//
-// Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple
-// has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the
-// tuple preceding it, and likewise for j1 == the previous j2.
-//
-// The tags are characters, with these meanings:
-//
-// 'r' (replace): a[i1:i2] should be replaced by b[j1:j2]
-//
-// 'd' (delete): a[i1:i2] should be deleted, j1==j2 in this case.
-//
-// 'i' (insert): b[j1:j2] should be inserted at a[i1:i1], i1==i2 in this case.
-//
-// 'e' (equal): a[i1:i2] == b[j1:j2]
-func (m *SequenceMatcher) GetOpCodes() []OpCode {
- if m.opCodes != nil {
- return m.opCodes
- }
- i, j := 0, 0
- matching := m.GetMatchingBlocks()
- opCodes := make([]OpCode, 0, len(matching))
- for _, m := range matching {
- // invariant: we've pumped out correct diffs to change
- // a[:i] into b[:j], and the next matching block is
- // a[ai:ai+size] == b[bj:bj+size]. So we need to pump
- // out a diff to change a[i:ai] into b[j:bj], pump out
- // the matching block, and move (i,j) beyond the match
- ai, bj, size := m.A, m.B, m.Size
- tag := byte(0)
- if i < ai && j < bj {
- tag = 'r'
- } else if i < ai {
- tag = 'd'
- } else if j < bj {
- tag = 'i'
- }
- if tag > 0 {
- opCodes = append(opCodes, OpCode{tag, i, ai, j, bj})
- }
- i, j = ai+size, bj+size
- // the list of matching blocks is terminated by a
- // sentinel with size 0
- if size > 0 {
- opCodes = append(opCodes, OpCode{'e', ai, i, bj, j})
- }
- }
- m.opCodes = opCodes
- return m.opCodes
-}
-
-// Isolate change clusters by eliminating ranges with no changes.
-//
-// Return a generator of groups with up to n lines of context.
-// Each group is in the same format as returned by GetOpCodes().
-func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode {
- if n < 0 {
- n = 3
- }
- codes := m.GetOpCodes()
- if len(codes) == 0 {
- codes = []OpCode{OpCode{'e', 0, 1, 0, 1}}
- }
- // Fixup leading and trailing groups if they show no changes.
- if codes[0].Tag == 'e' {
- c := codes[0]
- i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2
- codes[0] = OpCode{c.Tag, max(i1, i2-n), i2, max(j1, j2-n), j2}
- }
- if codes[len(codes)-1].Tag == 'e' {
- c := codes[len(codes)-1]
- i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2
- codes[len(codes)-1] = OpCode{c.Tag, i1, min(i2, i1+n), j1, min(j2, j1+n)}
- }
- nn := n + n
- groups := [][]OpCode{}
- group := []OpCode{}
- for _, c := range codes {
- i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2
- // End the current group and start a new one whenever
- // there is a large range with no changes.
- if c.Tag == 'e' && i2-i1 > nn {
- group = append(group, OpCode{c.Tag, i1, min(i2, i1+n),
- j1, min(j2, j1+n)})
- groups = append(groups, group)
- group = []OpCode{}
- i1, j1 = max(i1, i2-n), max(j1, j2-n)
- }
- group = append(group, OpCode{c.Tag, i1, i2, j1, j2})
- }
- if len(group) > 0 && !(len(group) == 1 && group[0].Tag == 'e') {
- groups = append(groups, group)
- }
- return groups
-}
-
-// Return a measure of the sequences' similarity (float in [0,1]).
-//
-// Where T is the total number of elements in both sequences, and
-// M is the number of matches, this is 2.0*M / T.
-// Note that this is 1 if the sequences are identical, and 0 if
-// they have nothing in common.
-//
-// .Ratio() is expensive to compute if you haven't already computed
-// .GetMatchingBlocks() or .GetOpCodes(), in which case you may
-// want to try .QuickRatio() or .RealQuickRation() first to get an
-// upper bound.
-func (m *SequenceMatcher) Ratio() float64 {
- matches := 0
- for _, m := range m.GetMatchingBlocks() {
- matches += m.Size
- }
- return calculateRatio(matches, len(m.a)+len(m.b))
-}
-
-// Return an upper bound on ratio() relatively quickly.
-//
-// This isn't defined beyond that it is an upper bound on .Ratio(), and
-// is faster to compute.
-func (m *SequenceMatcher) QuickRatio() float64 {
- // viewing a and b as multisets, set matches to the cardinality
- // of their intersection; this counts the number of matches
- // without regard to order, so is clearly an upper bound
- if m.fullBCount == nil {
- m.fullBCount = map[string]int{}
- for _, s := range m.b {
- m.fullBCount[s] = m.fullBCount[s] + 1
- }
- }
-
- // avail[x] is the number of times x appears in 'b' less the
- // number of times we've seen it in 'a' so far ... kinda
- avail := map[string]int{}
- matches := 0
- for _, s := range m.a {
- n, ok := avail[s]
- if !ok {
- n = m.fullBCount[s]
- }
- avail[s] = n - 1
- if n > 0 {
- matches += 1
- }
- }
- return calculateRatio(matches, len(m.a)+len(m.b))
-}
-
-// Return an upper bound on ratio() very quickly.
-//
-// This isn't defined beyond that it is an upper bound on .Ratio(), and
-// is faster to compute than either .Ratio() or .QuickRatio().
-func (m *SequenceMatcher) RealQuickRatio() float64 {
- la, lb := len(m.a), len(m.b)
- return calculateRatio(min(la, lb), la+lb)
-}
-
-// Convert range to the "ed" format
-func formatRangeUnified(start, stop int) string {
- // Per the diff spec at http://www.unix.org/single_unix_specification/
- beginning := start + 1 // lines start numbering with one
- length := stop - start
- if length == 1 {
- return fmt.Sprintf("%d", beginning)
- }
- if length == 0 {
- beginning -= 1 // empty ranges begin at line just before the range
- }
- return fmt.Sprintf("%d,%d", beginning, length)
-}
-
-// Unified diff parameters
-type UnifiedDiff struct {
- A []string // First sequence lines
- FromFile string // First file name
- FromDate string // First file time
- B []string // Second sequence lines
- ToFile string // Second file name
- ToDate string // Second file time
- Eol string // Headers end of line, defaults to LF
- Context int // Number of context lines
-}
-
-// Compare two sequences of lines; generate the delta as a unified diff.
-//
-// Unified diffs are a compact way of showing line changes and a few
-// lines of context. The number of context lines is set by 'n' which
-// defaults to three.
-//
-// By default, the diff control lines (those with ---, +++, or @@) are
-// created with a trailing newline. This is helpful so that inputs
-// created from file.readlines() result in diffs that are suitable for
-// file.writelines() since both the inputs and outputs have trailing
-// newlines.
-//
-// For inputs that do not have trailing newlines, set the lineterm
-// argument to "" so that the output will be uniformly newline free.
-//
-// The unidiff format normally has a header for filenames and modification
-// times. Any or all of these may be specified using strings for
-// 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
-// The modification times are normally expressed in the ISO 8601 format.
-func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error {
- buf := bufio.NewWriter(writer)
- defer buf.Flush()
- wf := func(format string, args ...interface{}) error {
- _, err := buf.WriteString(fmt.Sprintf(format, args...))
- return err
- }
- ws := func(s string) error {
- _, err := buf.WriteString(s)
- return err
- }
-
- if len(diff.Eol) == 0 {
- diff.Eol = "\n"
- }
-
- started := false
- m := NewMatcher(diff.A, diff.B)
- for _, g := range m.GetGroupedOpCodes(diff.Context) {
- if !started {
- started = true
- fromDate := ""
- if len(diff.FromDate) > 0 {
- fromDate = "\t" + diff.FromDate
- }
- toDate := ""
- if len(diff.ToDate) > 0 {
- toDate = "\t" + diff.ToDate
- }
- if diff.FromFile != "" || diff.ToFile != "" {
- err := wf("--- %s%s%s", diff.FromFile, fromDate, diff.Eol)
- if err != nil {
- return err
- }
- err = wf("+++ %s%s%s", diff.ToFile, toDate, diff.Eol)
- if err != nil {
- return err
- }
- }
- }
- first, last := g[0], g[len(g)-1]
- range1 := formatRangeUnified(first.I1, last.I2)
- range2 := formatRangeUnified(first.J1, last.J2)
- if err := wf("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil {
- return err
- }
- for _, c := range g {
- i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2
- if c.Tag == 'e' {
- for _, line := range diff.A[i1:i2] {
- if err := ws(" " + line); err != nil {
- return err
- }
- }
- continue
- }
- if c.Tag == 'r' || c.Tag == 'd' {
- for _, line := range diff.A[i1:i2] {
- if err := ws("-" + line); err != nil {
- return err
- }
- }
- }
- if c.Tag == 'r' || c.Tag == 'i' {
- for _, line := range diff.B[j1:j2] {
- if err := ws("+" + line); err != nil {
- return err
- }
- }
- }
- }
- }
- return nil
-}
-
-// Like WriteUnifiedDiff but returns the diff a string.
-func GetUnifiedDiffString(diff UnifiedDiff) (string, error) {
- w := &bytes.Buffer{}
- err := WriteUnifiedDiff(w, diff)
- return string(w.Bytes()), err
-}
-
-// Convert range to the "ed" format.
-func formatRangeContext(start, stop int) string {
- // Per the diff spec at http://www.unix.org/single_unix_specification/
- beginning := start + 1 // lines start numbering with one
- length := stop - start
- if length == 0 {
- beginning -= 1 // empty ranges begin at line just before the range
- }
- if length <= 1 {
- return fmt.Sprintf("%d", beginning)
- }
- return fmt.Sprintf("%d,%d", beginning, beginning+length-1)
-}
-
-type ContextDiff UnifiedDiff
-
-// Compare two sequences of lines; generate the delta as a context diff.
-//
-// Context diffs are a compact way of showing line changes and a few
-// lines of context. The number of context lines is set by diff.Context
-// which defaults to three.
-//
-// By default, the diff control lines (those with *** or ---) are
-// created with a trailing newline.
-//
-// For inputs that do not have trailing newlines, set the diff.Eol
-// argument to "" so that the output will be uniformly newline free.
-//
-// The context diff format normally has a header for filenames and
-// modification times. Any or all of these may be specified using
-// strings for diff.FromFile, diff.ToFile, diff.FromDate, diff.ToDate.
-// The modification times are normally expressed in the ISO 8601 format.
-// If not specified, the strings default to blanks.
-func WriteContextDiff(writer io.Writer, diff ContextDiff) error {
- buf := bufio.NewWriter(writer)
- defer buf.Flush()
- var diffErr error
- wf := func(format string, args ...interface{}) {
- _, err := buf.WriteString(fmt.Sprintf(format, args...))
- if diffErr == nil && err != nil {
- diffErr = err
- }
- }
- ws := func(s string) {
- _, err := buf.WriteString(s)
- if diffErr == nil && err != nil {
- diffErr = err
- }
- }
-
- if len(diff.Eol) == 0 {
- diff.Eol = "\n"
- }
-
- prefix := map[byte]string{
- 'i': "+ ",
- 'd': "- ",
- 'r': "! ",
- 'e': " ",
- }
-
- started := false
- m := NewMatcher(diff.A, diff.B)
- for _, g := range m.GetGroupedOpCodes(diff.Context) {
- if !started {
- started = true
- fromDate := ""
- if len(diff.FromDate) > 0 {
- fromDate = "\t" + diff.FromDate
- }
- toDate := ""
- if len(diff.ToDate) > 0 {
- toDate = "\t" + diff.ToDate
- }
- if diff.FromFile != "" || diff.ToFile != "" {
- wf("*** %s%s%s", diff.FromFile, fromDate, diff.Eol)
- wf("--- %s%s%s", diff.ToFile, toDate, diff.Eol)
- }
- }
-
- first, last := g[0], g[len(g)-1]
- ws("***************" + diff.Eol)
-
- range1 := formatRangeContext(first.I1, last.I2)
- wf("*** %s ****%s", range1, diff.Eol)
- for _, c := range g {
- if c.Tag == 'r' || c.Tag == 'd' {
- for _, cc := range g {
- if cc.Tag == 'i' {
- continue
- }
- for _, line := range diff.A[cc.I1:cc.I2] {
- ws(prefix[cc.Tag] + line)
- }
- }
- break
- }
- }
-
- range2 := formatRangeContext(first.J1, last.J2)
- wf("--- %s ----%s", range2, diff.Eol)
- for _, c := range g {
- if c.Tag == 'r' || c.Tag == 'i' {
- for _, cc := range g {
- if cc.Tag == 'd' {
- continue
- }
- for _, line := range diff.B[cc.J1:cc.J2] {
- ws(prefix[cc.Tag] + line)
- }
- }
- break
- }
- }
- }
- return diffErr
-}
-
-// Like WriteContextDiff but returns the diff a string.
-func GetContextDiffString(diff ContextDiff) (string, error) {
- w := &bytes.Buffer{}
- err := WriteContextDiff(w, diff)
- return string(w.Bytes()), err
-}
-
-// Split a string on "\n" while preserving them. The output can be used
-// as input for UnifiedDiff and ContextDiff structures.
-func SplitLines(s string) []string {
- lines := strings.SplitAfter(s, "\n")
- lines[len(lines)-1] += "\n"
- return lines
-}
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/LICENCE.txt b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/LICENCE.txt
deleted file mode 100644
index 473b670a7..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/LICENCE.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell
-
-Please consider promoting this project if you find it useful.
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without restriction,
-including without limitation the rights to use, copy, modify, merge,
-publish, distribute, sublicense, and/or sell copies of the Software,
-and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
-OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/LICENSE b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/LICENSE
deleted file mode 100644
index 473b670a7..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell
-
-Please consider promoting this project if you find it useful.
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without restriction,
-including without limitation the rights to use, copy, modify, merge,
-publish, distribute, sublicense, and/or sell copies of the Software,
-and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
-OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertion_forward.go b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertion_forward.go
deleted file mode 100644
index e6a796046..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertion_forward.go
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
-* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen
-* THIS FILE MUST NOT BE EDITED BY HAND
-*/
-
-package assert
-
-import (
-
- http "net/http"
- url "net/url"
- time "time"
-)
-
-
-// Condition uses a Comparison to assert a complex condition.
-func (a *Assertions) Condition(comp Comparison, msgAndArgs ...interface{}) bool {
- return Condition(a.t, comp, msgAndArgs...)
-}
-
-
-// Contains asserts that the specified string, list(array, slice...) or map contains the
-// specified substring or element.
-//
-// a.Contains("Hello World", "World", "But 'Hello World' does contain 'World'")
-// a.Contains(["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'")
-// a.Contains({"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool {
- return Contains(a.t, s, contains, msgAndArgs...)
-}
-
-
-// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either
-// a slice or a channel with len == 0.
-//
-// a.Empty(obj)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) bool {
- return Empty(a.t, object, msgAndArgs...)
-}
-
-
-// Equal asserts that two objects are equal.
-//
-// a.Equal(123, 123, "123 and 123 should be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
- return Equal(a.t, expected, actual, msgAndArgs...)
-}
-
-
-// EqualError asserts that a function returned an error (i.e. not `nil`)
-// and that it is equal to the provided error.
-//
-// actualObj, err := SomeFunction()
-// if assert.Error(t, err, "An error was expected") {
-// assert.Equal(t, err, expectedError)
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) bool {
- return EqualError(a.t, theError, errString, msgAndArgs...)
-}
-
-
-// EqualValues asserts that two objects are equal or convertable to the same types
-// and equal.
-//
-// a.EqualValues(uint32(123), int32(123), "123 and 123 should be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
- return EqualValues(a.t, expected, actual, msgAndArgs...)
-}
-
-
-// Error asserts that a function returned an error (i.e. not `nil`).
-//
-// actualObj, err := SomeFunction()
-// if a.Error(err, "An error was expected") {
-// assert.Equal(t, err, expectedError)
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool {
- return Error(a.t, err, msgAndArgs...)
-}
-
-
-// Exactly asserts that two objects are equal is value and type.
-//
-// a.Exactly(int32(123), int64(123), "123 and 123 should NOT be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
- return Exactly(a.t, expected, actual, msgAndArgs...)
-}
-
-
-// Fail reports a failure through
-func (a *Assertions) Fail(failureMessage string, msgAndArgs ...interface{}) bool {
- return Fail(a.t, failureMessage, msgAndArgs...)
-}
-
-
-// FailNow fails test
-func (a *Assertions) FailNow(failureMessage string, msgAndArgs ...interface{}) bool {
- return FailNow(a.t, failureMessage, msgAndArgs...)
-}
-
-
-// False asserts that the specified value is false.
-//
-// a.False(myBool, "myBool should be false")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) False(value bool, msgAndArgs ...interface{}) bool {
- return False(a.t, value, msgAndArgs...)
-}
-
-
-// HTTPBodyContains asserts that a specified handler returns a
-// body that contains a string.
-//
-// a.HTTPBodyContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) bool {
- return HTTPBodyContains(a.t, handler, method, url, values, str)
-}
-
-
-// HTTPBodyNotContains asserts that a specified handler returns a
-// body that does not contain a string.
-//
-// a.HTTPBodyNotContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) bool {
- return HTTPBodyNotContains(a.t, handler, method, url, values, str)
-}
-
-
-// HTTPError asserts that a specified handler returns an error status code.
-//
-// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values) bool {
- return HTTPError(a.t, handler, method, url, values)
-}
-
-
-// HTTPRedirect asserts that a specified handler returns a redirect status code.
-//
-// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values) bool {
- return HTTPRedirect(a.t, handler, method, url, values)
-}
-
-
-// HTTPSuccess asserts that a specified handler returns a success status code.
-//
-// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values) bool {
- return HTTPSuccess(a.t, handler, method, url, values)
-}
-
-
-// Implements asserts that an object is implemented by the specified interface.
-//
-// a.Implements((*MyInterface)(nil), new(MyObject), "MyObject")
-func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool {
- return Implements(a.t, interfaceObject, object, msgAndArgs...)
-}
-
-
-// InDelta asserts that the two numerals are within delta of each other.
-//
-// a.InDelta(math.Pi, (22 / 7.0), 0.01)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {
- return InDelta(a.t, expected, actual, delta, msgAndArgs...)
-}
-
-
-// InDeltaSlice is the same as InDelta, except it compares two slices.
-func (a *Assertions) InDeltaSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {
- return InDeltaSlice(a.t, expected, actual, delta, msgAndArgs...)
-}
-
-
-// InEpsilon asserts that expected and actual have a relative error less than epsilon
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) InEpsilon(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool {
- return InEpsilon(a.t, expected, actual, epsilon, msgAndArgs...)
-}
-
-
-// InEpsilonSlice is the same as InEpsilon, except it compares two slices.
-func (a *Assertions) InEpsilonSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {
- return InEpsilonSlice(a.t, expected, actual, delta, msgAndArgs...)
-}
-
-
-// IsType asserts that the specified objects are of the same type.
-func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool {
- return IsType(a.t, expectedType, object, msgAndArgs...)
-}
-
-
-// JSONEq asserts that two JSON strings are equivalent.
-//
-// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) bool {
- return JSONEq(a.t, expected, actual, msgAndArgs...)
-}
-
-
-// Len asserts that the specified object has specific length.
-// Len also fails if the object has a type that len() not accept.
-//
-// a.Len(mySlice, 3, "The size of slice is not 3")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) bool {
- return Len(a.t, object, length, msgAndArgs...)
-}
-
-
-// Nil asserts that the specified object is nil.
-//
-// a.Nil(err, "err should be nothing")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) bool {
- return Nil(a.t, object, msgAndArgs...)
-}
-
-
-// NoError asserts that a function returned no error (i.e. `nil`).
-//
-// actualObj, err := SomeFunction()
-// if a.NoError(err) {
-// assert.Equal(t, actualObj, expectedObj)
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) bool {
- return NoError(a.t, err, msgAndArgs...)
-}
-
-
-// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the
-// specified substring or element.
-//
-// a.NotContains("Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'")
-// a.NotContains(["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'")
-// a.NotContains({"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool {
- return NotContains(a.t, s, contains, msgAndArgs...)
-}
-
-
-// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
-// a slice or a channel with len == 0.
-//
-// if a.NotEmpty(obj) {
-// assert.Equal(t, "two", obj[1])
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) bool {
- return NotEmpty(a.t, object, msgAndArgs...)
-}
-
-
-// NotEqual asserts that the specified values are NOT equal.
-//
-// a.NotEqual(obj1, obj2, "two objects shouldn't be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
- return NotEqual(a.t, expected, actual, msgAndArgs...)
-}
-
-
-// NotNil asserts that the specified object is not nil.
-//
-// a.NotNil(err, "err should be something")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) bool {
- return NotNil(a.t, object, msgAndArgs...)
-}
-
-
-// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic.
-//
-// a.NotPanics(func(){
-// RemainCalm()
-// }, "Calling RemainCalm() should NOT panic")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NotPanics(f PanicTestFunc, msgAndArgs ...interface{}) bool {
- return NotPanics(a.t, f, msgAndArgs...)
-}
-
-
-// NotRegexp asserts that a specified regexp does not match a string.
-//
-// a.NotRegexp(regexp.MustCompile("starts"), "it's starting")
-// a.NotRegexp("^start", "it's not starting")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
- return NotRegexp(a.t, rx, str, msgAndArgs...)
-}
-
-
-// NotZero asserts that i is not the zero value for its type and returns the truth.
-func (a *Assertions) NotZero(i interface{}, msgAndArgs ...interface{}) bool {
- return NotZero(a.t, i, msgAndArgs...)
-}
-
-
-// Panics asserts that the code inside the specified PanicTestFunc panics.
-//
-// a.Panics(func(){
-// GoCrazy()
-// }, "Calling GoCrazy() should panic")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Panics(f PanicTestFunc, msgAndArgs ...interface{}) bool {
- return Panics(a.t, f, msgAndArgs...)
-}
-
-
-// Regexp asserts that a specified regexp matches a string.
-//
-// a.Regexp(regexp.MustCompile("start"), "it's starting")
-// a.Regexp("start...$", "it's not starting")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
- return Regexp(a.t, rx, str, msgAndArgs...)
-}
-
-
-// True asserts that the specified value is true.
-//
-// a.True(myBool, "myBool should be true")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) True(value bool, msgAndArgs ...interface{}) bool {
- return True(a.t, value, msgAndArgs...)
-}
-
-
-// WithinDuration asserts that the two times are within duration delta of each other.
-//
-// a.WithinDuration(time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool {
- return WithinDuration(a.t, expected, actual, delta, msgAndArgs...)
-}
-
-
-// Zero asserts that i is the zero value for its type and returns the truth.
-func (a *Assertions) Zero(i interface{}, msgAndArgs ...interface{}) bool {
- return Zero(a.t, i, msgAndArgs...)
-}
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertion_forward.go.tmpl b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertion_forward.go.tmpl
deleted file mode 100644
index 99f9acfbb..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertion_forward.go.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-{{.CommentWithoutT "a"}}
-func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool {
- return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}})
-}
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertions.go
deleted file mode 100644
index d7c16c590..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertions.go
+++ /dev/null
@@ -1,1004 +0,0 @@
-package assert
-
-import (
- "bufio"
- "bytes"
- "encoding/json"
- "fmt"
- "math"
- "reflect"
- "regexp"
- "runtime"
- "strings"
- "time"
- "unicode"
- "unicode/utf8"
-
- "github.com/davecgh/go-spew/spew"
- "github.com/pmezard/go-difflib/difflib"
-)
-
-// TestingT is an interface wrapper around *testing.T
-type TestingT interface {
- Errorf(format string, args ...interface{})
-}
-
-// Comparison a custom function that returns true on success and false on failure
-type Comparison func() (success bool)
-
-/*
- Helper functions
-*/
-
-// ObjectsAreEqual determines if two objects are considered equal.
-//
-// This function does no assertion of any kind.
-func ObjectsAreEqual(expected, actual interface{}) bool {
-
- if expected == nil || actual == nil {
- return expected == actual
- }
-
- return reflect.DeepEqual(expected, actual)
-
-}
-
-// ObjectsAreEqualValues gets whether two objects are equal, or if their
-// values are equal.
-func ObjectsAreEqualValues(expected, actual interface{}) bool {
- if ObjectsAreEqual(expected, actual) {
- return true
- }
-
- actualType := reflect.TypeOf(actual)
- if actualType == nil {
- return false
- }
- expectedValue := reflect.ValueOf(expected)
- if expectedValue.IsValid() && expectedValue.Type().ConvertibleTo(actualType) {
- // Attempt comparison after type conversion
- return reflect.DeepEqual(expectedValue.Convert(actualType).Interface(), actual)
- }
-
- return false
-}
-
-/* CallerInfo is necessary because the assert functions use the testing object
-internally, causing it to print the file:line of the assert method, rather than where
-the problem actually occured in calling code.*/
-
-// CallerInfo returns an array of strings containing the file and line number
-// of each stack frame leading from the current test to the assert call that
-// failed.
-func CallerInfo() []string {
-
- pc := uintptr(0)
- file := ""
- line := 0
- ok := false
- name := ""
-
- callers := []string{}
- for i := 0; ; i++ {
- pc, file, line, ok = runtime.Caller(i)
- if !ok {
- return nil
- }
-
- // This is a huge edge case, but it will panic if this is the case, see #180
- if file == "" {
- break
- }
-
- parts := strings.Split(file, "/")
- dir := parts[len(parts)-2]
- file = parts[len(parts)-1]
- if (dir != "assert" && dir != "mock" && dir != "require") || file == "mock_test.go" {
- callers = append(callers, fmt.Sprintf("%s:%d", file, line))
- }
-
- f := runtime.FuncForPC(pc)
- if f == nil {
- break
- }
- name = f.Name()
- // Drop the package
- segments := strings.Split(name, ".")
- name = segments[len(segments)-1]
- if isTest(name, "Test") ||
- isTest(name, "Benchmark") ||
- isTest(name, "Example") {
- break
- }
- }
-
- return callers
-}
-
-// Stolen from the `go test` tool.
-// isTest tells whether name looks like a test (or benchmark, according to prefix).
-// It is a Test (say) if there is a character after Test that is not a lower-case letter.
-// We don't want TesticularCancer.
-func isTest(name, prefix string) bool {
- if !strings.HasPrefix(name, prefix) {
- return false
- }
- if len(name) == len(prefix) { // "Test" is ok
- return true
- }
- rune, _ := utf8.DecodeRuneInString(name[len(prefix):])
- return !unicode.IsLower(rune)
-}
-
-// getWhitespaceString returns a string that is long enough to overwrite the default
-// output from the go testing framework.
-func getWhitespaceString() string {
-
- _, file, line, ok := runtime.Caller(1)
- if !ok {
- return ""
- }
- parts := strings.Split(file, "/")
- file = parts[len(parts)-1]
-
- return strings.Repeat(" ", len(fmt.Sprintf("%s:%d: ", file, line)))
-
-}
-
-func messageFromMsgAndArgs(msgAndArgs ...interface{}) string {
- if len(msgAndArgs) == 0 || msgAndArgs == nil {
- return ""
- }
- if len(msgAndArgs) == 1 {
- return msgAndArgs[0].(string)
- }
- if len(msgAndArgs) > 1 {
- return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...)
- }
- return ""
-}
-
-// Indents all lines of the message by appending a number of tabs to each line, in an output format compatible with Go's
-// test printing (see inner comment for specifics)
-func indentMessageLines(message string, tabs int) string {
- outBuf := new(bytes.Buffer)
-
- for i, scanner := 0, bufio.NewScanner(strings.NewReader(message)); scanner.Scan(); i++ {
- if i != 0 {
- outBuf.WriteRune('\n')
- }
- for ii := 0; ii < tabs; ii++ {
- outBuf.WriteRune('\t')
- // Bizarrely, all lines except the first need one fewer tabs prepended, so deliberately advance the counter
- // by 1 prematurely.
- if ii == 0 && i > 0 {
- ii++
- }
- }
- outBuf.WriteString(scanner.Text())
- }
-
- return outBuf.String()
-}
-
-type failNower interface {
- FailNow()
-}
-
-// FailNow fails test
-func FailNow(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool {
- Fail(t, failureMessage, msgAndArgs...)
-
- // We cannot extend TestingT with FailNow() and
- // maintain backwards compatibility, so we fallback
- // to panicking when FailNow is not available in
- // TestingT.
- // See issue #263
-
- if t, ok := t.(failNower); ok {
- t.FailNow()
- } else {
- panic("test failed and t is missing `FailNow()`")
- }
- return false
-}
-
-// Fail reports a failure through
-func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool {
-
- message := messageFromMsgAndArgs(msgAndArgs...)
-
- errorTrace := strings.Join(CallerInfo(), "\n\r\t\t\t")
- if len(message) > 0 {
- t.Errorf("\r%s\r\tError Trace:\t%s\n"+
- "\r\tError:%s\n"+
- "\r\tMessages:\t%s\n\r",
- getWhitespaceString(),
- errorTrace,
- indentMessageLines(failureMessage, 2),
- message)
- } else {
- t.Errorf("\r%s\r\tError Trace:\t%s\n"+
- "\r\tError:%s\n\r",
- getWhitespaceString(),
- errorTrace,
- indentMessageLines(failureMessage, 2))
- }
-
- return false
-}
-
-// Implements asserts that an object is implemented by the specified interface.
-//
-// assert.Implements(t, (*MyInterface)(nil), new(MyObject), "MyObject")
-func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool {
-
- interfaceType := reflect.TypeOf(interfaceObject).Elem()
-
- if !reflect.TypeOf(object).Implements(interfaceType) {
- return Fail(t, fmt.Sprintf("%T must implement %v", object, interfaceType), msgAndArgs...)
- }
-
- return true
-
-}
-
-// IsType asserts that the specified objects are of the same type.
-func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool {
-
- if !ObjectsAreEqual(reflect.TypeOf(object), reflect.TypeOf(expectedType)) {
- return Fail(t, fmt.Sprintf("Object expected to be of type %v, but was %v", reflect.TypeOf(expectedType), reflect.TypeOf(object)), msgAndArgs...)
- }
-
- return true
-}
-
-// Equal asserts that two objects are equal.
-//
-// assert.Equal(t, 123, 123, "123 and 123 should be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Equal(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
-
- if !ObjectsAreEqual(expected, actual) {
- diff := diff(expected, actual)
- return Fail(t, fmt.Sprintf("Not equal: %#v (expected)\n"+
- " != %#v (actual)%s", expected, actual, diff), msgAndArgs...)
- }
-
- return true
-
-}
-
-// EqualValues asserts that two objects are equal or convertable to the same types
-// and equal.
-//
-// assert.EqualValues(t, uint32(123), int32(123), "123 and 123 should be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func EqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
-
- if !ObjectsAreEqualValues(expected, actual) {
- return Fail(t, fmt.Sprintf("Not equal: %#v (expected)\n"+
- " != %#v (actual)", expected, actual), msgAndArgs...)
- }
-
- return true
-
-}
-
-// Exactly asserts that two objects are equal is value and type.
-//
-// assert.Exactly(t, int32(123), int64(123), "123 and 123 should NOT be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Exactly(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
-
- aType := reflect.TypeOf(expected)
- bType := reflect.TypeOf(actual)
-
- if aType != bType {
- return Fail(t, fmt.Sprintf("Types expected to match exactly\n\r\t%v != %v", aType, bType), msgAndArgs...)
- }
-
- return Equal(t, expected, actual, msgAndArgs...)
-
-}
-
-// NotNil asserts that the specified object is not nil.
-//
-// assert.NotNil(t, err, "err should be something")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
- if !isNil(object) {
- return true
- }
- return Fail(t, "Expected value not to be nil.", msgAndArgs...)
-}
-
-// isNil checks if a specified object is nil or not, without Failing.
-func isNil(object interface{}) bool {
- if object == nil {
- return true
- }
-
- value := reflect.ValueOf(object)
- kind := value.Kind()
- if kind >= reflect.Chan && kind <= reflect.Slice && value.IsNil() {
- return true
- }
-
- return false
-}
-
-// Nil asserts that the specified object is nil.
-//
-// assert.Nil(t, err, "err should be nothing")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
- if isNil(object) {
- return true
- }
- return Fail(t, fmt.Sprintf("Expected nil, but got: %#v", object), msgAndArgs...)
-}
-
-var numericZeros = []interface{}{
- int(0),
- int8(0),
- int16(0),
- int32(0),
- int64(0),
- uint(0),
- uint8(0),
- uint16(0),
- uint32(0),
- uint64(0),
- float32(0),
- float64(0),
-}
-
-// isEmpty gets whether the specified object is considered empty or not.
-func isEmpty(object interface{}) bool {
-
- if object == nil {
- return true
- } else if object == "" {
- return true
- } else if object == false {
- return true
- }
-
- for _, v := range numericZeros {
- if object == v {
- return true
- }
- }
-
- objValue := reflect.ValueOf(object)
-
- switch objValue.Kind() {
- case reflect.Map:
- fallthrough
- case reflect.Slice, reflect.Chan:
- {
- return (objValue.Len() == 0)
- }
- case reflect.Struct:
- switch object.(type) {
- case time.Time:
- return object.(time.Time).IsZero()
- }
- case reflect.Ptr:
- {
- if objValue.IsNil() {
- return true
- }
- switch object.(type) {
- case *time.Time:
- return object.(*time.Time).IsZero()
- default:
- return false
- }
- }
- }
- return false
-}
-
-// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either
-// a slice or a channel with len == 0.
-//
-// assert.Empty(t, obj)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
-
- pass := isEmpty(object)
- if !pass {
- Fail(t, fmt.Sprintf("Should be empty, but was %v", object), msgAndArgs...)
- }
-
- return pass
-
-}
-
-// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
-// a slice or a channel with len == 0.
-//
-// if assert.NotEmpty(t, obj) {
-// assert.Equal(t, "two", obj[1])
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
-
- pass := !isEmpty(object)
- if !pass {
- Fail(t, fmt.Sprintf("Should NOT be empty, but was %v", object), msgAndArgs...)
- }
-
- return pass
-
-}
-
-// getLen try to get length of object.
-// return (false, 0) if impossible.
-func getLen(x interface{}) (ok bool, length int) {
- v := reflect.ValueOf(x)
- defer func() {
- if e := recover(); e != nil {
- ok = false
- }
- }()
- return true, v.Len()
-}
-
-// Len asserts that the specified object has specific length.
-// Len also fails if the object has a type that len() not accept.
-//
-// assert.Len(t, mySlice, 3, "The size of slice is not 3")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) bool {
- ok, l := getLen(object)
- if !ok {
- return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", object), msgAndArgs...)
- }
-
- if l != length {
- return Fail(t, fmt.Sprintf("\"%s\" should have %d item(s), but has %d", object, length, l), msgAndArgs...)
- }
- return true
-}
-
-// True asserts that the specified value is true.
-//
-// assert.True(t, myBool, "myBool should be true")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func True(t TestingT, value bool, msgAndArgs ...interface{}) bool {
-
- if value != true {
- return Fail(t, "Should be true", msgAndArgs...)
- }
-
- return true
-
-}
-
-// False asserts that the specified value is false.
-//
-// assert.False(t, myBool, "myBool should be false")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func False(t TestingT, value bool, msgAndArgs ...interface{}) bool {
-
- if value != false {
- return Fail(t, "Should be false", msgAndArgs...)
- }
-
- return true
-
-}
-
-// NotEqual asserts that the specified values are NOT equal.
-//
-// assert.NotEqual(t, obj1, obj2, "two objects shouldn't be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
-
- if ObjectsAreEqual(expected, actual) {
- return Fail(t, fmt.Sprintf("Should not be: %#v\n", actual), msgAndArgs...)
- }
-
- return true
-
-}
-
-// containsElement try loop over the list check if the list includes the element.
-// return (false, false) if impossible.
-// return (true, false) if element was not found.
-// return (true, true) if element was found.
-func includeElement(list interface{}, element interface{}) (ok, found bool) {
-
- listValue := reflect.ValueOf(list)
- elementValue := reflect.ValueOf(element)
- defer func() {
- if e := recover(); e != nil {
- ok = false
- found = false
- }
- }()
-
- if reflect.TypeOf(list).Kind() == reflect.String {
- return true, strings.Contains(listValue.String(), elementValue.String())
- }
-
- if reflect.TypeOf(list).Kind() == reflect.Map {
- mapKeys := listValue.MapKeys()
- for i := 0; i < len(mapKeys); i++ {
- if ObjectsAreEqual(mapKeys[i].Interface(), element) {
- return true, true
- }
- }
- return true, false
- }
-
- for i := 0; i < listValue.Len(); i++ {
- if ObjectsAreEqual(listValue.Index(i).Interface(), element) {
- return true, true
- }
- }
- return true, false
-
-}
-
-// Contains asserts that the specified string, list(array, slice...) or map contains the
-// specified substring or element.
-//
-// assert.Contains(t, "Hello World", "World", "But 'Hello World' does contain 'World'")
-// assert.Contains(t, ["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'")
-// assert.Contains(t, {"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool {
-
- ok, found := includeElement(s, contains)
- if !ok {
- return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...)
- }
- if !found {
- return Fail(t, fmt.Sprintf("\"%s\" does not contain \"%s\"", s, contains), msgAndArgs...)
- }
-
- return true
-
-}
-
-// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the
-// specified substring or element.
-//
-// assert.NotContains(t, "Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'")
-// assert.NotContains(t, ["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'")
-// assert.NotContains(t, {"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool {
-
- ok, found := includeElement(s, contains)
- if !ok {
- return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...)
- }
- if found {
- return Fail(t, fmt.Sprintf("\"%s\" should not contain \"%s\"", s, contains), msgAndArgs...)
- }
-
- return true
-
-}
-
-// Condition uses a Comparison to assert a complex condition.
-func Condition(t TestingT, comp Comparison, msgAndArgs ...interface{}) bool {
- result := comp()
- if !result {
- Fail(t, "Condition failed!", msgAndArgs...)
- }
- return result
-}
-
-// PanicTestFunc defines a func that should be passed to the assert.Panics and assert.NotPanics
-// methods, and represents a simple func that takes no arguments, and returns nothing.
-type PanicTestFunc func()
-
-// didPanic returns true if the function passed to it panics. Otherwise, it returns false.
-func didPanic(f PanicTestFunc) (bool, interface{}) {
-
- didPanic := false
- var message interface{}
- func() {
-
- defer func() {
- if message = recover(); message != nil {
- didPanic = true
- }
- }()
-
- // call the target function
- f()
-
- }()
-
- return didPanic, message
-
-}
-
-// Panics asserts that the code inside the specified PanicTestFunc panics.
-//
-// assert.Panics(t, func(){
-// GoCrazy()
-// }, "Calling GoCrazy() should panic")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool {
-
- if funcDidPanic, panicValue := didPanic(f); !funcDidPanic {
- return Fail(t, fmt.Sprintf("func %#v should panic\n\r\tPanic value:\t%v", f, panicValue), msgAndArgs...)
- }
-
- return true
-}
-
-// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic.
-//
-// assert.NotPanics(t, func(){
-// RemainCalm()
-// }, "Calling RemainCalm() should NOT panic")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NotPanics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool {
-
- if funcDidPanic, panicValue := didPanic(f); funcDidPanic {
- return Fail(t, fmt.Sprintf("func %#v should not panic\n\r\tPanic value:\t%v", f, panicValue), msgAndArgs...)
- }
-
- return true
-}
-
-// WithinDuration asserts that the two times are within duration delta of each other.
-//
-// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func WithinDuration(t TestingT, expected, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool {
-
- dt := expected.Sub(actual)
- if dt < -delta || dt > delta {
- return Fail(t, fmt.Sprintf("Max difference between %v and %v allowed is %v, but difference was %v", expected, actual, delta, dt), msgAndArgs...)
- }
-
- return true
-}
-
-func toFloat(x interface{}) (float64, bool) {
- var xf float64
- xok := true
-
- switch xn := x.(type) {
- case uint8:
- xf = float64(xn)
- case uint16:
- xf = float64(xn)
- case uint32:
- xf = float64(xn)
- case uint64:
- xf = float64(xn)
- case int:
- xf = float64(xn)
- case int8:
- xf = float64(xn)
- case int16:
- xf = float64(xn)
- case int32:
- xf = float64(xn)
- case int64:
- xf = float64(xn)
- case float32:
- xf = float64(xn)
- case float64:
- xf = float64(xn)
- default:
- xok = false
- }
-
- return xf, xok
-}
-
-// InDelta asserts that the two numerals are within delta of each other.
-//
-// assert.InDelta(t, math.Pi, (22 / 7.0), 0.01)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func InDelta(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {
-
- af, aok := toFloat(expected)
- bf, bok := toFloat(actual)
-
- if !aok || !bok {
- return Fail(t, fmt.Sprintf("Parameters must be numerical"), msgAndArgs...)
- }
-
- if math.IsNaN(af) {
- return Fail(t, fmt.Sprintf("Actual must not be NaN"), msgAndArgs...)
- }
-
- if math.IsNaN(bf) {
- return Fail(t, fmt.Sprintf("Expected %v with delta %v, but was NaN", expected, delta), msgAndArgs...)
- }
-
- dt := af - bf
- if dt < -delta || dt > delta {
- return Fail(t, fmt.Sprintf("Max difference between %v and %v allowed is %v, but difference was %v", expected, actual, delta, dt), msgAndArgs...)
- }
-
- return true
-}
-
-// InDeltaSlice is the same as InDelta, except it compares two slices.
-func InDeltaSlice(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {
- if expected == nil || actual == nil ||
- reflect.TypeOf(actual).Kind() != reflect.Slice ||
- reflect.TypeOf(expected).Kind() != reflect.Slice {
- return Fail(t, fmt.Sprintf("Parameters must be slice"), msgAndArgs...)
- }
-
- actualSlice := reflect.ValueOf(actual)
- expectedSlice := reflect.ValueOf(expected)
-
- for i := 0; i < actualSlice.Len(); i++ {
- result := InDelta(t, actualSlice.Index(i).Interface(), expectedSlice.Index(i).Interface(), delta)
- if !result {
- return result
- }
- }
-
- return true
-}
-
-func calcRelativeError(expected, actual interface{}) (float64, error) {
- af, aok := toFloat(expected)
- if !aok {
- return 0, fmt.Errorf("expected value %q cannot be converted to float", expected)
- }
- if af == 0 {
- return 0, fmt.Errorf("expected value must have a value other than zero to calculate the relative error")
- }
- bf, bok := toFloat(actual)
- if !bok {
- return 0, fmt.Errorf("expected value %q cannot be converted to float", actual)
- }
-
- return math.Abs(af-bf) / math.Abs(af), nil
-}
-
-// InEpsilon asserts that expected and actual have a relative error less than epsilon
-//
-// Returns whether the assertion was successful (true) or not (false).
-func InEpsilon(t TestingT, expected, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool {
- actualEpsilon, err := calcRelativeError(expected, actual)
- if err != nil {
- return Fail(t, err.Error(), msgAndArgs...)
- }
- if actualEpsilon > epsilon {
- return Fail(t, fmt.Sprintf("Relative error is too high: %#v (expected)\n"+
- " < %#v (actual)", actualEpsilon, epsilon), msgAndArgs...)
- }
-
- return true
-}
-
-// InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices.
-func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool {
- if expected == nil || actual == nil ||
- reflect.TypeOf(actual).Kind() != reflect.Slice ||
- reflect.TypeOf(expected).Kind() != reflect.Slice {
- return Fail(t, fmt.Sprintf("Parameters must be slice"), msgAndArgs...)
- }
-
- actualSlice := reflect.ValueOf(actual)
- expectedSlice := reflect.ValueOf(expected)
-
- for i := 0; i < actualSlice.Len(); i++ {
- result := InEpsilon(t, actualSlice.Index(i).Interface(), expectedSlice.Index(i).Interface(), epsilon)
- if !result {
- return result
- }
- }
-
- return true
-}
-
-/*
- Errors
-*/
-
-// NoError asserts that a function returned no error (i.e. `nil`).
-//
-// actualObj, err := SomeFunction()
-// if assert.NoError(t, err) {
-// assert.Equal(t, actualObj, expectedObj)
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool {
- if isNil(err) {
- return true
- }
-
- return Fail(t, fmt.Sprintf("Received unexpected error %q", err), msgAndArgs...)
-}
-
-// Error asserts that a function returned an error (i.e. not `nil`).
-//
-// actualObj, err := SomeFunction()
-// if assert.Error(t, err, "An error was expected") {
-// assert.Equal(t, err, expectedError)
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Error(t TestingT, err error, msgAndArgs ...interface{}) bool {
-
- message := messageFromMsgAndArgs(msgAndArgs...)
- return NotNil(t, err, "An error is expected but got nil. %s", message)
-
-}
-
-// EqualError asserts that a function returned an error (i.e. not `nil`)
-// and that it is equal to the provided error.
-//
-// actualObj, err := SomeFunction()
-// if assert.Error(t, err, "An error was expected") {
-// assert.Equal(t, err, expectedError)
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) bool {
-
- message := messageFromMsgAndArgs(msgAndArgs...)
- if !NotNil(t, theError, "An error is expected but got nil. %s", message) {
- return false
- }
- s := "An error with value \"%s\" is expected but got \"%s\". %s"
- return Equal(t, errString, theError.Error(),
- s, errString, theError.Error(), message)
-}
-
-// matchRegexp return true if a specified regexp matches a string.
-func matchRegexp(rx interface{}, str interface{}) bool {
-
- var r *regexp.Regexp
- if rr, ok := rx.(*regexp.Regexp); ok {
- r = rr
- } else {
- r = regexp.MustCompile(fmt.Sprint(rx))
- }
-
- return (r.FindStringIndex(fmt.Sprint(str)) != nil)
-
-}
-
-// Regexp asserts that a specified regexp matches a string.
-//
-// assert.Regexp(t, regexp.MustCompile("start"), "it's starting")
-// assert.Regexp(t, "start...$", "it's not starting")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
-
- match := matchRegexp(rx, str)
-
- if !match {
- Fail(t, fmt.Sprintf("Expect \"%v\" to match \"%v\"", str, rx), msgAndArgs...)
- }
-
- return match
-}
-
-// NotRegexp asserts that a specified regexp does not match a string.
-//
-// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting")
-// assert.NotRegexp(t, "^start", "it's not starting")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
- match := matchRegexp(rx, str)
-
- if match {
- Fail(t, fmt.Sprintf("Expect \"%v\" to NOT match \"%v\"", str, rx), msgAndArgs...)
- }
-
- return !match
-
-}
-
-// Zero asserts that i is the zero value for its type and returns the truth.
-func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool {
- if i != nil && !reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) {
- return Fail(t, fmt.Sprintf("Should be zero, but was %v", i), msgAndArgs...)
- }
- return true
-}
-
-// NotZero asserts that i is not the zero value for its type and returns the truth.
-func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool {
- if i == nil || reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) {
- return Fail(t, fmt.Sprintf("Should not be zero, but was %v", i), msgAndArgs...)
- }
- return true
-}
-
-// JSONEq asserts that two JSON strings are equivalent.
-//
-// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) bool {
- var expectedJSONAsInterface, actualJSONAsInterface interface{}
-
- if err := json.Unmarshal([]byte(expected), &expectedJSONAsInterface); err != nil {
- return Fail(t, fmt.Sprintf("Expected value ('%s') is not valid json.\nJSON parsing error: '%s'", expected, err.Error()), msgAndArgs...)
- }
-
- if err := json.Unmarshal([]byte(actual), &actualJSONAsInterface); err != nil {
- return Fail(t, fmt.Sprintf("Input ('%s') needs to be valid json.\nJSON parsing error: '%s'", actual, err.Error()), msgAndArgs...)
- }
-
- return Equal(t, expectedJSONAsInterface, actualJSONAsInterface, msgAndArgs...)
-}
-
-func typeAndKind(v interface{}) (reflect.Type, reflect.Kind) {
- t := reflect.TypeOf(v)
- k := t.Kind()
-
- if k == reflect.Ptr {
- t = t.Elem()
- k = t.Kind()
- }
- return t, k
-}
-
-// diff returns a diff of both values as long as both are of the same type and
-// are a struct, map, slice or array. Otherwise it returns an empty string.
-func diff(expected interface{}, actual interface{}) string {
- if expected == nil || actual == nil {
- return ""
- }
-
- et, ek := typeAndKind(expected)
- at, _ := typeAndKind(actual)
-
- if et != at {
- return ""
- }
-
- if ek != reflect.Struct && ek != reflect.Map && ek != reflect.Slice && ek != reflect.Array {
- return ""
- }
-
- spew.Config.SortKeys = true
- e := spew.Sdump(expected)
- a := spew.Sdump(actual)
-
- diff, _ := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{
- A: difflib.SplitLines(e),
- B: difflib.SplitLines(a),
- FromFile: "Expected",
- FromDate: "",
- ToFile: "Actual",
- ToDate: "",
- Context: 1,
- })
-
- return "\n\nDiff:\n" + diff
-}
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/doc.go b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/doc.go
deleted file mode 100644
index c9dccc4d6..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/doc.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
-//
-// Example Usage
-//
-// The following is a complete example using assert in a standard test function:
-// import (
-// "testing"
-// "github.com/stretchr/testify/assert"
-// )
-//
-// func TestSomething(t *testing.T) {
-//
-// var a string = "Hello"
-// var b string = "Hello"
-//
-// assert.Equal(t, a, b, "The two words should be the same.")
-//
-// }
-//
-// if you assert many times, use the format below:
-//
-// import (
-// "testing"
-// "github.com/stretchr/testify/assert"
-// )
-//
-// func TestSomething(t *testing.T) {
-// assert := assert.New(t)
-//
-// var a string = "Hello"
-// var b string = "Hello"
-//
-// assert.Equal(a, b, "The two words should be the same.")
-// }
-//
-// Assertions
-//
-// Assertions allow you to easily write test code, and are global funcs in the `assert` package.
-// All assertion functions take, as the first argument, the `*testing.T` object provided by the
-// testing framework. This allows the assertion funcs to write the failings and other details to
-// the correct place.
-//
-// Every assertion function also takes an optional string message as the final argument,
-// allowing custom error messages to be appended to the message the assertion method outputs.
-package assert
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/errors.go b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/errors.go
deleted file mode 100644
index ac9dc9d1d..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/errors.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package assert
-
-import (
- "errors"
-)
-
-// AnError is an error instance useful for testing. If the code does not care
-// about error specifics, and only needs to return the error for example, this
-// error should be used to make the test code more readable.
-var AnError = errors.New("assert.AnError general error for testing")
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/forward_assertions.go b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/forward_assertions.go
deleted file mode 100644
index b867e95ea..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/forward_assertions.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package assert
-
-// Assertions provides assertion methods around the
-// TestingT interface.
-type Assertions struct {
- t TestingT
-}
-
-// New makes a new Assertions object for the specified TestingT.
-func New(t TestingT) *Assertions {
- return &Assertions{
- t: t,
- }
-}
-
-//go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/http_assertions.go b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/http_assertions.go
deleted file mode 100644
index e1b9442b5..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/assert/http_assertions.go
+++ /dev/null
@@ -1,106 +0,0 @@
-package assert
-
-import (
- "fmt"
- "net/http"
- "net/http/httptest"
- "net/url"
- "strings"
-)
-
-// httpCode is a helper that returns HTTP code of the response. It returns -1
-// if building a new request fails.
-func httpCode(handler http.HandlerFunc, method, url string, values url.Values) int {
- w := httptest.NewRecorder()
- req, err := http.NewRequest(method, url+"?"+values.Encode(), nil)
- if err != nil {
- return -1
- }
- handler(w, req)
- return w.Code
-}
-
-// HTTPSuccess asserts that a specified handler returns a success status code.
-//
-// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func HTTPSuccess(t TestingT, handler http.HandlerFunc, method, url string, values url.Values) bool {
- code := httpCode(handler, method, url, values)
- if code == -1 {
- return false
- }
- return code >= http.StatusOK && code <= http.StatusPartialContent
-}
-
-// HTTPRedirect asserts that a specified handler returns a redirect status code.
-//
-// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
-//
-// Returns whether the assertion was successful (true) or not (false).
-func HTTPRedirect(t TestingT, handler http.HandlerFunc, method, url string, values url.Values) bool {
- code := httpCode(handler, method, url, values)
- if code == -1 {
- return false
- }
- return code >= http.StatusMultipleChoices && code <= http.StatusTemporaryRedirect
-}
-
-// HTTPError asserts that a specified handler returns an error status code.
-//
-// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
-//
-// Returns whether the assertion was successful (true) or not (false).
-func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values url.Values) bool {
- code := httpCode(handler, method, url, values)
- if code == -1 {
- return false
- }
- return code >= http.StatusBadRequest
-}
-
-// HTTPBody is a helper that returns HTTP body of the response. It returns
-// empty string if building a new request fails.
-func HTTPBody(handler http.HandlerFunc, method, url string, values url.Values) string {
- w := httptest.NewRecorder()
- req, err := http.NewRequest(method, url+"?"+values.Encode(), nil)
- if err != nil {
- return ""
- }
- handler(w, req)
- return w.Body.String()
-}
-
-// HTTPBodyContains asserts that a specified handler returns a
-// body that contains a string.
-//
-// assert.HTTPBodyContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}) bool {
- body := HTTPBody(handler, method, url, values)
-
- contains := strings.Contains(body, fmt.Sprint(str))
- if !contains {
- Fail(t, fmt.Sprintf("Expected response body for \"%s\" to contain \"%s\" but found \"%s\"", url+"?"+values.Encode(), str, body))
- }
-
- return contains
-}
-
-// HTTPBodyNotContains asserts that a specified handler returns a
-// body that does not contain a string.
-//
-// assert.HTTPBodyNotContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}) bool {
- body := HTTPBody(handler, method, url, values)
-
- contains := strings.Contains(body, fmt.Sprint(str))
- if contains {
- Fail(t, "Expected response body for %s to NOT contain \"%s\" but found \"%s\"", url+"?"+values.Encode(), str, body)
- }
-
- return !contains
-}
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/doc.go b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/doc.go
deleted file mode 100644
index 169de3922..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/doc.go
+++ /dev/null
@@ -1,28 +0,0 @@
-// Package require implements the same assertions as the `assert` package but
-// stops test execution when a test fails.
-//
-// Example Usage
-//
-// The following is a complete example using require in a standard test function:
-// import (
-// "testing"
-// "github.com/stretchr/testify/require"
-// )
-//
-// func TestSomething(t *testing.T) {
-//
-// var a string = "Hello"
-// var b string = "Hello"
-//
-// require.Equal(t, a, b, "The two words should be the same.")
-//
-// }
-//
-// Assertions
-//
-// The `require` package have same global functions as in the `assert` package,
-// but instead of returning a boolean result they call `t.FailNow()`.
-//
-// Every assertion function also takes an optional string message as the final argument,
-// allowing custom error messages to be appended to the message the assertion method outputs.
-package require
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/forward_requirements.go b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/forward_requirements.go
deleted file mode 100644
index d3c2ab9bc..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/forward_requirements.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package require
-
-// Assertions provides assertion methods around the
-// TestingT interface.
-type Assertions struct {
- t TestingT
-}
-
-// New makes a new Assertions object for the specified TestingT.
-func New(t TestingT) *Assertions {
- return &Assertions{
- t: t,
- }
-}
-
-//go:generate go run ../_codegen/main.go -output-package=require -template=require_forward.go.tmpl
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/require.go b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/require.go
deleted file mode 100644
index 1bcfcb0d9..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/require.go
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
-* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen
-* THIS FILE MUST NOT BE EDITED BY HAND
-*/
-
-package require
-
-import (
-
- assert "github.com/stretchr/testify/assert"
- http "net/http"
- url "net/url"
- time "time"
-)
-
-
-// Condition uses a Comparison to assert a complex condition.
-func Condition(t TestingT, comp assert.Comparison, msgAndArgs ...interface{}) {
- if !assert.Condition(t, comp, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// Contains asserts that the specified string, list(array, slice...) or map contains the
-// specified substring or element.
-//
-// assert.Contains(t, "Hello World", "World", "But 'Hello World' does contain 'World'")
-// assert.Contains(t, ["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'")
-// assert.Contains(t, {"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Contains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) {
- if !assert.Contains(t, s, contains, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either
-// a slice or a channel with len == 0.
-//
-// assert.Empty(t, obj)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) {
- if !assert.Empty(t, object, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// Equal asserts that two objects are equal.
-//
-// assert.Equal(t, 123, 123, "123 and 123 should be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Equal(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
- if !assert.Equal(t, expected, actual, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// EqualError asserts that a function returned an error (i.e. not `nil`)
-// and that it is equal to the provided error.
-//
-// actualObj, err := SomeFunction()
-// if assert.Error(t, err, "An error was expected") {
-// assert.Equal(t, err, expectedError)
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) {
- if !assert.EqualError(t, theError, errString, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// EqualValues asserts that two objects are equal or convertable to the same types
-// and equal.
-//
-// assert.EqualValues(t, uint32(123), int32(123), "123 and 123 should be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
- if !assert.EqualValues(t, expected, actual, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// Error asserts that a function returned an error (i.e. not `nil`).
-//
-// actualObj, err := SomeFunction()
-// if assert.Error(t, err, "An error was expected") {
-// assert.Equal(t, err, expectedError)
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Error(t TestingT, err error, msgAndArgs ...interface{}) {
- if !assert.Error(t, err, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// Exactly asserts that two objects are equal is value and type.
-//
-// assert.Exactly(t, int32(123), int64(123), "123 and 123 should NOT be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Exactly(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
- if !assert.Exactly(t, expected, actual, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// Fail reports a failure through
-func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) {
- if !assert.Fail(t, failureMessage, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// FailNow fails test
-func FailNow(t TestingT, failureMessage string, msgAndArgs ...interface{}) {
- if !assert.FailNow(t, failureMessage, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// False asserts that the specified value is false.
-//
-// assert.False(t, myBool, "myBool should be false")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func False(t TestingT, value bool, msgAndArgs ...interface{}) {
- if !assert.False(t, value, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// HTTPBodyContains asserts that a specified handler returns a
-// body that contains a string.
-//
-// assert.HTTPBodyContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) {
- if !assert.HTTPBodyContains(t, handler, method, url, values, str) {
- t.FailNow()
- }
-}
-
-
-// HTTPBodyNotContains asserts that a specified handler returns a
-// body that does not contain a string.
-//
-// assert.HTTPBodyNotContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) {
- if !assert.HTTPBodyNotContains(t, handler, method, url, values, str) {
- t.FailNow()
- }
-}
-
-
-// HTTPError asserts that a specified handler returns an error status code.
-//
-// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
-//
-// Returns whether the assertion was successful (true) or not (false).
-func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values) {
- if !assert.HTTPError(t, handler, method, url, values) {
- t.FailNow()
- }
-}
-
-
-// HTTPRedirect asserts that a specified handler returns a redirect status code.
-//
-// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
-//
-// Returns whether the assertion was successful (true) or not (false).
-func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values) {
- if !assert.HTTPRedirect(t, handler, method, url, values) {
- t.FailNow()
- }
-}
-
-
-// HTTPSuccess asserts that a specified handler returns a success status code.
-//
-// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values) {
- if !assert.HTTPSuccess(t, handler, method, url, values) {
- t.FailNow()
- }
-}
-
-
-// Implements asserts that an object is implemented by the specified interface.
-//
-// assert.Implements(t, (*MyInterface)(nil), new(MyObject), "MyObject")
-func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) {
- if !assert.Implements(t, interfaceObject, object, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// InDelta asserts that the two numerals are within delta of each other.
-//
-// assert.InDelta(t, math.Pi, (22 / 7.0), 0.01)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func InDelta(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) {
- if !assert.InDelta(t, expected, actual, delta, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// InDeltaSlice is the same as InDelta, except it compares two slices.
-func InDeltaSlice(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) {
- if !assert.InDeltaSlice(t, expected, actual, delta, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// InEpsilon asserts that expected and actual have a relative error less than epsilon
-//
-// Returns whether the assertion was successful (true) or not (false).
-func InEpsilon(t TestingT, expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) {
- if !assert.InEpsilon(t, expected, actual, epsilon, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// InEpsilonSlice is the same as InEpsilon, except it compares two slices.
-func InEpsilonSlice(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) {
- if !assert.InEpsilonSlice(t, expected, actual, delta, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// IsType asserts that the specified objects are of the same type.
-func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) {
- if !assert.IsType(t, expectedType, object, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// JSONEq asserts that two JSON strings are equivalent.
-//
-// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) {
- if !assert.JSONEq(t, expected, actual, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// Len asserts that the specified object has specific length.
-// Len also fails if the object has a type that len() not accept.
-//
-// assert.Len(t, mySlice, 3, "The size of slice is not 3")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) {
- if !assert.Len(t, object, length, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// Nil asserts that the specified object is nil.
-//
-// assert.Nil(t, err, "err should be nothing")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) {
- if !assert.Nil(t, object, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// NoError asserts that a function returned no error (i.e. `nil`).
-//
-// actualObj, err := SomeFunction()
-// if assert.NoError(t, err) {
-// assert.Equal(t, actualObj, expectedObj)
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NoError(t TestingT, err error, msgAndArgs ...interface{}) {
- if !assert.NoError(t, err, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the
-// specified substring or element.
-//
-// assert.NotContains(t, "Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'")
-// assert.NotContains(t, ["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'")
-// assert.NotContains(t, {"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NotContains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) {
- if !assert.NotContains(t, s, contains, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
-// a slice or a channel with len == 0.
-//
-// if assert.NotEmpty(t, obj) {
-// assert.Equal(t, "two", obj[1])
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) {
- if !assert.NotEmpty(t, object, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// NotEqual asserts that the specified values are NOT equal.
-//
-// assert.NotEqual(t, obj1, obj2, "two objects shouldn't be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NotEqual(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
- if !assert.NotEqual(t, expected, actual, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// NotNil asserts that the specified object is not nil.
-//
-// assert.NotNil(t, err, "err should be something")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) {
- if !assert.NotNil(t, object, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic.
-//
-// assert.NotPanics(t, func(){
-// RemainCalm()
-// }, "Calling RemainCalm() should NOT panic")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NotPanics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
- if !assert.NotPanics(t, f, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// NotRegexp asserts that a specified regexp does not match a string.
-//
-// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting")
-// assert.NotRegexp(t, "^start", "it's not starting")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) {
- if !assert.NotRegexp(t, rx, str, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// NotZero asserts that i is not the zero value for its type and returns the truth.
-func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) {
- if !assert.NotZero(t, i, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// Panics asserts that the code inside the specified PanicTestFunc panics.
-//
-// assert.Panics(t, func(){
-// GoCrazy()
-// }, "Calling GoCrazy() should panic")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Panics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
- if !assert.Panics(t, f, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// Regexp asserts that a specified regexp matches a string.
-//
-// assert.Regexp(t, regexp.MustCompile("start"), "it's starting")
-// assert.Regexp(t, "start...$", "it's not starting")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) {
- if !assert.Regexp(t, rx, str, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// True asserts that the specified value is true.
-//
-// assert.True(t, myBool, "myBool should be true")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func True(t TestingT, value bool, msgAndArgs ...interface{}) {
- if !assert.True(t, value, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// WithinDuration asserts that the two times are within duration delta of each other.
-//
-// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) {
- if !assert.WithinDuration(t, expected, actual, delta, msgAndArgs...) {
- t.FailNow()
- }
-}
-
-
-// Zero asserts that i is the zero value for its type and returns the truth.
-func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) {
- if !assert.Zero(t, i, msgAndArgs...) {
- t.FailNow()
- }
-}
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/require.go.tmpl b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/require.go.tmpl
deleted file mode 100644
index ab1b1e9fd..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/require.go.tmpl
+++ /dev/null
@@ -1,6 +0,0 @@
-{{.Comment}}
-func {{.DocInfo.Name}}(t TestingT, {{.Params}}) {
- if !assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) {
- t.FailNow()
- }
-}
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/require_forward.go b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/require_forward.go
deleted file mode 100644
index 58324f105..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/require_forward.go
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
-* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen
-* THIS FILE MUST NOT BE EDITED BY HAND
-*/
-
-package require
-
-import (
-
- assert "github.com/stretchr/testify/assert"
- http "net/http"
- url "net/url"
- time "time"
-)
-
-
-// Condition uses a Comparison to assert a complex condition.
-func (a *Assertions) Condition(comp assert.Comparison, msgAndArgs ...interface{}) {
- Condition(a.t, comp, msgAndArgs...)
-}
-
-
-// Contains asserts that the specified string, list(array, slice...) or map contains the
-// specified substring or element.
-//
-// a.Contains("Hello World", "World", "But 'Hello World' does contain 'World'")
-// a.Contains(["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'")
-// a.Contains({"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) {
- Contains(a.t, s, contains, msgAndArgs...)
-}
-
-
-// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either
-// a slice or a channel with len == 0.
-//
-// a.Empty(obj)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) {
- Empty(a.t, object, msgAndArgs...)
-}
-
-
-// Equal asserts that two objects are equal.
-//
-// a.Equal(123, 123, "123 and 123 should be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
- Equal(a.t, expected, actual, msgAndArgs...)
-}
-
-
-// EqualError asserts that a function returned an error (i.e. not `nil`)
-// and that it is equal to the provided error.
-//
-// actualObj, err := SomeFunction()
-// if assert.Error(t, err, "An error was expected") {
-// assert.Equal(t, err, expectedError)
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) {
- EqualError(a.t, theError, errString, msgAndArgs...)
-}
-
-
-// EqualValues asserts that two objects are equal or convertable to the same types
-// and equal.
-//
-// a.EqualValues(uint32(123), int32(123), "123 and 123 should be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
- EqualValues(a.t, expected, actual, msgAndArgs...)
-}
-
-
-// Error asserts that a function returned an error (i.e. not `nil`).
-//
-// actualObj, err := SomeFunction()
-// if a.Error(err, "An error was expected") {
-// assert.Equal(t, err, expectedError)
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Error(err error, msgAndArgs ...interface{}) {
- Error(a.t, err, msgAndArgs...)
-}
-
-
-// Exactly asserts that two objects are equal is value and type.
-//
-// a.Exactly(int32(123), int64(123), "123 and 123 should NOT be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
- Exactly(a.t, expected, actual, msgAndArgs...)
-}
-
-
-// Fail reports a failure through
-func (a *Assertions) Fail(failureMessage string, msgAndArgs ...interface{}) {
- Fail(a.t, failureMessage, msgAndArgs...)
-}
-
-
-// FailNow fails test
-func (a *Assertions) FailNow(failureMessage string, msgAndArgs ...interface{}) {
- FailNow(a.t, failureMessage, msgAndArgs...)
-}
-
-
-// False asserts that the specified value is false.
-//
-// a.False(myBool, "myBool should be false")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) False(value bool, msgAndArgs ...interface{}) {
- False(a.t, value, msgAndArgs...)
-}
-
-
-// HTTPBodyContains asserts that a specified handler returns a
-// body that contains a string.
-//
-// a.HTTPBodyContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) {
- HTTPBodyContains(a.t, handler, method, url, values, str)
-}
-
-
-// HTTPBodyNotContains asserts that a specified handler returns a
-// body that does not contain a string.
-//
-// a.HTTPBodyNotContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) {
- HTTPBodyNotContains(a.t, handler, method, url, values, str)
-}
-
-
-// HTTPError asserts that a specified handler returns an error status code.
-//
-// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values) {
- HTTPError(a.t, handler, method, url, values)
-}
-
-
-// HTTPRedirect asserts that a specified handler returns a redirect status code.
-//
-// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values) {
- HTTPRedirect(a.t, handler, method, url, values)
-}
-
-
-// HTTPSuccess asserts that a specified handler returns a success status code.
-//
-// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values) {
- HTTPSuccess(a.t, handler, method, url, values)
-}
-
-
-// Implements asserts that an object is implemented by the specified interface.
-//
-// a.Implements((*MyInterface)(nil), new(MyObject), "MyObject")
-func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) {
- Implements(a.t, interfaceObject, object, msgAndArgs...)
-}
-
-
-// InDelta asserts that the two numerals are within delta of each other.
-//
-// a.InDelta(math.Pi, (22 / 7.0), 0.01)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) {
- InDelta(a.t, expected, actual, delta, msgAndArgs...)
-}
-
-
-// InDeltaSlice is the same as InDelta, except it compares two slices.
-func (a *Assertions) InDeltaSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) {
- InDeltaSlice(a.t, expected, actual, delta, msgAndArgs...)
-}
-
-
-// InEpsilon asserts that expected and actual have a relative error less than epsilon
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) InEpsilon(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) {
- InEpsilon(a.t, expected, actual, epsilon, msgAndArgs...)
-}
-
-
-// InEpsilonSlice is the same as InEpsilon, except it compares two slices.
-func (a *Assertions) InEpsilonSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) {
- InEpsilonSlice(a.t, expected, actual, delta, msgAndArgs...)
-}
-
-
-// IsType asserts that the specified objects are of the same type.
-func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) {
- IsType(a.t, expectedType, object, msgAndArgs...)
-}
-
-
-// JSONEq asserts that two JSON strings are equivalent.
-//
-// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) {
- JSONEq(a.t, expected, actual, msgAndArgs...)
-}
-
-
-// Len asserts that the specified object has specific length.
-// Len also fails if the object has a type that len() not accept.
-//
-// a.Len(mySlice, 3, "The size of slice is not 3")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) {
- Len(a.t, object, length, msgAndArgs...)
-}
-
-
-// Nil asserts that the specified object is nil.
-//
-// a.Nil(err, "err should be nothing")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) {
- Nil(a.t, object, msgAndArgs...)
-}
-
-
-// NoError asserts that a function returned no error (i.e. `nil`).
-//
-// actualObj, err := SomeFunction()
-// if a.NoError(err) {
-// assert.Equal(t, actualObj, expectedObj)
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) {
- NoError(a.t, err, msgAndArgs...)
-}
-
-
-// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the
-// specified substring or element.
-//
-// a.NotContains("Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'")
-// a.NotContains(["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'")
-// a.NotContains({"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) {
- NotContains(a.t, s, contains, msgAndArgs...)
-}
-
-
-// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
-// a slice or a channel with len == 0.
-//
-// if a.NotEmpty(obj) {
-// assert.Equal(t, "two", obj[1])
-// }
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) {
- NotEmpty(a.t, object, msgAndArgs...)
-}
-
-
-// NotEqual asserts that the specified values are NOT equal.
-//
-// a.NotEqual(obj1, obj2, "two objects shouldn't be equal")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
- NotEqual(a.t, expected, actual, msgAndArgs...)
-}
-
-
-// NotNil asserts that the specified object is not nil.
-//
-// a.NotNil(err, "err should be something")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) {
- NotNil(a.t, object, msgAndArgs...)
-}
-
-
-// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic.
-//
-// a.NotPanics(func(){
-// RemainCalm()
-// }, "Calling RemainCalm() should NOT panic")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NotPanics(f assert.PanicTestFunc, msgAndArgs ...interface{}) {
- NotPanics(a.t, f, msgAndArgs...)
-}
-
-
-// NotRegexp asserts that a specified regexp does not match a string.
-//
-// a.NotRegexp(regexp.MustCompile("starts"), "it's starting")
-// a.NotRegexp("^start", "it's not starting")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) {
- NotRegexp(a.t, rx, str, msgAndArgs...)
-}
-
-
-// NotZero asserts that i is not the zero value for its type and returns the truth.
-func (a *Assertions) NotZero(i interface{}, msgAndArgs ...interface{}) {
- NotZero(a.t, i, msgAndArgs...)
-}
-
-
-// Panics asserts that the code inside the specified PanicTestFunc panics.
-//
-// a.Panics(func(){
-// GoCrazy()
-// }, "Calling GoCrazy() should panic")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Panics(f assert.PanicTestFunc, msgAndArgs ...interface{}) {
- Panics(a.t, f, msgAndArgs...)
-}
-
-
-// Regexp asserts that a specified regexp matches a string.
-//
-// a.Regexp(regexp.MustCompile("start"), "it's starting")
-// a.Regexp("start...$", "it's not starting")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) {
- Regexp(a.t, rx, str, msgAndArgs...)
-}
-
-
-// True asserts that the specified value is true.
-//
-// a.True(myBool, "myBool should be true")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) True(value bool, msgAndArgs ...interface{}) {
- True(a.t, value, msgAndArgs...)
-}
-
-
-// WithinDuration asserts that the two times are within duration delta of each other.
-//
-// a.WithinDuration(time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s")
-//
-// Returns whether the assertion was successful (true) or not (false).
-func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) {
- WithinDuration(a.t, expected, actual, delta, msgAndArgs...)
-}
-
-
-// Zero asserts that i is the zero value for its type and returns the truth.
-func (a *Assertions) Zero(i interface{}, msgAndArgs ...interface{}) {
- Zero(a.t, i, msgAndArgs...)
-}
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/require_forward.go.tmpl b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/require_forward.go.tmpl
deleted file mode 100644
index b93569e0a..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/require_forward.go.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-{{.CommentWithoutT "a"}}
-func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) {
- {{.DocInfo.Name}}(a.t, {{.ForwardedParams}})
-}
diff --git a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/requirements.go b/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/requirements.go
deleted file mode 100644
index 41147562d..000000000
--- a/vendor/github.com/bitrise-io/goinp/Godeps/_workspace/src/github.com/stretchr/testify/require/requirements.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package require
-
-// TestingT is an interface wrapper around *testing.T
-type TestingT interface {
- Errorf(format string, args ...interface{})
- FailNow()
-}
-
-//go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl
diff --git a/vendor/github.com/bitrise-io/goinp/LICENSE b/vendor/github.com/bitrise-io/goinp/LICENSE
index 68b6ac3de..a6a5c39a6 100644
--- a/vendor/github.com/bitrise-io/goinp/LICENSE
+++ b/vendor/github.com/bitrise-io/goinp/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2015 Viktor Benei
+Copyright (c) 2015 Bitrise
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/github.com/bitrise-io/goinp/Makefile b/vendor/github.com/bitrise-io/goinp/Makefile
deleted file mode 100644
index ecc8c4618..000000000
--- a/vendor/github.com/bitrise-io/goinp/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-test:
- # Testing...
- go fmt ./...
- go test -v ./...
-build:
- # Building...
- go build
-install:
- # Installing...
- go install
diff --git a/vendor/github.com/bitrise-io/goinp/README.md b/vendor/github.com/bitrise-io/goinp/README.md
deleted file mode 100644
index f51b22312..000000000
--- a/vendor/github.com/bitrise-io/goinp/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# go-interactive-cli
-
-Interactive CLI in Go (test)
-
-## Ask for an input from the user with the `AskForXyz` methods.
-
-Ask for a string input with `AskForString`
-
-Ask for a 64 bit integer (int64) input with `AskForInt`
-
-Ask for a bool input with `AskForBool`
-
-* this method accepts all the standard true/false values handled by [http://golang.org/pkg/strconv/#ParseBool](http://golang.org/pkg/strconv/#ParseBool)
- * this includes: `1`, `t`, true`, `0`, `f`, false`
-* additionally `yes`, `y`, `no` and `n` are also accepted
-* every input handled in a case insensitive way, so `TrUe` will also return `true`
diff --git a/vendor/github.com/bitrise-io/goinp/bitrise.yml b/vendor/github.com/bitrise-io/goinp/bitrise.yml
deleted file mode 100644
index 02f4e1819..000000000
--- a/vendor/github.com/bitrise-io/goinp/bitrise.yml
+++ /dev/null
@@ -1,98 +0,0 @@
-format_version: 1.1.0
-default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
-
-app:
- envs:
- - BIN_NAME: goinp
-
-workflows:
- _install_test_tools:
- steps:
- - script:
- title: Install required testing tools
- inputs:
- - content: |-
- #!/bin/bash
- set -e
- set -v
-
- # Install dependencies
- go get -u github.com/tools/godep
-
- # Check for unhandled errors
- go get -u github.com/kisielk/errcheck
-
- # Go lint
- go get -u github.com/golang/lint/golint
-
- _test:
- steps:
- - script:
- title: Godeps - GOPATH patch
- inputs:
- - content: |-
- set -e
- set -v
- envman add --key ORIG_GOPATH --value "$GOPATH"
- envman add --key GOPATH --value "$(godep path):$GOPATH"
- - script:
- title: Go Test
- inputs:
- - content: godep go test ./...
- - script:
- title: Err check
- inputs:
- - content: errcheck -asserts=true -blank=true $(godep go list ./...)
- - script:
- title: Go Lint
- inputs:
- - content: |-
- #!/bin/bash
- set -e
-
- golint_out="$(golint ./...)"
- if [[ "${golint_out}" != "" ]] ; then
- echo "=> Golint issues found:"
- echo "${golint_out}"
- exit 1
- fi
- - script:
- title: Restore original GOPATH
- inputs:
- - content: envman add --key GOPATH --value "$ORIG_GOPATH"
-
- godeps-update:
- steps:
- - script:
- title: Dependency update
- inputs:
- - content: |-
- #!/bin/bash
- set -e
- set -x
- go get -u ./...
- rm -rf ./Godeps
- godep save ./...
-
- ci:
- before_run:
- - _install_test_tools
- - _test
- steps:
- - slack:
- run_if: .IsCI
- inputs:
- - webhook_url: $INTERNAL_DEV_SLACK_WEBHOOK_URL
- - channel: $INTERNAL_DEV_SLACK_CHANNEL
- - from_username: ${BIN_NAME} - CI - OK
- - from_username_on_error: ${BIN_NAME} - CI - ERROR
- - emoji: ":white_check_mark:"
- - emoji_on_error: ":no_entry_sign:"
- - message: |-
- CI was successful on branch: *${BITRISE_GIT_BRANCH}*
-
- Build URL: ${BITRISE_BUILD_URL}
- - message_on_error: |-
- CI FAILED on branch: *${BITRISE_GIT_BRANCH}*
-
- Build URL: ${BITRISE_BUILD_URL}
diff --git a/vendor/github.com/bitrise-io/goinp/deps.go b/vendor/github.com/bitrise-io/goinp/deps.go
deleted file mode 100644
index acb461d04..000000000
--- a/vendor/github.com/bitrise-io/goinp/deps.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file contains dependency imports
-// which are only required for `go test`.
-// Godeps recently introduced a breaking change, which now
-// completely ignors every file ending with `_test.go`,
-// and so the dependencies which are required only for `go test`.
-// So, we'll declare those here.
-package main
-
-import _ "github.com/stretchr/testify/require"
-import _ "github.com/bitrise-io/go-utils/testutil"
diff --git a/vendor/github.com/bitrise-io/goinp/goinp/goinp.go b/vendor/github.com/bitrise-io/goinp/goinp/goinp.go
index 8e71879e5..e910faf63 100644
--- a/vendor/github.com/bitrise-io/goinp/goinp/goinp.go
+++ b/vendor/github.com/bitrise-io/goinp/goinp/goinp.go
@@ -11,7 +11,7 @@ import (
"syscall"
"unsafe"
- "github.com/bitrise-io/go-utils/log"
+ "golang.org/x/crypto/ssh/terminal"
)
//=======================================
@@ -62,93 +62,44 @@ func AskForString(messageToPrint string) (string, error) {
return AskForStringFromReader(messageToPrint, os.Stdin)
}
-func writeStdinClearable(text string) error {
- for _, c := range []byte(text) {
- if _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, os.Stdin.Fd(), syscall.TIOCSTI, uintptr(unsafe.Pointer(&c))); errno != 0 {
- return fmt.Errorf("failed to write to stdin, err no: %d", errno)
+// WriteToTerminalInputBuffer prints a text to the terminal console which can be used as an input for a question or can be cleared out
+func WriteToTerminalInputBuffer(text string) error {
+ if terminal.IsTerminal(int(os.Stdin.Fd())) {
+ for _, c := range []byte(text) {
+ if _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, os.Stdin.Fd(), syscall.TIOCSTI, uintptr(unsafe.Pointer(&c))); errno != 0 {
+ return fmt.Errorf("failed to write to stdin, err no: %d", errno)
+ }
}
}
return nil
}
-// AskOptions ...
-func AskOptions(title string, defaultValue string, optional bool, options ...string) (string, error) {
- const customValueOptionText = ""
-
- if len(options) == 0 {
- for {
- if title != "" {
- fmt.Print("Enter value for \"" + strings.TrimSuffix(title, ":") + "\": ")
- }
- var (
- input string
- err error
- )
-
- if defaultValue != "" {
- if err := writeStdinClearable(defaultValue); err != nil {
- return "", err
- }
- }
-
- input, err = bufio.NewReader(os.Stdin).ReadString('\n')
- if err != nil {
- return "", err
- }
-
- if !optional && strings.TrimSpace(input) == "" {
- log.Errorf("value must be specified")
- continue
- }
+func askForOptionalInput(defaultValue string, optional bool, reader io.Reader, writer io.Writer) (string, error) {
+ r := bufio.NewReader(reader)
- return strings.TrimSpace(input), nil
+ if defaultValue != "" {
+ if err := WriteToTerminalInputBuffer(defaultValue); err != nil {
+ return "", err
}
}
- // add last option if optional so user can decide to input value manually
- if optional && len(options) > 0 {
- options = append(options, customValueOptionText)
+ input, err := r.ReadString('\n')
+ if err != nil {
+ return "", err
}
- // selector with one option -> auto select
- if len(options) == 1 {
- return options[0], nil
- }
+ input = strings.TrimSpace(input)
- if title != "" {
- fmt.Println("Select \"" + strings.TrimSuffix(title, ":") + "\" from the list:")
+ if !optional && input == "" {
+ return "", fmt.Errorf("value must be specified")
}
- for i, option := range options {
- log.Printf("[%d] : %s", i+1, option)
- }
-
- for {
- fmt.Print("Type in the option's number, then hit Enter: ")
-
- answer, err := bufio.NewReader(os.Stdin).ReadString('\n')
- if err != nil {
- log.Errorf("failed to read input value")
- continue
- }
-
- optionNo, err := strconv.Atoi(strings.TrimSpace(answer))
- if err != nil {
- log.Errorf("failed to parse option number, pick a number from 1-%d", len(options))
- continue
- }
-
- if optionNo-1 < 0 || optionNo-1 >= len(options) {
- log.Errorf("invalid option number, pick a number 1-%d", len(options))
- continue
- }
-
- if options[optionNo-1] == customValueOptionText {
- return AskOptions(title, "", true)
- }
+ return input, nil
+}
- return options[optionNo-1], nil
- }
+// AskForOptionalInput will wait for input, and will print clearable default text in case of interactive shell. Accepts empty input in case if optional.
+func AskForOptionalInput(defaultValue string, optional bool) (string, error) {
+ return askForOptionalInput(defaultValue, optional, os.Stdin, os.Stdout)
}
//=======================================
diff --git a/vendor/github.com/bitrise-io/goinp/goinp/goinp_test.go b/vendor/github.com/bitrise-io/goinp/goinp/goinp_test.go
deleted file mode 100644
index 268dba9e3..000000000
--- a/vendor/github.com/bitrise-io/goinp/goinp/goinp_test.go
+++ /dev/null
@@ -1,427 +0,0 @@
-package goinp
-
-import (
- "strings"
- "testing"
-
- "github.com/stretchr/testify/require"
-)
-
-//=======================================
-// String
-//=======================================
-
-func TestAskForStringFromReaderWithDefault(t *testing.T) {
- t.Log("TestAskForString - input, NO default value")
- {
- testUserInput := "this is some text"
-
- res, err := AskForStringFromReaderWithDefault("Enter some text", "", strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, testUserInput, res)
- }
-
- t.Log("TestAskForString - input, default value")
- {
- testUserInput := "this is some text"
- defaultValue := "default"
-
- res, err := AskForStringFromReaderWithDefault("Enter some text", defaultValue, strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, testUserInput, res)
- }
-
- t.Log("TestAskForString - NO input, NO default value")
- {
- testUserInput := ""
-
- res, err := AskForStringFromReaderWithDefault("Enter some text", "", strings.NewReader(testUserInput))
- require.Error(t, err)
- require.Equal(t, testUserInput, res)
- }
-
- t.Log("TestAskForString - NO input, default value")
- {
- testUserInput := ""
- defaultValue := "default"
-
- res, err := AskForStringFromReaderWithDefault("Enter some text", defaultValue, strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, defaultValue, res)
- }
-}
-
-func TestAskForStringFromReader(t *testing.T) {
- t.Log("TestAskForStringFromReader - input")
- {
- testUserInput := "this is some text"
-
- res, err := AskForStringFromReader("Enter some text", strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, testUserInput, res)
- }
-
- t.Log("TestAskForStringFromReader - NO input")
- {
- testUserInput := ""
-
- res, err := AskForStringFromReader("Enter some text", strings.NewReader(testUserInput))
- require.Error(t, err)
- require.Equal(t, testUserInput, res)
- }
-}
-
-//=======================================
-// Path
-//=======================================
-
-func TestAskForPathFromReaderWithDefault(t *testing.T) {
- t.Log("Simple path - input, NO default value")
- {
- testUserInput := "path/without/spaces"
- defaultValue := ""
-
- res, err := AskForPathFromReaderWithDefault("Enter a path", defaultValue, strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, testUserInput, res)
- }
-
- t.Log("TestAskForPathFromReaderWithDefault - input, with default value")
- {
- testUserInput := "path/without/spaces"
- defaultValue := "default"
-
- res, err := AskForPathFromReaderWithDefault("Enter a path", defaultValue, strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, testUserInput, res)
- }
-
- t.Log("TestAskForPathFromReaderWithDefault - NO input, NO default value")
- {
- testUserInput := ""
- defaultValue := ""
-
- res, err := AskForPathFromReaderWithDefault("Enter a path", defaultValue, strings.NewReader(testUserInput))
- require.Error(t, err)
- require.Equal(t, defaultValue, res)
- }
-
- t.Log("TestAskForPathFromReaderWithDefault - input, with default value")
- {
- testUserInput := ""
- defaultValue := "default"
-
- res, err := AskForPathFromReaderWithDefault("Enter a path", defaultValue, strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, defaultValue, res)
- }
-}
-
-func TestAskForPathFromReader(t *testing.T) {
- t.Log("TestAskForPathFromReader - Empty path")
- {
- testUserInput := ""
- res, err := AskForPathFromReader("Enter a path", strings.NewReader(testUserInput))
- require.Error(t, err)
- require.Equal(t, testUserInput, res)
- }
-
- t.Log("TestAskForPathFromReader - Simple path")
- {
- testUserInput := "path/without/spaces"
- res, err := AskForPathFromReader("Enter a path", strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, "path/without/spaces", res)
- }
-
- t.Log("TestAskForPathFromReader - Path with simple spaces")
- {
- testUserInput := "path/with simple/spaces"
- res, err := AskForPathFromReader("Enter a path", strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, "path/with simple/spaces", res)
- }
-
- t.Log("TestAskForPathFromReader - Path with backspace escaped space")
- {
- testUserInput := "path/with\\ spaces/in it"
- res, err := AskForPathFromReader("Enter a path", strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, "path/with spaces/in it", res)
- }
-}
-
-//=======================================
-// Int
-//=======================================
-
-func TestAskForIntFromReaderWithDefault(t *testing.T) {
- t.Log("TestAskForIntFromReaderWithDefault - input, with default value")
- {
- testUserInput := "31"
- defaultValue := 1
-
- res, err := AskForIntFromReaderWithDefault("Enter a number", defaultValue, strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, int64(31), res)
- }
-
- t.Log("TestAskForIntFromReaderWithDefault - NO input, with default value")
- {
- testUserInput := ""
- defaultValue := 1
-
- res, err := AskForIntFromReaderWithDefault("Enter a number", defaultValue, strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, int64(defaultValue), res)
- }
-}
-
-func TestAskForIntFromReader(t *testing.T) {
- t.Log("TestAskForIntFromReader - input")
- {
- testUserInput := "31"
-
- res, err := AskForIntFromReader("Enter a number", strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, int64(31), res)
- }
-
- t.Log("TestAskForIntFromReader - NO input")
- {
- testUserInput := ""
-
- res, err := AskForIntFromReader("Enter a number", strings.NewReader(testUserInput))
- require.Error(t, err)
- require.Equal(t, int64(0), res)
- }
-}
-
-//=======================================
-// Bool
-//=======================================
-
-func TestAskForBoolFromReaderWithDefaultValue(t *testing.T) {
- t.Log("TestAskForBoolFromReaderWithDefaultValue - input, default value")
- {
- testUserInput := "y"
- defaultValue := true
-
- res, err := AskForBoolFromReaderWithDefaultValue("Yes or no?", defaultValue, strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, true, res)
- }
-
- t.Log("TestAskForBoolFromReaderWithDefaultValue - input, default value")
- {
- testUserInput := "n"
- defaultValue := true
-
- res, err := AskForBoolFromReaderWithDefaultValue("Yes or no?", defaultValue, strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, false, res)
- }
-
- t.Log("TestAskForBoolFromReaderWithDefaultValue - NO input, default value")
- {
- testUserInput := ""
- defaultValue := true
-
- res, err := AskForBoolFromReaderWithDefaultValue("Yes or no?", defaultValue, strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, defaultValue, res)
- }
-
- t.Log("TestAskForBoolFromReaderWithDefaultValue - INVALID input, default value")
- {
- testUserInput := "invalid"
- defaultValue := true
-
- res, err := AskForBoolFromReaderWithDefaultValue("Yes or no?", defaultValue, strings.NewReader(testUserInput))
- require.Error(t, err)
- require.Equal(t, false, res)
- }
-}
-
-func TestAskForBoolFromReader(t *testing.T) {
- t.Log("TestAskForBoolFromReader - yes")
- {
- testUserInput := "y"
- res, err := AskForBoolFromReader("Yes or no?", strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, true, res)
- }
-
- t.Log("TestAskForBoolFromReader - no")
- {
- testUserInput := "n"
- res, err := AskForBoolFromReader("Yes or no?", strings.NewReader(testUserInput))
- require.NoError(t, err)
- require.Equal(t, false, res)
- }
-
- t.Log("TestAskForBoolFromReader - 1")
- {
- testUserInput := "-1"
- res, err := AskForBoolFromReader("Yes or no?", strings.NewReader(testUserInput))
- require.Error(t, err)
- require.Equal(t, false, res)
- }
-}
-
-func TestParseBool(t *testing.T) {
- t.Log("TestParseBool - Simple Yes")
- {
- testUserInput := "yes"
- isYes, err := ParseBool(testUserInput)
- require.NoError(t, err)
- require.Equal(t, true, isYes)
- }
-
- t.Log("TestParseBool - Simple true")
- {
- testUserInput := "true"
- isYes, err := ParseBool(testUserInput)
- require.NoError(t, err)
- require.Equal(t, true, isYes)
- }
-
- t.Log("TestParseBool - y")
- {
- testUserInput := "y"
- isYes, err := ParseBool(testUserInput)
- require.NoError(t, err)
- require.Equal(t, true, isYes)
- }
-
- t.Log("TestParseBool - Simple No")
- {
- testUserInput := "no"
- isYes, err := ParseBool(testUserInput)
- require.NoError(t, err)
- require.Equal(t, false, isYes)
- }
-
- t.Log("TestParseBool - Simple false")
- {
- testUserInput := "false"
- isYes, err := ParseBool(testUserInput)
- require.NoError(t, err)
- require.Equal(t, false, isYes)
- }
-
- t.Log("TestParseBool - n")
- {
- testUserInput := "n"
- isYes, err := ParseBool(testUserInput)
- require.NoError(t, err)
- require.Equal(t, false, isYes)
- }
-
- t.Log("TestParseBool - Newline in yes - trim")
- {
- testUserInput := `
- yes
-`
- isYes, err := ParseBool(testUserInput)
- require.NoError(t, err)
- require.Equal(t, true, isYes)
- }
-
- t.Log("TestParseBool - With number - 1")
- {
- testUserInput := "1"
- isYes, err := ParseBool(testUserInput)
- require.NoError(t, err)
- require.Equal(t, true, isYes)
- }
-
- t.Log("TestParseBool - With number - 0")
- {
- testUserInput := "0"
- isYes, err := ParseBool(testUserInput)
- require.NoError(t, err)
- require.Equal(t, false, isYes)
- }
-
- t.Log("TestParseBool - With INVALID number - -1")
- {
- testUserInput := "-1"
- isYes, err := ParseBool(testUserInput)
- require.Error(t, err)
- require.Equal(t, false, isYes)
- }
-}
-
-//=======================================
-// Select
-//=======================================
-
-func TestSelectFromStringsFromReaderWithDefault(t *testing.T) {
- availableOptions := []string{"first", "second", "third"}
- defaultValue := 3
-
- t.Log("TestSelectFromStringsFromReaderWithDefault - input, with default value")
- {
- res, err := SelectFromStringsFromReaderWithDefault("Select something", defaultValue, availableOptions, strings.NewReader("1"))
- require.NoError(t, err)
- require.Equal(t, "first", res)
- }
-
- t.Log("TestSelectFromStringsFromReaderWithDefault - NO input, with default value")
- {
- res, err := SelectFromStringsFromReaderWithDefault("Select something", defaultValue, availableOptions, strings.NewReader(""))
- require.NoError(t, err)
- require.Equal(t, "third", res)
- }
-
- t.Log("TestSelectFromStringsFromReaderWithDefault - INVALID input, with default value")
- {
- res, err := SelectFromStringsFromReaderWithDefault("Select something", defaultValue, availableOptions, strings.NewReader("-1"))
- require.Error(t, err)
- require.Equal(t, "", res)
- }
-}
-
-func TestSelectFromStringsFromReader(t *testing.T) {
- availableOptions := []string{"first", "second", "third"}
-
- t.Log("TestSelectFromStringsFromReader - NO input")
- {
- _, err := SelectFromStringsFromReader("Select something", availableOptions, strings.NewReader(""))
- require.Error(t, err)
- }
-
- t.Log("TestSelectFromStringsFromReader - INVALID input")
- {
- _, err := SelectFromStringsFromReader("Select something", availableOptions, strings.NewReader("-1"))
- require.EqualError(t, err, "invalid option: You entered a number less than 1")
- }
-
- t.Log("TestSelectFromStringsFromReader - input")
- {
- res, err := SelectFromStringsFromReader("Select something", availableOptions, strings.NewReader("1"))
- require.NoError(t, err)
- require.Equal(t, "first", res)
- }
-
- t.Log("TestSelectFromStringsFromReader - input")
- {
- res, err := SelectFromStringsFromReader("Select something", availableOptions, strings.NewReader("2"))
- require.NoError(t, err)
- require.Equal(t, "second", res)
- }
-
- t.Log("TestSelectFromStringsFromReader - input")
- {
- res, err := SelectFromStringsFromReader("Select something", availableOptions, strings.NewReader("3"))
- require.NoError(t, err)
- require.Equal(t, "third", res)
- }
-
- t.Log("TestSelectFromStringsFromReader - INVALID input")
- {
- _, err := SelectFromStringsFromReader("Select something", availableOptions, strings.NewReader("4"))
- require.EqualError(t, err, "invalid option: You entered a number greater than the last option's number")
- }
-}
diff --git a/vendor/github.com/bitrise-io/goinp/main.go b/vendor/github.com/bitrise-io/goinp/main.go
deleted file mode 100644
index a317168a7..000000000
--- a/vendor/github.com/bitrise-io/goinp/main.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package main
-
-import (
- "fmt"
- "log"
-
- "github.com/bitrise-io/goinp/goinp"
-)
-
-func main() {
- retStr, err := goinp.AskForString("Please enter some text here")
- if err != nil {
- log.Fatalln("Error:", err)
- }
- fmt.Println("Entered text was:", retStr)
-
- retInt, err := goinp.AskForInt("Please enter a number")
- if err != nil {
- log.Fatalln("Error:", err)
- }
- fmt.Println("Entered:", retInt)
-
- retBool, err := goinp.AskForBool("Yes or no?")
- if err != nil {
- log.Fatalln("Error:", err)
- }
- fmt.Println("Entered:", retBool)
-}
diff --git a/vendor/github.com/bitrise-io/gows/.gitignore b/vendor/github.com/bitrise-io/gows/.gitignore
deleted file mode 100644
index 2f2b58313..000000000
--- a/vendor/github.com/bitrise-io/gows/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-.bitrise*
-_tmp
-.gows
-.gows.user.yml
-
-.vscode
-.directory
diff --git a/vendor/github.com/bitrise-io/gows/Gopkg.lock b/vendor/github.com/bitrise-io/gows/Gopkg.lock
deleted file mode 100644
index 6793949d8..000000000
--- a/vendor/github.com/bitrise-io/gows/Gopkg.lock
+++ /dev/null
@@ -1,93 +0,0 @@
-# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
-
-
-[[projects]]
- name = "github.com/Sirupsen/logrus"
- packages = ["."]
- revision = "c155da19408a8799da419ed3eeb0cb5db0ad5dbc"
- version = "v1.0.5"
-
-[[projects]]
- branch = "master"
- name = "github.com/bitrise-io/go-utils"
- packages = [
- "colorstring",
- "command",
- "errorutil",
- "fileutil",
- "pathutil"
- ]
- revision = "b33f6bcef9b50045d7e62364b354584afc3ee329"
-
-[[projects]]
- name = "github.com/davecgh/go-spew"
- packages = ["spew"]
- revision = "346938d642f2ec3594ed81d874461961cd0faa76"
- version = "v1.1.0"
-
-[[projects]]
- name = "github.com/inconshreveable/mousetrap"
- packages = ["."]
- revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"
- version = "v1.0"
-
-[[projects]]
- name = "github.com/pkg/errors"
- packages = ["."]
- revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
- version = "v0.8.0"
-
-[[projects]]
- name = "github.com/pmezard/go-difflib"
- packages = ["difflib"]
- revision = "792786c7400a136282c1664665ae0a8db921c6c2"
- version = "v1.0.0"
-
-[[projects]]
- name = "github.com/spf13/pflag"
- packages = ["."]
- revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66"
- version = "v1.0.0"
-
-[[projects]]
- name = "github.com/stretchr/testify"
- packages = [
- "assert",
- "require"
- ]
- revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71"
- version = "v1.2.1"
-
-[[projects]]
- branch = "master"
- name = "golang.org/x/crypto"
- packages = ["ssh/terminal"]
- revision = "80db560fac1fb3e6ac81dbc7f8ae4c061f5257bd"
-
-[[projects]]
- branch = "master"
- name = "golang.org/x/sys"
- packages = [
- "unix",
- "windows"
- ]
- revision = "c488ab1dd8481ef762f96a79a9577c27825be697"
-
-[[projects]]
- name = "gopkg.in/viktorbenei/cobra.v0"
- packages = ["."]
- revision = "5513220bc3d99d258948b1094b864892f256c249"
- version = "v0"
-
-[[projects]]
- name = "gopkg.in/yaml.v2"
- packages = ["."]
- revision = "7f97868eec74b32b0982dd158a51a446d1da7eb5"
- version = "v2.1.1"
-
-[solve-meta]
- analyzer-name = "dep"
- analyzer-version = 1
- inputs-digest = "0c50a806bc07c41984e7c1a65bb14030901c05177c3b1b93a6b7c9376e6a5cd7"
- solver-name = "gps-cdcl"
- solver-version = 1
diff --git a/vendor/github.com/bitrise-io/gows/Gopkg.toml b/vendor/github.com/bitrise-io/gows/Gopkg.toml
deleted file mode 100644
index df97559a6..000000000
--- a/vendor/github.com/bitrise-io/gows/Gopkg.toml
+++ /dev/null
@@ -1,34 +0,0 @@
-# Gopkg.toml example
-#
-# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
-# for detailed Gopkg.toml documentation.
-#
-# required = ["github.com/user/thing/cmd/thing"]
-# ignored = ["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"
-#
-# [prune]
-# non-go = false
-# go-tests = true
-# unused-packages = true
-
-
-[[constraint]]
- name = "gopkg.in/viktorbenei/cobra.v0"
- version = "0.0.0"
-
-[prune]
- go-tests = true
- unused-packages = true
diff --git a/vendor/github.com/bitrise-io/gows/README.md b/vendor/github.com/bitrise-io/gows/README.md
deleted file mode 100644
index 599213f91..000000000
--- a/vendor/github.com/bitrise-io/gows/README.md
+++ /dev/null
@@ -1,226 +0,0 @@
-# gows
-
-Go Workspace / Environment Manager, to easily manage the Go Workspace during development.
-
-
-## The idea
-
-Work in **isolated (development) environment** when you're working on your Go projects.
-**No cross-project dependency version missmatch**, no more packages left out from `vendor/`.
-
-No need for initializing a go workspace either, **your project can be located anywhere**,
-not just in a predefined `$GOPATH` workspace.
-`gows` will take care about crearing the (per-project isolated) workspace directory
-structure, no matter where your project is located.
-
-`gows` **works perfectly with other Go tools**, all it does is it ensures
-that every project gets it's own, isolated Go workspace and sets `$GOPATH`
-accordingly.
-
-
-## Install
-
-### Requirements
-
-* `Go` with a prepared `$GOPATH`
- * required for creating the `GOPATH/bin` symlink, to have shared `GOPATH/bin` between workspaces
-
-
-### Install & Prepare Go
-
-Install & configure `Go` - [official guide](https://golang.org/doc/install).
-
-Make sure you have `$GOPATH/bin` in your `$PATH`, e.g. by adding
-
-```
-export PATH="$PATH:$GOPATH/bin"
-```
-
-to your `~/.bash_profile` or `~/.bashrc` (don't forget to `source` it or to open a new Terminal window/tab
-if you just added this line to the profile file).
-
-*This makes sure that the Go projects you build/install will be available in any Terminal / Command Line
-window, without the need to type in the full path of the binary.*
-
-
-### Install `gows`
-
-```
-go get -u github.com/bitrise-tools/gows
-```
-
-That's all. If you have a "properly" configured Go environment (see the previous Install section)
-then you should be able to run `gows -version` now, and be able to run `gows` in any directory.
-
-
-## Usage
-
-Run `gows init` inside your Go project's directory (*you only have to do this once*).
-This will initialize the isolated
-Workspace for the project and create a `gows.yml` file in your
-project's directory (you can commit or `.gitignore` this file if you want to).
-
-Once you initialized the workspace,
-just prefix your commands (any command) with `gows`.
-
-Example:
-
-Instead of `go get ./...` use `gows go get ./...`,
-instead of `go install` use `gows go install`, etc.
-
-That's pretty much all :)
-
-If you'd want to clean up the workspace you can run `gows clear`
-in your project's directory, that'll delete and re-initialize the
-related workspace.
-
-
-### Alternative usage option: jump into a prepared Shell
-
-*This solution works for most shells, but there are exceptions, like `fish`.
-The reason is: `gows` creates a symlink between your project and the isolated workspace.
-In Bash and most shells if you `cd` into a symlink directory (e.g. `cd my/symlink-dir`)
-your `pwd` will point to the symlink path (`.../my/symlink-dir`),
-but a few shells (`fish` for example) change the path to the symlink target path instead,
-which means that when `go` gets the current path that will point to your project's original
-path, instead of to the symlink inside the isolated workspace. Which, at that point,
-is outside of GOPATH.*
-
-In shells which keep the working directory path to point to the symlink's path, instead
-of it's target (e.g. Bash) you can run:
-
-```
-gows bash
-```
-
-or
-
-```
-gows bash -l
-```
-
-which will start a shell (in this example Bash) with prepared `GOPATH` and your
-working directory will be set to the symlink inside the isolated workspace.
-
-If you want to use this mode you'll have to change how you initialize
-your `GOPATH`, to allow it to be overwritten by `gows` for "shell jump in".
-To allow `gows` to overwrite the `GOPATH` for shells initialized **by/through** `gows` you should
-change your `GOPATH` init entry in your `~/.bash_profile` / `~/.bashrc` (or
-wherever you did set GOPATH for your shell).
-For Bash (`~/.bash_profile` / `~/.bashrc`) you can use this form:
-
-```
-if [ -z "$GOPATH" ] ; then
- export GOPATH="/my/go/path"
-fi
-```
-
-instead of this one:
-
-```
-export GOPATH="/my/go/path"
-```
-
-This means that your (Bash) shell will only set the `GOPATH` environment if it's not set to a value already.
-
-This is not required if you use `gows` only in a "single command / prefix" style,
-it's only required if you want to initialize
-the shell and jump into the initialized shell through `gows`. In general it's safe to initialize the
-environment variable this way even if you don't plan to initialize any shell through `gows`,
-as this will always initialize `GOPATH` *unless* it's already initialized (e.g. by an outer shell).
-
-
-### `gows` commands
-
-*You can get the list of available commands by running: `gows --help`,
-and command specific help by running: `gows COMMAND --help`*
-
-* `gows version` : Print the version of `gows`, same as `gows --version`.
-* `gows init [--reset] [go-package-name]` : Initialize a workspace for the current directory.
- * If called without a go-package-name parameter `gows` will try to determine the package name
- from `git remote` (`git remote get-url origin`).
- * For more help see: `gows init --help`.
-* `gows workspaces` : List registered gows projects -> workspaces path pairs
-
-
-## Technical Notes, how `gows` works behind the scenes
-
-When you call `gows init` in your project's directory (wherever it is),
-`gows` creates an empty Go Workspace for it in `~/.bitrise-gows/wsdirs/`,
-and registers your project's path in `~/.bitrise-gows/workspaces.yml`, so
-that the same workspace (inside `~/.bitrise-gows/wsdirs/`) can be assigned
-for it every time.
-
-When you run any `gows` command from your project's directory, `gows` will
-symlink the project directory into the related `~/.bitrise-gows/wsdirs/...`
-Workspace directory before running the command. Additionally `gows`
-will symlink your original `GOPATH/bin` into the workspace in
-`~/.bitrise-gows/wsdirs/...`, so that if you `go install` something that'll
-create the binary in your `GOPATH/bin`, not just inside the isolated Workspace.
-
-Once the symlinks are in place `gows` will also set two environments for the command,
-`GOPATH` and `PWD`, to point to the isolated workspace and the project path
-inside it.
-
-A step by step example about how the directory structure is built:
-
-```
-$ cd $GOPATH/src/github.com/bitrise-tools/gows
-
-$ ls -alh ~/.bitrise-gows/
-ls: ~/.bitrise-gows/: No such file or directory
-
-$ gows init
-...
-Successful init - gows is ready for use!
-
-$ tree -L 5 ~/.bitrise-gows/wsdirs/
-~/.bitrise-gows/wsdirs/
-└── gows-1464900642
- └── src
-
-2 directories, 0 files
-
-$ ls -l1 ~/.bitrise-gows/
-workspaces.yml
-wsdirs
-
-# the first `gows` command you run creates the symlinks
-# inside the related workspace, in `~/.bitrise-gows/wsdirs/`
-$ gows pwd
-~/.bitrise-gows/wsdirs/gows-1464900642/src/github.com/bitrise-tools/gows
-
-$ tree -L 5 ~/.bitrise-gows/wsdirs/
-~/.bitrise-gows/wsdirs/
-└── gows-1464900642
- ├── bin -> ~/develop/go/bin
- └── src
- └── github.com
- └── bitrise-tools
- └── gows -> ~/develop/go/src/github.com/bitrise-tools/gows
-```
-
-
-## TODO
-
-- [x] Setup the base code (generate the template project, e.g. create a new Xcode project or `rails new`)
- - [x] commit & push
-- [ ] Add linter tools
- - go:
- - [ ] `go test`
- - [ ] `go vet`
- - [ ] [errcheck](github.com/kisielk/errcheck)
- - [ ] [golint](github.com/golang/lint/golint)
-- [ ] Write tests & base functionality, BDD/TDD preferred
-- [ ] Setup continuous integration (testing) on [bitrise.io](https://www.bitrise.io)
-- [ ] Setup continuous deployment for the project - just add it to the existing [bitrise.io](https://www.bitrise.io) config
-- [ ] Use [releaseman](https://github.com/bitrise-tools/releaseman) to automate the release and CHANGELOG generation
-- [ ] Iterate on the project (and on the automation), test the automatic deployment
-
-- [ ] Add (r)sync mode as an option - as a workaround for "shell jump in" usage mode in Shells which don't work with the symlink based mode (e.g. `fish`)
- - allow it to be specified in the `gows.yml`
- - add commands: `sync-in` and `sync-back`, in case you want to sync with an already open shell (e.g. you changed the code in the Project dir),
- and to be able to `sync-back` in case you missed to add the `-sync-back` flag to the original command
-- [ ] Option to disable `GOPATH/bin` symlinking. Once this
- - [ ] configurable in `gows.yml`
- - [ ] it should be able to handle if the user changes the option - should remove the symlink / dir and create the dir / symlink instead
\ No newline at end of file
diff --git a/vendor/github.com/bitrise-io/gows/bitrise.yml b/vendor/github.com/bitrise-io/gows/bitrise.yml
deleted file mode 100644
index 151c250ab..000000000
--- a/vendor/github.com/bitrise-io/gows/bitrise.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-format_version: 1.2.0
-default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
-workflows:
- test:
- steps:
- - script:
- inputs:
- - content: |-
- #!/bin/bash
- set -ex
- go test ./...
- dep-update:
- title: Dep update
- description: |
- Used for updating bitrise dependencies with dep
- steps:
- - script:
- title: Dependency update
- inputs:
- - content: |-
- #!/usr/bin/env bash
- set -ex
- go get -u -v github.com/golang/dep/cmd/dep
- dep ensure -v
- dep ensure -v -update
diff --git a/vendor/github.com/bitrise-io/gows/cmd/clear.go b/vendor/github.com/bitrise-io/gows/cmd/clear.go
deleted file mode 100644
index 03d88a273..000000000
--- a/vendor/github.com/bitrise-io/gows/cmd/clear.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package cmd
-
-import (
- "fmt"
-
- log "github.com/Sirupsen/logrus"
- "github.com/bitrise-io/go-utils/colorstring"
- "github.com/bitrise-tools/gows/config"
- "gopkg.in/viktorbenei/cobra.v0"
-)
-
-// clearCmd represents the clear command
-var clearCmd = &cobra.Command{
- Use: "clear",
- Short: "Clear out the project's workspace",
- Long: `Clear out the project's workspace`,
- RunE: func(cmd *cobra.Command, args []string) error {
- projectConfig, err := config.LoadProjectConfigFromFile()
- if err != nil {
- log.Info("Run " + colorstring.Green("gows init") + " to initialize a workspace & gows config for this project")
- return fmt.Errorf("Failed to read Project Config: %s", err)
- }
- if projectConfig.PackageName == "" {
- log.Info("Run " + colorstring.Green("gows init") + " to initialize a workspace & gows config for this project")
- return fmt.Errorf("Package Name is empty")
- }
-
- if err := InitGOWS(projectConfig.PackageName, true); err != nil {
- return fmt.Errorf("Failed to initialize: %s", err)
- }
-
- log.Println("Done, workspace is clean!")
-
- return nil
- },
-}
-
-func init() {
- RootCmd.AddCommand(clearCmd)
-}
diff --git a/vendor/github.com/bitrise-io/gows/cmd/common.go b/vendor/github.com/bitrise-io/gows/cmd/common.go
deleted file mode 100644
index b82cf1402..000000000
--- a/vendor/github.com/bitrise-io/gows/cmd/common.go
+++ /dev/null
@@ -1,238 +0,0 @@
-package cmd
-
-import (
- "fmt"
- "os"
- "os/exec"
- "path/filepath"
- "syscall"
-
- log "github.com/Sirupsen/logrus"
- "github.com/pkg/errors"
-
- "github.com/bitrise-io/go-utils/colorstring"
- "github.com/bitrise-io/go-utils/command"
- "github.com/bitrise-io/go-utils/fileutil"
- "github.com/bitrise-io/go-utils/pathutil"
- "github.com/bitrise-tools/gows/config"
- "github.com/bitrise-tools/gows/gows"
-)
-
-const (
- gowsCopyModeActiveFilePath = "./GOWS-COPY-MODE-ACTIVE"
-)
-
-// PrepareEnvironmentAndRunCommand ...
-// Returns the exit code of the command and any error occured in the function
-func PrepareEnvironmentAndRunCommand(userConfig config.UserConfigModel, cmdName string, cmdArgs ...string) (int, error) {
- projectConfig, err := config.LoadProjectConfigFromFile()
- if err != nil {
- log.Info("Run " + colorstring.Green("gows init") + " to initialize a workspace & gows config for this project")
- return 0, fmt.Errorf("Failed to read Project Config: %s", err)
- }
-
- gowsConfig, err := config.LoadGOWSConfigFromFile()
- if err != nil {
- return 0, fmt.Errorf("Failed to read gows configs: %s", err)
- }
- currWorkDir, err := os.Getwd()
- if err != nil {
- return 0, fmt.Errorf("[PrepareEnvironmentAndRunCommand] Failed to get current working directory: %s", err)
- }
-
- wsConfig, isFound := gowsConfig.WorkspaceForProjectLocation(currWorkDir)
- if !isFound {
- log.Debugln("No initialized workspace dir found for this project, initializing one ...")
- if err := initWorkspaceForProjectPath(currWorkDir, false); err != nil {
- return 0, fmt.Errorf("[PrepareEnvironmentAndRunCommand] Failed to initialize Workspace for Project: %s", err)
- }
- log.Debugln("[DONE] workspace dir initialized - continue running ...")
-
- // reload config
- gowsConfig, err := config.LoadGOWSConfigFromFile()
- if err != nil {
- return 0, fmt.Errorf("Failed to read gows configs: %s", err)
- }
- wsConfig, isFound = gowsConfig.WorkspaceForProjectLocation(currWorkDir)
- }
- if !isFound {
- log.Info("Run " + colorstring.Green("gows init") + " to initialize a workspace & gows config for this project")
- return 0, fmt.Errorf("No Workspace configuration found for the current project / working directory: %s", currWorkDir)
- }
-
- origGOPATH := os.Getenv("GOPATH")
- if origGOPATH == "" {
- // since Go 1.8 GOPATH is no longer required, it defaults to $HOME/go if not set:
- // https://golang.org/doc/go1.8#gopath
- p, err := pathutil.AbsPath("$HOME/go")
- if err != nil {
- return 0, errors.Wrap(err, "No GOPATH environment variable specified, and failed to get Abs path of default $HOME/go dir")
- }
- origGOPATH = p
- }
-
- if err := pathutil.EnsureDirExist(origGOPATH); err != nil {
- return 0, errors.Wrapf(err, "Failed to ensure that GOPATH exists at path: %s", origGOPATH)
- }
-
- if wsConfig.WorkspaceRootPath == "" {
- return 0, fmt.Errorf("No gows Workspace root path found for the current project / working directory: %s", currWorkDir)
- }
- if projectConfig.PackageName == "" {
- return 0, errors.New("No Package Name specified - make sure you initialized the workspace (with: gows init)")
- }
-
- if err := pathutil.EnsureDirExist(wsConfig.WorkspaceRootPath); err != nil {
- return 0, fmt.Errorf("Failed to create workspace root directory (path: %s), error: %s", wsConfig.WorkspaceRootPath, err)
- }
-
- if err := gows.CreateGopathBinSymlink(origGOPATH, wsConfig.WorkspaceRootPath); err != nil {
- return 0, fmt.Errorf("Failed to create GOPATH/bin symlink, error: %s", err)
- }
-
- fullPackageWorkspacePath := filepath.Join(wsConfig.WorkspaceRootPath, "src", projectConfig.PackageName)
-
- userConfigSyncMode := userConfig.SyncMode
- if userConfigSyncMode == "" {
- userConfigSyncMode = config.DefaultSyncMode
- }
- log.Debug("[PrepareEnvironmentAndRunCommand] specified Sync Mode : ", userConfigSyncMode)
-
- // --- prepare ---
- {
- fullPackageWorkspacePathFileInfo, fullPackageWorkspaceIsExists, err := pathutil.PathCheckAndInfos(fullPackageWorkspacePath)
- if err != nil {
- return 0, fmt.Errorf("Failed to check Symlink status (at: %s), error: %s", fullPackageWorkspacePath, err)
- }
-
- switch userConfigSyncMode {
- case config.SyncModeSymlink:
- // create symlink for Project->Workspace
- if fullPackageWorkspaceIsExists && fullPackageWorkspacePathFileInfo.Mode()&os.ModeSymlink == 0 {
- // directory (non symlink) exists - remove it
- log.Warningf("Directory exists (at: %s)", fullPackageWorkspacePath)
- log.Warning("Removing it ...")
- if err := os.RemoveAll(fullPackageWorkspacePath); err != nil {
- return 0, fmt.Errorf("Failed to remove Directory (at: %s), error: %s", fullPackageWorkspacePath, err)
- }
- }
-
- log.Debugf("=> Creating Symlink: (%s) -> (%s)", currWorkDir, fullPackageWorkspacePath)
- if err := gows.CreateOrUpdateSymlink(currWorkDir, fullPackageWorkspacePath); err != nil {
- return 0, fmt.Errorf("Failed to create Project->Workspace symlink, error: %s", err)
- }
- log.Debugf(" [DONE] Symlink is in place")
- case config.SyncModeCopy:
- // Sync project into workspace
- if fullPackageWorkspaceIsExists && fullPackageWorkspacePathFileInfo.Mode()&os.ModeSymlink != 0 {
- // symlink exists - remove it
- log.Warningf("Symlink exists (at: %s)", fullPackageWorkspacePath)
- log.Warning("Removing it ...")
- if err := os.Remove(fullPackageWorkspacePath); err != nil {
- return 0, fmt.Errorf("Failed to remove Symlink (at: %s), error: %s", fullPackageWorkspacePath, err)
- }
- }
-
- log.Debugf("=> Sync project content into workspace: (%s) -> (%s)", currWorkDir, fullPackageWorkspacePath)
- if err := syncDirWithDir(currWorkDir, fullPackageWorkspacePath); err != nil {
- return 0, fmt.Errorf("Failed to sync the project path / workdir into the Workspace, error: %s", err)
- }
- if err := writeGowsCopySyncActiveFileToPath(gowsCopyModeActiveFilePath, fullPackageWorkspacePath, currWorkDir); err != nil {
- log.Warningf(" [!] Failed to write gows-copy-mode-active file to path: %s", gowsCopyModeActiveFilePath)
- }
- log.Debugf(" [DONE] Sync project content into workspace")
- default:
- return 0, fmt.Errorf("Unsupported Sync Mode: %s", userConfigSyncMode)
- }
- }
-
- // Run the command, in the prepared Workspace
- exitCode, cmdErr := runCommand(fullPackageWorkspacePath, wsConfig, cmdName, cmdArgs...)
-
- // cleanup / finishing
- {
- switch userConfigSyncMode {
- case config.SyncModeSymlink:
- // nothing to do
- case config.SyncModeCopy:
- // Sync back from workspace into project
- log.Debugf("=> Sync workspace content into project: (%s) -> (%s)", fullPackageWorkspacePath, currWorkDir)
- if err := syncDirWithDir(fullPackageWorkspacePath, currWorkDir); err != nil {
- // we should return the command's exit code and error (if any)
- // maybe if the exitCode==0 and cmdErr==nil only then we could return an error here ...
- // for now we'll just print an error log, but it won't change the "output" of this function
- log.Errorf("Failed to sync back the project content from the Workspace, error: %s", err)
- } else {
- log.Debugf(" [DONE] Sync back project content from workspace")
- }
- default:
- return 0, fmt.Errorf("Unsupported Sync Mode: %s", userConfigSyncMode)
- }
- }
-
- return exitCode, cmdErr
-}
-
-func writeGowsCopySyncActiveFileToPath(pth, gowsWorkspacePath, originalProjectPath string) error {
- gowsCopyModeActiveContent := fmt.Sprintf(`gows workspace is active at the path: %s
-
-Changes you do here (%s) WILL NOT SYNC, and WILL BE OVERWRITTEN by the changes done
-inside the workspace (at path: %s) when sync/the current command is finished!
-
-This file will be removed after the sync-back. After that it's safe to work
-in this directory again.
-`,
- gowsWorkspacePath, originalProjectPath, gowsWorkspacePath)
-
- return fileutil.WriteStringToFile(pth, gowsCopyModeActiveContent)
-}
-
-func syncDirWithDir(syncContentOf, syncIntoDir string) error {
- syncContentOf = filepath.Clean(syncContentOf)
- syncIntoDir = filepath.Clean(syncIntoDir)
-
- if err := pathutil.EnsureDirExist(syncIntoDir); err != nil {
- return fmt.Errorf("Failed to create target (at: %s), error: %s", syncIntoDir, err)
- }
-
- cmd := exec.Command("rsync", "-avhP", "--delete", syncContentOf+"/", syncIntoDir+"/")
- cmd.Stdin = os.Stdin
-
- log.Debugf("[syncDirWithDir] Running command: $ %s", command.NewWithCmd(cmd).PrintableCommandArgs())
- out, err := cmd.Output()
- if err != nil {
- if exitError, ok := err.(*exec.ExitError); ok {
- log.Error("[syncDirWithDir] Sync Error")
- log.Errorf("[syncDirWithDir] Output (Stdout) was: %s", out)
- log.Errorf("[syncDirWithDir] Error Output (Stderr) was: %s", exitError.Stderr)
- } else {
- log.Error("[syncDirWithDir] Failed to convert error to ExitError")
- }
- return fmt.Errorf("Failed to rsync between (%s) and (%s), error: %s", syncContentOf, syncIntoDir, err)
- }
- return nil
-}
-
-// runCommand runs the command with it's arguments
-// Returns the exit code of the command and any error occured in the function
-func runCommand(cmdWorkdir string, wsConfig config.WorkspaceConfigModel, cmdName string, cmdArgs ...string) (int, error) {
- log.Debugf("[RunCommand] Command Name: %s", cmdName)
- log.Debugf("[RunCommand] Command Args: %#v", cmdArgs)
- log.Debugf("[RunCommand] Command Work Dir: %#v", cmdWorkdir)
-
- cmd := gows.CreateCommand(cmdWorkdir, wsConfig.WorkspaceRootPath, cmdName, cmdArgs...)
-
- cmdExitCode := 0
- if err := cmd.Run(); err != nil {
- if exitError, ok := err.(*exec.ExitError); ok {
- waitStatus, ok := exitError.Sys().(syscall.WaitStatus)
- if !ok {
- return 0, errors.New("Failed to cast exit status")
- }
- cmdExitCode = waitStatus.ExitStatus()
- }
- return cmdExitCode, err
- }
-
- return 0, nil
-}
diff --git a/vendor/github.com/bitrise-io/gows/cmd/common_test.go b/vendor/github.com/bitrise-io/gows/cmd/common_test.go
deleted file mode 100644
index 1d619dd05..000000000
--- a/vendor/github.com/bitrise-io/gows/cmd/common_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package cmd
diff --git a/vendor/github.com/bitrise-io/gows/cmd/init.go b/vendor/github.com/bitrise-io/gows/cmd/init.go
deleted file mode 100644
index 1e7c322d1..000000000
--- a/vendor/github.com/bitrise-io/gows/cmd/init.go
+++ /dev/null
@@ -1,213 +0,0 @@
-package cmd
-
-import (
- "errors"
- "fmt"
- "os"
- "os/exec"
- "path/filepath"
- "strings"
- "time"
-
- log "github.com/Sirupsen/logrus"
- "github.com/bitrise-io/go-utils/colorstring"
- "github.com/bitrise-tools/gows/config"
- "github.com/bitrise-tools/gows/goutil"
- "gopkg.in/viktorbenei/cobra.v0"
-)
-
-var (
- isAllowReset = false
-)
-
-// initCmd represents the init command
-var initCmd = &cobra.Command{
- Use: "init",
- Short: "Initialize gows for your Go project",
- Long: ``,
- SilenceUsage: true,
- SilenceErrors: true,
- RunE: func(cmd *cobra.Command, args []string) error {
- if len(args) > 1 {
- return errors.New("More than one package argument specified")
- }
- packageName := ""
- if len(args) < 1 {
- log.Info("No package name specified, scanning it automatically ...")
- scanRes, err := AutoScanPackageName()
- if err != nil {
- return fmt.Errorf("Failed to auto-scan the package name: %s", err)
- }
- if scanRes == "" {
- return errors.New("Empty package name scanned")
- }
- packageName = scanRes
- log.Infof(" Scanned package name: %s", packageName)
- } else {
- packageName = args[0]
- }
-
- if isAllowReset {
- log.Warning(colorstring.Red("Will reset the related workspace"))
- }
-
- if err := InitGOWS(packageName, isAllowReset); err != nil {
- return fmt.Errorf("Failed to initialize: %s", err)
- }
-
- log.Info("Successful init - " + colorstring.Green("gows is ready for use!"))
-
- return nil
- },
-}
-
-func init() {
- RootCmd.AddCommand(initCmd)
- initCmd.Flags().BoolVarP(&isAllowReset,
- "reset", "",
- false,
- "Delete previous workspace (if any) and initialize a new one")
-}
-
-// AutoScanPackageName ...
-func AutoScanPackageName() (string, error) {
- cmd := exec.Command("git", "remote", "get-url", "origin")
- out, err := cmd.Output()
- if err != nil {
- if exitError, ok := err.(*exec.ExitError); ok {
- log.Errorf("[AutoScanPackageName] (Error) Output was: %s", exitError.Stderr)
- } else {
- log.Error("[AutoScanPackageName] Failed to convert error to ExitError")
- }
- return "", fmt.Errorf("Failed to get git remote url for origin: %s", err)
- }
-
- outStr := string(out)
- gitRemoteStr := strings.TrimSpace(outStr)
- log.Debugf("Found Git Remote: %s", gitRemoteStr)
- packageName, err := goutil.ParsePackageNameFromURL(gitRemoteStr)
- if err != nil {
- return "", fmt.Errorf("Failed to parse package name from remote URL (%s), error: %s", outStr, err)
- }
- if packageName == "" {
- return "", fmt.Errorf("Failed to parse package name from remote URL (%s), error: empty package name parsed", outStr)
- }
-
- return packageName, nil
-}
-
-func initGoWorkspaceAtPath(wsRootPath string) error {
- if err := os.MkdirAll(filepath.Join(wsRootPath, "src"), 0777); err != nil {
- return fmt.Errorf("Failed to create GOPATH/src directory: %s", err)
- }
- return nil
-}
-
-// initWorkspaceForProjectPath ...
-// Workspaces are linked to project paths, not to package IDs!
-// You can have multiple workspaces for the same package ID, but not for the
-// same (project) path.
-func initWorkspaceForProjectPath(projectPath string, isAllowReset bool) error {
- log.Debug("[Init] Initializing Workspace & Config ...")
-
- gowsWorspacesRootDirAbsPath, err := config.GOWSWorspacesRootDirAbsPath()
- if err != nil {
- return fmt.Errorf("Failed to get absolute path for gows workspaces root dir, error: %s", err)
- }
-
- // Create the Workspace
- gowsConfig, err := config.LoadGOWSConfigFromFile()
- if err != nil {
- return fmt.Errorf("Failed to load gows config: %s", err)
- }
-
- projectWorkspaceAbsPath := ""
- wsConfig, isFound := gowsConfig.WorkspaceForProjectLocation(projectPath)
- if isFound {
- if wsConfig.WorkspaceRootPath == "" {
- return fmt.Errorf("A workspace is found for this project (path: %s), but the workspace root directory path is not defined", projectPath)
- }
- projectWorkspaceAbsPath = wsConfig.WorkspaceRootPath
-
- if isAllowReset {
- if err := os.RemoveAll(projectWorkspaceAbsPath); err != nil {
- return fmt.Errorf("Failed to delete previous workspace at path: %s", projectWorkspaceAbsPath)
- }
- // init a new one
- projectWorkspaceAbsPath = ""
- } else {
- log.Warning(colorstring.Yellow("A workspace already exists for this project") + " (" + projectWorkspaceAbsPath + "), will be reused.")
- log.Warning("If you want to delete the previous workspace of this project and generate a new one you should run: " + colorstring.Green("gows clear"))
- }
- }
-
- if projectWorkspaceAbsPath == "" {
- // generate one
- projectBaseWorkspaceDirName := fmt.Sprintf("%s-%d", filepath.Base(projectPath), time.Now().Unix())
- projectWorkspaceAbsPath = filepath.Join(gowsWorspacesRootDirAbsPath, projectBaseWorkspaceDirName)
- }
-
- log.Debugf(" projectWorkspaceAbsPath: %s", projectWorkspaceAbsPath)
- if err := initGoWorkspaceAtPath(projectWorkspaceAbsPath); err != nil {
- return fmt.Errorf("Failed to initialize workspace at path: %s", projectWorkspaceAbsPath)
- }
- log.Debugf(" Workspace successfully created")
-
- // Save the location into Workspace config
- {
- workspaceConf := config.WorkspaceConfigModel{
- WorkspaceRootPath: projectWorkspaceAbsPath,
- }
- gowsConfig.Workspaces[projectPath] = workspaceConf
-
- if err := config.SaveGOWSConfigToFile(gowsConfig); err != nil {
- return fmt.Errorf("Failed to save gows config: %s", err)
- }
- }
- log.Debug("[Init] Workspace Config saved")
-
- return nil
-}
-
-// InitGOWS ...
-func InitGOWS(packageName string, isAllowReset bool) error {
- log.Infof("[Init] Initializing package: %s", packageName)
-
- log.Info("[Init] Initializing Project Config ...")
- {
- projectConf := config.ProjectConfigModel{
- PackageName: packageName,
- }
-
- if err := config.SaveProjectConfigToFile(projectConf); err != nil {
- return fmt.Errorf("Failed to write Project Config into file: %s", err)
- }
- log.Infof(" [OK] Project Config file saved to: %s", colorstring.Green(config.ProjectConfigFilePath))
- }
-
- log.Info("[Init] Initializing User Config ...")
- {
- if _, err := config.LoadUserConfigFromFile(); err == nil {
- log.Infof(" [OK] User Config file already exists at %s - will not generate a new one", config.UserConfigFilePath)
- } else {
- userConf := config.CreateDefaultUserConfig()
-
- if err := config.SaveUserConfigToFile(userConf); err != nil {
- return fmt.Errorf("Failed to write User Config into file: %s", err)
- }
- log.Info(" [OK] User Config file saved as " + colorstring.Green(config.UserConfigFilePath) + " - " + colorstring.Yellow("please add it to your .gitignore file!"))
- }
- }
-
- // init workspace for project (path)
- currWorkDir, err := os.Getwd()
- if err != nil {
- return fmt.Errorf("Failed to get current working directory: %s", err)
- }
-
- if err := initWorkspaceForProjectPath(currWorkDir, isAllowReset); err != nil {
- return fmt.Errorf("Failed to initialize Workspace for Project: %s", err)
- }
-
- return nil
-}
diff --git a/vendor/github.com/bitrise-io/gows/cmd/init_test.go b/vendor/github.com/bitrise-io/gows/cmd/init_test.go
deleted file mode 100644
index 1d619dd05..000000000
--- a/vendor/github.com/bitrise-io/gows/cmd/init_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package cmd
diff --git a/vendor/github.com/bitrise-io/gows/cmd/root.go b/vendor/github.com/bitrise-io/gows/cmd/root.go
deleted file mode 100644
index 59b281734..000000000
--- a/vendor/github.com/bitrise-io/gows/cmd/root.go
+++ /dev/null
@@ -1,124 +0,0 @@
-package cmd
-
-import (
- "fmt"
- "os"
-
- "github.com/pkg/errors"
-
- log "github.com/Sirupsen/logrus"
- "github.com/bitrise-tools/gows/config"
- "gopkg.in/viktorbenei/cobra.v0"
-)
-
-var (
- loglevelFlag string
-)
-
-// RootCmd represents the base command when called without any subcommands
-var RootCmd = &cobra.Command{
- Use: "gows",
- Short: "Go Workspace / Environment Manager, to easily manage the Go Workspace during development.",
- Long: `Go Workspace / Environment Manager, to easily manage the Go Workspace during development.
-
-Work in isolated (development) environment when you're working on your Go projects.
-No cross-project dependency version missmatch, no more packages left out from vendor/.
-
-No need for initializing a go workspace either, your project can be located anywhere,
-not just in a predefined $GOPATH workspace. gows will take care about crearing
-the (per-project isolated) workspace directory structure, no matter where your project is located.
-
-gows works perfectly with other Go tools, all it does is it ensures that every project
-gets it's own, isolated Go workspace and sets $GOPATH accordingly.
-
-Sync Mode can be set in the .gows.user.yml config file,
-or through the $GOWS_SYNC_MODE environment variable.`,
-
- DisableFlagParsing: true,
-
- PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
- initLogFormatter()
-
- // Log level
- if loglevelFlag == "" {
- if loglevelEnv := os.Getenv("GOWS_LOGLEVEL"); loglevelEnv != "" {
- loglevelFlag = loglevelEnv
- } else {
- // default
- loglevelFlag = "info"
- }
- }
-
- level, err := log.ParseLevel(loglevelFlag)
- if err != nil {
- return err
- }
- log.SetLevel(level)
-
- return nil
- },
-}
-
-func initLogFormatter() {
- log.SetFormatter(&log.TextFormatter{
- FullTimestamp: true,
- ForceColors: true,
- TimestampFormat: "15:04:05",
- })
-}
-
-// Execute adds all child commands to the root command sets flags appropriately.
-// This is called by main.main(). It only needs to happen once to the rootCmd.
-func Execute() {
- if err := RootCmd.Execute(); err != nil {
- fmt.Println(err)
- os.Exit(-1)
- }
-}
-
-func init() {
- RootCmd.PersistentFlags().StringVarP(&loglevelFlag, "loglevel", "l", "", `Log level (options: debug, info, warn, error, fatal, panic). [$GOWS_LOGLEVEL]`)
- RootCmd.PreRunE = func(cmd *cobra.Command, args []string) error {
- if len(args) < 1 {
- return errors.New("No command specified")
- }
- RootCmd.SilenceErrors = true
- RootCmd.SilenceUsage = true
- return nil
- }
- RootCmd.RunE = func(cmd *cobra.Command, args []string) error {
- cmdName := args[0]
- if cmdName == "-h" || cmdName == "--help" {
- if err := RootCmd.Help(); err != nil {
- return errors.WithStack(err)
- }
- return nil
- }
-
- cmdArgs := []string{}
- if len(args) > 1 {
- cmdArgs = args[1:]
- }
-
- userConfig, err := config.LoadUserConfigFromFile()
- if err != nil {
- log.Debug("No User Config found, using defaults")
- userConfig = config.CreateDefaultUserConfig()
- }
- forceSyncMode := os.Getenv("GOWS_SYNC_MODE")
- if forceSyncMode != "" {
- log.Debugf(" (i) Sync Mode specified as a parameter, using it (%s)", forceSyncMode)
- userConfig.SyncMode = forceSyncMode
- }
- log.Debugf("User Config: %#v", userConfig)
-
- exitCode, err := PrepareEnvironmentAndRunCommand(userConfig, cmdName, cmdArgs...)
- if exitCode != 0 {
- os.Exit(exitCode)
- }
- if err != nil {
- return fmt.Errorf("Exit Code was 0, but an error happened: %s", err)
- }
- return nil
- }
-}
diff --git a/vendor/github.com/bitrise-io/gows/cmd/version.go b/vendor/github.com/bitrise-io/gows/cmd/version.go
deleted file mode 100644
index 053d4d366..000000000
--- a/vendor/github.com/bitrise-io/gows/cmd/version.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package cmd
-
-import (
- "fmt"
-
- "github.com/bitrise-tools/gows/version"
- "gopkg.in/viktorbenei/cobra.v0"
-)
-
-// versionCmd represents the version command
-var versionCmd = &cobra.Command{
- Use: "version",
- Short: "Prints the version",
- Long: ``,
- Run: func(cmd *cobra.Command, args []string) {
- fmt.Printf("%s\n", version.VERSION)
- },
-}
-
-func init() {
- RootCmd.AddCommand(versionCmd)
-}
diff --git a/vendor/github.com/bitrise-io/gows/cmd/workspaces.go b/vendor/github.com/bitrise-io/gows/cmd/workspaces.go
deleted file mode 100644
index 0ea5f31a2..000000000
--- a/vendor/github.com/bitrise-io/gows/cmd/workspaces.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package cmd
-
-import (
- "fmt"
- "os"
-
- log "github.com/Sirupsen/logrus"
- "github.com/bitrise-io/go-utils/colorstring"
- "github.com/bitrise-tools/gows/config"
- "gopkg.in/viktorbenei/cobra.v0"
-)
-
-// workspacesCmd represents the workspaces command
-var workspacesCmd = &cobra.Command{
- Use: "workspaces",
- Short: "List registered gows projects -> workspaces path pairs",
- Long: ``,
- SilenceUsage: true,
- SilenceErrors: true,
- RunE: func(cmd *cobra.Command, args []string) error {
- gowsConfig, err := config.LoadGOWSConfigFromFile()
- if err != nil {
- return fmt.Errorf("Failed to load gows config: %s", err)
- }
-
- currWorkDir, err := os.Getwd()
- if err != nil {
- log.Debugf("Failed to get current working directory: %s", err)
- }
-
- fmt.Println()
- fmt.Println("=== Registered gows [project -> workspace] path list ===")
- for projectPath, wsConfig := range gowsConfig.Workspaces {
- if projectPath == currWorkDir {
- fmt.Println(colorstring.Greenf(" * %s -> %s", projectPath, wsConfig.WorkspaceRootPath))
- } else {
- fmt.Printf(" * %s -> %s\n", projectPath, wsConfig.WorkspaceRootPath)
- }
- }
- fmt.Println("========================================================")
- fmt.Println()
-
- return nil
- },
-}
-
-func init() {
- RootCmd.AddCommand(workspacesCmd)
-}
diff --git a/vendor/github.com/bitrise-io/gows/cmd/wspath.go b/vendor/github.com/bitrise-io/gows/cmd/wspath.go
deleted file mode 100644
index 8a363823e..000000000
--- a/vendor/github.com/bitrise-io/gows/cmd/wspath.go
+++ /dev/null
@@ -1,52 +0,0 @@
-package cmd
-
-import (
- "fmt"
- "os"
-
- log "github.com/Sirupsen/logrus"
- "github.com/bitrise-tools/gows/config"
- "gopkg.in/viktorbenei/cobra.v0"
-)
-
-// wspathCmd represents the wspath command
-var wspathCmd = &cobra.Command{
- Use: "wspath",
- Short: "Prints the current workspace path",
- Long: ``,
- RunE: func(cmd *cobra.Command, args []string) error {
- gowsConfig, err := config.LoadGOWSConfigFromFile()
- if err != nil {
- return fmt.Errorf("Failed to load gows config: %s", err)
- }
-
- currWorkDir, err := os.Getwd()
- if err != nil {
- log.Debugf("Failed to get current working directory: %s", err)
- }
-
- wsConfig, isFound := gowsConfig.WorkspaceForProjectLocation(currWorkDir)
- if !isFound {
- return fmt.Errorf("No Workspace configuration found for the current project / working directory: %s", currWorkDir)
- }
-
- fmt.Println(wsConfig.WorkspaceRootPath)
-
- return nil
- },
-}
-
-func init() {
- RootCmd.AddCommand(wspathCmd)
-
- // Here you will define your flags and configuration settings.
-
- // Cobra supports Persistent Flags which will work for this command
- // and all subcommands, e.g.:
- // wspathCmd.PersistentFlags().String("foo", "", "A help for foo")
-
- // Cobra supports local flags which will only run when this command
- // is called directly, e.g.:
- // wspathCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
-
-}
diff --git a/vendor/github.com/bitrise-io/gows/config/gows.go b/vendor/github.com/bitrise-io/gows/config/gows.go
deleted file mode 100644
index d22276dd3..000000000
--- a/vendor/github.com/bitrise-io/gows/config/gows.go
+++ /dev/null
@@ -1,99 +0,0 @@
-package config
-
-import (
- "fmt"
- "io/ioutil"
-
- log "github.com/Sirupsen/logrus"
- "github.com/bitrise-io/go-utils/fileutil"
- "github.com/bitrise-io/go-utils/pathutil"
- "gopkg.in/yaml.v2"
-)
-
-const (
- gowsWorspacesRootDirPath = "$HOME/.bitrise-gows/wsdirs"
- gowsConfigFilePath = "$HOME/.bitrise-gows/workspaces.yml"
-)
-
-// GOWSWorspacesRootDirAbsPath ...
-func GOWSWorspacesRootDirAbsPath() (string, error) {
- return pathutil.AbsPath(gowsWorspacesRootDirPath)
-}
-
-// GOWSConfigFileAbsPath ...
-func GOWSConfigFileAbsPath() (string, error) {
- return pathutil.AbsPath(gowsConfigFilePath)
-}
-
-// WorkspaceConfigModel ...
-type WorkspaceConfigModel struct {
- WorkspaceRootPath string `json:"workspace_root_path" yaml:"workspace_root_path"`
-}
-
-// GOWSConfigModel ...
-type GOWSConfigModel struct {
- Workspaces map[string]WorkspaceConfigModel `json:"workspaces" yaml:"workspaces"`
-}
-
-func createDefaultGOWSConfigModel() GOWSConfigModel {
- return GOWSConfigModel{
- Workspaces: map[string]WorkspaceConfigModel{},
- }
-}
-
-// WorkspaceForProjectLocation ...
-func (gowsConfig GOWSConfigModel) WorkspaceForProjectLocation(projectPath string) (WorkspaceConfigModel, bool) {
- wsConfig, isFound := gowsConfig.Workspaces[projectPath]
- return wsConfig, isFound
-}
-
-// LoadGOWSConfigFromFile ...
-func LoadGOWSConfigFromFile() (GOWSConfigModel, error) {
- gowsConfigFileAbsPath, err := GOWSConfigFileAbsPath()
- if err != nil {
- return GOWSConfigModel{}, fmt.Errorf("Failed to get absolute path of gows config: %s", err)
- }
-
- // If doesn't exist yet, return a default/empty gows config
- {
- isExists, err := pathutil.IsPathExists(gowsConfigFileAbsPath)
- if !isExists {
- log.Debugf(" (!) cows Config does not yet exists at: %s", gowsConfigFileAbsPath)
- // return an empty/default config
- return createDefaultGOWSConfigModel(), nil
- } else if err != nil {
- return GOWSConfigModel{}, err
- }
- }
-
- bytes, err := ioutil.ReadFile(gowsConfigFileAbsPath)
- if err != nil {
- return GOWSConfigModel{}, fmt.Errorf("Failed to read gows config file (%s), error: %s", gowsConfigFileAbsPath, err)
- }
- var gowsConfig GOWSConfigModel
- if err := yaml.Unmarshal(bytes, &gowsConfig); err != nil {
- return GOWSConfigModel{}, fmt.Errorf("Failed to parse gows config (should be valid YML, path: %s), error: %s", gowsConfigFileAbsPath, err)
- }
-
- return gowsConfig, nil
-}
-
-// SaveGOWSConfigToFile ...
-func SaveGOWSConfigToFile(gowsConfig GOWSConfigModel) error {
- bytes, err := yaml.Marshal(gowsConfig)
- if err != nil {
- return fmt.Errorf("Failed to generate YML for gows config: %s", err)
- }
-
- gowsConfigFileAbsPath, err := GOWSConfigFileAbsPath()
- if err != nil {
- return fmt.Errorf("Failed to get absolute path of gows config: %s", err)
- }
-
- err = fileutil.WriteBytesToFile(gowsConfigFileAbsPath, bytes)
- if err != nil {
- return fmt.Errorf("Failed to write Project Config into file (%s), error: %s", gowsConfigFileAbsPath, err)
- }
-
- return nil
-}
diff --git a/vendor/github.com/bitrise-io/gows/config/gows_test.go b/vendor/github.com/bitrise-io/gows/config/gows_test.go
deleted file mode 100644
index da1a2d8fd..000000000
--- a/vendor/github.com/bitrise-io/gows/config/gows_test.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package config
-
-import (
- "testing"
-
- "github.com/stretchr/testify/require"
-)
-
-func Test_GOWSConfigModel_WorkspaceForProjectLocation(t *testing.T) {
-
- gowsConfig := GOWSConfigModel{
- Workspaces: map[string]WorkspaceConfigModel{
- "/proj/path/1": WorkspaceConfigModel{
- WorkspaceRootPath: "/p1/ws/root",
- },
- },
- }
-
- t.Log("Found")
- {
- wsConfig, isFound := gowsConfig.WorkspaceForProjectLocation("/proj/path/1")
- require.Equal(t, true, isFound)
- require.Equal(t, "/p1/ws/root", wsConfig.WorkspaceRootPath)
- }
-
- t.Log("Not Found")
- {
- wsConfig, isFound := gowsConfig.WorkspaceForProjectLocation("/proj/path/noproj")
- require.Equal(t, false, isFound)
- require.Equal(t, "", wsConfig.WorkspaceRootPath)
- }
-}
diff --git a/vendor/github.com/bitrise-io/gows/config/project.go b/vendor/github.com/bitrise-io/gows/config/project.go
deleted file mode 100644
index 147848865..000000000
--- a/vendor/github.com/bitrise-io/gows/config/project.go
+++ /dev/null
@@ -1,59 +0,0 @@
-package config
-
-import (
- "fmt"
- "io/ioutil"
-
- "github.com/bitrise-io/go-utils/fileutil"
- "github.com/bitrise-io/go-utils/pathutil"
- "gopkg.in/yaml.v2"
-)
-
-const (
- // ProjectConfigFilePath ...
- ProjectConfigFilePath = "./gows.yml"
-)
-
-// ProjectConfigFileAbsPath ...
-func ProjectConfigFileAbsPath() (string, error) {
- return pathutil.AbsPath(ProjectConfigFilePath)
-}
-
-// ProjectConfigModel - stored in ./gows.yml
-type ProjectConfigModel struct {
- PackageName string `json:"package_name" yaml:"package_name"`
-}
-
-// LoadProjectConfigFromFile ...
-func LoadProjectConfigFromFile() (ProjectConfigModel, error) {
- projectConfigFileAbsPath, err := ProjectConfigFileAbsPath()
- if err != nil {
- return ProjectConfigModel{}, fmt.Errorf("Failed to get absolute path of project config: %s", err)
- }
-
- bytes, err := ioutil.ReadFile(projectConfigFileAbsPath)
- if err != nil {
- return ProjectConfigModel{}, fmt.Errorf("Failed to read project config file (%s), error: %s", projectConfigFileAbsPath, err)
- }
- var projectConfig ProjectConfigModel
- if err := yaml.Unmarshal(bytes, &projectConfig); err != nil {
- return ProjectConfigModel{}, fmt.Errorf("Failed to parse project config (should be valid YML, path: %s), error: %s", projectConfigFileAbsPath, err)
- }
-
- return projectConfig, nil
-}
-
-// SaveProjectConfigToFile ...
-func SaveProjectConfigToFile(projectConf ProjectConfigModel) error {
- bytes, err := yaml.Marshal(projectConf)
- if err != nil {
- return fmt.Errorf("Failed to parse Project Config (should be valid YML): %s", err)
- }
-
- err = fileutil.WriteBytesToFile(ProjectConfigFilePath, bytes)
- if err != nil {
- return fmt.Errorf("Failed to write Project Config into file (%s), error: %s", ProjectConfigFilePath, err)
- }
-
- return nil
-}
diff --git a/vendor/github.com/bitrise-io/gows/config/project_test.go b/vendor/github.com/bitrise-io/gows/config/project_test.go
deleted file mode 100644
index 63acfdde1..000000000
--- a/vendor/github.com/bitrise-io/gows/config/project_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package config
\ No newline at end of file
diff --git a/vendor/github.com/bitrise-io/gows/config/user.go b/vendor/github.com/bitrise-io/gows/config/user.go
deleted file mode 100644
index 5ffbd3ce6..000000000
--- a/vendor/github.com/bitrise-io/gows/config/user.go
+++ /dev/null
@@ -1,73 +0,0 @@
-package config
-
-import (
- "fmt"
- "io/ioutil"
-
- "github.com/bitrise-io/go-utils/fileutil"
- "github.com/bitrise-io/go-utils/pathutil"
- "gopkg.in/yaml.v2"
-)
-
-const (
- // UserConfigFilePath ...
- UserConfigFilePath = "./.gows.user.yml"
-
- // SyncModeSymlink ...
- SyncModeSymlink = "symlink"
- // SyncModeCopy ...
- SyncModeCopy = "copy"
- // DefaultSyncMode ...
- DefaultSyncMode = SyncModeSymlink
-)
-
-// UserConfigFileAbsPath ...
-func UserConfigFileAbsPath() (string, error) {
- return pathutil.AbsPath(UserConfigFilePath)
-}
-
-// UserConfigModel - stored in ./.gows.user.yml
-type UserConfigModel struct {
- SyncMode string `json:"sync_mode" yaml:"sync_mode"`
-}
-
-// CreateDefaultUserConfig ...
-func CreateDefaultUserConfig() UserConfigModel {
- return UserConfigModel{
- SyncMode: DefaultSyncMode,
- }
-}
-
-// LoadUserConfigFromFile ...
-func LoadUserConfigFromFile() (UserConfigModel, error) {
- UserConfigFileAbsPath, err := UserConfigFileAbsPath()
- if err != nil {
- return UserConfigModel{}, fmt.Errorf("Failed to get absolute path of project config: %s", err)
- }
-
- bytes, err := ioutil.ReadFile(UserConfigFileAbsPath)
- if err != nil {
- return UserConfigModel{}, fmt.Errorf("Failed to read project config file (%s), error: %s", UserConfigFileAbsPath, err)
- }
- var UserConfig UserConfigModel
- if err := yaml.Unmarshal(bytes, &UserConfig); err != nil {
- return UserConfigModel{}, fmt.Errorf("Failed to parse project config (should be valid YML, path: %s), error: %s", UserConfigFileAbsPath, err)
- }
-
- return UserConfig, nil
-}
-
-// SaveUserConfigToFile ...
-func SaveUserConfigToFile(projectConf UserConfigModel) error {
- bytes, err := yaml.Marshal(projectConf)
- if err != nil {
- return fmt.Errorf("Failed to parse Project Config (should be valid YML): %s", err)
- }
-
- err = fileutil.WriteBytesToFile(UserConfigFilePath, bytes)
- if err != nil {
- return fmt.Errorf("Failed to write Project Config into file (%s), error: %s", UserConfigFilePath, err)
- }
-
- return nil
-}
diff --git a/vendor/github.com/bitrise-io/gows/config/user_test.go b/vendor/github.com/bitrise-io/gows/config/user_test.go
deleted file mode 100644
index 63acfdde1..000000000
--- a/vendor/github.com/bitrise-io/gows/config/user_test.go
+++ /dev/null
@@ -1 +0,0 @@
-package config
\ No newline at end of file
diff --git a/vendor/github.com/bitrise-io/gows/goutil/goutil.go b/vendor/github.com/bitrise-io/gows/goutil/goutil.go
deleted file mode 100644
index 969e9582f..000000000
--- a/vendor/github.com/bitrise-io/gows/goutil/goutil.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package goutil
-
-import (
- "fmt"
- "net/url"
- "strings"
-)
-
-// ParsePackageNameFromURL - returns a Go package name/id (e.g. github.com/bitrise-tools/gows)
-// from a git clone URL (e.g. https://github.com/bitrise-tools/gows.git)
-func ParsePackageNameFromURL(remoteURL string) (string, error) {
- origRemoteURL := remoteURL
- if strings.HasPrefix(remoteURL, "git@") {
- remoteURL = "ssh://" + remoteURL
- }
-
- u, err := url.Parse(remoteURL)
- if err != nil {
- return "", fmt.Errorf("Failed to parse remote URL (%s): %s", origRemoteURL, err)
- }
-
- packagePth := u.Path
- packagePth = strings.TrimSuffix(packagePth, ".git")
-
- // in SSH git urls like "ssh://git@github.com:bitrise-io/go-utils.git" Go parses "github.com:bitrise-io" as the host
- // fix it by splitting it and replacing ":" with "/"
- hostSplits := strings.Split(u.Host, ":")
- host := hostSplits[0]
- if len(hostSplits) > 1 {
- if len(hostSplits) > 2 {
- return "", fmt.Errorf("More than one ':' found in the Host part of the URL (%s)", origRemoteURL)
- }
- packagePth = "/" + hostSplits[1] + packagePth
- }
-
- if host == "" {
- return "", fmt.Errorf("No Host found in URL (%s)", origRemoteURL)
- }
- if packagePth == "" || packagePth == "/" {
- return "", fmt.Errorf("No Path found in URL (%s)", origRemoteURL)
- }
-
- return host + packagePth, nil
-}
diff --git a/vendor/github.com/bitrise-io/gows/goutil/goutil_test.go b/vendor/github.com/bitrise-io/gows/goutil/goutil_test.go
deleted file mode 100644
index a1f9408d1..000000000
--- a/vendor/github.com/bitrise-io/gows/goutil/goutil_test.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package goutil
-
-import (
- "testing"
-
- "github.com/stretchr/testify/require"
-)
-
-func TestParsePackageNameFromURL(t *testing.T) {
- t.Log("No error - parse package name")
- {
- testListMap := map[string]string{
- "https://github.com/bitrise-io/bitrise.io.git": "github.com/bitrise-io/bitrise.io",
- "git@github.com:bitrise-io/bitrise.io.git": "github.com/bitrise-io/bitrise.io",
- //
- "https://github.com/bitrise-io/go-utils.git": "github.com/bitrise-io/go-utils",
- "git@github.com:bitrise-io/go-utils.git": "github.com/bitrise-io/go-utils",
- //
- "https://github.com/my_usr-name.here/repo-part_1.here.git": "github.com/my_usr-name.here/repo-part_1.here",
- "git@github.com:my_usr-name.here/repo-part_1.here.git": "github.com/my_usr-name.here/repo-part_1.here",
- // no .git
- "https://github.com/my_usr-name.here/repo-part_1.here": "github.com/my_usr-name.here/repo-part_1.here",
- // .git.git
- "https://github.com/my_usr-name.here/repo-part_1.git.git": "github.com/my_usr-name.here/repo-part_1.git",
- }
-
- for k, v := range testListMap {
- packageName, err := ParsePackageNameFromURL(k)
- require.NoError(t, err)
- require.Equal(t, v, packageName)
- }
- }
-
- t.Log("Invalid remote URL - parse error")
- {
- testListMap := map[string]string{
- "git@github.com:double:my_usr-name.here/repo-part_1.here.git": "More than one ':' found in the Host part of the URL (git@github.com:double:my_usr-name.here/repo-part_1.here.git)",
- "my_usr-name/repo-part_1.here": "No Host found in URL (my_usr-name/repo-part_1.here)",
- "https://github.com": "No Path found in URL (https://github.com)",
- "https://github.com/": "No Path found in URL (https://github.com/)",
- }
-
- for k, v := range testListMap {
- packageName, err := ParsePackageNameFromURL(k)
- require.EqualError(t, err, v)
- require.Equal(t, "", packageName)
- }
- }
-}
diff --git a/vendor/github.com/bitrise-io/gows/gows.yml b/vendor/github.com/bitrise-io/gows/gows.yml
deleted file mode 100644
index 5f342fea0..000000000
--- a/vendor/github.com/bitrise-io/gows/gows.yml
+++ /dev/null
@@ -1 +0,0 @@
-package_name: github.com/bitrise-tools/gows
diff --git a/vendor/github.com/bitrise-io/gows/gows/gows_test.go b/vendor/github.com/bitrise-io/gows/gows/gows_test.go
deleted file mode 100644
index 19686c6a1..000000000
--- a/vendor/github.com/bitrise-io/gows/gows/gows_test.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package gows
-
-import (
- "testing"
-
- "github.com/stretchr/testify/require"
-)
-
-func Test_filteredEnvsList(t *testing.T) {
- t.Log("Remove second item")
- {
- inputEnvs := []string{"env1=value1", "env2=value two"}
- filteredEnvs := filteredEnvsList(inputEnvs, "env2")
- require.Equal(t, []string{"env1=value1"}, filteredEnvs)
- // should not change the input env list
- require.Equal(t, []string{"env1=value1", "env2=value two"}, inputEnvs)
- }
-
- t.Log("Remove first item")
- {
- inputEnvs := []string{"env1=value1", "env2=value two"}
- filteredEnvs := filteredEnvsList(inputEnvs, "env1")
- require.Equal(t, []string{"env2=value two"}, filteredEnvs)
- }
-
- t.Log("Key is not in the list")
- {
- inputEnvs := []string{"env1=value1", "env2=value two"}
- filteredEnvs := filteredEnvsList(inputEnvs, "not-in-list")
- require.Equal(t, []string{"env1=value1", "env2=value two"}, filteredEnvs)
- }
-
- t.Log("Empty input list")
- {
- inputEnvs := []string{"env1=value1", "env2=value two"}
- filteredEnvs := filteredEnvsList(inputEnvs, "env1")
- require.Equal(t, []string{"env2=value two"}, filteredEnvs)
- }
-}
diff --git a/vendor/github.com/bitrise-io/gows/main.go b/vendor/github.com/bitrise-io/gows/main.go
deleted file mode 100644
index 7be249b41..000000000
--- a/vendor/github.com/bitrise-io/gows/main.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package main
-
-import (
- log "github.com/Sirupsen/logrus"
- "github.com/bitrise-tools/gows/cmd"
-)
-
-func init() {
- log.SetFormatter(&log.TextFormatter{
- FullTimestamp: true,
- TimestampFormat: "15:04:05",
- })
-}
-
-func main() {
- cmd.Execute()
-}
diff --git a/vendor/github.com/bitrise-io/gows/version/version.go b/vendor/github.com/bitrise-io/gows/version/version.go
deleted file mode 100644
index 6d6595705..000000000
--- a/vendor/github.com/bitrise-io/gows/version/version.go
+++ /dev/null
@@ -1,4 +0,0 @@
-package version
-
-// VERSION ...
-const VERSION = "0.9.0"
diff --git a/vendor/github.com/bitrise-io/stepman/Gopkg.lock b/vendor/github.com/bitrise-io/stepman/Gopkg.lock
index 47a7c72c9..4b3b571ab 100644
--- a/vendor/github.com/bitrise-io/stepman/Gopkg.lock
+++ b/vendor/github.com/bitrise-io/stepman/Gopkg.lock
@@ -2,12 +2,12 @@
[[projects]]
- branch = "master"
- digest = "1:9ffd8274c90a47cb2bdf4f469722a95027ee0dce146571d86211f08f7d8e2547"
+ digest = "1:04457f9f6f3ffc5fea48e71d62f2ca256637dee0a04d710288e27e05c8b41976"
name = "github.com/Sirupsen/logrus"
packages = ["."]
pruneopts = "UT"
- revision = "2a22dbedbad1fd454910cd1f44f210ef90c28464"
+ revision = "839c75faf7f98a33d445d181f3018b5c3409a45e"
+ version = "v1.4.2"
[[projects]]
branch = "master"
@@ -23,7 +23,7 @@
name = "github.com/bitrise-io/envman"
packages = ["models"]
pruneopts = "UT"
- revision = "1716460e0651c3f40b9542f9e237b9a3d35773bb"
+ revision = "94a0544660e8d2d73612f744bbd66d61216a1221"
[[projects]]
branch = "master"
@@ -45,15 +45,15 @@
"versions",
]
pruneopts = "UT"
- revision = "8898129615c9e407fc6b0e60ea882f2b18ec4dc2"
+ revision = "10ba6612803187a89b6935f06a617e9e1cd9d2bf"
[[projects]]
branch = "master"
- digest = "1:094419e25266ad87ac9eec38043f314f474c81f6b1bb7f4ca11cc7fe5a5d9c2d"
+ digest = "1:980e760f25b82cb4ffe32b146956029f1f5c8bea3c39f9f973cc023d4ae965b1"
name = "github.com/bitrise-io/goinp"
packages = ["goinp"]
pruneopts = "UT"
- revision = "c9a4dac0f9b3539bbbeb10eece5c3f03d0ec3ea0"
+ revision = "bd18a8681e272db4696c50152b288f722d08b914"
[[projects]]
digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec"
@@ -94,39 +94,50 @@
version = "v1.0.0"
[[projects]]
- branch = "master"
- digest = "1:45511ffd176fe0c5ab6cb08cdd141f3217df8e115124b176e894ab103925d53c"
+ digest = "1:5da8ce674952566deae4dbc23d07c85caafc6cfa815b0b3e03e41979cedb8750"
name = "github.com/stretchr/testify"
packages = [
"assert",
"require",
]
pruneopts = "UT"
- revision = "34c6fa2dc70986bccbbffcc6130f6920a924b075"
+ revision = "ffdc059bfe9ce6a4e144ba849dbedead332c6053"
+ version = "v1.3.0"
[[projects]]
- branch = "master"
- digest = "1:8286f653bf8b8fd155a0c9c3b9ee3dbc2a95b1b51f7a1dc11fe2c66018454a0c"
+ digest = "1:b24d38b282bacf9791408a080f606370efa3d364e4b5fd9ba0f7b87786d3b679"
name = "github.com/urfave/cli"
packages = ["."]
pruneopts = "UT"
- revision = "693af58b4d51b8fcc7f9d89576da170765980581"
+ revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1"
+ version = "v1.20.0"
[[projects]]
branch = "master"
- digest = "1:010311506e3917b54487c35a4277e2709678a40c1587d82492c40b78b6a0a01d"
+ digest = "1:bbe51412d9915d64ffaa96b51d409e070665efc5194fcf145c4a27d4133107a4"
+ name = "golang.org/x/crypto"
+ packages = ["ssh/terminal"]
+ pruneopts = "UT"
+ revision = "4def268fd1a49955bfb3dda92fe3db4f924f2285"
+
+[[projects]]
+ branch = "master"
+ digest = "1:afb5346f71acefc3da7ad800f952cb2bcdb762194b05304bbf54d7f9490e31c5"
name = "golang.org/x/sys"
- packages = ["unix"]
+ packages = [
+ "unix",
+ "windows",
+ ]
pruneopts = "UT"
- revision = "93c9922d18aeb82498a065f07aec7ad7fa60dfb7"
+ revision = "04f50cda93cbb67f2afa353c52f342100e80e625"
[[projects]]
- branch = "v2"
- digest = "1:2d56cd111a870bdf3ee37601877effe1fc79b8983645c147846f4769b6eb7051"
+ digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96"
name = "gopkg.in/yaml.v2"
packages = ["."]
pruneopts = "UT"
- revision = "7b8349ac747c6a24702b762d2c4fd9266cf4f1d6"
+ revision = "51d6538a90f86fe93ac480b35f37b2be17fef232"
+ version = "v2.2.2"
[solve-meta]
analyzer-name = "dep"
diff --git a/vendor/github.com/bitrise-io/stepman/Gopkg.toml b/vendor/github.com/bitrise-io/stepman/Gopkg.toml
index 8cafb9fb6..ed5ce425f 100644
--- a/vendor/github.com/bitrise-io/stepman/Gopkg.toml
+++ b/vendor/github.com/bitrise-io/stepman/Gopkg.toml
@@ -1,30 +1,39 @@
+
[[constraint]]
name = "github.com/Sirupsen/logrus"
+ version = "1.4.2"
+
+[[constraint]]
branch = "master"
+ name = "github.com/bitrise-io/colorstring"
[[constraint]]
- name = "github.com/bitrise-io/envman"
branch = "master"
+ name = "github.com/bitrise-io/envman"
[[constraint]]
- name = "github.com/bitrise-io/go-utils"
branch = "master"
+ name = "github.com/bitrise-io/go-utils"
[[constraint]]
- name = "github.com/bitrise-io/goinp"
branch = "master"
+ name = "github.com/bitrise-io/goinp"
+
+[[constraint]]
+ name = "github.com/google/go-cmp"
+ version = "0.3.0"
[[constraint]]
name = "github.com/stretchr/testify"
- branch = "master"
+ version = "1.3.0"
[[constraint]]
name = "github.com/urfave/cli"
- branch = "master"
+ version = "1.20.0"
[[constraint]]
name = "gopkg.in/yaml.v2"
- branch = "v2"
+ version = "v2"
[prune]
go-tests = true
diff --git a/vendor/github.com/bitrise-io/stepman/_tests/integration/helper.go b/vendor/github.com/bitrise-io/stepman/_tests/integration/helper.go
deleted file mode 100644
index f11abd67f..000000000
--- a/vendor/github.com/bitrise-io/stepman/_tests/integration/helper.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package integration
-
-import (
- "os"
-
- "github.com/bitrise-io/go-utils/command"
-)
-
-const defaultLibraryURI = "https://github.com/bitrise-io/bitrise-steplib.git"
-
-func binPath() string {
- return os.Getenv("INTEGRATION_TEST_BINARY_PATH")
-}
-
-func cleanupLibrary(libraryURI string) error {
- cmd := command.New(binPath(), "delete", "--collection", libraryURI)
- return cmd.Run()
-}
-
-func setupLibrary(libraryURI string) error {
- cmd := command.New(binPath(), "setup", "--collection", libraryURI)
- return cmd.Run()
-}
diff --git a/vendor/github.com/bitrise-io/stepman/_tests/integration/setup_test.go b/vendor/github.com/bitrise-io/stepman/_tests/integration/setup_test.go
deleted file mode 100644
index 7961f70be..000000000
--- a/vendor/github.com/bitrise-io/stepman/_tests/integration/setup_test.go
+++ /dev/null
@@ -1,60 +0,0 @@
-package integration
-
-import (
- "testing"
-
- "os"
-
- "github.com/bitrise-io/go-utils/command"
- "github.com/bitrise-io/go-utils/command/git"
- "github.com/bitrise-io/go-utils/pathutil"
- "github.com/stretchr/testify/require"
-)
-
-func TestSetup(t *testing.T) {
- t.Log("remote library")
- {
- out, err := command.New(binPath(), "delete", "-c", defaultLibraryURI).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- out, err = command.New(binPath(), "setup", "-c", defaultLibraryURI).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- out, err = command.New(binPath(), "delete", "-c", defaultLibraryURI).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- }
-
- t.Log("local library")
- {
- tmpDir, err := pathutil.NormalizedOSTempDirPath("__library__")
- require.NoError(t, err)
- defer func() {
- require.NoError(t, os.RemoveAll(tmpDir))
- }()
-
- repo, err := git.New(tmpDir)
- require.NoError(t, err)
- require.NoError(t, repo.Clone(defaultLibraryURI).Run())
-
- out, err := command.New(binPath(), "delete", "-c", tmpDir).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- out, err = command.New(binPath(), "setup", "--local", "-c", tmpDir).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- out, err = command.New(binPath(), "delete", "-c", "file://"+tmpDir).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- out, err = command.New(binPath(), "setup", "--local", "-c", "file://"+tmpDir).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- out, err = command.New(binPath(), "delete", "-c", "file://"+tmpDir).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- out, err = command.New(binPath(), "setup", "-c", "file://"+tmpDir).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- out, err = command.New(binPath(), "delete", "-c", "file://"+tmpDir).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- }
-}
diff --git a/vendor/github.com/bitrise-io/stepman/_tests/integration/step_info_test.go b/vendor/github.com/bitrise-io/stepman/_tests/integration/step_info_test.go
deleted file mode 100644
index 94d2588d5..000000000
--- a/vendor/github.com/bitrise-io/stepman/_tests/integration/step_info_test.go
+++ /dev/null
@@ -1,298 +0,0 @@
-package integration
-
-import (
- "strings"
- "testing"
-
- "github.com/bitrise-io/go-utils/command"
- "github.com/stretchr/testify/require"
-)
-
-func TestStepInfo(t *testing.T) {
- out, err := command.New(binPath(), "setup", "-c", defaultLibraryURI).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- t.Log("library step")
- {
- out, err = command.New(binPath(), "step-info", "--collection", defaultLibraryURI, "--id", "apk-info", "--version", "1.0.4").RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- require.Equal(t, apkInfo104Definition, out)
- }
-
- t.Log("library step --format json")
- {
- out, err = command.New(binPath(), "step-info", "--collection", defaultLibraryURI, "--id", "apk-info", "--version", "1.0.4", "--format", "json").RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- require.Equal(t, true, strings.Contains(out, apkInfo104DefinitionJSON), out)
- }
-
- t.Log("local step")
- {
- out, err := command.New(binPath(), "step-info", "--collection", "path", "--id", "./test-step").RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- require.Equal(t, localTestStepDefinition, out)
- }
-
- t.Log("local step - deprecated --step-yml flag")
- {
- out, err := command.New(binPath(), "step-info", "--step-yml", "./test-step").RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- require.Equal(t, localTestStepDefinition, out)
- }
-
- t.Log("local step --format json")
- {
- out, err := command.New(binPath(), "step-info", "--collection", "path", "--id", "./test-step", "--format", "json").RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- require.Equal(t, localTestStepDefinitionJSON, out)
- }
-
- t.Log("git step")
- {
- out, err := command.New(binPath(), "step-info", "--collection", "git", "--id", "https://github.com/bitrise-steplib/steps-xamarin-user-management.git", "--version", "1.0.3").RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- require.Equal(t, gitTestStepDefinition, out)
- }
-
- t.Log("git step --format json")
- {
- out, err := command.New(binPath(), "step-info", "--collection", "git", "--id", "https://github.com/bitrise-steplib/steps-xamarin-user-management.git", "--version", "1.0.3", "--format", "json").RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- require.Equal(t, true, strings.Contains(out, gitTestStepDefinitionJSON), out)
- }
-}
-
-func TestStepInfoExitCode(t *testing.T) {
- t.Log("default setup - desired exit code: 0")
- {
- out, err := command.New(binPath(), "setup", "--collection", defaultLibraryURI).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- }
-
- t.Log("latest version - desired exit code: 0")
- {
- out, err := command.New(binPath(), "step-info", "--collection", defaultLibraryURI, "--id", "script").RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- }
-
- t.Log("latest version, json format - desired exit code: 0")
- {
- out, err := command.New(binPath(), "step-info", "--collection", defaultLibraryURI, "--id", "script", "--format", "json").RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- }
-
- t.Log("invalid version -1 - desired exit code: NOT 0")
- {
- out, err := command.New(binPath(), "step-info", "--collection", defaultLibraryURI, "--id", "script", "--version", "-1").RunAndReturnTrimmedCombinedOutput()
- require.Error(t, err, out)
- }
-
- t.Log("invalid version -1 - desired exit code: NOT 0")
- {
- out, err := command.New(binPath(), "step-info", "--collection", defaultLibraryURI, "--id", "script", "--version", "-1", "--format", "json").RunAndReturnTrimmedCombinedOutput()
- require.Error(t, err, out)
- }
-}
-
-const gitTestStepDefinitionJSON = `{"library":"git","id":"https://github.com/bitrise-steplib/steps-xamarin-user-management.git","version":"1.0.3","info":{},"step":{"title":"Xamarin User Management","summary":"This step helps you authenticate your user with Xamarin and to download your Xamarin liceses.","description":"This step helps you authenticate your user with Xamarin and to download your Xamarin licenses.","website":"https://github.com/bitrise-steplib/steps-xamarin-user-management","source_code_url":"https://github.com/bitrise-steplib/steps-xamarin-user-management","support_url":"https://github.com/bitrise-steplib/steps-xamarin-user-management/issues","host_os_tags":["osx-10.10"],"project_type_tags":["xamarin"],"is_requires_admin_user":false,"is_always_run":true,"is_skippable":false,"run_if":".IsCI","timeout":0,"inputs":[{"build_slug":"$BITRISE_BUILD_SLUG","opts":{"is_expand":true,"skip_if_empty":false,"title":"Bitrise build slug","description":"Bitrise build slug\n","summary":"","category":"","is_required":true,"is_dont_change_value":false,"is_template":false,"is_sensitive":false,"unset":false}},{"opts":{"is_expand":true,"skip_if_empty":false,"title":"Xamarin.iOS License","description":"Set to yes if you want to download the Xamarin.iOS license file\n","summary":"","category":"","value_options":["yes","no"],"is_required":true,"is_dont_change_value":false,"is_template":false,"is_sensitive":false,"unset":false},"xamarin_ios_license":"yes"},{"opts":{"is_expand":true,"skip_if_empty":false,"title":"Xamarin.Android License","description":"Set to yes if you want to download the Xamarin.Android license file\n","summary":"","category":"","value_options":["yes","no"],"is_required":true,"is_dont_change_value":false,"is_template":false,"is_sensitive":false,"unset":false},"xamarin_android_license":"yes"},{"opts":{"is_expand":true,"skip_if_empty":false,"title":"Xamarin.Mac License","description":"Set to yes if you want to download the Xamarin.Mac license file\n","summary":"","category":"","value_options":["yes","no"],"is_required":true,"is_dont_change_value":false,"is_template":false,"is_sensitive":false,"unset":false},"xamarin_mac_license":"no"}]}`
-
-const gitTestStepDefinition = "\x1b[34;1m" + `Library:` + "\x1b[0m" + ` git
-` + "\x1b[34;1m" + `ID:` + "\x1b[0m" + ` https://github.com/bitrise-steplib/steps-xamarin-user-management.git
-` + "\x1b[34;1m" + `Version:` + "\x1b[0m" + ` 1.0.3
-` + "\x1b[34;1m" + `LatestVersion:` + "\x1b[0m" + `
-` + "\x1b[34;1m" + `Definition:` + "\x1b[0m" + `
-
-title: "Xamarin User Management"
-summary: This step helps you authenticate your user with Xamarin and to download your Xamarin liceses.
-description: |-
- This step helps you authenticate your user with Xamarin and to download your Xamarin licenses.
-website: https://github.com/bitrise-steplib/steps-xamarin-user-management
-source_code_url: https://github.com/bitrise-steplib/steps-xamarin-user-management
-support_url: https://github.com/bitrise-steplib/steps-xamarin-user-management/issues
-host_os_tags:
- - osx-10.10
-project_type_tags:
- - xamarin
-type_tags:
-is_requires_admin_user: false
-is_always_run: true
-is_skippable: false
-run_if: .IsCI
-inputs:
- - build_slug: $BITRISE_BUILD_SLUG
- opts:
- title: Bitrise build slug
- description: |
- Bitrise build slug
- is_required: true
- is_expand: true
- - xamarin_ios_license: "yes"
- opts:
- title: Xamarin.iOS License
- description: |
- Set to yes if you want to download the Xamarin.iOS license file
- value_options:
- - "yes"
- - "no"
- is_required: true
- is_expand: true
- - xamarin_android_license: "yes"
- opts:
- title: Xamarin.Android License
- description: |
- Set to yes if you want to download the Xamarin.Android license file
- value_options:
- - "yes"
- - "no"
- is_required: true
- is_expand: true
- - xamarin_mac_license: "no"
- opts:
- title: Xamarin.Mac License
- description: |
- Set to yes if you want to download the Xamarin.Mac license file
- value_options:
- - "yes"
- - "no"
- is_required: true
- is_expand: true`
-
-const localTestStepDefinitionJSON = `{"library":"path","id":"./test-step","info":{},"step":{"title":"STEP TEMPLATE","summary":"A short summary of the step. Don't make it too long ;)","description":"This is a Step template.\nContains everything what's required for a valid Stepman managed step.\n\nA Step's description (and generally any description property)\ncan be a [Markdown](https://en.wikipedia.org/wiki/Markdown) formatted text.\n\nTo create your own Step:\n\n1. Create a new repository on GitHub\n2. Copy the files from this folder into your repository\n3. That's all, you can use it on your own machine\n4. Once you're happy with it you can share it with others.","website":"https://github.com/...","source_code_url":"https://github.com/...","support_url":"https://github.com/.../issues","host_os_tags":["osx-10.10"],"project_type_tags":["ios","android","xamarin"],"type_tags":["script"],"deps":{"brew":[{"name":"git"},{"name":"wget"}],"apt_get":[{"name":"git"},{"name":"wget"}]},"is_requires_admin_user":true,"is_always_run":false,"is_skippable":false,"run_if":"","timeout":0,"meta":{"bitrise.io.addons.optional":[{"addon_id":"addons-testing"}],"bitrise.io.addons.required":[{"addon_id":"addons-testing","addon_options":{"required":true,"title":"Testing Addon"},"addon_params":"--token TOKEN"},{"addon_id":"addons-ship","addon_options":{"required":true,"title":"Ship Addon"},"addon_params":"--token TOKEN"}]},"inputs":[{"example_step_input":"Default Value - you can leave this empty if you want to","opts":{"is_expand":true,"skip_if_empty":false,"title":"Example Step Input","description":"Description of this input.\n\nCan be Markdown formatted text.\n","summary":"Summary. No more than 2-3 sentences.","category":"","is_required":true,"is_dont_change_value":false,"is_template":false,"is_sensitive":false,"unset":false}}],"outputs":[{"EXAMPLE_STEP_OUTPUT":null,"opts":{"is_expand":true,"skip_if_empty":false,"title":"Example Step Output","description":"Description of this output.\n\nCan be Markdown formatted text.\n","summary":"Summary. No more than 2-3 sentences.","category":"","is_required":false,"is_dont_change_value":false,"is_template":false,"is_sensitive":false,"unset":false}}]},"definition_pth":"test-step/step.yml"}`
-
-const localTestStepDefinition = "\x1b[34;1m" + `Library:` + "\x1b[0m" + ` path
-` + "\x1b[34;1m" + `ID:` + "\x1b[0m" + ` ./test-step
-` + "\x1b[34;1m" + `Version:` + "\x1b[0m" + `
-` + "\x1b[34;1m" + `LatestVersion:` + "\x1b[0m" + `
-` + "\x1b[34;1m" + `Definition:` + "\x1b[0m" + `
-
-title: "STEP TEMPLATE"
-summary: A short summary of the step. Don't make it too long ;)
-description: |-
- This is a Step template.
- Contains everything what's required for a valid Stepman managed step.
-
- A Step's description (and generally any description property)
- can be a [Markdown](https://en.wikipedia.org/wiki/Markdown) formatted text.
-
- To create your own Step:
-
- 1. Create a new repository on GitHub
- 2. Copy the files from this folder into your repository
- 3. That's all, you can use it on your own machine
- 4. Once you're happy with it you can share it with others.
-website: https://github.com/...
-source_code_url: https://github.com/...
-support_url: https://github.com/.../issues
-host_os_tags:
- - osx-10.10
-project_type_tags:
- - ios
- - android
- - xamarin
-type_tags:
- - script
-is_requires_admin_user: true
-is_always_run: false
-is_skippable: false
-meta:
- bitrise.io.addons.required:
- - addon_id: "addons-testing"
- addon_params: "--token TOKEN"
- addon_options:
- required: true
- title: "Testing Addon"
- - addon_id: "addons-ship"
- addon_params: "--token TOKEN"
- addon_options:
- required: true
- title: "Ship Addon"
- bitrise.io.addons.optional: [{"addon_id":"addons-testing"}]
-deps:
- brew:
- - name: git
- - name: wget
- apt_get:
- - name: git
- - name: wget
-run_if: ""
-inputs:
- - example_step_input: Default Value - you can leave this empty if you want to
- opts:
- title: "Example Step Input"
- summary: Summary. No more than 2-3 sentences.
- description: |
- Description of this input.
-
- Can be Markdown formatted text.
- is_expand: true
- is_required: true
- value_options: []
-outputs:
- - EXAMPLE_STEP_OUTPUT:
- opts:
- title: "Example Step Output"
- summary: Summary. No more than 2-3 sentences.
- description: |
- Description of this output.
-
- Can be Markdown formatted text.`
-
-const apkInfo104DefinitionJSON = `{"library":"https://github.com/bitrise-io/bitrise-steplib.git","id":"apk-info","version":"1.0.4","latest_version":"1.4.4","info":{},"step":{"title":"APK info","summary":"APK Android info provider","description":"Provides all possible Android APK information as package name, version name or version code.","website":"https://github.com/thefuntasty/bitrise-step-apk-info","source_code_url":"https://github.com/thefuntasty/bitrise-step-apk-info","support_url":"https://github.com/thefuntasty/bitrise-step-apk-info/issues","published_at":"2016-10-19T15:35:00.882498804+02:00","source":{"git":"https://github.com/thefuntasty/bitrise-step-apk-info.git","commit":"104e26a8800fc9363658b5837cf4747e5f26b032"},"asset_urls":{"icon.svg":"https://bitrise-steplib-collection.s3.amazonaws.com/steps/apk-info/assets/icon.svg"},"project_type_tags":["android"],"type_tags":["android","apk"],"is_requires_admin_user":false,"is_always_run":false,"is_skippable":false,"run_if":"","timeout":0,"inputs":[{"apk_path":"$BITRISE_APK_PATH","opts":{"category":"","description":"File path to APK file to get info from.\n","is_dont_change_value":false,"is_expand":true,"is_required":true,"is_sensitive":false,"is_template":false,"skip_if_empty":false,"summary":"","title":"APK file path","unset":false}}],"outputs":[{"ANDROID_APP_PACKAGE_NAME":null,"opts":{"category":"","description":"Android application package name, ex. com.package.my","is_dont_change_value":false,"is_expand":true,"is_required":false,"is_sensitive":false,"is_template":false,"skip_if_empty":false,"summary":"","title":"Android application package name","unset":false}},{"ANDROID_APK_FILE_SIZE":null,"opts":{"category":"","description":"Android APK file size, in bytes","is_dont_change_value":false,"is_expand":true,"is_required":false,"is_sensitive":false,"is_template":false,"skip_if_empty":false,"summary":"","title":"Android APK file size","unset":false}},{"ANDROID_APP_NAME":null,"opts":{"category":"","description":"Android application name from APK","is_dont_change_value":false,"is_expand":true,"is_required":false,"is_sensitive":false,"is_template":false,"skip_if_empty":false,"summary":"","title":"Android application name","unset":false}},{"ANDROID_APP_VERSION_NAME":null,"opts":{"category":"","description":"Android application version name from APK, ex. 1.0.0","is_dont_change_value":false,"is_expand":true,"is_required":false,"is_sensitive":false,"is_template":false,"skip_if_empty":false,"summary":"","title":"Android application version name","unset":false}},{"ANDROID_APP_VERSION_CODE":null,"opts":{"category":"","description":"Android application version code from APK, ex. 10","is_dont_change_value":false,"is_expand":true,"is_required":false,"is_sensitive":false,"is_template":false,"skip_if_empty":false,"summary":"","title":"Android application version code","unset":false}},{"ANDROID_ICON_PATH":null,"opts":{"category":"","description":"File path to android application icon","is_dont_change_value":false,"is_expand":true,"is_required":false,"is_sensitive":false,"is_template":false,"skip_if_empty":false,"summary":"","title":"File path to icon","unset":false}}]}`
-
-const apkInfo104Definition = "\x1b[34;1m" + `Library:` + "\x1b[0m" + ` https://github.com/bitrise-io/bitrise-steplib.git
-` + "\x1b[34;1m" + `ID:` + "\x1b[0m" + ` apk-info
-` + "\x1b[34;1m" + `Version:` + "\x1b[0m" + ` 1.0.4
-` + "\x1b[34;1m" + `LatestVersion:` + "\x1b[0m" + ` 1.4.4
-` + "\x1b[34;1m" + `Definition:` + "\x1b[0m" + `
-
-title: APK info
-summary: APK Android info provider
-description: Provides all possible Android APK information as package name, version
- name or version code.
-website: https://github.com/thefuntasty/bitrise-step-apk-info
-source_code_url: https://github.com/thefuntasty/bitrise-step-apk-info
-support_url: https://github.com/thefuntasty/bitrise-step-apk-info/issues
-published_at: 2016-10-19T15:35:00.882498804+02:00
-source:
- git: https://github.com/thefuntasty/bitrise-step-apk-info.git
- commit: 104e26a8800fc9363658b5837cf4747e5f26b032
-project_type_tags:
-- android
-type_tags:
-- android
-- apk
-is_requires_admin_user: false
-is_always_run: false
-is_skippable: false
-inputs:
-- apk_path: $BITRISE_APK_PATH
- opts:
- description: |
- File path to APK file to get info from.
- is_required: true
- title: APK file path
-outputs:
-- ANDROID_APP_PACKAGE_NAME: null
- opts:
- description: Android application package name, ex. com.package.my
- title: Android application package name
-- ANDROID_APK_FILE_SIZE: null
- opts:
- description: Android APK file size, in bytes
- title: Android APK file size
-- ANDROID_APP_NAME: null
- opts:
- description: Android application name from APK
- title: Android application name
-- ANDROID_APP_VERSION_NAME: null
- opts:
- description: Android application version name from APK, ex. 1.0.0
- title: Android application version name
-- ANDROID_APP_VERSION_CODE: null
- opts:
- description: Android application version code from APK, ex. 10
- title: Android application version code
-- ANDROID_ICON_PATH: null
- opts:
- description: File path to android application icon
- title: File path to icon`
diff --git a/vendor/github.com/bitrise-io/stepman/_tests/integration/test-step/README.md b/vendor/github.com/bitrise-io/stepman/_tests/integration/test-step/README.md
deleted file mode 100755
index 6ba2a3723..000000000
--- a/vendor/github.com/bitrise-io/stepman/_tests/integration/test-step/README.md
+++ /dev/null
@@ -1,93 +0,0 @@
-# My Awesome Step
-
-My Awesome Step is a solid starting code base for
-a new Step.
-
-
-## How to use this Step
-
-Can be run directly with the [bitrise CLI](https://github.com/bitrise-io/bitrise),
-just `git clone` this repository, `cd` into it's folder in your Terminal/Command Line
-and call `bitrise run test`.
-
-*Check the `bitrise.yml` file for required inputs which have to be
-added to your `.bitrise.secrets.yml` file!*
-
-Step by step:
-
-1. Open up your Terminal / Command Line
-2. `git clone` the repository
-3. `cd` into the directory of the step (the one you just `git clone`d)
-5. Create a `.bitrise.secrets.yml` file in the same directory of `bitrise.yml` - the `.bitrise.secrets.yml` is a git ignored file, you can store your secrets in
-6. Check the `bitrise.yml` file for any secret you should set in `.bitrise.secrets.yml`
- * Best practice is to mark these options with something like `# define these in your .bitrise.secrets.yml`, in the `app:envs` section.
-7. Once you have all the required secret parameters in your `.bitrise.secrets.yml` you can just run this step with the [bitrise CLI](https://github.com/bitrise-io/bitrise): `bitrise run test`
-
-An example `.bitrise.secrets.yml` file:
-
-```
-envs:
-- A_SECRET_PARAM_ONE: the value for secret one
-- A_SECRET_PARAM_TWO: the value for secret two
-```
-
-## How to create your own step
-
-1. Create a new git repository for your step (**don't fork** the *step template*, create a *new* repository)
-2. Copy the [step template](https://github.com/bitrise-steplib/step-template) files into your repository
-3. Fill the `step.sh` with your functionality
-4. Wire out your inputs to `step.yml` (`inputs` section)
-5. Fill out the other parts of the `step.yml` too
-6. Provide test values for the inputs in the `bitrise.yml`
-7. Run your step with `bitrise run test` - if it works, you're ready
-
-__For Step development guidelines & best practices__ check this documentation: [https://github.com/bitrise-io/bitrise/blob/master/_docs/step-development-guideline.md](https://github.com/bitrise-io/bitrise/blob/master/_docs/step-development-guideline.md).
-
-**NOTE:**
-
-If you want to use your step in your project's `bitrise.yml`:
-
-1. git push the step into it's repository
-2. reference it in your `bitrise.yml` with the `git::PUBLIC-GIT-CLONE-URL@BRANCH` step reference style:
-
-```
-- git::https://github.com/user/my-step.git@branch:
- title: My step
- inputs:
- - my_input_1: "my value 1"
- - my_input_2: "my value 2"
-```
-
-You can find more examples of step reference styles
-in the [bitrise CLI repository](https://github.com/bitrise-io/bitrise/blob/master/_examples/tutorials/steps-and-workflows/bitrise.yml#L65).
-
-## How to contribute to this Step
-
-1. Fork this repository
-2. `git clone` it
-3. Create a branch you'll work on
-4. To use/test the step just follow the **How to use this Step** section
-5. Do the changes you want to
-6. Run/test the step before sending your contribution
- * You can also test the step in your `bitrise` project, either on your Mac or on [bitrise.io](https://www.bitrise.io)
- * You just have to replace the step ID in your project's `bitrise.yml` with either a relative path, or with a git URL format
- * (relative) path format: instead of `- original-step-id:` use `- path::./relative/path/of/script/on/your/Mac:`
- * direct git URL format: instead of `- original-step-id:` use `- git::https://github.com/user/step.git@branch:`
- * You can find more example of alternative step referencing at: https://github.com/bitrise-io/bitrise/blob/master/_examples/tutorials/steps-and-workflows/bitrise.yml
-7. Once you're done just commit your changes & create a Pull Request
-
-
-## Share your own Step
-
-You can share your Step or step version with the [bitrise CLI](https://github.com/bitrise-io/bitrise). If you use the `bitrise.yml` included in this repository, all you have to do is:
-
-1. In your Terminal / Command Line `cd` into this directory (where the `bitrise.yml` of the step is located)
-1. Run: `bitrise run test` to test the step
-1. Run: `bitrise run audit-this-step` to audit the `step.yml`
-1. Check the `share-this-step` workflow in the `bitrise.yml`, and fill out the
- `envs` if you haven't done so already (don't forget to bump the version number if this is an update
- of your step!)
-1. Then run: `bitrise run share-this-step` to share the step (version) you specified in the `envs`
-1. Send the Pull Request, as described in the logs of `bitrise run share-this-step`
-
-That's all ;)
diff --git a/vendor/github.com/bitrise-io/stepman/_tests/integration/test-step/bitrise.yml b/vendor/github.com/bitrise-io/stepman/_tests/integration/test-step/bitrise.yml
deleted file mode 100755
index da3e64f4a..000000000
--- a/vendor/github.com/bitrise-io/stepman/_tests/integration/test-step/bitrise.yml
+++ /dev/null
@@ -1,84 +0,0 @@
-format_version: 1.1.0
-default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
-
-app:
- envs:
- # define these in your .bitrise.secrets.yml
- - A_SECRET_PARAM: $A_SECRET_PARAM
-
-workflows:
- test:
- steps:
- - change-workdir:
- title: Switch working dir to test / _tmp dir
- description: |-
- To prevent step testing issues, like referencing relative
- files with just './some-file' in the step's code, which would
- work for testing the step from this directory directly
- but would break if the step is included in another `bitrise.yml`.
- run_if: true
- inputs:
- - path: ./_tmp
- - is_create_path: true
- - path::./:
- title: Step Test
- description: |-
- The example input has a default value,
- you can overwrite it if you want to, just like we did below,
- but the step would use the default value specified in the `step.yml`
- file if you would not specify another value.
- run_if: true
- inputs:
- - example_step_input: Example Step Input's value
-
-
- # ----------------------------------------------------------------
- # --- workflows to Share this step into a Step Library
- audit-this-step:
- steps:
- - script:
- inputs:
- - content: |-
- #!/bin/bash
- set -ex
- stepman audit --step-yml ./step.yml
-
- share-this-step:
- envs:
- # if you want to share this step into a StepLib
- - MY_STEPLIB_REPO_FORK_GIT_URL:
- - STEP_ID_IN_STEPLIB:
- - STEP_GIT_VERION_TAG_TO_SHARE:
- - STEP_GIT_CLONE_URL:
- description: |-
- If this is the first time you try to share a Step you should
- first call: $ bitrise share
-
- This will print you a guide, and information about how Step sharing
- works. Please read it at least once!
-
- As noted in the Step sharing guide you'll have to fork the
- StepLib you want to share this step into. Once you're done with forking
- the repository you should set your own fork's git clone URL
- in the `.bitrise.secrets.yml` file, or here in the `envs` section,
- as the value of the `MY_STEPLIB_REPO_FORK_GIT_URL` environment.
-
- You're now ready to share this Step, just make sure that
- the `STEP_ID_IN_STEPLIB` and `STEP_GIT_VERION_TAG_TO_SHARE`
- environments are set to the desired values!
-
- To share this Step into a StepLib you can just run: $ bitrise run share-this-step
-
- Once it finishes the only thing left is to actually create a Pull Request,
- the way described in the guide printed at the end of the process.
- before_run:
- - audit-this-step
- steps:
- - script:
- inputs:
- - content: |-
- #!/bin/bash
- set -ex
- bitrise share start -c ${MY_STEPLIB_REPO_FORK_GIT_URL}
- bitrise share create --stepid ${STEP_ID_IN_STEPLIB} --tag ${STEP_GIT_VERION_TAG_TO_SHARE} --git ${STEP_GIT_CLONE_URL}
- bitrise share finish
diff --git a/vendor/github.com/bitrise-io/stepman/_tests/integration/test-step/step.sh b/vendor/github.com/bitrise-io/stepman/_tests/integration/test-step/step.sh
deleted file mode 100755
index 2cf7beee1..000000000
--- a/vendor/github.com/bitrise-io/stepman/_tests/integration/test-step/step.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-echo "This is the value specified for the input 'example_step_input': ${example_step_input}"
-
-#
-# --- Export Environment Variables for other Steps:
-# You can export Environment Variables for other Steps with
-# envman, which is automatically installed by `bitrise setup`.
-# A very simple example:
-# envman add --key EXAMPLE_STEP_OUTPUT --value 'the value you want to share'
-# Envman can handle piped inputs, which is useful if the text you want to
-# share is complex and you don't want to deal with proper bash escaping:
-# cat file_with_complex_input | envman add --KEY EXAMPLE_STEP_OUTPUT
-# You can find more usage examples on envman's GitHub page
-# at: https://github.com/bitrise-io/envman
-
-#
-# --- Exit codes:
-# The exit code of your Step is very important. If you return
-# with a 0 exit code `bitrise` will register your Step as "successful".
-# Any non zero exit code will be registered as "failed" by `bitrise`.
diff --git a/vendor/github.com/bitrise-io/stepman/_tests/integration/test-step/step.yml b/vendor/github.com/bitrise-io/stepman/_tests/integration/test-step/step.yml
deleted file mode 100755
index 07c664ea2..000000000
--- a/vendor/github.com/bitrise-io/stepman/_tests/integration/test-step/step.yml
+++ /dev/null
@@ -1,71 +0,0 @@
-title: "STEP TEMPLATE"
-summary: A short summary of the step. Don't make it too long ;)
-description: |-
- This is a Step template.
- Contains everything what's required for a valid Stepman managed step.
-
- A Step's description (and generally any description property)
- can be a [Markdown](https://en.wikipedia.org/wiki/Markdown) formatted text.
-
- To create your own Step:
-
- 1. Create a new repository on GitHub
- 2. Copy the files from this folder into your repository
- 3. That's all, you can use it on your own machine
- 4. Once you're happy with it you can share it with others.
-website: https://github.com/...
-source_code_url: https://github.com/...
-support_url: https://github.com/.../issues
-host_os_tags:
- - osx-10.10
-project_type_tags:
- - ios
- - android
- - xamarin
-type_tags:
- - script
-is_requires_admin_user: true
-is_always_run: false
-is_skippable: false
-meta:
- bitrise.io.addons.required:
- - addon_id: "addons-testing"
- addon_params: "--token TOKEN"
- addon_options:
- required: true
- title: "Testing Addon"
- - addon_id: "addons-ship"
- addon_params: "--token TOKEN"
- addon_options:
- required: true
- title: "Ship Addon"
- bitrise.io.addons.optional: [{"addon_id":"addons-testing"}]
-deps:
- brew:
- - name: git
- - name: wget
- apt_get:
- - name: git
- - name: wget
-run_if: ""
-inputs:
- - example_step_input: Default Value - you can leave this empty if you want to
- opts:
- title: "Example Step Input"
- summary: Summary. No more than 2-3 sentences.
- description: |
- Description of this input.
-
- Can be Markdown formatted text.
- is_expand: true
- is_required: true
- value_options: []
-outputs:
- - EXAMPLE_STEP_OUTPUT:
- opts:
- title: "Example Step Output"
- summary: Summary. No more than 2-3 sentences.
- description: |
- Description of this output.
-
- Can be Markdown formatted text.
diff --git a/vendor/github.com/bitrise-io/stepman/_tests/integration/update_test.go b/vendor/github.com/bitrise-io/stepman/_tests/integration/update_test.go
deleted file mode 100644
index 5dd3d1873..000000000
--- a/vendor/github.com/bitrise-io/stepman/_tests/integration/update_test.go
+++ /dev/null
@@ -1,52 +0,0 @@
-package integration
-
-import (
- "os"
- "testing"
-
- "github.com/bitrise-io/go-utils/command"
- "github.com/bitrise-io/go-utils/command/git"
- "github.com/bitrise-io/go-utils/pathutil"
- "github.com/stretchr/testify/require"
-)
-
-func TestUpdate(t *testing.T) {
- t.Log("remote library")
- {
- out, err := command.New(binPath(), "delete", "-c", defaultLibraryURI).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- out, err = command.New(binPath(), "setup", "-c", defaultLibraryURI).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- out, err = command.New(binPath(), "update", "-c", defaultLibraryURI).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- }
-
- t.Log("local library")
- {
- tmpDir, err := pathutil.NormalizedOSTempDirPath("__library__")
- require.NoError(t, err)
- defer func() {
- require.NoError(t, os.RemoveAll(tmpDir))
- }()
- repo, err := git.New(tmpDir)
- require.NoError(t, err)
- require.NoError(t, repo.Clone(defaultLibraryURI).Run())
-
- out, err := command.New(binPath(), "delete", "-c", "file://"+tmpDir).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- out, err = command.New(binPath(), "setup", "-c", "file://"+tmpDir).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- out, err = command.New(binPath(), "update", "-c", tmpDir).RunAndReturnTrimmedCombinedOutput()
- require.Error(t, err, out)
-
- out, err = command.New(binPath(), "update", "-c", "file://"+tmpDir).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
-
- out, err = command.New(binPath(), "delete", "-c", "file://"+tmpDir).RunAndReturnTrimmedCombinedOutput()
- require.NoError(t, err, out)
- }
-}
diff --git a/vendor/github.com/bitrise-io/stepman/_tests/integration/version_test.go b/vendor/github.com/bitrise-io/stepman/_tests/integration/version_test.go
deleted file mode 100644
index c03c03c0f..000000000
--- a/vendor/github.com/bitrise-io/stepman/_tests/integration/version_test.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package integration
-
-import (
- "fmt"
- "runtime"
- "testing"
-
- "github.com/bitrise-io/go-utils/command"
- "github.com/stretchr/testify/require"
-)
-
-func Test_VersionOutput(t *testing.T) {
- t.Log("Version")
- {
- out, err := command.RunCommandAndReturnCombinedStdoutAndStderr(binPath(), "version")
- require.NoError(t, err, out)
- require.Equal(t, "0.11.6", out)
- }
-
- t.Log("Version --full")
- {
- out, err := command.RunCommandAndReturnCombinedStdoutAndStderr(binPath(), "version", "--full")
- require.NoError(t, err, out)
-
- expectedOSVersion := fmt.Sprintf("%s (%s)", runtime.GOOS, runtime.GOARCH)
- expectedVersionOut := fmt.Sprintf(`version: 0.11.6
-os: %s
-go: %s
-build_number:
-commit:`, expectedOSVersion, runtime.Version())
-
- require.Equal(t, expectedVersionOut, out)
- }
-}
diff --git a/vendor/github.com/bitrise-io/stepman/cli/audit_test.go b/vendor/github.com/bitrise-io/stepman/cli/audit_test.go
deleted file mode 100644
index 34d0d1a2f..000000000
--- a/vendor/github.com/bitrise-io/stepman/cli/audit_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package cli
-
-import (
- "testing"
- "time"
-
- "github.com/bitrise-io/go-utils/pointers"
- "github.com/bitrise-io/stepman/models"
-)
-
-// Test - Stepman audit step
-// Checks if step Source.Commit meets the git commit hash of realese version
-// 'auditStep(...)' calls 'cmdex.GitCloneTagOrBranchAndValidateCommitHash(...)', which method validates the commit hash
-func TestValidateStepCommitHash(t *testing.T) {
- // Slack step - valid hash
- stepSlack := models.StepModel{
- Title: pointers.NewStringPtr("hash_test"),
- Summary: pointers.NewStringPtr("summary"),
- Website: pointers.NewStringPtr("website"),
- PublishedAt: pointers.NewTimePtr(time.Date(2012, time.January, 1, 0, 0, 0, 0, time.UTC)),
- Source: &models.StepSourceModel{
- Git: "https://github.com/bitrise-io/steps-slack-message.git",
- Commit: "756f39f76f94d525aaea2fc2d0c5a23799f8ec97",
- },
- }
- if err := auditStepModelBeforeSharePullRequest(stepSlack, "slack", "2.1.0"); err != nil {
- t.Fatal("Step audit failed:", err)
- }
-
- // Slack step - invalid hash
- stepSlack.Source.Commit = "should fail commit"
- if err := auditStepModelBeforeSharePullRequest(stepSlack, "slack", "2.1.0"); err == nil {
- t.Fatal("Step audit should fail")
- }
-
- // Slack step - empty hash
- stepSlack.Source.Commit = ""
- if err := auditStepModelBeforeSharePullRequest(stepSlack, "slack", "2.1.0"); err == nil {
- t.Fatal("Step audit should fail")
- }
-}
diff --git a/vendor/github.com/bitrise-io/stepman/cli/share_create_test.go b/vendor/github.com/bitrise-io/stepman/cli/share_create_test.go
deleted file mode 100644
index 52713c9ab..000000000
--- a/vendor/github.com/bitrise-io/stepman/cli/share_create_test.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package cli
-
-import "testing"
-
-func TestValidateTag(t *testing.T) {
- cases := []struct {
- tag string
- valid bool
- }{
- {tag: "1.0.0", valid: true},
- {tag: "1.0", valid: false},
- {tag: "v1.0.0", valid: false},
- }
-
- for _, tc := range cases {
- got := validateTag(tc.tag)
- valid := got == nil
-
- if valid != tc.valid {
- t.Errorf("validateTag(%s) == nil should be %t but got %s", tc.tag, tc.valid, got)
- }
- }
-}
diff --git a/vendor/github.com/bitrise-io/stepman/models/models_methods_test.go b/vendor/github.com/bitrise-io/stepman/models/models_methods_test.go
deleted file mode 100644
index 941f22d98..000000000
--- a/vendor/github.com/bitrise-io/stepman/models/models_methods_test.go
+++ /dev/null
@@ -1,467 +0,0 @@
-package models
-
-import (
- "testing"
- "time"
-
- envmanModels "github.com/bitrise-io/envman/models"
- "github.com/bitrise-io/go-utils/pointers"
- "github.com/stretchr/testify/require"
-)
-
-func TestValidate(t *testing.T) {
- step := StepModel{
- Title: pointers.NewStringPtr("title"),
- Summary: pointers.NewStringPtr("summary"),
- Website: pointers.NewStringPtr("website"),
- PublishedAt: pointers.NewTimePtr(time.Date(2012, time.January, 1, 0, 0, 0, 0, time.UTC)),
- Source: &StepSourceModel{
- Git: "https://github.com/bitrise-io/bitrise.git",
- Commit: "1e1482141079fc12def64d88cb7825b8f1cb1dc3",
- },
- }
-
- require.Equal(t, nil, step.Audit())
-
- step.Title = nil
- require.EqualError(t, step.Audit(), "Invalid step: missing or empty required 'title' property")
-
- step.Title = new(string)
- *step.Title = ""
- require.EqualError(t, step.Audit(), "Invalid step: missing or empty required 'title' property")
- *step.Title = "title"
-
- step.PublishedAt = nil
- require.NotEqual(t, nil, step.Audit())
- require.EqualError(t, step.Audit(), "Invalid step: missing or empty required 'PublishedAt' property")
- step.PublishedAt = new(time.Time)
-
- *step.PublishedAt = time.Time{}
- require.EqualError(t, step.Audit(), "Invalid step: missing or empty required 'PublishedAt' property")
- step.PublishedAt = pointers.NewTimePtr(time.Date(2012, time.January, 1, 0, 0, 0, 0, time.UTC))
-
- step.Website = nil
- require.EqualError(t, step.Audit(), "Invalid step: missing or empty required 'website' property")
-
- step.Website = new(string)
- *step.Website = ""
- require.EqualError(t, step.Audit(), "Invalid step: missing or empty required 'website' property")
- *step.Website = "website"
-
- step.Source.Git = ""
- require.EqualError(t, step.Audit(), "Invalid step: missing or empty required 'source.git' property")
- step.Source.Git = "git"
-
- step.Source.Git = "git@github.com:bitrise-io/bitrise.git"
- require.EqualError(t, step.Audit(), "Invalid step: step source should start with http:// or https://")
-
- step.Source.Git = "https://github.com/bitrise-io/bitrise"
- require.EqualError(t, step.Audit(), "Invalid step: step source should end with .git")
- step.Source.Git = "https://github.com/bitrise-io/bitrise.git"
-
- step.Source.Commit = ""
- require.EqualError(t, step.Audit(), "Invalid step: missing or empty required 'source.commit' property")
- step.Source.Commit = "1e1482141079fc12def64d88cb7825b8f1cb1dc3"
-
- step.Timeout = new(int)
- *step.Timeout = -1
- require.EqualError(t, step.Audit(), "Invalid step: timeout less then 0")
-}
-
-func TestValidateStepInputOutputModel(t *testing.T) {
- // Filled env
- env := envmanModels.EnvironmentItemModel{
- "test_key": "test_value",
- envmanModels.OptionsKey: envmanModels.EnvironmentItemOptionsModel{
- Title: pointers.NewStringPtr("test_title"),
- Description: pointers.NewStringPtr("test_description"),
- Summary: pointers.NewStringPtr("test_summary"),
- ValueOptions: []string{"test_key2", "test_value2"},
- IsRequired: pointers.NewBoolPtr(true),
- IsExpand: pointers.NewBoolPtr(false),
- IsDontChangeValue: pointers.NewBoolPtr(true),
- },
- }
-
- step := StepModel{
- Inputs: []envmanModels.EnvironmentItemModel{env},
- }
-
- require.NoError(t, step.ValidateInputAndOutputEnvs(true))
-
- // Empty key
- env = envmanModels.EnvironmentItemModel{
- "": "test_value",
- envmanModels.OptionsKey: envmanModels.EnvironmentItemOptionsModel{
- Title: pointers.NewStringPtr("test_title"),
- Description: pointers.NewStringPtr("test_description"),
- Summary: pointers.NewStringPtr("test_summary"),
- ValueOptions: []string{"test_key2", "test_value2"},
- IsRequired: pointers.NewBoolPtr(true),
- IsExpand: pointers.NewBoolPtr(false),
- IsDontChangeValue: pointers.NewBoolPtr(true),
- },
- }
-
- step = StepModel{
- Inputs: []envmanModels.EnvironmentItemModel{env},
- }
-
- require.Error(t, step.ValidateInputAndOutputEnvs(true))
-
- // Title is empty
- env = envmanModels.EnvironmentItemModel{
- "test_key": "test_value",
- envmanModels.OptionsKey: envmanModels.EnvironmentItemOptionsModel{
- Description: pointers.NewStringPtr("test_description"),
- ValueOptions: []string{"test_key2", "test_value2"},
- IsRequired: pointers.NewBoolPtr(true),
- IsExpand: pointers.NewBoolPtr(false),
- IsDontChangeValue: pointers.NewBoolPtr(true),
- },
- }
-
- step = StepModel{
- Inputs: []envmanModels.EnvironmentItemModel{env},
- }
-
- require.Error(t, step.ValidateInputAndOutputEnvs(true))
-
- // IsSensitive is true but IsExpand is not
- env = envmanModels.EnvironmentItemModel{
- "test_key": "test_value",
- envmanModels.OptionsKey: envmanModels.EnvironmentItemOptionsModel{
- Title: pointers.NewStringPtr("test_title"),
- Description: pointers.NewStringPtr("test_description"),
- ValueOptions: []string{"test_key2", "test_value2"},
- IsRequired: pointers.NewBoolPtr(true),
- IsExpand: pointers.NewBoolPtr(false),
- IsSensitive: pointers.NewBoolPtr(true),
- IsDontChangeValue: pointers.NewBoolPtr(true),
- },
- }
-
- step = StepModel{
- Inputs: []envmanModels.EnvironmentItemModel{env},
- }
-
- require.Error(t, step.ValidateInputAndOutputEnvs(true))
-
- // IsSensitive is not set
- env = envmanModels.EnvironmentItemModel{
- "test_key": "test_value",
- envmanModels.OptionsKey: envmanModels.EnvironmentItemOptionsModel{
- Title: pointers.NewStringPtr("test_title"),
- Description: pointers.NewStringPtr("test_description"),
- ValueOptions: []string{"test_key2", "test_value2"},
- IsRequired: pointers.NewBoolPtr(true),
- IsExpand: pointers.NewBoolPtr(false),
- IsDontChangeValue: pointers.NewBoolPtr(true),
- },
- }
-
- step = StepModel{
- Inputs: []envmanModels.EnvironmentItemModel{env},
- }
-
- require.NoError(t, step.ValidateInputAndOutputEnvs(true))
-
- // IsSensitive is set to false
- env = envmanModels.EnvironmentItemModel{
- "test_key": "test_value",
- envmanModels.OptionsKey: envmanModels.EnvironmentItemOptionsModel{
- Title: pointers.NewStringPtr("test_title"),
- Description: pointers.NewStringPtr("test_description"),
- ValueOptions: []string{"test_key2", "test_value2"},
- IsRequired: pointers.NewBoolPtr(true),
- IsExpand: pointers.NewBoolPtr(false),
- IsSensitive: pointers.NewBoolPtr(false),
- IsDontChangeValue: pointers.NewBoolPtr(true),
- },
- }
-
- step = StepModel{
- Inputs: []envmanModels.EnvironmentItemModel{env},
- }
-
- require.NoError(t, step.ValidateInputAndOutputEnvs(true))
-
- // IsExpand not set and IsSensitive set
- env = envmanModels.EnvironmentItemModel{
- "test_key": "test_value",
- envmanModels.OptionsKey: envmanModels.EnvironmentItemOptionsModel{
- Title: pointers.NewStringPtr("test_title"),
- Description: pointers.NewStringPtr("test_description"),
- ValueOptions: []string{"test_key2", "test_value2"},
- IsRequired: pointers.NewBoolPtr(true),
- IsSensitive: pointers.NewBoolPtr(true),
- IsDontChangeValue: pointers.NewBoolPtr(true),
- },
- }
-
- step = StepModel{
- Inputs: []envmanModels.EnvironmentItemModel{env},
- }
-
- require.NoError(t, step.ValidateInputAndOutputEnvs(true))
-}
-
-func TestFillMissingDefaults(t *testing.T) {
- title := "name 1"
- // "desc 1" := ""desc 1" 1"
- website := "web/1"
- git := "https://git.url"
- // fork := "fork/1"
-
- step := StepModel{
- Title: pointers.NewStringPtr(title),
- Website: pointers.NewStringPtr(website),
- Source: &StepSourceModel{
- Git: git,
- },
- HostOsTags: []string{"osx"},
- ProjectTypeTags: []string{"ios"},
- TypeTags: []string{"test"},
- }
-
- require.Equal(t, nil, step.FillMissingDefaults())
-
- if step.Description == nil || *step.Description != "" {
- t.Fatal("Description missing")
- }
- if step.SourceCodeURL == nil || *step.SourceCodeURL != "" {
- t.Fatal("SourceCodeURL missing")
- }
- if step.SupportURL == nil || *step.SupportURL != "" {
- t.Fatal("SourceCodeURL missing")
- }
- if step.IsRequiresAdminUser == nil || *step.IsRequiresAdminUser != DefaultIsRequiresAdminUser {
- t.Fatal("IsRequiresAdminUser missing")
- }
- if step.IsAlwaysRun == nil || *step.IsAlwaysRun != DefaultIsAlwaysRun {
- t.Fatal("IsAlwaysRun missing")
- }
- if step.IsSkippable == nil || *step.IsSkippable != DefaultIsSkippable {
- t.Fatal("IsSkippable missing")
- }
- if step.RunIf == nil || *step.RunIf != "" {
- t.Fatal("RunIf missing")
- }
- if step.Timeout == nil || *step.Timeout != 0 {
- t.Fatal("Timeout missing")
- }
-}
-
-func TestGetStep(t *testing.T) {
- defaultIsRequiresAdminUser := DefaultIsRequiresAdminUser
-
- step := StepModel{
- Title: pointers.NewStringPtr("name 1"),
- Description: pointers.NewStringPtr("desc 1"),
- Website: pointers.NewStringPtr("web/1"),
- SourceCodeURL: pointers.NewStringPtr("fork/1"),
- Source: &StepSourceModel{
- Git: "https://git.url",
- },
- HostOsTags: []string{"osx"},
- ProjectTypeTags: []string{"ios"},
- TypeTags: []string{"test"},
- IsRequiresAdminUser: pointers.NewBoolPtr(defaultIsRequiresAdminUser),
- Inputs: []envmanModels.EnvironmentItemModel{
- envmanModels.EnvironmentItemModel{
- "KEY_1": "Value 1",
- },
- envmanModels.EnvironmentItemModel{
- "KEY_2": "Value 2",
- },
- },
- Outputs: []envmanModels.EnvironmentItemModel{
- envmanModels.EnvironmentItemModel{
- "KEY_3": "Value 3",
- },
- },
- }
-
- collection := StepCollectionModel{
- FormatVersion: "1.0.0",
- GeneratedAtTimeStamp: 0,
- Steps: StepHash{
- "step": StepGroupModel{
- Versions: map[string]StepModel{
- "1.0.0": step,
- },
- },
- },
- SteplibSource: "source",
- DownloadLocations: []DownloadLocationModel{
- DownloadLocationModel{
- Type: "zip",
- Src: "amazon/",
- },
- DownloadLocationModel{
- Type: "git",
- Src: "step.git",
- },
- },
- }
-
- _, stepFound, versionFound := collection.GetStep("step", "1.0.0")
- require.Equal(t, true, (stepFound && versionFound))
-}
-
-func TestGetDownloadLocations(t *testing.T) {
- defaultIsRequiresAdminUser := DefaultIsRequiresAdminUser
-
- // Zip & git download locations
- step := StepModel{
- Title: pointers.NewStringPtr("name 1"),
- Description: pointers.NewStringPtr("desc 1"),
- Website: pointers.NewStringPtr("web/1"),
- SourceCodeURL: pointers.NewStringPtr("fork/1"),
- Source: &StepSourceModel{
- Git: "https://git.url",
- },
- HostOsTags: []string{"osx"},
- ProjectTypeTags: []string{"ios"},
- TypeTags: []string{"test"},
- IsRequiresAdminUser: pointers.NewBoolPtr(defaultIsRequiresAdminUser),
- Inputs: []envmanModels.EnvironmentItemModel{
- envmanModels.EnvironmentItemModel{
- "KEY_1": "Value 1",
- },
- envmanModels.EnvironmentItemModel{
- "KEY_2": "Value 2",
- },
- },
- Outputs: []envmanModels.EnvironmentItemModel{
- envmanModels.EnvironmentItemModel{
- "KEY_3": "Value 3",
- },
- },
- }
-
- collection := StepCollectionModel{
- FormatVersion: "1.0.0",
- GeneratedAtTimeStamp: 0,
- Steps: StepHash{
- "step": StepGroupModel{
- Versions: map[string]StepModel{
- "1.0.0": step,
- },
- },
- },
- SteplibSource: "source",
- DownloadLocations: []DownloadLocationModel{
- DownloadLocationModel{
- Type: "zip",
- Src: "amazon/",
- },
- DownloadLocationModel{
- Type: "git",
- Src: "step.git",
- },
- },
- }
-
- locations, err := collection.GetDownloadLocations("step", "1.0.0")
- require.Equal(t, nil, err)
-
- zipFound := false
- gitFount := false
- zipIdx := -1
- gitIdx := -1
-
- for idx, location := range locations {
- if location.Type == "zip" {
- if location.Src != "amazon/step/1.0.0/step.zip" {
- t.Fatalf("Incorrect zip location (%s)", location.Src)
- }
- zipFound = true
- zipIdx = idx
- } else if location.Type == "git" {
- if location.Src != "https://git.url" {
- t.Fatalf("Incorrect git location (%s)", location.Src)
- }
- gitFount = true
- gitIdx = idx
- }
- }
-
- require.Equal(t, true, zipFound)
- require.Equal(t, true, gitFount)
- if gitIdx < zipIdx {
- t.Fatal("Incorrect download locations order")
- }
-}
-
-func TestGetLatestStepVersion(t *testing.T) {
- defaultIsRequiresAdminUser := DefaultIsRequiresAdminUser
-
- step := StepModel{
- Title: pointers.NewStringPtr("name 1"),
- Description: pointers.NewStringPtr("desc 1"),
- Website: pointers.NewStringPtr("web/1"),
- SourceCodeURL: pointers.NewStringPtr("fork/1"),
- Source: &StepSourceModel{
- Git: "https://git.url",
- },
- HostOsTags: []string{"osx"},
- ProjectTypeTags: []string{"ios"},
- TypeTags: []string{"test"},
- IsRequiresAdminUser: pointers.NewBoolPtr(defaultIsRequiresAdminUser),
- Inputs: []envmanModels.EnvironmentItemModel{
- envmanModels.EnvironmentItemModel{
- "KEY_1": "Value 1",
- },
- envmanModels.EnvironmentItemModel{
- "KEY_2": "Value 2",
- },
- },
- Outputs: []envmanModels.EnvironmentItemModel{
- envmanModels.EnvironmentItemModel{
- "KEY_3": "Value 3",
- },
- },
- }
-
- collection := StepCollectionModel{
- FormatVersion: "1.0.0",
- GeneratedAtTimeStamp: 0,
- Steps: StepHash{
- "step": StepGroupModel{
- Versions: map[string]StepModel{
- "1.0.0": step,
- "2.0.0": step,
- },
- LatestVersionNumber: "2.0.0",
- },
- },
- SteplibSource: "source",
- DownloadLocations: []DownloadLocationModel{
- DownloadLocationModel{
- Type: "zip",
- Src: "amazon/",
- },
- DownloadLocationModel{
- Type: "git",
- Src: "step.git",
- },
- },
- }
-
- latest, err := collection.GetLatestStepVersion("step")
- require.Equal(t, nil, err)
- require.Equal(t, "2.0.0", latest)
-}
-
-func Test_BrewDepModel_GetBinaryName(t *testing.T) {
- require.Equal(t, "", BrewDepModel{}.GetBinaryName())
- require.Equal(t, "awscli", BrewDepModel{Name: "awscli"}.GetBinaryName())
- require.Equal(t, "aws", BrewDepModel{Name: "awscli", BinName: "aws"}.GetBinaryName())
-}
-
-func Test_AptGetDepModel_GetBinaryName(t *testing.T) {
- require.Equal(t, "", AptGetDepModel{}.GetBinaryName())
- require.Equal(t, "awscli", AptGetDepModel{Name: "awscli"}.GetBinaryName())
- require.Equal(t, "aws", AptGetDepModel{Name: "awscli", BinName: "aws"}.GetBinaryName())
-}
diff --git a/vendor/github.com/bitrise-io/stepman/models/models_test.go b/vendor/github.com/bitrise-io/stepman/models/models_test.go
deleted file mode 100644
index 6f2924cb8..000000000
--- a/vendor/github.com/bitrise-io/stepman/models/models_test.go
+++ /dev/null
@@ -1,70 +0,0 @@
-package models
-
-import (
- "encoding/json"
- "testing"
-
- "gopkg.in/yaml.v2"
-
- "github.com/bitrise-io/go-utils/pointers"
- "github.com/stretchr/testify/require"
-)
-
-func Test_serialize_StepModel(t *testing.T) {
- t.Log("Empty")
- {
- step := StepModel{}
-
- // JSON
- {
- bytes, err := json.Marshal(step)
- require.NoError(t, err)
- require.Equal(t, `{}`, string(bytes))
- }
-
- // YAML
- {
- bytes, err := yaml.Marshal(step)
- require.NoError(t, err)
- require.Equal(t, `{}
-`,
- string(bytes))
- }
- }
-
- t.Log("Toolkit")
- {
- step := StepModel{
- Title: pointers.NewStringPtr("Test Step"),
- Toolkit: &StepToolkitModel{
- Go: &GoStepToolkitModel{
- PackageName: "go/package",
- },
- Bash: &BashStepToolkitModel{
- EntryFile: "step.sh",
- },
- },
- }
-
- // JSON
- {
- bytes, err := json.Marshal(step)
- require.NoError(t, err)
- require.Equal(t, `{"title":"Test Step","toolkit":{"bash":{"entry_file":"step.sh"},"go":{"package_name":"go/package"}}}`, string(bytes))
- }
-
- // YAML
- {
- bytes, err := yaml.Marshal(step)
- require.NoError(t, err)
- require.Equal(t, `title: Test Step
-toolkit:
- bash:
- entry_file: step.sh
- go:
- package_name: go/package
-`,
- string(bytes))
- }
- }
-}
diff --git a/vendor/github.com/bitrise-io/stepman/models/parse_util_test.go b/vendor/github.com/bitrise-io/stepman/models/parse_util_test.go
deleted file mode 100644
index fdcdfdd07..000000000
--- a/vendor/github.com/bitrise-io/stepman/models/parse_util_test.go
+++ /dev/null
@@ -1,108 +0,0 @@
-package models
-
-import (
- "reflect"
- "testing"
-
- "github.com/google/go-cmp/cmp"
-)
-
-func Test_castRecursiveToMapStringInterface(t *testing.T) {
- tests := []struct {
- name string
- source interface{}
- want interface{}
- wantErr bool
- }{
- {
- name: "1 level",
- source: map[interface{}]interface{}{"aa": "bb"},
- want: map[string]interface{}{"aa": "bb"},
- wantErr: false,
- },
- {
- name: "1 level map[string]interface at top",
- source: map[string]interface{}{"aa": "bb"},
- want: map[string]interface{}{"aa": "bb"},
- wantErr: false,
- },
- {
- name: "2 levels",
- source: map[interface{}]interface{}{"aa": map[interface{}]interface{}{"aa": "bb"}, "b": "c"},
- want: map[string]interface{}{"aa": map[string]interface{}{"aa": "bb"}, "b": "c"},
- wantErr: false,
- },
- {
- name: "2 levels map[string]interface at top",
- source: map[string]interface{}{"aa": map[interface{}]interface{}{"aa": "bb"}, "b": "c"},
- want: map[string]interface{}{"aa": map[string]interface{}{"aa": "bb"}, "b": "c"},
- wantErr: false,
- },
- {
- name: "Decoded from yml",
- source: map[interface{}]interface{}{
- "bitrise.io.addons.optional.2": []interface{}{
- map[interface{}]interface{}{
- "addon_id": "addons-testing",
- },
- },
- "bitrise.io.addons.required": []interface{}{
- map[interface{}]interface{}{
- "addon_id": "addons-testing",
- "addon_options": map[interface{}]interface{}{
- "required": true,
- "title": "Testing Addon",
- },
- "addon_params": "--token TOKEN",
- },
- map[interface{}]interface{}{
- "addon_id": "addons-ship",
- "addon_options": map[interface{}]interface{}{
- "required": true,
- "title": "Ship Addon",
- },
- "addon_params": "--token TOKEN",
- },
- },
- },
- want: map[string]interface{}{
- "bitrise.io.addons.optional.2": []interface{}{
- map[string]interface{}{
- "addon_id": "addons-testing",
- },
- },
- "bitrise.io.addons.required": []interface{}{
- map[string]interface{}{
- "addon_id": "addons-testing",
- "addon_options": map[string]interface{}{
- "required": true,
- "title": "Testing Addon",
- },
- "addon_params": "--token TOKEN",
- },
- map[string]interface{}{
- "addon_id": "addons-ship",
- "addon_options": map[string]interface{}{
- "required": true,
- "title": "Ship Addon",
- },
- "addon_params": "--token TOKEN",
- },
- },
- },
- wantErr: false,
- },
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- got, err := recursiveJSONMarshallable(tt.source)
- if (err != nil) != tt.wantErr {
- t.Errorf("castRecursiveToMapStringInterface() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("castRecursiveToMapStringInterface() = %v, want %v, \n Diff %v", got, tt.want, cmp.Diff(got, tt.want))
- }
- })
- }
-}
diff --git a/vendor/github.com/bitrise-io/stepman/stepman/util_test.go b/vendor/github.com/bitrise-io/stepman/stepman/util_test.go
deleted file mode 100644
index 86fdda7da..000000000
--- a/vendor/github.com/bitrise-io/stepman/stepman/util_test.go
+++ /dev/null
@@ -1,117 +0,0 @@
-package stepman
-
-import (
- "reflect"
- "testing"
-
- "github.com/google/go-cmp/cmp"
-
- "github.com/bitrise-io/go-utils/pointers"
- "github.com/bitrise-io/stepman/models"
- "github.com/stretchr/testify/require"
-)
-
-func TestAddStepVersionToStepGroup(t *testing.T) {
- step := models.StepModel{
- Title: pointers.NewStringPtr("name 1"),
- }
-
- group := models.StepGroupModel{
- Versions: map[string]models.StepModel{
- "1.0.0": step,
- "2.0.0": step,
- },
- LatestVersionNumber: "2.0.0",
- }
-
- group, err := addStepVersionToStepGroup(step, "2.1.0", group)
- require.Equal(t, nil, err)
- require.Equal(t, 3, len(group.Versions))
- require.Equal(t, "2.1.0", group.LatestVersionNumber)
-}
-
-func Test_parseStepModel(t *testing.T) {
- empty := ""
- falseBool := false
- zero := 0
- tests := []struct {
- name string
- bytes []byte
- validate bool
- want models.StepModel
- wantErr bool
- }{
- {
- name: "Meta field",
- bytes: []byte(stepDefinitionMetaFieldOnly),
- validate: false,
- want: models.StepModel{
- Title: &empty,
- Meta: map[string]interface{}{
- "bitrise.io.addons.optional.2": []interface{}{
- map[string]interface{}{
- "addon_id": "addons-testing",
- },
- },
- "bitrise.io.addons.required": []interface{}{
- map[string]interface{}{
- "addon_id": "addons-testing",
- "addon_options": map[string]interface{}{
- "required": true,
- "title": "Testing Addon",
- },
- "addon_params": "--token TOKEN",
- },
- map[string]interface{}{
- "addon_id": "addons-ship",
- "addon_options": map[string]interface{}{
- "required": true,
- "title": "Ship Addon",
- },
- "addon_params": "--token TOKEN",
- },
- },
- },
- Summary: &empty,
- Description: &empty,
- Website: &empty,
- SourceCodeURL: &empty,
- SupportURL: &empty,
- IsRequiresAdminUser: &falseBool,
- IsAlwaysRun: &falseBool,
- IsSkippable: &falseBool,
- RunIf: &empty,
- Timeout: &zero,
- },
- wantErr: false,
- },
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- got, err := parseStepModel(tt.bytes, tt.validate)
- if (err != nil) != tt.wantErr {
- t.Errorf("parseStepModel() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("parseStepModel() = %+v, want %v,\n Diff: %s", got, tt.want, cmp.Diff(got, tt.want))
- }
- })
- }
-}
-
-const stepDefinitionMetaFieldOnly = `
-meta:
- bitrise.io.addons.required:
- - addon_id: "addons-testing"
- addon_params: "--token TOKEN"
- addon_options:
- required: true
- title: "Testing Addon"
- - addon_id: "addons-ship"
- addon_params: "--token TOKEN"
- addon_options:
- required: true
- title: "Ship Addon"
- bitrise.io.addons.optional.2: [{"addon_id":"addons-testing"}]
-`
diff --git a/vendor/github.com/bitrise-io/stepman/version/version.go b/vendor/github.com/bitrise-io/stepman/version/version.go
index 179147e1d..dc9b82f3d 100644
--- a/vendor/github.com/bitrise-io/stepman/version/version.go
+++ b/vendor/github.com/bitrise-io/stepman/version/version.go
@@ -1,4 +1,4 @@
package version
// VERSION ...
-const VERSION = "0.11.6"
+const VERSION = "0.11.7"
diff --git a/vendor/github.com/davecgh/go-spew/.gitignore b/vendor/github.com/davecgh/go-spew/.gitignore
deleted file mode 100644
index 00268614f..000000000
--- a/vendor/github.com/davecgh/go-spew/.gitignore
+++ /dev/null
@@ -1,22 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
diff --git a/vendor/github.com/davecgh/go-spew/.travis.yml b/vendor/github.com/davecgh/go-spew/.travis.yml
deleted file mode 100644
index 1f4cbf542..000000000
--- a/vendor/github.com/davecgh/go-spew/.travis.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-language: go
-go_import_path: github.com/davecgh/go-spew
-go:
- - 1.6.x
- - 1.7.x
- - 1.8.x
- - 1.9.x
- - 1.10.x
- - tip
-sudo: false
-install:
- - go get -v github.com/alecthomas/gometalinter
- - gometalinter --install
-script:
- - export PATH=$PATH:$HOME/gopath/bin
- - export GORACE="halt_on_error=1"
- - test -z "$(gometalinter --disable-all
- --enable=gofmt
- --enable=golint
- --enable=vet
- --enable=gosimple
- --enable=unconvert
- --deadline=4m ./spew | tee /dev/stderr)"
- - go test -v -race -tags safe ./spew
- - go test -v -race -tags testcgo ./spew -covermode=atomic -coverprofile=profile.cov
-after_success:
- - go get -v github.com/mattn/goveralls
- - goveralls -coverprofile=profile.cov -service=travis-ci
diff --git a/vendor/github.com/davecgh/go-spew/README.md b/vendor/github.com/davecgh/go-spew/README.md
deleted file mode 100644
index f6ed02c3b..000000000
--- a/vendor/github.com/davecgh/go-spew/README.md
+++ /dev/null
@@ -1,201 +0,0 @@
-go-spew
-=======
-
-[![Build Status](https://img.shields.io/travis/davecgh/go-spew.svg)](https://travis-ci.org/davecgh/go-spew)
-[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org)
-[![Coverage Status](https://img.shields.io/coveralls/davecgh/go-spew.svg)](https://coveralls.io/r/davecgh/go-spew?branch=master)
-
-Go-spew implements a deep pretty printer for Go data structures to aid in
-debugging. A comprehensive suite of tests with 100% test coverage is provided
-to ensure proper functionality. See `test_coverage.txt` for the gocov coverage
-report. Go-spew is licensed under the liberal ISC license, so it may be used in
-open source or commercial projects.
-
-If you're interested in reading about how this package came to life and some
-of the challenges involved in providing a deep pretty printer, there is a blog
-post about it
-[here](https://web.archive.org/web/20160304013555/https://blog.cyphertite.com/go-spew-a-journey-into-dumping-go-data-structures/).
-
-## Documentation
-
-[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/davecgh/go-spew/spew)
-
-Full `go doc` style documentation for the project can be viewed online without
-installing this package by using the excellent GoDoc site here:
-http://godoc.org/github.com/davecgh/go-spew/spew
-
-You can also view the documentation locally once the package is installed with
-the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to
-http://localhost:6060/pkg/github.com/davecgh/go-spew/spew
-
-## Installation
-
-```bash
-$ go get -u github.com/davecgh/go-spew/spew
-```
-
-## Quick Start
-
-Add this import line to the file you're working in:
-
-```Go
-import "github.com/davecgh/go-spew/spew"
-```
-
-To dump a variable with full newlines, indentation, type, and pointer
-information use Dump, Fdump, or Sdump:
-
-```Go
-spew.Dump(myVar1, myVar2, ...)
-spew.Fdump(someWriter, myVar1, myVar2, ...)
-str := spew.Sdump(myVar1, myVar2, ...)
-```
-
-Alternatively, if you would prefer to use format strings with a compacted inline
-printing style, use the convenience wrappers Printf, Fprintf, etc with %v (most
-compact), %+v (adds pointer addresses), %#v (adds types), or %#+v (adds types
-and pointer addresses):
-
-```Go
-spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2)
-spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
-spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2)
-spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
-```
-
-## Debugging a Web Application Example
-
-Here is an example of how you can use `spew.Sdump()` to help debug a web application. Please be sure to wrap your output using the `html.EscapeString()` function for safety reasons. You should also only use this debugging technique in a development environment, never in production.
-
-```Go
-package main
-
-import (
- "fmt"
- "html"
- "net/http"
-
- "github.com/davecgh/go-spew/spew"
-)
-
-func handler(w http.ResponseWriter, r *http.Request) {
- w.Header().Set("Content-Type", "text/html")
- fmt.Fprintf(w, "Hi there, %s!", r.URL.Path[1:])
- fmt.Fprintf(w, "")
-}
-
-func main() {
- http.HandleFunc("/", handler)
- http.ListenAndServe(":8080", nil)
-}
-```
-
-## Sample Dump Output
-
-```
-(main.Foo) {
- unexportedField: (*main.Bar)(0xf84002e210)({
- flag: (main.Flag) flagTwo,
- data: (uintptr)
- }),
- ExportedField: (map[interface {}]interface {}) {
- (string) "one": (bool) true
- }
-}
-([]uint8) {
- 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... |
- 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0|
- 00000020 31 32 |12|
-}
-```
-
-## Sample Formatter Output
-
-Double pointer to a uint8:
-```
- %v: <**>5
- %+v: <**>(0xf8400420d0->0xf8400420c8)5
- %#v: (**uint8)5
- %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5
-```
-
-Pointer to circular struct with a uint8 field and a pointer to itself:
-```
- %v: <*>{1 <*>}
- %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)}
- %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)}
- %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)}
-```
-
-## Configuration Options
-
-Configuration of spew is handled by fields in the ConfigState type. For
-convenience, all of the top-level functions use a global state available via the
-spew.Config global.
-
-It is also possible to create a ConfigState instance that provides methods
-equivalent to the top-level functions. This allows concurrent configuration
-options. See the ConfigState documentation for more details.
-
-```
-* Indent
- String to use for each indentation level for Dump functions.
- It is a single space by default. A popular alternative is "\t".
-
-* MaxDepth
- Maximum number of levels to descend into nested data structures.
- There is no limit by default.
-
-* DisableMethods
- Disables invocation of error and Stringer interface methods.
- Method invocation is enabled by default.
-
-* DisablePointerMethods
- Disables invocation of error and Stringer interface methods on types
- which only accept pointer receivers from non-pointer variables. This option
- relies on access to the unsafe package, so it will not have any effect when
- running in environments without access to the unsafe package such as Google
- App Engine or with the "safe" build tag specified.
- Pointer method invocation is enabled by default.
-
-* DisablePointerAddresses
- DisablePointerAddresses specifies whether to disable the printing of
- pointer addresses. This is useful when diffing data structures in tests.
-
-* DisableCapacities
- DisableCapacities specifies whether to disable the printing of capacities
- for arrays, slices, maps and channels. This is useful when diffing data
- structures in tests.
-
-* ContinueOnMethod
- Enables recursion into types after invoking error and Stringer interface
- methods. Recursion after method invocation is disabled by default.
-
-* SortKeys
- Specifies map keys should be sorted before being printed. Use
- this to have a more deterministic, diffable output. Note that
- only native types (bool, int, uint, floats, uintptr and string)
- and types which implement error or Stringer interfaces are supported,
- with other types sorted according to the reflect.Value.String() output
- which guarantees display stability. Natural map order is used by
- default.
-
-* SpewKeys
- SpewKeys specifies that, as a last resort attempt, map keys should be
- spewed to strings and sorted by those strings. This is only considered
- if SortKeys is true.
-
-```
-
-## Unsafe Package Dependency
-
-This package relies on the unsafe package to perform some of the more advanced
-features, however it also supports a "limited" mode which allows it to work in
-environments where the unsafe package is not available. By default, it will
-operate in this mode on Google App Engine and when compiled with GopherJS. The
-"safe" build tag may also be specified to force the package to build without
-using the unsafe package.
-
-## License
-
-Go-spew is licensed under the [copyfree](http://copyfree.org) ISC License.
diff --git a/vendor/github.com/davecgh/go-spew/cov_report.sh b/vendor/github.com/davecgh/go-spew/cov_report.sh
deleted file mode 100644
index 9579497e4..000000000
--- a/vendor/github.com/davecgh/go-spew/cov_report.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-# This script uses gocov to generate a test coverage report.
-# The gocov tool my be obtained with the following command:
-# go get github.com/axw/gocov/gocov
-#
-# It will be installed to $GOPATH/bin, so ensure that location is in your $PATH.
-
-# Check for gocov.
-if ! type gocov >/dev/null 2>&1; then
- echo >&2 "This script requires the gocov tool."
- echo >&2 "You may obtain it with the following command:"
- echo >&2 "go get github.com/axw/gocov/gocov"
- exit 1
-fi
-
-# Only run the cgo tests if gcc is installed.
-if type gcc >/dev/null 2>&1; then
- (cd spew && gocov test -tags testcgo | gocov report)
-else
- (cd spew && gocov test | gocov report)
-fi
diff --git a/vendor/github.com/davecgh/go-spew/spew/common_test.go b/vendor/github.com/davecgh/go-spew/spew/common_test.go
deleted file mode 100644
index 0f5ce47dc..000000000
--- a/vendor/github.com/davecgh/go-spew/spew/common_test.go
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew_test
-
-import (
- "fmt"
- "reflect"
- "testing"
-
- "github.com/davecgh/go-spew/spew"
-)
-
-// custom type to test Stinger interface on non-pointer receiver.
-type stringer string
-
-// String implements the Stringer interface for testing invocation of custom
-// stringers on types with non-pointer receivers.
-func (s stringer) String() string {
- return "stringer " + string(s)
-}
-
-// custom type to test Stinger interface on pointer receiver.
-type pstringer string
-
-// String implements the Stringer interface for testing invocation of custom
-// stringers on types with only pointer receivers.
-func (s *pstringer) String() string {
- return "stringer " + string(*s)
-}
-
-// xref1 and xref2 are cross referencing structs for testing circular reference
-// detection.
-type xref1 struct {
- ps2 *xref2
-}
-type xref2 struct {
- ps1 *xref1
-}
-
-// indirCir1, indirCir2, and indirCir3 are used to generate an indirect circular
-// reference for testing detection.
-type indirCir1 struct {
- ps2 *indirCir2
-}
-type indirCir2 struct {
- ps3 *indirCir3
-}
-type indirCir3 struct {
- ps1 *indirCir1
-}
-
-// embed is used to test embedded structures.
-type embed struct {
- a string
-}
-
-// embedwrap is used to test embedded structures.
-type embedwrap struct {
- *embed
- e *embed
-}
-
-// panicer is used to intentionally cause a panic for testing spew properly
-// handles them
-type panicer int
-
-func (p panicer) String() string {
- panic("test panic")
-}
-
-// customError is used to test custom error interface invocation.
-type customError int
-
-func (e customError) Error() string {
- return fmt.Sprintf("error: %d", int(e))
-}
-
-// stringizeWants converts a slice of wanted test output into a format suitable
-// for a test error message.
-func stringizeWants(wants []string) string {
- s := ""
- for i, want := range wants {
- if i > 0 {
- s += fmt.Sprintf("want%d: %s", i+1, want)
- } else {
- s += "want: " + want
- }
- }
- return s
-}
-
-// testFailed returns whether or not a test failed by checking if the result
-// of the test is in the slice of wanted strings.
-func testFailed(result string, wants []string) bool {
- for _, want := range wants {
- if result == want {
- return false
- }
- }
- return true
-}
-
-type sortableStruct struct {
- x int
-}
-
-func (ss sortableStruct) String() string {
- return fmt.Sprintf("ss.%d", ss.x)
-}
-
-type unsortableStruct struct {
- x int
-}
-
-type sortTestCase struct {
- input []reflect.Value
- expected []reflect.Value
-}
-
-func helpTestSortValues(tests []sortTestCase, cs *spew.ConfigState, t *testing.T) {
- getInterfaces := func(values []reflect.Value) []interface{} {
- interfaces := []interface{}{}
- for _, v := range values {
- interfaces = append(interfaces, v.Interface())
- }
- return interfaces
- }
-
- for _, test := range tests {
- spew.SortValues(test.input, cs)
- // reflect.DeepEqual cannot really make sense of reflect.Value,
- // probably because of all the pointer tricks. For instance,
- // v(2.0) != v(2.0) on a 32-bits system. Turn them into interface{}
- // instead.
- input := getInterfaces(test.input)
- expected := getInterfaces(test.expected)
- if !reflect.DeepEqual(input, expected) {
- t.Errorf("Sort mismatch:\n %v != %v", input, expected)
- }
- }
-}
-
-// TestSortValues ensures the sort functionality for relect.Value based sorting
-// works as intended.
-func TestSortValues(t *testing.T) {
- v := reflect.ValueOf
-
- a := v("a")
- b := v("b")
- c := v("c")
- embedA := v(embed{"a"})
- embedB := v(embed{"b"})
- embedC := v(embed{"c"})
- tests := []sortTestCase{
- // No values.
- {
- []reflect.Value{},
- []reflect.Value{},
- },
- // Bools.
- {
- []reflect.Value{v(false), v(true), v(false)},
- []reflect.Value{v(false), v(false), v(true)},
- },
- // Ints.
- {
- []reflect.Value{v(2), v(1), v(3)},
- []reflect.Value{v(1), v(2), v(3)},
- },
- // Uints.
- {
- []reflect.Value{v(uint8(2)), v(uint8(1)), v(uint8(3))},
- []reflect.Value{v(uint8(1)), v(uint8(2)), v(uint8(3))},
- },
- // Floats.
- {
- []reflect.Value{v(2.0), v(1.0), v(3.0)},
- []reflect.Value{v(1.0), v(2.0), v(3.0)},
- },
- // Strings.
- {
- []reflect.Value{b, a, c},
- []reflect.Value{a, b, c},
- },
- // Array
- {
- []reflect.Value{v([3]int{3, 2, 1}), v([3]int{1, 3, 2}), v([3]int{1, 2, 3})},
- []reflect.Value{v([3]int{1, 2, 3}), v([3]int{1, 3, 2}), v([3]int{3, 2, 1})},
- },
- // Uintptrs.
- {
- []reflect.Value{v(uintptr(2)), v(uintptr(1)), v(uintptr(3))},
- []reflect.Value{v(uintptr(1)), v(uintptr(2)), v(uintptr(3))},
- },
- // SortableStructs.
- {
- // Note: not sorted - DisableMethods is set.
- []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})},
- []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})},
- },
- // UnsortableStructs.
- {
- // Note: not sorted - SpewKeys is false.
- []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},
- []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},
- },
- // Invalid.
- {
- []reflect.Value{embedB, embedA, embedC},
- []reflect.Value{embedB, embedA, embedC},
- },
- }
- cs := spew.ConfigState{DisableMethods: true, SpewKeys: false}
- helpTestSortValues(tests, &cs, t)
-}
-
-// TestSortValuesWithMethods ensures the sort functionality for relect.Value
-// based sorting works as intended when using string methods.
-func TestSortValuesWithMethods(t *testing.T) {
- v := reflect.ValueOf
-
- a := v("a")
- b := v("b")
- c := v("c")
- tests := []sortTestCase{
- // Ints.
- {
- []reflect.Value{v(2), v(1), v(3)},
- []reflect.Value{v(1), v(2), v(3)},
- },
- // Strings.
- {
- []reflect.Value{b, a, c},
- []reflect.Value{a, b, c},
- },
- // SortableStructs.
- {
- []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})},
- []reflect.Value{v(sortableStruct{1}), v(sortableStruct{2}), v(sortableStruct{3})},
- },
- // UnsortableStructs.
- {
- // Note: not sorted - SpewKeys is false.
- []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},
- []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},
- },
- }
- cs := spew.ConfigState{DisableMethods: false, SpewKeys: false}
- helpTestSortValues(tests, &cs, t)
-}
-
-// TestSortValuesWithSpew ensures the sort functionality for relect.Value
-// based sorting works as intended when using spew to stringify keys.
-func TestSortValuesWithSpew(t *testing.T) {
- v := reflect.ValueOf
-
- a := v("a")
- b := v("b")
- c := v("c")
- tests := []sortTestCase{
- // Ints.
- {
- []reflect.Value{v(2), v(1), v(3)},
- []reflect.Value{v(1), v(2), v(3)},
- },
- // Strings.
- {
- []reflect.Value{b, a, c},
- []reflect.Value{a, b, c},
- },
- // SortableStructs.
- {
- []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})},
- []reflect.Value{v(sortableStruct{1}), v(sortableStruct{2}), v(sortableStruct{3})},
- },
- // UnsortableStructs.
- {
- []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})},
- []reflect.Value{v(unsortableStruct{1}), v(unsortableStruct{2}), v(unsortableStruct{3})},
- },
- }
- cs := spew.ConfigState{DisableMethods: true, SpewKeys: true}
- helpTestSortValues(tests, &cs, t)
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/dump_test.go b/vendor/github.com/davecgh/go-spew/spew/dump_test.go
deleted file mode 100644
index 4a31a2ee3..000000000
--- a/vendor/github.com/davecgh/go-spew/spew/dump_test.go
+++ /dev/null
@@ -1,1042 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
-Test Summary:
-NOTE: For each test, a nil pointer, a single pointer and double pointer to the
-base test element are also tested to ensure proper indirection across all types.
-
-- Max int8, int16, int32, int64, int
-- Max uint8, uint16, uint32, uint64, uint
-- Boolean true and false
-- Standard complex64 and complex128
-- Array containing standard ints
-- Array containing type with custom formatter on pointer receiver only
-- Array containing interfaces
-- Array containing bytes
-- Slice containing standard float32 values
-- Slice containing type with custom formatter on pointer receiver only
-- Slice containing interfaces
-- Slice containing bytes
-- Nil slice
-- Standard string
-- Nil interface
-- Sub-interface
-- Map with string keys and int vals
-- Map with custom formatter type on pointer receiver only keys and vals
-- Map with interface keys and values
-- Map with nil interface value
-- Struct with primitives
-- Struct that contains another struct
-- Struct that contains custom type with Stringer pointer interface via both
- exported and unexported fields
-- Struct that contains embedded struct and field to same struct
-- Uintptr to 0 (null pointer)
-- Uintptr address of real variable
-- Unsafe.Pointer to 0 (null pointer)
-- Unsafe.Pointer to address of real variable
-- Nil channel
-- Standard int channel
-- Function with no params and no returns
-- Function with param and no returns
-- Function with multiple params and multiple returns
-- Struct that is circular through self referencing
-- Structs that are circular through cross referencing
-- Structs that are indirectly circular
-- Type that panics in its Stringer interface
-*/
-
-package spew_test
-
-import (
- "bytes"
- "fmt"
- "testing"
- "unsafe"
-
- "github.com/davecgh/go-spew/spew"
-)
-
-// dumpTest is used to describe a test to be performed against the Dump method.
-type dumpTest struct {
- in interface{}
- wants []string
-}
-
-// dumpTests houses all of the tests to be performed against the Dump method.
-var dumpTests = make([]dumpTest, 0)
-
-// addDumpTest is a helper method to append the passed input and desired result
-// to dumpTests
-func addDumpTest(in interface{}, wants ...string) {
- test := dumpTest{in, wants}
- dumpTests = append(dumpTests, test)
-}
-
-func addIntDumpTests() {
- // Max int8.
- v := int8(127)
- nv := (*int8)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "int8"
- vs := "127"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Max int16.
- v2 := int16(32767)
- nv2 := (*int16)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "int16"
- v2s := "32767"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-
- // Max int32.
- v3 := int32(2147483647)
- nv3 := (*int32)(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "int32"
- v3s := "2147483647"
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n")
- addDumpTest(nv3, "(*"+v3t+")()\n")
-
- // Max int64.
- v4 := int64(9223372036854775807)
- nv4 := (*int64)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "int64"
- v4s := "9223372036854775807"
- addDumpTest(v4, "("+v4t+") "+v4s+"\n")
- addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n")
- addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n")
- addDumpTest(nv4, "(*"+v4t+")()\n")
-
- // Max int.
- v5 := int(2147483647)
- nv5 := (*int)(nil)
- pv5 := &v5
- v5Addr := fmt.Sprintf("%p", pv5)
- pv5Addr := fmt.Sprintf("%p", &pv5)
- v5t := "int"
- v5s := "2147483647"
- addDumpTest(v5, "("+v5t+") "+v5s+"\n")
- addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n")
- addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n")
- addDumpTest(nv5, "(*"+v5t+")()\n")
-}
-
-func addUintDumpTests() {
- // Max uint8.
- v := uint8(255)
- nv := (*uint8)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "uint8"
- vs := "255"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Max uint16.
- v2 := uint16(65535)
- nv2 := (*uint16)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "uint16"
- v2s := "65535"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-
- // Max uint32.
- v3 := uint32(4294967295)
- nv3 := (*uint32)(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "uint32"
- v3s := "4294967295"
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n")
- addDumpTest(nv3, "(*"+v3t+")()\n")
-
- // Max uint64.
- v4 := uint64(18446744073709551615)
- nv4 := (*uint64)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "uint64"
- v4s := "18446744073709551615"
- addDumpTest(v4, "("+v4t+") "+v4s+"\n")
- addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n")
- addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n")
- addDumpTest(nv4, "(*"+v4t+")()\n")
-
- // Max uint.
- v5 := uint(4294967295)
- nv5 := (*uint)(nil)
- pv5 := &v5
- v5Addr := fmt.Sprintf("%p", pv5)
- pv5Addr := fmt.Sprintf("%p", &pv5)
- v5t := "uint"
- v5s := "4294967295"
- addDumpTest(v5, "("+v5t+") "+v5s+"\n")
- addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n")
- addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n")
- addDumpTest(nv5, "(*"+v5t+")()\n")
-}
-
-func addBoolDumpTests() {
- // Boolean true.
- v := bool(true)
- nv := (*bool)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "bool"
- vs := "true"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Boolean false.
- v2 := bool(false)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "bool"
- v2s := "false"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
-}
-
-func addFloatDumpTests() {
- // Standard float32.
- v := float32(3.1415)
- nv := (*float32)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "float32"
- vs := "3.1415"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Standard float64.
- v2 := float64(3.1415926)
- nv2 := (*float64)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "float64"
- v2s := "3.1415926"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-}
-
-func addComplexDumpTests() {
- // Standard complex64.
- v := complex(float32(6), -2)
- nv := (*complex64)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "complex64"
- vs := "(6-2i)"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Standard complex128.
- v2 := complex(float64(-6), 2)
- nv2 := (*complex128)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "complex128"
- v2s := "(-6+2i)"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-}
-
-func addArrayDumpTests() {
- // Array containing standard ints.
- v := [3]int{1, 2, 3}
- vLen := fmt.Sprintf("%d", len(v))
- vCap := fmt.Sprintf("%d", cap(v))
- nv := (*[3]int)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "int"
- vs := "(len=" + vLen + " cap=" + vCap + ") {\n (" + vt + ") 1,\n (" +
- vt + ") 2,\n (" + vt + ") 3\n}"
- addDumpTest(v, "([3]"+vt+") "+vs+"\n")
- addDumpTest(pv, "(*[3]"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**[3]"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*[3]"+vt+")()\n")
-
- // Array containing type with custom formatter on pointer receiver only.
- v2i0 := pstringer("1")
- v2i1 := pstringer("2")
- v2i2 := pstringer("3")
- v2 := [3]pstringer{v2i0, v2i1, v2i2}
- v2i0Len := fmt.Sprintf("%d", len(v2i0))
- v2i1Len := fmt.Sprintf("%d", len(v2i1))
- v2i2Len := fmt.Sprintf("%d", len(v2i2))
- v2Len := fmt.Sprintf("%d", len(v2))
- v2Cap := fmt.Sprintf("%d", cap(v2))
- nv2 := (*[3]pstringer)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "spew_test.pstringer"
- v2sp := "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t +
- ") (len=" + v2i0Len + ") stringer 1,\n (" + v2t +
- ") (len=" + v2i1Len + ") stringer 2,\n (" + v2t +
- ") (len=" + v2i2Len + ") " + "stringer 3\n}"
- v2s := v2sp
- if spew.UnsafeDisabled {
- v2s = "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t +
- ") (len=" + v2i0Len + ") \"1\",\n (" + v2t + ") (len=" +
- v2i1Len + ") \"2\",\n (" + v2t + ") (len=" + v2i2Len +
- ") " + "\"3\"\n}"
- }
- addDumpTest(v2, "([3]"+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*[3]"+v2t+")("+v2Addr+")("+v2sp+")\n")
- addDumpTest(&pv2, "(**[3]"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2sp+")\n")
- addDumpTest(nv2, "(*[3]"+v2t+")()\n")
-
- // Array containing interfaces.
- v3i0 := "one"
- v3 := [3]interface{}{v3i0, int(2), uint(3)}
- v3i0Len := fmt.Sprintf("%d", len(v3i0))
- v3Len := fmt.Sprintf("%d", len(v3))
- v3Cap := fmt.Sprintf("%d", cap(v3))
- nv3 := (*[3]interface{})(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "[3]interface {}"
- v3t2 := "string"
- v3t3 := "int"
- v3t4 := "uint"
- v3s := "(len=" + v3Len + " cap=" + v3Cap + ") {\n (" + v3t2 + ") " +
- "(len=" + v3i0Len + ") \"one\",\n (" + v3t3 + ") 2,\n (" +
- v3t4 + ") 3\n}"
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n")
- addDumpTest(nv3, "(*"+v3t+")()\n")
-
- // Array containing bytes.
- v4 := [34]byte{
- 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
- 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
- 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
- 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
- 0x31, 0x32,
- }
- v4Len := fmt.Sprintf("%d", len(v4))
- v4Cap := fmt.Sprintf("%d", cap(v4))
- nv4 := (*[34]byte)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "[34]uint8"
- v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " +
- "{\n 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20" +
- " |............... |\n" +
- " 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30" +
- " |!\"#$%&'()*+,-./0|\n" +
- " 00000020 31 32 " +
- " |12|\n}"
- addDumpTest(v4, "("+v4t+") "+v4s+"\n")
- addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n")
- addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n")
- addDumpTest(nv4, "(*"+v4t+")()\n")
-}
-
-func addSliceDumpTests() {
- // Slice containing standard float32 values.
- v := []float32{3.14, 6.28, 12.56}
- vLen := fmt.Sprintf("%d", len(v))
- vCap := fmt.Sprintf("%d", cap(v))
- nv := (*[]float32)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "float32"
- vs := "(len=" + vLen + " cap=" + vCap + ") {\n (" + vt + ") 3.14,\n (" +
- vt + ") 6.28,\n (" + vt + ") 12.56\n}"
- addDumpTest(v, "([]"+vt+") "+vs+"\n")
- addDumpTest(pv, "(*[]"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**[]"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*[]"+vt+")()\n")
-
- // Slice containing type with custom formatter on pointer receiver only.
- v2i0 := pstringer("1")
- v2i1 := pstringer("2")
- v2i2 := pstringer("3")
- v2 := []pstringer{v2i0, v2i1, v2i2}
- v2i0Len := fmt.Sprintf("%d", len(v2i0))
- v2i1Len := fmt.Sprintf("%d", len(v2i1))
- v2i2Len := fmt.Sprintf("%d", len(v2i2))
- v2Len := fmt.Sprintf("%d", len(v2))
- v2Cap := fmt.Sprintf("%d", cap(v2))
- nv2 := (*[]pstringer)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "spew_test.pstringer"
- v2s := "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t + ") (len=" +
- v2i0Len + ") stringer 1,\n (" + v2t + ") (len=" + v2i1Len +
- ") stringer 2,\n (" + v2t + ") (len=" + v2i2Len + ") " +
- "stringer 3\n}"
- addDumpTest(v2, "([]"+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*[]"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**[]"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*[]"+v2t+")()\n")
-
- // Slice containing interfaces.
- v3i0 := "one"
- v3 := []interface{}{v3i0, int(2), uint(3), nil}
- v3i0Len := fmt.Sprintf("%d", len(v3i0))
- v3Len := fmt.Sprintf("%d", len(v3))
- v3Cap := fmt.Sprintf("%d", cap(v3))
- nv3 := (*[]interface{})(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "[]interface {}"
- v3t2 := "string"
- v3t3 := "int"
- v3t4 := "uint"
- v3t5 := "interface {}"
- v3s := "(len=" + v3Len + " cap=" + v3Cap + ") {\n (" + v3t2 + ") " +
- "(len=" + v3i0Len + ") \"one\",\n (" + v3t3 + ") 2,\n (" +
- v3t4 + ") 3,\n (" + v3t5 + ") \n}"
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n")
- addDumpTest(nv3, "(*"+v3t+")()\n")
-
- // Slice containing bytes.
- v4 := []byte{
- 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
- 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
- 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
- 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
- 0x31, 0x32,
- }
- v4Len := fmt.Sprintf("%d", len(v4))
- v4Cap := fmt.Sprintf("%d", cap(v4))
- nv4 := (*[]byte)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "[]uint8"
- v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " +
- "{\n 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20" +
- " |............... |\n" +
- " 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30" +
- " |!\"#$%&'()*+,-./0|\n" +
- " 00000020 31 32 " +
- " |12|\n}"
- addDumpTest(v4, "("+v4t+") "+v4s+"\n")
- addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n")
- addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n")
- addDumpTest(nv4, "(*"+v4t+")()\n")
-
- // Nil slice.
- v5 := []int(nil)
- nv5 := (*[]int)(nil)
- pv5 := &v5
- v5Addr := fmt.Sprintf("%p", pv5)
- pv5Addr := fmt.Sprintf("%p", &pv5)
- v5t := "[]int"
- v5s := ""
- addDumpTest(v5, "("+v5t+") "+v5s+"\n")
- addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n")
- addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n")
- addDumpTest(nv5, "(*"+v5t+")()\n")
-}
-
-func addStringDumpTests() {
- // Standard string.
- v := "test"
- vLen := fmt.Sprintf("%d", len(v))
- nv := (*string)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "string"
- vs := "(len=" + vLen + ") \"test\""
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-}
-
-func addInterfaceDumpTests() {
- // Nil interface.
- var v interface{}
- nv := (*interface{})(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "interface {}"
- vs := ""
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Sub-interface.
- v2 := interface{}(uint16(65535))
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "uint16"
- v2s := "65535"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
-}
-
-func addMapDumpTests() {
- // Map with string keys and int vals.
- k := "one"
- kk := "two"
- m := map[string]int{k: 1, kk: 2}
- klen := fmt.Sprintf("%d", len(k)) // not kLen to shut golint up
- kkLen := fmt.Sprintf("%d", len(kk))
- mLen := fmt.Sprintf("%d", len(m))
- nilMap := map[string]int(nil)
- nm := (*map[string]int)(nil)
- pm := &m
- mAddr := fmt.Sprintf("%p", pm)
- pmAddr := fmt.Sprintf("%p", &pm)
- mt := "map[string]int"
- mt1 := "string"
- mt2 := "int"
- ms := "(len=" + mLen + ") {\n (" + mt1 + ") (len=" + klen + ") " +
- "\"one\": (" + mt2 + ") 1,\n (" + mt1 + ") (len=" + kkLen +
- ") \"two\": (" + mt2 + ") 2\n}"
- ms2 := "(len=" + mLen + ") {\n (" + mt1 + ") (len=" + kkLen + ") " +
- "\"two\": (" + mt2 + ") 2,\n (" + mt1 + ") (len=" + klen +
- ") \"one\": (" + mt2 + ") 1\n}"
- addDumpTest(m, "("+mt+") "+ms+"\n", "("+mt+") "+ms2+"\n")
- addDumpTest(pm, "(*"+mt+")("+mAddr+")("+ms+")\n",
- "(*"+mt+")("+mAddr+")("+ms2+")\n")
- addDumpTest(&pm, "(**"+mt+")("+pmAddr+"->"+mAddr+")("+ms+")\n",
- "(**"+mt+")("+pmAddr+"->"+mAddr+")("+ms2+")\n")
- addDumpTest(nm, "(*"+mt+")()\n")
- addDumpTest(nilMap, "("+mt+") \n")
-
- // Map with custom formatter type on pointer receiver only keys and vals.
- k2 := pstringer("one")
- v2 := pstringer("1")
- m2 := map[pstringer]pstringer{k2: v2}
- k2Len := fmt.Sprintf("%d", len(k2))
- v2Len := fmt.Sprintf("%d", len(v2))
- m2Len := fmt.Sprintf("%d", len(m2))
- nilMap2 := map[pstringer]pstringer(nil)
- nm2 := (*map[pstringer]pstringer)(nil)
- pm2 := &m2
- m2Addr := fmt.Sprintf("%p", pm2)
- pm2Addr := fmt.Sprintf("%p", &pm2)
- m2t := "map[spew_test.pstringer]spew_test.pstringer"
- m2t1 := "spew_test.pstringer"
- m2t2 := "spew_test.pstringer"
- m2s := "(len=" + m2Len + ") {\n (" + m2t1 + ") (len=" + k2Len + ") " +
- "stringer one: (" + m2t2 + ") (len=" + v2Len + ") stringer 1\n}"
- if spew.UnsafeDisabled {
- m2s = "(len=" + m2Len + ") {\n (" + m2t1 + ") (len=" + k2Len +
- ") " + "\"one\": (" + m2t2 + ") (len=" + v2Len +
- ") \"1\"\n}"
- }
- addDumpTest(m2, "("+m2t+") "+m2s+"\n")
- addDumpTest(pm2, "(*"+m2t+")("+m2Addr+")("+m2s+")\n")
- addDumpTest(&pm2, "(**"+m2t+")("+pm2Addr+"->"+m2Addr+")("+m2s+")\n")
- addDumpTest(nm2, "(*"+m2t+")()\n")
- addDumpTest(nilMap2, "("+m2t+") \n")
-
- // Map with interface keys and values.
- k3 := "one"
- k3Len := fmt.Sprintf("%d", len(k3))
- m3 := map[interface{}]interface{}{k3: 1}
- m3Len := fmt.Sprintf("%d", len(m3))
- nilMap3 := map[interface{}]interface{}(nil)
- nm3 := (*map[interface{}]interface{})(nil)
- pm3 := &m3
- m3Addr := fmt.Sprintf("%p", pm3)
- pm3Addr := fmt.Sprintf("%p", &pm3)
- m3t := "map[interface {}]interface {}"
- m3t1 := "string"
- m3t2 := "int"
- m3s := "(len=" + m3Len + ") {\n (" + m3t1 + ") (len=" + k3Len + ") " +
- "\"one\": (" + m3t2 + ") 1\n}"
- addDumpTest(m3, "("+m3t+") "+m3s+"\n")
- addDumpTest(pm3, "(*"+m3t+")("+m3Addr+")("+m3s+")\n")
- addDumpTest(&pm3, "(**"+m3t+")("+pm3Addr+"->"+m3Addr+")("+m3s+")\n")
- addDumpTest(nm3, "(*"+m3t+")()\n")
- addDumpTest(nilMap3, "("+m3t+") \n")
-
- // Map with nil interface value.
- k4 := "nil"
- k4Len := fmt.Sprintf("%d", len(k4))
- m4 := map[string]interface{}{k4: nil}
- m4Len := fmt.Sprintf("%d", len(m4))
- nilMap4 := map[string]interface{}(nil)
- nm4 := (*map[string]interface{})(nil)
- pm4 := &m4
- m4Addr := fmt.Sprintf("%p", pm4)
- pm4Addr := fmt.Sprintf("%p", &pm4)
- m4t := "map[string]interface {}"
- m4t1 := "string"
- m4t2 := "interface {}"
- m4s := "(len=" + m4Len + ") {\n (" + m4t1 + ") (len=" + k4Len + ")" +
- " \"nil\": (" + m4t2 + ") \n}"
- addDumpTest(m4, "("+m4t+") "+m4s+"\n")
- addDumpTest(pm4, "(*"+m4t+")("+m4Addr+")("+m4s+")\n")
- addDumpTest(&pm4, "(**"+m4t+")("+pm4Addr+"->"+m4Addr+")("+m4s+")\n")
- addDumpTest(nm4, "(*"+m4t+")()\n")
- addDumpTest(nilMap4, "("+m4t+") \n")
-}
-
-func addStructDumpTests() {
- // Struct with primitives.
- type s1 struct {
- a int8
- b uint8
- }
- v := s1{127, 255}
- nv := (*s1)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "spew_test.s1"
- vt2 := "int8"
- vt3 := "uint8"
- vs := "{\n a: (" + vt2 + ") 127,\n b: (" + vt3 + ") 255\n}"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Struct that contains another struct.
- type s2 struct {
- s1 s1
- b bool
- }
- v2 := s2{s1{127, 255}, true}
- nv2 := (*s2)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "spew_test.s2"
- v2t2 := "spew_test.s1"
- v2t3 := "int8"
- v2t4 := "uint8"
- v2t5 := "bool"
- v2s := "{\n s1: (" + v2t2 + ") {\n a: (" + v2t3 + ") 127,\n b: (" +
- v2t4 + ") 255\n },\n b: (" + v2t5 + ") true\n}"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-
- // Struct that contains custom type with Stringer pointer interface via both
- // exported and unexported fields.
- type s3 struct {
- s pstringer
- S pstringer
- }
- v3 := s3{"test", "test2"}
- nv3 := (*s3)(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "spew_test.s3"
- v3t2 := "spew_test.pstringer"
- v3s := "{\n s: (" + v3t2 + ") (len=4) stringer test,\n S: (" + v3t2 +
- ") (len=5) stringer test2\n}"
- v3sp := v3s
- if spew.UnsafeDisabled {
- v3s = "{\n s: (" + v3t2 + ") (len=4) \"test\",\n S: (" +
- v3t2 + ") (len=5) \"test2\"\n}"
- v3sp = "{\n s: (" + v3t2 + ") (len=4) \"test\",\n S: (" +
- v3t2 + ") (len=5) stringer test2\n}"
- }
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3sp+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3sp+")\n")
- addDumpTest(nv3, "(*"+v3t+")()\n")
-
- // Struct that contains embedded struct and field to same struct.
- e := embed{"embedstr"}
- eLen := fmt.Sprintf("%d", len("embedstr"))
- v4 := embedwrap{embed: &e, e: &e}
- nv4 := (*embedwrap)(nil)
- pv4 := &v4
- eAddr := fmt.Sprintf("%p", &e)
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "spew_test.embedwrap"
- v4t2 := "spew_test.embed"
- v4t3 := "string"
- v4s := "{\n embed: (*" + v4t2 + ")(" + eAddr + ")({\n a: (" + v4t3 +
- ") (len=" + eLen + ") \"embedstr\"\n }),\n e: (*" + v4t2 +
- ")(" + eAddr + ")({\n a: (" + v4t3 + ") (len=" + eLen + ")" +
- " \"embedstr\"\n })\n}"
- addDumpTest(v4, "("+v4t+") "+v4s+"\n")
- addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n")
- addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n")
- addDumpTest(nv4, "(*"+v4t+")()\n")
-}
-
-func addUintptrDumpTests() {
- // Null pointer.
- v := uintptr(0)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "uintptr"
- vs := ""
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
-
- // Address of real variable.
- i := 1
- v2 := uintptr(unsafe.Pointer(&i))
- nv2 := (*uintptr)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "uintptr"
- v2s := fmt.Sprintf("%p", &i)
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-}
-
-func addUnsafePointerDumpTests() {
- // Null pointer.
- v := unsafe.Pointer(nil)
- nv := (*unsafe.Pointer)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "unsafe.Pointer"
- vs := ""
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Address of real variable.
- i := 1
- v2 := unsafe.Pointer(&i)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "unsafe.Pointer"
- v2s := fmt.Sprintf("%p", &i)
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-}
-
-func addChanDumpTests() {
- // Nil channel.
- var v chan int
- pv := &v
- nv := (*chan int)(nil)
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "chan int"
- vs := ""
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Real channel.
- v2 := make(chan int)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "chan int"
- v2s := fmt.Sprintf("%p", v2)
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
-}
-
-func addFuncDumpTests() {
- // Function with no params and no returns.
- v := addIntDumpTests
- nv := (*func())(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "func()"
- vs := fmt.Sprintf("%p", v)
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-
- // Function with param and no returns.
- v2 := TestDump
- nv2 := (*func(*testing.T))(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "func(*testing.T)"
- v2s := fmt.Sprintf("%p", v2)
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
- addDumpTest(nv2, "(*"+v2t+")()\n")
-
- // Function with multiple params and multiple returns.
- var v3 = func(i int, s string) (b bool, err error) {
- return true, nil
- }
- nv3 := (*func(int, string) (bool, error))(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "func(int, string) (bool, error)"
- v3s := fmt.Sprintf("%p", v3)
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n")
- addDumpTest(nv3, "(*"+v3t+")()\n")
-}
-
-func addCircularDumpTests() {
- // Struct that is circular through self referencing.
- type circular struct {
- c *circular
- }
- v := circular{nil}
- v.c = &v
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "spew_test.circular"
- vs := "{\n c: (*" + vt + ")(" + vAddr + ")({\n c: (*" + vt + ")(" +
- vAddr + ")()\n })\n}"
- vs2 := "{\n c: (*" + vt + ")(" + vAddr + ")()\n}"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs2+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs2+")\n")
-
- // Structs that are circular through cross referencing.
- v2 := xref1{nil}
- ts2 := xref2{&v2}
- v2.ps2 = &ts2
- pv2 := &v2
- ts2Addr := fmt.Sprintf("%p", &ts2)
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "spew_test.xref1"
- v2t2 := "spew_test.xref2"
- v2s := "{\n ps2: (*" + v2t2 + ")(" + ts2Addr + ")({\n ps1: (*" + v2t +
- ")(" + v2Addr + ")({\n ps2: (*" + v2t2 + ")(" + ts2Addr +
- ")()\n })\n })\n}"
- v2s2 := "{\n ps2: (*" + v2t2 + ")(" + ts2Addr + ")({\n ps1: (*" + v2t +
- ")(" + v2Addr + ")()\n })\n}"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
- addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s2+")\n")
- addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s2+")\n")
-
- // Structs that are indirectly circular.
- v3 := indirCir1{nil}
- tic2 := indirCir2{nil}
- tic3 := indirCir3{&v3}
- tic2.ps3 = &tic3
- v3.ps2 = &tic2
- pv3 := &v3
- tic2Addr := fmt.Sprintf("%p", &tic2)
- tic3Addr := fmt.Sprintf("%p", &tic3)
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "spew_test.indirCir1"
- v3t2 := "spew_test.indirCir2"
- v3t3 := "spew_test.indirCir3"
- v3s := "{\n ps2: (*" + v3t2 + ")(" + tic2Addr + ")({\n ps3: (*" + v3t3 +
- ")(" + tic3Addr + ")({\n ps1: (*" + v3t + ")(" + v3Addr +
- ")({\n ps2: (*" + v3t2 + ")(" + tic2Addr +
- ")()\n })\n })\n })\n}"
- v3s2 := "{\n ps2: (*" + v3t2 + ")(" + tic2Addr + ")({\n ps3: (*" + v3t3 +
- ")(" + tic3Addr + ")({\n ps1: (*" + v3t + ")(" + v3Addr +
- ")()\n })\n })\n}"
- addDumpTest(v3, "("+v3t+") "+v3s+"\n")
- addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s2+")\n")
- addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s2+")\n")
-}
-
-func addPanicDumpTests() {
- // Type that panics in its Stringer interface.
- v := panicer(127)
- nv := (*panicer)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "spew_test.panicer"
- vs := "(PANIC=test panic)127"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-}
-
-func addErrorDumpTests() {
- // Type that has a custom Error interface.
- v := customError(127)
- nv := (*customError)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "spew_test.customError"
- vs := "error: 127"
- addDumpTest(v, "("+vt+") "+vs+"\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
- addDumpTest(nv, "(*"+vt+")()\n")
-}
-
-// TestDump executes all of the tests described by dumpTests.
-func TestDump(t *testing.T) {
- // Setup tests.
- addIntDumpTests()
- addUintDumpTests()
- addBoolDumpTests()
- addFloatDumpTests()
- addComplexDumpTests()
- addArrayDumpTests()
- addSliceDumpTests()
- addStringDumpTests()
- addInterfaceDumpTests()
- addMapDumpTests()
- addStructDumpTests()
- addUintptrDumpTests()
- addUnsafePointerDumpTests()
- addChanDumpTests()
- addFuncDumpTests()
- addCircularDumpTests()
- addPanicDumpTests()
- addErrorDumpTests()
- addCgoDumpTests()
-
- t.Logf("Running %d tests", len(dumpTests))
- for i, test := range dumpTests {
- buf := new(bytes.Buffer)
- spew.Fdump(buf, test.in)
- s := buf.String()
- if testFailed(s, test.wants) {
- t.Errorf("Dump #%d\n got: %s %s", i, s, stringizeWants(test.wants))
- continue
- }
- }
-}
-
-func TestDumpSortedKeys(t *testing.T) {
- cfg := spew.ConfigState{SortKeys: true}
- s := cfg.Sdump(map[int]string{1: "1", 3: "3", 2: "2"})
- expected := "(map[int]string) (len=3) {\n(int) 1: (string) (len=1) " +
- "\"1\",\n(int) 2: (string) (len=1) \"2\",\n(int) 3: (string) " +
- "(len=1) \"3\"\n" +
- "}\n"
- if s != expected {
- t.Errorf("Sorted keys mismatch:\n %v %v", s, expected)
- }
-
- s = cfg.Sdump(map[stringer]int{"1": 1, "3": 3, "2": 2})
- expected = "(map[spew_test.stringer]int) (len=3) {\n" +
- "(spew_test.stringer) (len=1) stringer 1: (int) 1,\n" +
- "(spew_test.stringer) (len=1) stringer 2: (int) 2,\n" +
- "(spew_test.stringer) (len=1) stringer 3: (int) 3\n" +
- "}\n"
- if s != expected {
- t.Errorf("Sorted keys mismatch:\n %v %v", s, expected)
- }
-
- s = cfg.Sdump(map[pstringer]int{pstringer("1"): 1, pstringer("3"): 3, pstringer("2"): 2})
- expected = "(map[spew_test.pstringer]int) (len=3) {\n" +
- "(spew_test.pstringer) (len=1) stringer 1: (int) 1,\n" +
- "(spew_test.pstringer) (len=1) stringer 2: (int) 2,\n" +
- "(spew_test.pstringer) (len=1) stringer 3: (int) 3\n" +
- "}\n"
- if spew.UnsafeDisabled {
- expected = "(map[spew_test.pstringer]int) (len=3) {\n" +
- "(spew_test.pstringer) (len=1) \"1\": (int) 1,\n" +
- "(spew_test.pstringer) (len=1) \"2\": (int) 2,\n" +
- "(spew_test.pstringer) (len=1) \"3\": (int) 3\n" +
- "}\n"
- }
- if s != expected {
- t.Errorf("Sorted keys mismatch:\n %v %v", s, expected)
- }
-
- s = cfg.Sdump(map[customError]int{customError(1): 1, customError(3): 3, customError(2): 2})
- expected = "(map[spew_test.customError]int) (len=3) {\n" +
- "(spew_test.customError) error: 1: (int) 1,\n" +
- "(spew_test.customError) error: 2: (int) 2,\n" +
- "(spew_test.customError) error: 3: (int) 3\n" +
- "}\n"
- if s != expected {
- t.Errorf("Sorted keys mismatch:\n %v %v", s, expected)
- }
-
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go b/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go
deleted file mode 100644
index 108baa55f..000000000
--- a/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (c) 2013-2016 Dave Collins
-//
-// Permission to use, copy, modify, and distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-// NOTE: Due to the following build constraints, this file will only be compiled
-// when both cgo is supported and "-tags testcgo" is added to the go test
-// command line. This means the cgo tests are only added (and hence run) when
-// specifially requested. This configuration is used because spew itself
-// does not require cgo to run even though it does handle certain cgo types
-// specially. Rather than forcing all clients to require cgo and an external
-// C compiler just to run the tests, this scheme makes them optional.
-// +build cgo,testcgo
-
-package spew_test
-
-import (
- "fmt"
-
- "github.com/davecgh/go-spew/spew/testdata"
-)
-
-func addCgoDumpTests() {
- // C char pointer.
- v := testdata.GetCgoCharPointer()
- nv := testdata.GetCgoNullCharPointer()
- pv := &v
- vcAddr := fmt.Sprintf("%p", v)
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "*testdata._Ctype_char"
- vs := "116"
- addDumpTest(v, "("+vt+")("+vcAddr+")("+vs+")\n")
- addDumpTest(pv, "(*"+vt+")("+vAddr+"->"+vcAddr+")("+vs+")\n")
- addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+"->"+vcAddr+")("+vs+")\n")
- addDumpTest(nv, "("+vt+")()\n")
-
- // C char array.
- v2, v2l, v2c := testdata.GetCgoCharArray()
- v2Len := fmt.Sprintf("%d", v2l)
- v2Cap := fmt.Sprintf("%d", v2c)
- v2t := "[6]testdata._Ctype_char"
- v2s := "(len=" + v2Len + " cap=" + v2Cap + ") " +
- "{\n 00000000 74 65 73 74 32 00 " +
- " |test2.|\n}"
- addDumpTest(v2, "("+v2t+") "+v2s+"\n")
-
- // C unsigned char array.
- v3, v3l, v3c := testdata.GetCgoUnsignedCharArray()
- v3Len := fmt.Sprintf("%d", v3l)
- v3Cap := fmt.Sprintf("%d", v3c)
- v3t := "[6]testdata._Ctype_unsignedchar"
- v3t2 := "[6]testdata._Ctype_uchar"
- v3s := "(len=" + v3Len + " cap=" + v3Cap + ") " +
- "{\n 00000000 74 65 73 74 33 00 " +
- " |test3.|\n}"
- addDumpTest(v3, "("+v3t+") "+v3s+"\n", "("+v3t2+") "+v3s+"\n")
-
- // C signed char array.
- v4, v4l, v4c := testdata.GetCgoSignedCharArray()
- v4Len := fmt.Sprintf("%d", v4l)
- v4Cap := fmt.Sprintf("%d", v4c)
- v4t := "[6]testdata._Ctype_schar"
- v4t2 := "testdata._Ctype_schar"
- v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " +
- "{\n (" + v4t2 + ") 116,\n (" + v4t2 + ") 101,\n (" + v4t2 +
- ") 115,\n (" + v4t2 + ") 116,\n (" + v4t2 + ") 52,\n (" + v4t2 +
- ") 0\n}"
- addDumpTest(v4, "("+v4t+") "+v4s+"\n")
-
- // C uint8_t array.
- v5, v5l, v5c := testdata.GetCgoUint8tArray()
- v5Len := fmt.Sprintf("%d", v5l)
- v5Cap := fmt.Sprintf("%d", v5c)
- v5t := "[6]testdata._Ctype_uint8_t"
- v5t2 := "[6]testdata._Ctype_uchar"
- v5s := "(len=" + v5Len + " cap=" + v5Cap + ") " +
- "{\n 00000000 74 65 73 74 35 00 " +
- " |test5.|\n}"
- addDumpTest(v5, "("+v5t+") "+v5s+"\n", "("+v5t2+") "+v5s+"\n")
-
- // C typedefed unsigned char array.
- v6, v6l, v6c := testdata.GetCgoTypdefedUnsignedCharArray()
- v6Len := fmt.Sprintf("%d", v6l)
- v6Cap := fmt.Sprintf("%d", v6c)
- v6t := "[6]testdata._Ctype_custom_uchar_t"
- v6t2 := "[6]testdata._Ctype_uchar"
- v6s := "(len=" + v6Len + " cap=" + v6Cap + ") " +
- "{\n 00000000 74 65 73 74 36 00 " +
- " |test6.|\n}"
- addDumpTest(v6, "("+v6t+") "+v6s+"\n", "("+v6t2+") "+v6s+"\n")
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go b/vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go
deleted file mode 100644
index 52a0971fb..000000000
--- a/vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) 2013 Dave Collins
-//
-// Permission to use, copy, modify, and distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-// NOTE: Due to the following build constraints, this file will only be compiled
-// when either cgo is not supported or "-tags testcgo" is not added to the go
-// test command line. This file intentionally does not setup any cgo tests in
-// this scenario.
-// +build !cgo !testcgo
-
-package spew_test
-
-func addCgoDumpTests() {
- // Don't add any tests for cgo since this file is only compiled when
- // there should not be any cgo tests.
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/example_test.go b/vendor/github.com/davecgh/go-spew/spew/example_test.go
deleted file mode 100644
index c6ec8c6d5..000000000
--- a/vendor/github.com/davecgh/go-spew/spew/example_test.go
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew_test
-
-import (
- "fmt"
-
- "github.com/davecgh/go-spew/spew"
-)
-
-type Flag int
-
-const (
- flagOne Flag = iota
- flagTwo
-)
-
-var flagStrings = map[Flag]string{
- flagOne: "flagOne",
- flagTwo: "flagTwo",
-}
-
-func (f Flag) String() string {
- if s, ok := flagStrings[f]; ok {
- return s
- }
- return fmt.Sprintf("Unknown flag (%d)", int(f))
-}
-
-type Bar struct {
- data uintptr
-}
-
-type Foo struct {
- unexportedField Bar
- ExportedField map[interface{}]interface{}
-}
-
-// This example demonstrates how to use Dump to dump variables to stdout.
-func ExampleDump() {
- // The following package level declarations are assumed for this example:
- /*
- type Flag int
-
- const (
- flagOne Flag = iota
- flagTwo
- )
-
- var flagStrings = map[Flag]string{
- flagOne: "flagOne",
- flagTwo: "flagTwo",
- }
-
- func (f Flag) String() string {
- if s, ok := flagStrings[f]; ok {
- return s
- }
- return fmt.Sprintf("Unknown flag (%d)", int(f))
- }
-
- type Bar struct {
- data uintptr
- }
-
- type Foo struct {
- unexportedField Bar
- ExportedField map[interface{}]interface{}
- }
- */
-
- // Setup some sample data structures for the example.
- bar := Bar{uintptr(0)}
- s1 := Foo{bar, map[interface{}]interface{}{"one": true}}
- f := Flag(5)
- b := []byte{
- 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
- 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
- 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
- 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
- 0x31, 0x32,
- }
-
- // Dump!
- spew.Dump(s1, f, b)
-
- // Output:
- // (spew_test.Foo) {
- // unexportedField: (spew_test.Bar) {
- // data: (uintptr)
- // },
- // ExportedField: (map[interface {}]interface {}) (len=1) {
- // (string) (len=3) "one": (bool) true
- // }
- // }
- // (spew_test.Flag) Unknown flag (5)
- // ([]uint8) (len=34 cap=34) {
- // 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... |
- // 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0|
- // 00000020 31 32 |12|
- // }
- //
-}
-
-// This example demonstrates how to use Printf to display a variable with a
-// format string and inline formatting.
-func ExamplePrintf() {
- // Create a double pointer to a uint 8.
- ui8 := uint8(5)
- pui8 := &ui8
- ppui8 := &pui8
-
- // Create a circular data type.
- type circular struct {
- ui8 uint8
- c *circular
- }
- c := circular{ui8: 1}
- c.c = &c
-
- // Print!
- spew.Printf("ppui8: %v\n", ppui8)
- spew.Printf("circular: %v\n", c)
-
- // Output:
- // ppui8: <**>5
- // circular: {1 <*>{1 <*>}}
-}
-
-// This example demonstrates how to use a ConfigState.
-func ExampleConfigState() {
- // Modify the indent level of the ConfigState only. The global
- // configuration is not modified.
- scs := spew.ConfigState{Indent: "\t"}
-
- // Output using the ConfigState instance.
- v := map[string]int{"one": 1}
- scs.Printf("v: %v\n", v)
- scs.Dump(v)
-
- // Output:
- // v: map[one:1]
- // (map[string]int) (len=1) {
- // (string) (len=3) "one": (int) 1
- // }
-}
-
-// This example demonstrates how to use ConfigState.Dump to dump variables to
-// stdout
-func ExampleConfigState_Dump() {
- // See the top-level Dump example for details on the types used in this
- // example.
-
- // Create two ConfigState instances with different indentation.
- scs := spew.ConfigState{Indent: "\t"}
- scs2 := spew.ConfigState{Indent: " "}
-
- // Setup some sample data structures for the example.
- bar := Bar{uintptr(0)}
- s1 := Foo{bar, map[interface{}]interface{}{"one": true}}
-
- // Dump using the ConfigState instances.
- scs.Dump(s1)
- scs2.Dump(s1)
-
- // Output:
- // (spew_test.Foo) {
- // unexportedField: (spew_test.Bar) {
- // data: (uintptr)
- // },
- // ExportedField: (map[interface {}]interface {}) (len=1) {
- // (string) (len=3) "one": (bool) true
- // }
- // }
- // (spew_test.Foo) {
- // unexportedField: (spew_test.Bar) {
- // data: (uintptr)
- // },
- // ExportedField: (map[interface {}]interface {}) (len=1) {
- // (string) (len=3) "one": (bool) true
- // }
- // }
- //
-}
-
-// This example demonstrates how to use ConfigState.Printf to display a variable
-// with a format string and inline formatting.
-func ExampleConfigState_Printf() {
- // See the top-level Dump example for details on the types used in this
- // example.
-
- // Create two ConfigState instances and modify the method handling of the
- // first ConfigState only.
- scs := spew.NewDefaultConfig()
- scs2 := spew.NewDefaultConfig()
- scs.DisableMethods = true
-
- // Alternatively
- // scs := spew.ConfigState{Indent: " ", DisableMethods: true}
- // scs2 := spew.ConfigState{Indent: " "}
-
- // This is of type Flag which implements a Stringer and has raw value 1.
- f := flagTwo
-
- // Dump using the ConfigState instances.
- scs.Printf("f: %v\n", f)
- scs2.Printf("f: %v\n", f)
-
- // Output:
- // f: 1
- // f: flagTwo
-}
diff --git a/vendor/github.com/davecgh/go-spew/spew/format_test.go b/vendor/github.com/davecgh/go-spew/spew/format_test.go
deleted file mode 100644
index 87ee9651e..000000000
--- a/vendor/github.com/davecgh/go-spew/spew/format_test.go
+++ /dev/null
@@ -1,1558 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
-Test Summary:
-NOTE: For each test, a nil pointer, a single pointer and double pointer to the
-base test element are also tested to ensure proper indirection across all types.
-
-- Max int8, int16, int32, int64, int
-- Max uint8, uint16, uint32, uint64, uint
-- Boolean true and false
-- Standard complex64 and complex128
-- Array containing standard ints
-- Array containing type with custom formatter on pointer receiver only
-- Array containing interfaces
-- Slice containing standard float32 values
-- Slice containing type with custom formatter on pointer receiver only
-- Slice containing interfaces
-- Nil slice
-- Standard string
-- Nil interface
-- Sub-interface
-- Map with string keys and int vals
-- Map with custom formatter type on pointer receiver only keys and vals
-- Map with interface keys and values
-- Map with nil interface value
-- Struct with primitives
-- Struct that contains another struct
-- Struct that contains custom type with Stringer pointer interface via both
- exported and unexported fields
-- Struct that contains embedded struct and field to same struct
-- Uintptr to 0 (null pointer)
-- Uintptr address of real variable
-- Unsafe.Pointer to 0 (null pointer)
-- Unsafe.Pointer to address of real variable
-- Nil channel
-- Standard int channel
-- Function with no params and no returns
-- Function with param and no returns
-- Function with multiple params and multiple returns
-- Struct that is circular through self referencing
-- Structs that are circular through cross referencing
-- Structs that are indirectly circular
-- Type that panics in its Stringer interface
-- Type that has a custom Error interface
-- %x passthrough with uint
-- %#x passthrough with uint
-- %f passthrough with precision
-- %f passthrough with width and precision
-- %d passthrough with width
-- %q passthrough with string
-*/
-
-package spew_test
-
-import (
- "bytes"
- "fmt"
- "testing"
- "unsafe"
-
- "github.com/davecgh/go-spew/spew"
-)
-
-// formatterTest is used to describe a test to be performed against NewFormatter.
-type formatterTest struct {
- format string
- in interface{}
- wants []string
-}
-
-// formatterTests houses all of the tests to be performed against NewFormatter.
-var formatterTests = make([]formatterTest, 0)
-
-// addFormatterTest is a helper method to append the passed input and desired
-// result to formatterTests.
-func addFormatterTest(format string, in interface{}, wants ...string) {
- test := formatterTest{format, in, wants}
- formatterTests = append(formatterTests, test)
-}
-
-func addIntFormatterTests() {
- // Max int8.
- v := int8(127)
- nv := (*int8)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "int8"
- vs := "127"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Max int16.
- v2 := int16(32767)
- nv2 := (*int16)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "int16"
- v2s := "32767"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-
- // Max int32.
- v3 := int32(2147483647)
- nv3 := (*int32)(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "int32"
- v3s := "2147483647"
- addFormatterTest("%v", v3, v3s)
- addFormatterTest("%v", pv3, "<*>"+v3s)
- addFormatterTest("%v", &pv3, "<**>"+v3s)
- addFormatterTest("%v", nv3, "")
- addFormatterTest("%+v", v3, v3s)
- addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s)
- addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%#v", v3, "("+v3t+")"+v3s)
- addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s)
- addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
- addFormatterTest("%#+v", v3, "("+v3t+")"+v3s)
- addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s)
- addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
-
- // Max int64.
- v4 := int64(9223372036854775807)
- nv4 := (*int64)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "int64"
- v4s := "9223372036854775807"
- addFormatterTest("%v", v4, v4s)
- addFormatterTest("%v", pv4, "<*>"+v4s)
- addFormatterTest("%v", &pv4, "<**>"+v4s)
- addFormatterTest("%v", nv4, "")
- addFormatterTest("%+v", v4, v4s)
- addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s)
- addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%#v", v4, "("+v4t+")"+v4s)
- addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s)
- addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s)
- addFormatterTest("%#v", nv4, "(*"+v4t+")"+"")
- addFormatterTest("%#+v", v4, "("+v4t+")"+v4s)
- addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s)
- addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"")
-
- // Max int.
- v5 := int(2147483647)
- nv5 := (*int)(nil)
- pv5 := &v5
- v5Addr := fmt.Sprintf("%p", pv5)
- pv5Addr := fmt.Sprintf("%p", &pv5)
- v5t := "int"
- v5s := "2147483647"
- addFormatterTest("%v", v5, v5s)
- addFormatterTest("%v", pv5, "<*>"+v5s)
- addFormatterTest("%v", &pv5, "<**>"+v5s)
- addFormatterTest("%v", nv5, "")
- addFormatterTest("%+v", v5, v5s)
- addFormatterTest("%+v", pv5, "<*>("+v5Addr+")"+v5s)
- addFormatterTest("%+v", &pv5, "<**>("+pv5Addr+"->"+v5Addr+")"+v5s)
- addFormatterTest("%+v", nv5, "")
- addFormatterTest("%#v", v5, "("+v5t+")"+v5s)
- addFormatterTest("%#v", pv5, "(*"+v5t+")"+v5s)
- addFormatterTest("%#v", &pv5, "(**"+v5t+")"+v5s)
- addFormatterTest("%#v", nv5, "(*"+v5t+")"+"")
- addFormatterTest("%#+v", v5, "("+v5t+")"+v5s)
- addFormatterTest("%#+v", pv5, "(*"+v5t+")("+v5Addr+")"+v5s)
- addFormatterTest("%#+v", &pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")"+v5s)
- addFormatterTest("%#+v", nv5, "(*"+v5t+")"+"")
-}
-
-func addUintFormatterTests() {
- // Max uint8.
- v := uint8(255)
- nv := (*uint8)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "uint8"
- vs := "255"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Max uint16.
- v2 := uint16(65535)
- nv2 := (*uint16)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "uint16"
- v2s := "65535"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-
- // Max uint32.
- v3 := uint32(4294967295)
- nv3 := (*uint32)(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "uint32"
- v3s := "4294967295"
- addFormatterTest("%v", v3, v3s)
- addFormatterTest("%v", pv3, "<*>"+v3s)
- addFormatterTest("%v", &pv3, "<**>"+v3s)
- addFormatterTest("%v", nv3, "")
- addFormatterTest("%+v", v3, v3s)
- addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s)
- addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%#v", v3, "("+v3t+")"+v3s)
- addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s)
- addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
- addFormatterTest("%#+v", v3, "("+v3t+")"+v3s)
- addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s)
- addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
-
- // Max uint64.
- v4 := uint64(18446744073709551615)
- nv4 := (*uint64)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "uint64"
- v4s := "18446744073709551615"
- addFormatterTest("%v", v4, v4s)
- addFormatterTest("%v", pv4, "<*>"+v4s)
- addFormatterTest("%v", &pv4, "<**>"+v4s)
- addFormatterTest("%v", nv4, "")
- addFormatterTest("%+v", v4, v4s)
- addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s)
- addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%#v", v4, "("+v4t+")"+v4s)
- addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s)
- addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s)
- addFormatterTest("%#v", nv4, "(*"+v4t+")"+"")
- addFormatterTest("%#+v", v4, "("+v4t+")"+v4s)
- addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s)
- addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"")
-
- // Max uint.
- v5 := uint(4294967295)
- nv5 := (*uint)(nil)
- pv5 := &v5
- v5Addr := fmt.Sprintf("%p", pv5)
- pv5Addr := fmt.Sprintf("%p", &pv5)
- v5t := "uint"
- v5s := "4294967295"
- addFormatterTest("%v", v5, v5s)
- addFormatterTest("%v", pv5, "<*>"+v5s)
- addFormatterTest("%v", &pv5, "<**>"+v5s)
- addFormatterTest("%v", nv5, "")
- addFormatterTest("%+v", v5, v5s)
- addFormatterTest("%+v", pv5, "<*>("+v5Addr+")"+v5s)
- addFormatterTest("%+v", &pv5, "<**>("+pv5Addr+"->"+v5Addr+")"+v5s)
- addFormatterTest("%+v", nv5, "")
- addFormatterTest("%#v", v5, "("+v5t+")"+v5s)
- addFormatterTest("%#v", pv5, "(*"+v5t+")"+v5s)
- addFormatterTest("%#v", &pv5, "(**"+v5t+")"+v5s)
- addFormatterTest("%#v", nv5, "(*"+v5t+")"+"")
- addFormatterTest("%#+v", v5, "("+v5t+")"+v5s)
- addFormatterTest("%#+v", pv5, "(*"+v5t+")("+v5Addr+")"+v5s)
- addFormatterTest("%#+v", &pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")"+v5s)
- addFormatterTest("%#v", nv5, "(*"+v5t+")"+"")
-}
-
-func addBoolFormatterTests() {
- // Boolean true.
- v := bool(true)
- nv := (*bool)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "bool"
- vs := "true"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Boolean false.
- v2 := bool(false)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "bool"
- v2s := "false"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
-}
-
-func addFloatFormatterTests() {
- // Standard float32.
- v := float32(3.1415)
- nv := (*float32)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "float32"
- vs := "3.1415"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Standard float64.
- v2 := float64(3.1415926)
- nv2 := (*float64)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "float64"
- v2s := "3.1415926"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-}
-
-func addComplexFormatterTests() {
- // Standard complex64.
- v := complex(float32(6), -2)
- nv := (*complex64)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "complex64"
- vs := "(6-2i)"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Standard complex128.
- v2 := complex(float64(-6), 2)
- nv2 := (*complex128)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "complex128"
- v2s := "(-6+2i)"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-}
-
-func addArrayFormatterTests() {
- // Array containing standard ints.
- v := [3]int{1, 2, 3}
- nv := (*[3]int)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "[3]int"
- vs := "[1 2 3]"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Array containing type with custom formatter on pointer receiver only.
- v2 := [3]pstringer{"1", "2", "3"}
- nv2 := (*[3]pstringer)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "[3]spew_test.pstringer"
- v2sp := "[stringer 1 stringer 2 stringer 3]"
- v2s := v2sp
- if spew.UnsafeDisabled {
- v2s = "[1 2 3]"
- }
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2sp)
- addFormatterTest("%v", &pv2, "<**>"+v2sp)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2sp)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2sp)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2sp)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2sp)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2sp)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2sp)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-
- // Array containing interfaces.
- v3 := [3]interface{}{"one", int(2), uint(3)}
- nv3 := (*[3]interface{})(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "[3]interface {}"
- v3t2 := "string"
- v3t3 := "int"
- v3t4 := "uint"
- v3s := "[one 2 3]"
- v3s2 := "[(" + v3t2 + ")one (" + v3t3 + ")2 (" + v3t4 + ")3]"
- addFormatterTest("%v", v3, v3s)
- addFormatterTest("%v", pv3, "<*>"+v3s)
- addFormatterTest("%v", &pv3, "<**>"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%+v", v3, v3s)
- addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s)
- addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%#v", v3, "("+v3t+")"+v3s2)
- addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s2)
- addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s2)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
- addFormatterTest("%#+v", v3, "("+v3t+")"+v3s2)
- addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s2)
- addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s2)
- addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"")
-}
-
-func addSliceFormatterTests() {
- // Slice containing standard float32 values.
- v := []float32{3.14, 6.28, 12.56}
- nv := (*[]float32)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "[]float32"
- vs := "[3.14 6.28 12.56]"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Slice containing type with custom formatter on pointer receiver only.
- v2 := []pstringer{"1", "2", "3"}
- nv2 := (*[]pstringer)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "[]spew_test.pstringer"
- v2s := "[stringer 1 stringer 2 stringer 3]"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-
- // Slice containing interfaces.
- v3 := []interface{}{"one", int(2), uint(3), nil}
- nv3 := (*[]interface{})(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "[]interface {}"
- v3t2 := "string"
- v3t3 := "int"
- v3t4 := "uint"
- v3t5 := "interface {}"
- v3s := "[one 2 3 ]"
- v3s2 := "[(" + v3t2 + ")one (" + v3t3 + ")2 (" + v3t4 + ")3 (" + v3t5 +
- ")]"
- addFormatterTest("%v", v3, v3s)
- addFormatterTest("%v", pv3, "<*>"+v3s)
- addFormatterTest("%v", &pv3, "<**>"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%+v", v3, v3s)
- addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s)
- addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%#v", v3, "("+v3t+")"+v3s2)
- addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s2)
- addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s2)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
- addFormatterTest("%#+v", v3, "("+v3t+")"+v3s2)
- addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s2)
- addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s2)
- addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"")
-
- // Nil slice.
- var v4 []int
- nv4 := (*[]int)(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "[]int"
- v4s := ""
- addFormatterTest("%v", v4, v4s)
- addFormatterTest("%v", pv4, "<*>"+v4s)
- addFormatterTest("%v", &pv4, "<**>"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%+v", v4, v4s)
- addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s)
- addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%#v", v4, "("+v4t+")"+v4s)
- addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s)
- addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s)
- addFormatterTest("%#v", nv4, "(*"+v4t+")"+"")
- addFormatterTest("%#+v", v4, "("+v4t+")"+v4s)
- addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s)
- addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"")
-}
-
-func addStringFormatterTests() {
- // Standard string.
- v := "test"
- nv := (*string)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "string"
- vs := "test"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-}
-
-func addInterfaceFormatterTests() {
- // Nil interface.
- var v interface{}
- nv := (*interface{})(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "interface {}"
- vs := ""
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Sub-interface.
- v2 := interface{}(uint16(65535))
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "uint16"
- v2s := "65535"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
-}
-
-func addMapFormatterTests() {
- // Map with string keys and int vals.
- v := map[string]int{"one": 1, "two": 2}
- nilMap := map[string]int(nil)
- nv := (*map[string]int)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "map[string]int"
- vs := "map[one:1 two:2]"
- vs2 := "map[two:2 one:1]"
- addFormatterTest("%v", v, vs, vs2)
- addFormatterTest("%v", pv, "<*>"+vs, "<*>"+vs2)
- addFormatterTest("%v", &pv, "<**>"+vs, "<**>"+vs2)
- addFormatterTest("%+v", nilMap, "")
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs, vs2)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs, "<*>("+vAddr+")"+vs2)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs,
- "<**>("+pvAddr+"->"+vAddr+")"+vs2)
- addFormatterTest("%+v", nilMap, "")
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs, "("+vt+")"+vs2)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs, "(*"+vt+")"+vs2)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs, "(**"+vt+")"+vs2)
- addFormatterTest("%#v", nilMap, "("+vt+")"+"")
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs, "("+vt+")"+vs2)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs,
- "(*"+vt+")("+vAddr+")"+vs2)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs,
- "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs2)
- addFormatterTest("%#+v", nilMap, "("+vt+")"+"")
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Map with custom formatter type on pointer receiver only keys and vals.
- v2 := map[pstringer]pstringer{"one": "1"}
- nv2 := (*map[pstringer]pstringer)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "map[spew_test.pstringer]spew_test.pstringer"
- v2s := "map[stringer one:stringer 1]"
- if spew.UnsafeDisabled {
- v2s = "map[one:1]"
- }
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-
- // Map with interface keys and values.
- v3 := map[interface{}]interface{}{"one": 1}
- nv3 := (*map[interface{}]interface{})(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "map[interface {}]interface {}"
- v3t1 := "string"
- v3t2 := "int"
- v3s := "map[one:1]"
- v3s2 := "map[(" + v3t1 + ")one:(" + v3t2 + ")1]"
- addFormatterTest("%v", v3, v3s)
- addFormatterTest("%v", pv3, "<*>"+v3s)
- addFormatterTest("%v", &pv3, "<**>"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%+v", v3, v3s)
- addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s)
- addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%#v", v3, "("+v3t+")"+v3s2)
- addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s2)
- addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s2)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
- addFormatterTest("%#+v", v3, "("+v3t+")"+v3s2)
- addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s2)
- addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s2)
- addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"")
-
- // Map with nil interface value
- v4 := map[string]interface{}{"nil": nil}
- nv4 := (*map[string]interface{})(nil)
- pv4 := &v4
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "map[string]interface {}"
- v4t1 := "interface {}"
- v4s := "map[nil:]"
- v4s2 := "map[nil:(" + v4t1 + ")]"
- addFormatterTest("%v", v4, v4s)
- addFormatterTest("%v", pv4, "<*>"+v4s)
- addFormatterTest("%v", &pv4, "<**>"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%+v", v4, v4s)
- addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s)
- addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%#v", v4, "("+v4t+")"+v4s2)
- addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s2)
- addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s2)
- addFormatterTest("%#v", nv4, "(*"+v4t+")"+"")
- addFormatterTest("%#+v", v4, "("+v4t+")"+v4s2)
- addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s2)
- addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s2)
- addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"")
-}
-
-func addStructFormatterTests() {
- // Struct with primitives.
- type s1 struct {
- a int8
- b uint8
- }
- v := s1{127, 255}
- nv := (*s1)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "spew_test.s1"
- vt2 := "int8"
- vt3 := "uint8"
- vs := "{127 255}"
- vs2 := "{a:127 b:255}"
- vs3 := "{a:(" + vt2 + ")127 b:(" + vt3 + ")255}"
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs2)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs2)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs2)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs3)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs3)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs3)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs3)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs3)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs3)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Struct that contains another struct.
- type s2 struct {
- s1 s1
- b bool
- }
- v2 := s2{s1{127, 255}, true}
- nv2 := (*s2)(nil)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "spew_test.s2"
- v2t2 := "spew_test.s1"
- v2t3 := "int8"
- v2t4 := "uint8"
- v2t5 := "bool"
- v2s := "{{127 255} true}"
- v2s2 := "{s1:{a:127 b:255} b:true}"
- v2s3 := "{s1:(" + v2t2 + "){a:(" + v2t3 + ")127 b:(" + v2t4 + ")255} b:(" +
- v2t5 + ")true}"
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%+v", v2, v2s2)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s2)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s2)
- addFormatterTest("%+v", nv2, "")
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s3)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s3)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s3)
- addFormatterTest("%#v", nv2, "(*"+v2t+")"+"")
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s3)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s3)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s3)
- addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"")
-
- // Struct that contains custom type with Stringer pointer interface via both
- // exported and unexported fields.
- type s3 struct {
- s pstringer
- S pstringer
- }
- v3 := s3{"test", "test2"}
- nv3 := (*s3)(nil)
- pv3 := &v3
- v3Addr := fmt.Sprintf("%p", pv3)
- pv3Addr := fmt.Sprintf("%p", &pv3)
- v3t := "spew_test.s3"
- v3t2 := "spew_test.pstringer"
- v3s := "{stringer test stringer test2}"
- v3sp := v3s
- v3s2 := "{s:stringer test S:stringer test2}"
- v3s2p := v3s2
- v3s3 := "{s:(" + v3t2 + ")stringer test S:(" + v3t2 + ")stringer test2}"
- v3s3p := v3s3
- if spew.UnsafeDisabled {
- v3s = "{test test2}"
- v3sp = "{test stringer test2}"
- v3s2 = "{s:test S:test2}"
- v3s2p = "{s:test S:stringer test2}"
- v3s3 = "{s:(" + v3t2 + ")test S:(" + v3t2 + ")test2}"
- v3s3p = "{s:(" + v3t2 + ")test S:(" + v3t2 + ")stringer test2}"
- }
- addFormatterTest("%v", v3, v3s)
- addFormatterTest("%v", pv3, "<*>"+v3sp)
- addFormatterTest("%v", &pv3, "<**>"+v3sp)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%+v", v3, v3s2)
- addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s2p)
- addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s2p)
- addFormatterTest("%+v", nv3, "")
- addFormatterTest("%#v", v3, "("+v3t+")"+v3s3)
- addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s3p)
- addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s3p)
- addFormatterTest("%#v", nv3, "(*"+v3t+")"+"")
- addFormatterTest("%#+v", v3, "("+v3t+")"+v3s3)
- addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s3p)
- addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s3p)
- addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"")
-
- // Struct that contains embedded struct and field to same struct.
- e := embed{"embedstr"}
- v4 := embedwrap{embed: &e, e: &e}
- nv4 := (*embedwrap)(nil)
- pv4 := &v4
- eAddr := fmt.Sprintf("%p", &e)
- v4Addr := fmt.Sprintf("%p", pv4)
- pv4Addr := fmt.Sprintf("%p", &pv4)
- v4t := "spew_test.embedwrap"
- v4t2 := "spew_test.embed"
- v4t3 := "string"
- v4s := "{<*>{embedstr} <*>{embedstr}}"
- v4s2 := "{embed:<*>(" + eAddr + "){a:embedstr} e:<*>(" + eAddr +
- "){a:embedstr}}"
- v4s3 := "{embed:(*" + v4t2 + "){a:(" + v4t3 + ")embedstr} e:(*" + v4t2 +
- "){a:(" + v4t3 + ")embedstr}}"
- v4s4 := "{embed:(*" + v4t2 + ")(" + eAddr + "){a:(" + v4t3 +
- ")embedstr} e:(*" + v4t2 + ")(" + eAddr + "){a:(" + v4t3 + ")embedstr}}"
- addFormatterTest("%v", v4, v4s)
- addFormatterTest("%v", pv4, "<*>"+v4s)
- addFormatterTest("%v", &pv4, "<**>"+v4s)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%+v", v4, v4s2)
- addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s2)
- addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s2)
- addFormatterTest("%+v", nv4, "")
- addFormatterTest("%#v", v4, "("+v4t+")"+v4s3)
- addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s3)
- addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s3)
- addFormatterTest("%#v", nv4, "(*"+v4t+")"+"")
- addFormatterTest("%#+v", v4, "("+v4t+")"+v4s4)
- addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s4)
- addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s4)
- addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"")
-}
-
-func addUintptrFormatterTests() {
- // Null pointer.
- v := uintptr(0)
- nv := (*uintptr)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "uintptr"
- vs := ""
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Address of real variable.
- i := 1
- v2 := uintptr(unsafe.Pointer(&i))
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "uintptr"
- v2s := fmt.Sprintf("%p", &i)
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
-}
-
-func addUnsafePointerFormatterTests() {
- // Null pointer.
- v := unsafe.Pointer(nil)
- nv := (*unsafe.Pointer)(nil)
- pv := &v
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "unsafe.Pointer"
- vs := ""
- addFormatterTest("%v", v, vs)
- addFormatterTest("%v", pv, "<*>"+vs)
- addFormatterTest("%v", &pv, "<**>"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%+v", v, vs)
- addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs)
- addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%+v", nv, "")
- addFormatterTest("%#v", v, "("+vt+")"+vs)
- addFormatterTest("%#v", pv, "(*"+vt+")"+vs)
- addFormatterTest("%#v", &pv, "(**"+vt+")"+vs)
- addFormatterTest("%#v", nv, "(*"+vt+")"+"")
- addFormatterTest("%#+v", v, "("+vt+")"+vs)
- addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs)
- addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs)
- addFormatterTest("%#+v", nv, "(*"+vt+")"+"")
-
- // Address of real variable.
- i := 1
- v2 := unsafe.Pointer(&i)
- pv2 := &v2
- v2Addr := fmt.Sprintf("%p", pv2)
- pv2Addr := fmt.Sprintf("%p", &pv2)
- v2t := "unsafe.Pointer"
- v2s := fmt.Sprintf("%p", &i)
- addFormatterTest("%v", v2, v2s)
- addFormatterTest("%v", pv2, "<*>"+v2s)
- addFormatterTest("%v", &pv2, "<**>"+v2s)
- addFormatterTest("%+v", v2, v2s)
- addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s)
- addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s)
- addFormatterTest("%#v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s)
- addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s)
- addFormatterTest("%#+v", v2, "("+v2t+")"+v2s)
- addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s)
- addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s)
-}
-
-func addChanFormatterTests() {
- // Nil channel.
- var v chan int
- pv := &v
- nv := (*chan int)(nil)
- vAddr := fmt.Sprintf("%p", pv)
- pvAddr := fmt.Sprintf("%p", &pv)
- vt := "chan int"
- vs := "