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
This commit is contained in:
wxiaoguang authored and GitHub committed 2024-11-04 10:59:50 +00:00
1 parent af28ce59b8
commit 61be51e56b
19 files changed
+1154 -1087

No files matched your search

+6
View File
@@ -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.