summaryrefslogtreecommitdiff
path: root/vendor/github.com/pquerna/ffjson/inception/writerstack.go
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2021-05-10 10:16:27 +0000
committerGitHub <noreply@github.com>2021-05-10 10:16:27 +0000
commitd2f7d5cbabf8ce1057f2d04a6318cb76ad6488b3 (patch)
tree5c7ddaf638811fa57de746069bc64c10a26995dc /vendor/github.com/pquerna/ffjson/inception/writerstack.go
parent54bed1025d07bc5f77ee4e1e7f942157e211ec0a (diff)
downloadpodman-d2f7d5cbabf8ce1057f2d04a6318cb76ad6488b3.tar.gz
podman-d2f7d5cbabf8ce1057f2d04a6318cb76ad6488b3.tar.bz2
podman-d2f7d5cbabf8ce1057f2d04a6318cb76ad6488b3.zip
Bump github.com/containers/storage from 1.30.1 to 1.30.2
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.30.1 to 1.30.2. - [Release notes](https://github.com/containers/storage/releases) - [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md) - [Commits](https://github.com/containers/storage/compare/v1.30.1...v1.30.2) Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/github.com/pquerna/ffjson/inception/writerstack.go')
-rw-r--r--vendor/github.com/pquerna/ffjson/inception/writerstack.go65
1 files changed, 0 insertions, 65 deletions
diff --git a/vendor/github.com/pquerna/ffjson/inception/writerstack.go b/vendor/github.com/pquerna/ffjson/inception/writerstack.go
deleted file mode 100644
index 1521961c9..000000000
--- a/vendor/github.com/pquerna/ffjson/inception/writerstack.go
+++ /dev/null
@@ -1,65 +0,0 @@
-package ffjsoninception
-
-import "strings"
-
-// ConditionalWrite is a stack containing a number of pending writes
-type ConditionalWrite struct {
- Queued []string
-}
-
-// Write will add a string to be written
-func (w *ConditionalWrite) Write(s string) {
- w.Queued = append(w.Queued, s)
-}
-
-// DeleteLast will delete the last added write
-func (w *ConditionalWrite) DeleteLast() {
- if len(w.Queued) == 0 {
- return
- }
- w.Queued = w.Queued[:len(w.Queued)-1]
-}
-
-// Last will return the last added write
-func (w *ConditionalWrite) Last() string {
- if len(w.Queued) == 0 {
- return ""
- }
- return w.Queued[len(w.Queued)-1]
-}
-
-// Flush will return all queued writes, and return
-// "" (empty string) in nothing has been queued
-// "buf.WriteByte('" + byte + "')" + '\n' if one bute has been queued.
-// "buf.WriteString(`" + string + "`)" + "\n" if more than one byte has been queued.
-func (w *ConditionalWrite) Flush() string {
- combined := strings.Join(w.Queued, "")
- if len(combined) == 0 {
- return ""
- }
-
- w.Queued = nil
- if len(combined) == 1 {
- return "buf.WriteByte('" + combined + "')" + "\n"
- }
- return "buf.WriteString(`" + combined + "`)" + "\n"
-}
-
-func (w *ConditionalWrite) FlushTo(out string) string {
- out += w.Flush()
- return out
-}
-
-// WriteFlush will add a string and return the Flush result for the queue
-func (w *ConditionalWrite) WriteFlush(s string) string {
- w.Write(s)
- return w.Flush()
-}
-
-// GetQueued will return the current queued content without flushing.
-func (w *ConditionalWrite) GetQueued() string {
- t := w.Queued
- s := w.Flush()
- w.Queued = t
- return s
-}