mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
all: Run gofumpt -l -w .
This commit is contained in:
@ -71,7 +71,5 @@ func (t *Transformer) Transform(doc *ast.Document, reader text.Reader, pctx pars
|
||||
}
|
||||
|
||||
return ast.WalkContinue, nil
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ func (a *attrParser) Continue(node ast.Node, reader text.Reader, pc parser.Conte
|
||||
func (a *attrParser) Open(parent ast.Node, reader text.Reader, pc parser.Context) (ast.Node, parser.State) {
|
||||
if attrs, ok := parser.ParseAttributes(reader); ok {
|
||||
// add attributes
|
||||
var node = &attributesBlock{
|
||||
node := &attributesBlock{
|
||||
BaseBlock: ast.BaseBlock{},
|
||||
}
|
||||
for _, attr := range attrs {
|
||||
@ -95,7 +95,7 @@ func (a *attributesBlock) Kind() ast.NodeKind {
|
||||
type transformer struct{}
|
||||
|
||||
func (a *transformer) Transform(node *ast.Document, reader text.Reader, pc parser.Context) {
|
||||
var attributes = make([]ast.Node, 0, 500)
|
||||
attributes := make([]ast.Node, 0, 500)
|
||||
ast.Walk(node, func(node ast.Node, entering bool) (ast.WalkStatus, error) {
|
||||
if entering && node.Kind() == kindAttributesBlock {
|
||||
// Attributes for fenced code blocks are handled in their own extension,
|
||||
|
@ -13,7 +13,8 @@ import (
|
||||
func ExternallyRenderContent(
|
||||
cfg converter.ProviderConfig,
|
||||
ctx converter.DocumentContext,
|
||||
content []byte, binaryName string, args []string) ([]byte, error) {
|
||||
content []byte, binaryName string, args []string,
|
||||
) ([]byte, error) {
|
||||
logger := cfg.Logger
|
||||
|
||||
if strings.Contains(binaryName, "/") {
|
||||
|
@ -83,7 +83,5 @@ func TestConfig(t *testing.T) {
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(conf.Goldmark.Extensions.Typographer.Disable, qt.Equals, false)
|
||||
c.Assert(conf.Goldmark.Extensions.Typographer.Ellipsis, qt.Equals, "…")
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
@ -26,8 +26,7 @@ import (
|
||||
// Provider is the package entry point.
|
||||
var Provider converter.ProviderProvider = provider{}
|
||||
|
||||
type provider struct {
|
||||
}
|
||||
type provider struct{}
|
||||
|
||||
func (p provider) New(cfg converter.ProviderConfig) (converter.Provider, error) {
|
||||
return converter.NewProvider("pandoc", func(ctx converter.DocumentContext) (converter.Converter, error) {
|
||||
|
@ -30,8 +30,7 @@ import (
|
||||
// Provider is the package entry point.
|
||||
var Provider converter.ProviderProvider = provider{}
|
||||
|
||||
type provider struct {
|
||||
}
|
||||
type provider struct{}
|
||||
|
||||
func (p provider) New(cfg converter.ProviderConfig) (converter.Provider, error) {
|
||||
return converter.NewProvider("rst", func(ctx converter.DocumentContext) (converter.Converter, error) {
|
||||
|
@ -186,7 +186,6 @@ func TestTocMisc(t *testing.T) {
|
||||
}
|
||||
|
||||
func BenchmarkToc(b *testing.B) {
|
||||
|
||||
newTocs := func(n int) []*Fragments {
|
||||
var tocs []*Fragments
|
||||
for i := 0; i < n; i++ {
|
||||
@ -216,5 +215,4 @@ func BenchmarkToc(b *testing.B) {
|
||||
toc.ToHTML(1, -1, false)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user