aboutsummaryrefslogtreecommitdiffstats
path: root/modules/util
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-11-04 18:59:50 +0800
committerGitHub <noreply@github.com>2024-11-04 10:59:50 +0000
commit61be51e56baf037aa7902e7cd066b895a10da244 (patch)
tree1cbf5fed4146977538975ea3d7ce4e302294cba0 /modules/util
parentaf28ce59b8695a8412632c50cf96fdd420215719 (diff)
downloadgitea-61be51e56baf037aa7902e7cd066b895a10da244.tar.gz
gitea-61be51e56baf037aa7902e7cd066b895a10da244.zip
Refactor markup package (#32399)
To make the markup package easier to maintain: 1. Split some go files into small files 2. Use a shared util.NopCloser, remove duplicate code 3. Remove unused functions
Diffstat (limited to 'modules/util')
-rw-r--r--modules/util/io.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/util/io.go b/modules/util/io.go
index eb200c9f9a..b3dde9d1f6 100644
--- a/modules/util/io.go
+++ b/modules/util/io.go
@@ -9,6 +9,12 @@ import (
"io"
)
+type NopCloser struct {
+ io.Writer
+}
+
+func (NopCloser) Close() error { return nil }
+
// ReadAtMost reads at most len(buf) bytes from r into buf.
// It returns the number of bytes copied. n is only less than len(buf) if r provides fewer bytes.
// If EOF or ErrUnexpectedEOF occurs while reading, err will be nil.