From 61be51e56baf037aa7902e7cd066b895a10da244 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 4 Nov 2024 18:59:50 +0800 Subject: 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 --- modules/util/io.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules/util') 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. -- cgit v1.2.3