aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/gotest.tools/internal/format/format.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-03-01 23:17:57 +0100
committerGitHub <noreply@github.com>2019-03-01 23:17:57 +0100
commit7260ca05bc3588c0572887a7d8f1b897c7fc13da (patch)
tree66854358df3cb9de651f7688556ec5a4b8ab1868 /vendor/gotest.tools/internal/format/format.go
parent0aefae6fcca5786f2c898029c3d6282f760f2c63 (diff)
parentb6bed784e5664819250aac20b2b9690879ee6ab1 (diff)
downloadgit-bug-7260ca05bc3588c0572887a7d8f1b897c7fc13da.tar.gz
Merge pull request #89 from MichaelMure/identity
WIP identity in git
Diffstat (limited to 'vendor/gotest.tools/internal/format/format.go')
-rw-r--r--vendor/gotest.tools/internal/format/format.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/vendor/gotest.tools/internal/format/format.go b/vendor/gotest.tools/internal/format/format.go
deleted file mode 100644
index 8f6494f9..00000000
--- a/vendor/gotest.tools/internal/format/format.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package format // import "gotest.tools/internal/format"
-
-import "fmt"
-
-// Message accepts a msgAndArgs varargs and formats it using fmt.Sprintf
-func Message(msgAndArgs ...interface{}) string {
- switch len(msgAndArgs) {
- case 0:
- return ""
- case 1:
- return fmt.Sprintf("%v", msgAndArgs[0])
- default:
- return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...)
- }
-}
-
-// WithCustomMessage accepts one or two messages and formats them appropriately
-func WithCustomMessage(source string, msgAndArgs ...interface{}) string {
- custom := Message(msgAndArgs...)
- switch {
- case custom == "":
- return source
- case source == "":
- return custom
- }
- return fmt.Sprintf("%s: %s", source, custom)
-}