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:
parent
af28ce59b8
commit
61be51e56b
19 changed files with 1154 additions and 1087 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
"io"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
"code.gitea.io/gitea/modules/zstd"
|
||||
|
||||
"github.com/blakesmith/ar"
|
||||
|
@ -77,7 +78,7 @@ func TestParsePackage(t *testing.T) {
|
|||
{
|
||||
Extension: "",
|
||||
WriterFactory: func(w io.Writer) io.WriteCloser {
|
||||
return nopCloser{w}
|
||||
return util.NopCloser{Writer: w}
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -129,14 +130,6 @@ func TestParsePackage(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
type nopCloser struct {
|
||||
io.Writer
|
||||
}
|
||||
|
||||
func (nopCloser) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func TestParseControlFile(t *testing.T) {
|
||||
buildContent := func(name, version, architecture string) *bytes.Buffer {
|
||||
var buf bytes.Buffer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue