ci: add reviewdog (#1096)

This commit is contained in:
Kevin Wan
2021-09-29 13:09:20 +08:00
committed by GitHub
parent 80e3407be1
commit 65905b914d
23 changed files with 46 additions and 86 deletions

View File

@@ -11,6 +11,7 @@ import (
func TestReadLink(t *testing.T) {
dir, err := ioutil.TempDir("", "go-zero")
assert.Nil(t, err)
symLink := filepath.Join(dir, "test")
pwd, err := os.Getwd()
assertError(err, t)

View File

@@ -13,10 +13,9 @@ const regularPerm = 0o666
// DefaultTemplate is a tool to provides the text/template operations
type DefaultTemplate struct {
name string
text string
goFmt bool
savePath string
name string
text string
goFmt bool
}
// With returns a instance of DefaultTemplate
@@ -70,7 +69,7 @@ func (t *DefaultTemplate) Execute(data interface{}) (*bytes.Buffer, error) {
formatOutput, err := goformat.Source(buf.Bytes())
if err != nil {
return nil, errorx.Wrap(err, "go format error:", string(buf.Bytes()))
return nil, errorx.Wrap(err, "go format error:", buf.String())
}
buf.Reset()