all: Format code with gofumpt

See https://github.com/mvdan/gofumpt
This commit is contained in:
Bjørn Erik Pedersen 2020-12-02 13:23:25 +01:00
parent 32471b57bd
commit d90e37e0c6
442 changed files with 1426 additions and 2254 deletions

View file

@ -14,6 +14,7 @@
package create_test
import (
"fmt"
"os"
"path/filepath"
"strings"
@ -23,8 +24,6 @@ import (
"github.com/gohugoio/hugo/hugolib"
"fmt"
"github.com/gohugoio/hugo/hugofs"
qt "github.com/frankban/quicktest"
@ -35,7 +34,6 @@ import (
)
func TestNewContent(t *testing.T) {
cases := []struct {
kind string
path string
@ -59,7 +57,8 @@ func TestNewContent(t *testing.T) {
`title = "GO"`,
"{{< myshortcode >}}",
"{{% myshortcode %}}",
"{{</* comment */>}}\n{{%/* comment */%}}"}}, // shortcodes
"{{</* comment */>}}\n{{%/* comment */%}}",
}}, // shortcodes
}
for i, cas := range cases {
@ -140,7 +139,6 @@ i18n: {{ T "hugo" }}
c.Assert(create.NewContent(h, "my-theme-bundle", "post/my-theme-post"), qt.IsNil)
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-theme-post/index.md")), `File: index.md`, `Site Lang: en`, `Name: My Theme Post`, `i18n: Hugo Rocks!`)
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-theme-post/resources/hugo1.json")), `hugo1: {{ printf "no template handling in here" }}`)
}
func initFs(fs afero.Fs) error {
@ -248,7 +246,6 @@ func readFileFromFs(t *testing.T, fs afero.Fs, filename string) string {
}
func newTestCfg(c *qt.C, mm afero.Fs) (*viper.Viper, *hugofs.Fs) {
cfg := `
theme = "mytheme"
@ -281,5 +278,4 @@ other = "Hugo Rokkar!"`), 0755), qt.IsNil)
c.Assert(err, qt.IsNil)
return v, hugofs.NewFrom(mm, v)
}