From 39332db20d2cf9137a9095f8e92098f5c208ec8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kriszti=C3=A1n=20G=C3=B6drei?= Date: Tue, 10 Jan 2017 13:31:50 +0100 Subject: [PATCH] godeps-update (#117) --- Godeps/Godeps.json | 24 ++++----- .../bitrise-io/go-utils/cmdex/run.go | 11 ++++ .../bitrise-io/go-utils/pathutil/pathutil.go | 2 +- .../bitrise-io/go-utils/pointers/pointers.go | 50 +++++++++++++++++++ vendor/github.com/davecgh/go-spew/LICENSE | 2 +- .../github.com/davecgh/go-spew/spew/bypass.go | 2 +- .../davecgh/go-spew/spew/bypasssafe.go | 2 +- .../github.com/davecgh/go-spew/spew/common.go | 2 +- .../github.com/davecgh/go-spew/spew/config.go | 11 +++- vendor/github.com/davecgh/go-spew/spew/doc.go | 11 +++- .../github.com/davecgh/go-spew/spew/dump.go | 8 +-- .../github.com/davecgh/go-spew/spew/format.go | 2 +- .../github.com/davecgh/go-spew/spew/spew.go | 2 +- .../stretchr/testify/assert/assertions.go | 15 +++--- 14 files changed, 113 insertions(+), 31 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index dd4980ac..ebc81dea 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -13,27 +13,27 @@ }, { "ImportPath": "github.com/bitrise-io/go-utils/cmdex", - "Rev": "5c210e4691a5a75e5685d2e842a104ca55ec7697" + "Rev": "6d158a26258c099e22b13ec9222b104f17bf68f7" }, { "ImportPath": "github.com/bitrise-io/go-utils/errorutil", - "Rev": "5c210e4691a5a75e5685d2e842a104ca55ec7697" + "Rev": "6d158a26258c099e22b13ec9222b104f17bf68f7" }, { "ImportPath": "github.com/bitrise-io/go-utils/fileutil", - "Rev": "5c210e4691a5a75e5685d2e842a104ca55ec7697" + "Rev": "6d158a26258c099e22b13ec9222b104f17bf68f7" }, { "ImportPath": "github.com/bitrise-io/go-utils/parseutil", - "Rev": "5c210e4691a5a75e5685d2e842a104ca55ec7697" + "Rev": "6d158a26258c099e22b13ec9222b104f17bf68f7" }, { "ImportPath": "github.com/bitrise-io/go-utils/pathutil", - "Rev": "5c210e4691a5a75e5685d2e842a104ca55ec7697" + "Rev": "6d158a26258c099e22b13ec9222b104f17bf68f7" }, { "ImportPath": "github.com/bitrise-io/go-utils/pointers", - "Rev": "5c210e4691a5a75e5685d2e842a104ca55ec7697" + "Rev": "6d158a26258c099e22b13ec9222b104f17bf68f7" }, { "ImportPath": "github.com/bitrise-io/goinp/goinp", @@ -41,8 +41,8 @@ }, { "ImportPath": "github.com/davecgh/go-spew/spew", - "Comment": "v1.0.0-3-g6d21280", - "Rev": "6d212800a42e8ab5c146b8ace3490ee17e5225f9" + "Comment": "v1.1.0", + "Rev": "346938d642f2ec3594ed81d874461961cd0faa76" }, { "ImportPath": "github.com/pmezard/go-difflib/difflib", @@ -51,13 +51,13 @@ }, { "ImportPath": "github.com/stretchr/testify/assert", - "Comment": "v1.1.4-4-g976c720", - "Rev": "976c720a22c8eb4eb6a0b4348ad85ad12491a506" + "Comment": "v1.1.4-6-g18a02ba", + "Rev": "18a02ba4a312f95da08ff4cfc0055750ce50ae9e" }, { "ImportPath": "github.com/stretchr/testify/require", - "Comment": "v1.1.4-4-g976c720", - "Rev": "976c720a22c8eb4eb6a0b4348ad85ad12491a506" + "Comment": "v1.1.4-6-g18a02ba", + "Rev": "18a02ba4a312f95da08ff4cfc0055750ce50ae9e" }, { "ImportPath": "github.com/urfave/cli", diff --git a/vendor/github.com/bitrise-io/go-utils/cmdex/run.go b/vendor/github.com/bitrise-io/go-utils/cmdex/run.go index f9790726..5d55c68b 100644 --- a/vendor/github.com/bitrise-io/go-utils/cmdex/run.go +++ b/vendor/github.com/bitrise-io/go-utils/cmdex/run.go @@ -26,6 +26,12 @@ func NewCommand(name string, args ...string) *CommandModel { } } +// NewCommandWithStandardOuts - same as NewCommand, but sets the command's +// stdout and stderr to the standard (OS) out (os.Stdout) and err (os.Stderr) +func NewCommandWithStandardOuts(name string, args ...string) *CommandModel { + return NewCommand(name, args...).SetStdout(os.Stdout).SetStderr(os.Stderr) +} + // NewCommandFromSlice ... func NewCommandFromSlice(cmdSlice []string) (*CommandModel, error) { if len(cmdSlice) == 0 { @@ -106,6 +112,11 @@ func (command CommandModel) RunAndReturnTrimmedCombinedOutput() (string, error) return RunCmdAndReturnTrimmedCombinedOutput(command.cmd) } +// PrintableCommandArgs ... +func (command CommandModel) PrintableCommandArgs() string { + return PrintableCommandArgs(false, command.cmd.Args) +} + // ---------- // PrintableCommandArgs ... diff --git a/vendor/github.com/bitrise-io/go-utils/pathutil/pathutil.go b/vendor/github.com/bitrise-io/go-utils/pathutil/pathutil.go index 53899cd7..a0b08661 100644 --- a/vendor/github.com/bitrise-io/go-utils/pathutil/pathutil.go +++ b/vendor/github.com/bitrise-io/go-utils/pathutil/pathutil.go @@ -74,7 +74,7 @@ func IsDirExists(pth string) (bool, error) { return false, nil } if fileInf == nil { - return false, errors.New("No file info available.") + return false, errors.New("No file info available") } return fileInf.IsDir(), nil } diff --git a/vendor/github.com/bitrise-io/go-utils/pointers/pointers.go b/vendor/github.com/bitrise-io/go-utils/pointers/pointers.go index 1d1dba6f..e2896078 100644 --- a/vendor/github.com/bitrise-io/go-utils/pointers/pointers.go +++ b/vendor/github.com/bitrise-io/go-utils/pointers/pointers.go @@ -29,3 +29,53 @@ func NewIntPtr(val int) *int { *ptrValue = val return ptrValue } + +// ------------------------------------------------------ +// --- Safe Getters + +// Bool ... +func Bool(val *bool) bool { + return BoolWithDefault(val, false) +} + +// BoolWithDefault ... +func BoolWithDefault(val *bool, defaultValue bool) bool { + if val == nil { + return defaultValue + } + return *val +} + +// String ... +func String(val *string) string { + return StringWithDefault(val, "") +} + +// StringWithDefault ... +func StringWithDefault(val *string, defaultValue string) string { + if val == nil { + return defaultValue + } + return *val +} + +// TimeWithDefault ... +func TimeWithDefault(val *time.Time, defaultValue time.Time) time.Time { + if val == nil { + return defaultValue + } + return *val +} + +// Int ... +func Int(val *int) int { + return IntWithDefault(val, 0) +} + +// IntWithDefault ... +func IntWithDefault(val *int, defaultValue int) int { + if val == nil { + return defaultValue + } + return *val +} diff --git a/vendor/github.com/davecgh/go-spew/LICENSE b/vendor/github.com/davecgh/go-spew/LICENSE index bb673323..c8364161 100644 --- a/vendor/github.com/davecgh/go-spew/LICENSE +++ b/vendor/github.com/davecgh/go-spew/LICENSE @@ -1,6 +1,6 @@ ISC License -Copyright (c) 2012-2013 Dave Collins +Copyright (c) 2012-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 diff --git a/vendor/github.com/davecgh/go-spew/spew/bypass.go b/vendor/github.com/davecgh/go-spew/spew/bypass.go index d42a0bc4..8a4a6589 100644 --- a/vendor/github.com/davecgh/go-spew/spew/bypass.go +++ b/vendor/github.com/davecgh/go-spew/spew/bypass.go @@ -1,4 +1,4 @@ -// Copyright (c) 2015 Dave Collins +// Copyright (c) 2015-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 diff --git a/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go b/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go index e47a4e79..1fe3cf3d 100644 --- a/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go +++ b/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go @@ -1,4 +1,4 @@ -// Copyright (c) 2015 Dave Collins +// Copyright (c) 2015-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 diff --git a/vendor/github.com/davecgh/go-spew/spew/common.go b/vendor/github.com/davecgh/go-spew/spew/common.go index 14f02dc1..7c519ff4 100644 --- a/vendor/github.com/davecgh/go-spew/spew/common.go +++ b/vendor/github.com/davecgh/go-spew/spew/common.go @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Dave Collins + * 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 diff --git a/vendor/github.com/davecgh/go-spew/spew/config.go b/vendor/github.com/davecgh/go-spew/spew/config.go index 55528272..2e3d22f3 100644 --- a/vendor/github.com/davecgh/go-spew/spew/config.go +++ b/vendor/github.com/davecgh/go-spew/spew/config.go @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Dave Collins + * 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 @@ -67,6 +67,15 @@ type ConfigState struct { // Google App Engine or with the "safe" build tag specified. DisablePointerMethods bool + // DisablePointerAddresses specifies whether to disable the printing of + // pointer addresses. This is useful when diffing data structures in tests. + DisablePointerAddresses bool + + // DisableCapacities specifies whether to disable the printing of capacities + // for arrays, slices, maps and channels. This is useful when diffing + // data structures in tests. + DisableCapacities bool + // ContinueOnMethod specifies whether or not recursion should continue once // a custom error or Stringer interface is invoked. The default, false, // means it will print the results of invoking the custom error or Stringer diff --git a/vendor/github.com/davecgh/go-spew/spew/doc.go b/vendor/github.com/davecgh/go-spew/spew/doc.go index 5be0c406..aacaac6f 100644 --- a/vendor/github.com/davecgh/go-spew/spew/doc.go +++ b/vendor/github.com/davecgh/go-spew/spew/doc.go @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Dave Collins + * 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 @@ -91,6 +91,15 @@ The following configuration options are available: which only accept pointer receivers from non-pointer variables. 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. diff --git a/vendor/github.com/davecgh/go-spew/spew/dump.go b/vendor/github.com/davecgh/go-spew/spew/dump.go index a0ff95e2..df1d582a 100644 --- a/vendor/github.com/davecgh/go-spew/spew/dump.go +++ b/vendor/github.com/davecgh/go-spew/spew/dump.go @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Dave Collins + * 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 @@ -129,7 +129,7 @@ func (d *dumpState) dumpPtr(v reflect.Value) { d.w.Write(closeParenBytes) // Display pointer information. - if len(pointerChain) > 0 { + if !d.cs.DisablePointerAddresses && len(pointerChain) > 0 { d.w.Write(openParenBytes) for i, addr := range pointerChain { if i > 0 { @@ -282,13 +282,13 @@ func (d *dumpState) dump(v reflect.Value) { case reflect.Map, reflect.String: valueLen = v.Len() } - if valueLen != 0 || valueCap != 0 { + if valueLen != 0 || !d.cs.DisableCapacities && valueCap != 0 { d.w.Write(openParenBytes) if valueLen != 0 { d.w.Write(lenEqualsBytes) printInt(d.w, int64(valueLen), 10) } - if valueCap != 0 { + if !d.cs.DisableCapacities && valueCap != 0 { if valueLen != 0 { d.w.Write(spaceBytes) } diff --git a/vendor/github.com/davecgh/go-spew/spew/format.go b/vendor/github.com/davecgh/go-spew/spew/format.go index ecf3b80e..c49875ba 100644 --- a/vendor/github.com/davecgh/go-spew/spew/format.go +++ b/vendor/github.com/davecgh/go-spew/spew/format.go @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Dave Collins + * 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 diff --git a/vendor/github.com/davecgh/go-spew/spew/spew.go b/vendor/github.com/davecgh/go-spew/spew/spew.go index d8233f54..32c0e338 100644 --- a/vendor/github.com/davecgh/go-spew/spew/spew.go +++ b/vendor/github.com/davecgh/go-spew/spew/spew.go @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Dave Collins + * 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 diff --git a/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/stretchr/testify/assert/assertions.go index 835084ff..2feb4193 100644 --- a/vendor/github.com/stretchr/testify/assert/assertions.go +++ b/vendor/github.com/stretchr/testify/assert/assertions.go @@ -18,10 +18,6 @@ import ( "github.com/pmezard/go-difflib/difflib" ) -func init() { - spew.Config.SortKeys = true -} - // TestingT is an interface wrapper around *testing.T type TestingT interface { Errorf(format string, args ...interface{}) @@ -1043,8 +1039,8 @@ func diff(expected interface{}, actual interface{}) string { return "" } - e := spew.Sdump(expected) - a := spew.Sdump(actual) + e := spewConfig.Sdump(expected) + a := spewConfig.Sdump(actual) diff, _ := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{ A: difflib.SplitLines(e), @@ -1058,3 +1054,10 @@ func diff(expected interface{}, actual interface{}) string { return "\n\nDiff:\n" + diff } + +var spewConfig = spew.ConfigState{ + Indent: " ", + DisablePointerAddresses: true, + DisableCapacities: true, + SortKeys: true, +}