1
0
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:
Bjørn Erik Pedersen
2024-01-28 22:34:10 +01:00
parent 982d9513e7
commit a795acbcd8
77 changed files with 102 additions and 203 deletions

View File

@ -71,7 +71,5 @@ func (t *Transformer) Transform(doc *ast.Document, reader text.Reader, pctx pars
}
return ast.WalkContinue, nil
})
}

View File

@ -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,

View File

@ -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, "/") {

View File

@ -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, "…")
})
}

View File

@ -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) {

View File

@ -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) {

View File

@ -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)
}
})
}