summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-format/print.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-05-08 19:49:45 +0200
committerLibravatar GitHub <noreply@github.com>2022-05-08 18:49:45 +0100
commit5004e0a9da665ccc0e18cd4075ee636641b71f0a (patch)
treeb7c8269b954ced61afa9fffd7305bd88acca6f8e /vendor/codeberg.org/gruf/go-format/print.go
parent[bugfix] Fix existing bio text showing as HTML (#531) (diff)
downloadgotosocial-5004e0a9da665ccc0e18cd4075ee636641b71f0a.tar.xz
[bugfix] Fix remote media pruning failing if media already gone (#548)
* fix error check of prune to allow missing files * update go-store library, add test for pruning item with db entry but no file Signed-off-by: kim <grufwub@gmail.com> * remove now-unneccessary error check Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/codeberg.org/gruf/go-format/print.go')
-rw-r--r--vendor/codeberg.org/gruf/go-format/print.go88
1 files changed, 0 insertions, 88 deletions
diff --git a/vendor/codeberg.org/gruf/go-format/print.go b/vendor/codeberg.org/gruf/go-format/print.go
deleted file mode 100644
index 288e6af10..000000000
--- a/vendor/codeberg.org/gruf/go-format/print.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package format
-
-import (
- "io"
- "os"
- "sync"
-)
-
-// pool is the global printer buffer pool.
-var pool = sync.Pool{
- New: func() interface{} {
- return &Buffer{}
- },
-}
-
-// getBuf fetches a buffer from pool.
-func getBuf() *Buffer {
- return pool.Get().(*Buffer)
-}
-
-// putBuf places a Buffer back in pool.
-func putBuf(buf *Buffer) {
- if buf.Cap() > 64<<10 {
- return // drop large
- }
- buf.Reset()
- pool.Put(buf)
-}
-
-// Sprint will format supplied values, returning this string.
-func Sprint(v ...interface{}) string {
- buf := Buffer{}
- Append(&buf, v...)
- return buf.String()
-}
-
-// Sprintf will format supplied format string and args, returning this string.
-// See Formatter.Appendf() for more documentation.
-func Sprintf(s string, a ...interface{}) string {
- buf := Buffer{}
- Appendf(&buf, s, a...)
- return buf.String()
-}
-
-// Print will format supplied values, print this to os.Stdout.
-func Print(v ...interface{}) {
- Fprint(os.Stdout, v...) //nolint
-}
-
-// Printf will format supplied format string and args, printing this to os.Stdout.
-// See Formatter.Appendf() for more documentation.
-func Printf(s string, a ...interface{}) {
- Fprintf(os.Stdout, s, a...) //nolint
-}
-
-// Println will format supplied values, append a trailing newline and print this to os.Stdout.
-func Println(v ...interface{}) {
- Fprintln(os.Stdout, v...) //nolint
-}
-
-// Fprint will format supplied values, writing this to an io.Writer.
-func Fprint(w io.Writer, v ...interface{}) (int, error) {
- buf := getBuf()
- Append(buf, v...)
- n, err := w.Write(buf.B)
- putBuf(buf)
- return n, err
-}
-
-// Fprintf will format supplied format string and args, writing this to an io.Writer.
-// See Formatter.Appendf() for more documentation.
-func Fprintf(w io.Writer, s string, a ...interface{}) (int, error) {
- buf := getBuf()
- Appendf(buf, s, a...)
- n, err := w.Write(buf.B)
- putBuf(buf)
- return n, err
-}
-
-// Println will format supplied values, append a trailing newline and writer this to an io.Writer.
-func Fprintln(w io.Writer, v ...interface{}) (int, error) {
- buf := getBuf()
- Append(buf, v...)
- buf.AppendByte('\n')
- n, err := w.Write(buf.B)
- putBuf(buf)
- return n, err
-}